Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,21 +33,17 @@ def generate_mcqs_on_topic(text, topic, num_mcqs=5):
|
|
| 33 |
chatgpt_question = generate_question_with_chatgpt(sentence)
|
| 34 |
mcqs.append(chatgpt_question)
|
| 35 |
|
| 36 |
-
|
| 37 |
return mcqs
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
def generate_question_with_chatgpt(context, generated_question):
|
| 42 |
headers = {
|
| 43 |
"Content-Type": "application/json",
|
| 44 |
"Authorization": f"Bearer {OPENAI_API_KEY}",
|
| 45 |
}
|
| 46 |
|
| 47 |
-
#Initializing the default value
|
| 48 |
generated_question = "Unable to generate a question.."
|
| 49 |
|
| 50 |
-
|
| 51 |
data = {
|
| 52 |
"model": "gpt-3.5-turbo",
|
| 53 |
"messages": [
|
|
@@ -98,3 +94,4 @@ def main():
|
|
| 98 |
|
| 99 |
if __name__ == "__main__":
|
| 100 |
main()
|
|
|
|
|
|
| 33 |
chatgpt_question = generate_question_with_chatgpt(sentence)
|
| 34 |
mcqs.append(chatgpt_question)
|
| 35 |
|
|
|
|
| 36 |
return mcqs
|
| 37 |
|
| 38 |
+
def generate_question_with_chatgpt(context):
|
|
|
|
|
|
|
| 39 |
headers = {
|
| 40 |
"Content-Type": "application/json",
|
| 41 |
"Authorization": f"Bearer {OPENAI_API_KEY}",
|
| 42 |
}
|
| 43 |
|
| 44 |
+
# Initializing the default value
|
| 45 |
generated_question = "Unable to generate a question.."
|
| 46 |
|
|
|
|
| 47 |
data = {
|
| 48 |
"model": "gpt-3.5-turbo",
|
| 49 |
"messages": [
|
|
|
|
| 94 |
|
| 95 |
if __name__ == "__main__":
|
| 96 |
main()
|
| 97 |
+
|