mohammed3536 commited on
Commit
aa1786a
1 Parent(s): d572e23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -42,7 +42,6 @@ def generate_question_with_chatgpt(context):
42
  "Authorization": f"Bearer {OPENAI_API_KEY}",
43
  }
44
 
45
- generated_question = []
46
 
47
  data = {
48
  "model": "gpt-3.5-turbo",
@@ -61,6 +60,12 @@ def generate_question_with_chatgpt(context):
61
 
62
  # Decode the byte string to Unicode string
63
  generated_question = generated_question.decode("utf-8")
 
 
 
 
 
 
64
  return generated_question
65
 
66
  def main():
 
42
  "Authorization": f"Bearer {OPENAI_API_KEY}",
43
  }
44
 
 
45
 
46
  data = {
47
  "model": "gpt-3.5-turbo",
 
60
 
61
  # Decode the byte string to Unicode string
62
  generated_question = generated_question.decode("utf-8")
63
+
64
+ # Post-process the question if needed
65
+ # Example: Ensure the question ends with a question mark
66
+ if not generated_question.endswith('?'):
67
+ generated_question += '?'
68
+
69
  return generated_question
70
 
71
  def main():