Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
+
|