Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,14 +11,16 @@ def health_check():
|
|
| 11 |
return jsonify({"status": "ready"}), 200
|
| 12 |
|
| 13 |
@app.route('/ask', methods=['POST'])
|
|
|
|
| 14 |
def ask_question():
|
| 15 |
try:
|
|
|
|
| 16 |
data = request.get_json()
|
| 17 |
question = data.get('question', '').strip()
|
| 18 |
|
| 19 |
if not question:
|
| 20 |
return jsonify({"error": "Question is required"}), 400
|
| 21 |
-
|
| 22 |
answer = text2generation.text
|
| 23 |
#audio_text = generate_audio_script(answer)
|
| 24 |
return jsonify({
|
|
|
|
| 11 |
return jsonify({"status": "ready"}), 200
|
| 12 |
|
| 13 |
@app.route('/ask', methods=['POST'])
|
| 14 |
+
question=""
|
| 15 |
def ask_question():
|
| 16 |
try:
|
| 17 |
+
global question
|
| 18 |
data = request.get_json()
|
| 19 |
question = data.get('question', '').strip()
|
| 20 |
|
| 21 |
if not question:
|
| 22 |
return jsonify({"error": "Question is required"}), 400
|
| 23 |
+
|
| 24 |
answer = text2generation.text
|
| 25 |
#audio_text = generate_audio_script(answer)
|
| 26 |
return jsonify({
|