Spaces:
Sleeping
Sleeping
Fix: use chat_completion instead of text_generation
Browse files
app.py
CHANGED
|
@@ -27,12 +27,13 @@ if st.button("Generate Recipe"):
|
|
| 27 |
f"- Numbered step-by-step cooking instructions\n"
|
| 28 |
f"- Estimated cooking time\n"
|
| 29 |
)
|
| 30 |
-
response = client.
|
| 31 |
-
prompt,
|
| 32 |
model="mistralai/Mistral-7B-Instruct-v0.3",
|
| 33 |
-
|
|
|
|
| 34 |
temperature=0.7,
|
| 35 |
)
|
| 36 |
-
|
|
|
|
| 37 |
else:
|
| 38 |
st.warning("Please enter some ingredients!")
|
|
|
|
| 27 |
f"- Numbered step-by-step cooking instructions\n"
|
| 28 |
f"- Estimated cooking time\n"
|
| 29 |
)
|
| 30 |
+
response = client.chat_completion(
|
|
|
|
| 31 |
model="mistralai/Mistral-7B-Instruct-v0.3",
|
| 32 |
+
messages=[{"role": "user", "content": prompt}],
|
| 33 |
+
max_tokens=400,
|
| 34 |
temperature=0.7,
|
| 35 |
)
|
| 36 |
+
recipe = response.choices[0].message.content
|
| 37 |
+
st.success(recipe)
|
| 38 |
else:
|
| 39 |
st.warning("Please enter some ingredients!")
|