Open jeffxtang opened 5 months ago
Add one more line: change model_name="gpt-4"
to model_name="llama3"
@jeffxtang Thanks for the suggestions! Adding support for Llama would be a great extension to the codebase. Would you like to submit a PR with the proposed extension incorporating the Groq APIs? Much appreciated.
@icecreamzhao good catch!
If using OpenAI is too expensive for you to try out examples with long text, you can create a free API key in seconds at https://console.groq.com/keys using your gmail or github then make the changes below:
run:
pip install groq
Add a new line in your .env file (renamed from .env.sample, originally with a line starting with "OPEN_API_KEY"):
GROQ_API_KEY="your_groq_api_key"
In src/translation_agent/utils.py, make 3 changes:
import openai
tofrom groq import Groq
client = openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
toclient = Groq(api_key=os.getenv("GROQ_API_KEY"))
model: str = "gpt-4-turbo"
tomodel: str = "llama3-8b-8192"
ormodel: str = "llama3-70b-8192"
Now running
python examples/example_script.py
will use Llama 3 on Groq for free.