Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,14 +56,11 @@ def generate_question_with_chatgpt(context):
|
|
56 |
result = response.json()
|
57 |
|
58 |
if 'choices' in result:
|
59 |
-
|
60 |
-
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
# Decode the byte string to Unicode string
|
66 |
-
generated_question = generated_question.decode("utf-8")
|
67 |
|
68 |
return generated_question
|
69 |
|
|
|
56 |
result = response.json()
|
57 |
|
58 |
if 'choices' in result:
|
59 |
+
# Extract the generated question from the response
|
60 |
+
generated_question = result["choices"][0]["message"]["content"]
|
61 |
|
62 |
+
# Decode the byte string to Unicode string
|
63 |
+
generated_question = generated_question.decode("utf-8")
|
|
|
|
|
|
|
64 |
|
65 |
return generated_question
|
66 |
|