Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from flask import Flask,
|
2 |
from huggingface_hub import InferenceClient
|
3 |
from requests.exceptions import RequestException
|
4 |
|
@@ -52,7 +52,7 @@ def generate_quiz_page():
|
|
52 |
response = generate_quiz(context)
|
53 |
|
54 |
if request.headers.get('Content-Type') == 'application/json':
|
55 |
-
return jsonify(response)
|
56 |
|
57 |
|
58 |
quiz_html = f"""
|
|
|
1 |
+
from flask import Flask, request, jsonify
|
2 |
from huggingface_hub import InferenceClient
|
3 |
from requests.exceptions import RequestException
|
4 |
|
|
|
52 |
response = generate_quiz(context)
|
53 |
|
54 |
if request.headers.get('Content-Type') == 'application/json':
|
55 |
+
return jsonify({"quiz": response})
|
56 |
|
57 |
|
58 |
quiz_html = f"""
|