#3 : Bruh do you even AI !?
Langchain for beginners , Logo design using midjourney, Generative Music
Welcome to the episode 3 of AI Tribe 1-1-1 : A Biweekly newsletter designed to spark your interest in AI tools, concepts, applications and research !
This episode we will be looking into basics of langchain , Generative music and a guide on logo design using Midjourney .
I have lot to cover so let's dive right in.
⚙️ Tool : Google’s MusicLM
MusicLM is impressive in its ability to generate music from the textual description, a quantum leap compared to previous models. Music LM's ability to produce several minutes of coherent music while maintaining a high sampling rate of 24K Hertz is impressive and could revolutionize the music industry.
Sign up for AI test kitchen → Google MusicLM
Try this prompt:
“ Atlanta-inspired trap music with strong 808 base ”
Bonus - Mubert is another impressive music generation AI that you can try out .
😇 Today’s Recipe : Logo Design using AI
Prompt Examples :
a lettermark of letter A, logo, serif font, vector, simple --no realistic details
an emblem for a motorcycle group, vector, simple --no photorealistic details
Additional crafting :
Choose a art genre → Psychedelic Art , De Stijl , Pop Art
Choose a artistic technique → Line , Gradient, Screen print
Choose a art style - Miami, Origami, Synthwave
Steps :
→ Go to Midjourney and paste one of the prompts → Watch it generate the logo → Choose one logo and upscale it
→ Copy the upscaled version to Canva → Add your text if needed
Note : Midjourney offers only paid services as of now. Leonardo.ai , Bluewillow.ai would be better alternatives if you are looking for free ones.
P.S : Refer a friend and unlock exclusive offers waiting for you !
🔗 Article : What is LangChain ?
LangChain is an open source software development framework designed to simplify the creation of applications using large language models (LLMs). LangChain provides a standard interface for agents, memory, and chains.
If you want to conquer the vector embeddings and build better applications, you should definitely head over to Pinecone Leanrning center .
Prompt Templates are a way to provide guidance to LangChain when generating text. If you followed my previous posts I have already covered most of it. Here is an example of a prompt template for generating a poem where topic and poet are user parameters.
Write a poem about [topic] in the style of [poet].
Agents are a way to provide additional information to LangChain when generating text. They can be used to provide context, background knowledge, or specific instructions. For example, you could use an agent to provide a list of keywords that LangChain should use when generating text. They can be used to implement a wide variety of tasks, such as chatbots, question answering systems, and text summarization systems. Using agents also allows us to give LLMs access to tools. These tools present an infinite number of possibilities. With tools, LLMs can search the web, do math, run code, and more. The LangChain library provides a substantial selection of prebuilt tools.
Memory is a way to store information that LangChain can access when generating text. This can be useful for storing things like facts, figures, or even entire documents. For example, you could use memory to store a list of customer names and addresses so that LangChain can generate personalized emails.
Chains are sequences of actions that are performed in order to achieve a goal. They can be used to implement complex tasks that would be difficult or impossible to implement with a single agent. Will cover this topic in detail in upcoming posts. For now, remember that in chains, a sequence of actions is hardcoded (in code). In agents, a language model is used as a reasoning engine to determine which actions to take and in which order.
This intro to Langchain should be enough to start building apps with no-code tools. I will be bringing a post on that soon. But if you do care I have attached a code snippet that shows how things work. Its only a boiler plate code and won’t execute. Please do your research.
Code Snippets to Try
Here are some boiler plate code that you can try to get started with LangChain:
from langchain.llms import OpenAI
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
from langchain.agents import Tool , initialize_agent
#Choose an LLM ( Temperature sets the level of creativity / randomness )
llm = OpenAI( model_name="text-davinci-003",
openai_api_key="YOUR_API_KEY" , temperature=0.7)
1.
# Create a LangChain instance
langchain = LLMChain(llm = llm )
# Generate text that is creative and original involving specific keywords.
text = langchain.generate_text( prompt = "Write a story about a human falling in love with robot" ,
agent={
"creative": True,
"style": "Dan Brown",
"keywords": ["Philosophy","world","danger", "comedy"]
}
)
2.
# Add a memory to the LangChain instance
memory = langchain.add_memory()
# Store a list of customer names and addresses in the memory
memory.store("customers", ["John Doe", "Jane Doe", "Bill Smith"])
# Generate text that uses the information stored in a memory
text = langchain.generate_text(
"Write an email to a customer.",
memory=memory
)
Thanks for reading 😄.
I really enjoyed making this for you and sincerely hope you find it useful.