Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,22 +34,21 @@ def text_to_emoji(text):
|
|
34 |
#response = client.text_generation(prompt, max_new_tokens=50)
|
35 |
#return response
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
)
|
53 |
return completion.choices[0].message
|
54 |
|
55 |
# Gradio UI
|
|
|
34 |
#response = client.text_generation(prompt, max_new_tokens=50)
|
35 |
#return response
|
36 |
|
37 |
+
completion = client.chat.completions.create(
|
38 |
+
model="mistralai/Mistral-Small-3.1-24B-Instruct-2503",
|
39 |
+
messages=[
|
40 |
+
{
|
41 |
+
"role": "user",
|
42 |
+
"content": [
|
43 |
+
{
|
44 |
+
"type": "text",
|
45 |
+
"text": prompt
|
46 |
+
}
|
47 |
+
]
|
48 |
+
}
|
49 |
+
],
|
50 |
+
max_tokens=25
|
51 |
+
)
|
|
|
52 |
return completion.choices[0].message
|
53 |
|
54 |
# Gradio UI
|