Spaces:
Sleeping
Sleeping
Update backend.py
Browse files- backend.py +8 -3
backend.py
CHANGED
@@ -253,8 +253,13 @@ def prompt_objectif(user_input):
|
|
253 |
|
254 |
# Extract and return the generated response
|
255 |
resultat = response.choices[0].message.content
|
256 |
-
|
|
|
|
|
257 |
|
258 |
except Exception as e:
|
259 |
-
|
260 |
-
|
|
|
|
|
|
|
|
253 |
|
254 |
# Extract and return the generated response
|
255 |
resultat = response.choices[0].message.content
|
256 |
+
for word in resultat.split():
|
257 |
+
yield word + " "
|
258 |
+
time.sleep(0.05)
|
259 |
|
260 |
except Exception as e:
|
261 |
+
message_error = f"Failed to generate questions: {e}"
|
262 |
+
for word in message_error.split():
|
263 |
+
yield word + " "
|
264 |
+
time.sleep(0.05)
|
265 |
+
|