mgokg commited on
Commit
c51298d
·
verified ·
1 Parent(s): b4b488f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -13,13 +13,14 @@ api_key = os.environ.get('groq')
13
  read_key = os.environ.get('HF_TOKEN', None)
14
 
15
  # Use Llama 3 70B powered by Groq for answering
16
- def ask_llm(prompt):
 
17
  try:
18
  completion = client.chat.completions.create(
19
  model="llama3-70b-8192",
20
  messages=[
21
  {"role": "system", "content": "You are a helpful assistant."},
22
- {"role": "user", "content": f"{prompt}. \n instruction: antworte kurz und knapp. antworte immer auf deutsch"}
23
  ],
24
  )
25
  return completion.choices[0].message.content
 
13
  read_key = os.environ.get('HF_TOKEN', None)
14
 
15
  # Use Llama 3 70B powered by Groq for answering
16
+ def ask_llm(ort):
17
+ client = groq.Client(api_key=api_key)
18
  try:
19
  completion = client.chat.completions.create(
20
  model="llama3-70b-8192",
21
  messages=[
22
  {"role": "system", "content": "You are a helpful assistant."},
23
+ {"role": "user", "content": f"{ort}. \n instruction: antworte kurz und knapp. antworte immer auf deutsch"}
24
  ],
25
  )
26
  return completion.choices[0].message.content