Spaces:
Runtime error
Runtime error
Commit
·
1c62393
1
Parent(s):
d822936
Update main.py
Browse files
main.py
CHANGED
@@ -314,13 +314,14 @@ def generateQuestions():
|
|
314 |
results = []
|
315 |
# Update the model name to "text-davinci-003" (Ada)
|
316 |
question = "\n".join([f"{msg['role']}: {msg['content']}" for msg in messages])
|
317 |
-
response = openai.chat.completions.create(
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
324 |
filtered_list = [item for item in resulta if len(item) >= 10]
|
325 |
return jsonify(filtered_list)
|
326 |
# return jsonify({'question': {'id': question_id, 'date': date, 'texte': texte},'result_qdrant':results})
|
|
|
314 |
results = []
|
315 |
# Update the model name to "text-davinci-003" (Ada)
|
316 |
question = "\n".join([f"{msg['role']}: {msg['content']}" for msg in messages])
|
317 |
+
# response = openai.chat.completions.create(
|
318 |
+
# model="gpt-3.5-turbo-instruct",
|
319 |
+
# prompt=begin_message +'\n'+ context_generation + question ,
|
320 |
+
# max_tokens=500,
|
321 |
+
# temperature=0
|
322 |
+
# )
|
323 |
+
response = openai.chat.completions.create(model="gpt-4",messages=[{"role": "user","content": begin_message +'\n'+ context_generation + question ,},],)
|
324 |
+
resulta = response.choices[0].message.content.splitlines()
|
325 |
filtered_list = [item for item in resulta if len(item) >= 10]
|
326 |
return jsonify(filtered_list)
|
327 |
# return jsonify({'question': {'id': question_id, 'date': date, 'texte': texte},'result_qdrant':results})
|