EditsPaarth commited on
Commit
6720592
·
verified ·
1 Parent(s): e83d0d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -27,12 +27,10 @@ def chat_with_groq(prompt):
27
  def generate_code_with_groq(prompt):
28
  try:
29
  chat_completion = client.chat.completions.create(
30
- messages=[{"role": "user", "content": prompt}, {"role": "assistant", "content": "
31
- python"}],
32
  model="gemma-7b-it",
33
  stream=False,
34
- stop="
35
- "
36
  )
37
  return chat_completion.choices[0].message.content
38
  except Exception as e:
@@ -185,3 +183,6 @@ if uploaded_file is not None:
185
  except Exception as e:
186
  st.error(f"An error occurred: {e}")
187
 
 
 
 
 
27
  def generate_code_with_groq(prompt):
28
  try:
29
  chat_completion = client.chat.completions.create(
30
+ messages=[{"role": "user", "content": prompt}, {"role": "assistant", "content": "```python"}],
 
31
  model="gemma-7b-it",
32
  stream=False,
33
+ stop="```"
 
34
  )
35
  return chat_completion.choices[0].message.content
36
  except Exception as e:
 
183
  except Exception as e:
184
  st.error(f"An error occurred: {e}")
185
 
186
+
187
+
188
+