Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ from text2generation import generate_long_answer # Your own function
|
|
| 5 |
|
| 6 |
app = Flask(__name__)
|
| 7 |
CORS(app)
|
|
|
|
| 8 |
|
| 9 |
@app.route('/health')
|
| 10 |
def health_check():
|
|
@@ -21,6 +22,7 @@ def ask_question():
|
|
| 21 |
return jsonify({"error": "Question is required"}), 400
|
| 22 |
|
| 23 |
answer = generate_long_answer(question)
|
|
|
|
| 24 |
return jsonify({"question": question, "answer": answer})
|
| 25 |
|
| 26 |
except Exception as e:
|
|
@@ -28,7 +30,8 @@ def ask_question():
|
|
| 28 |
|
| 29 |
@app.route('/get_video')
|
| 30 |
def get_video():
|
| 31 |
-
|
|
|
|
| 32 |
|
| 33 |
|
| 34 |
if __name__ == '__main__':
|
|
|
|
| 5 |
|
| 6 |
app = Flask(__name__)
|
| 7 |
CORS(app)
|
| 8 |
+
temp_data={}
|
| 9 |
|
| 10 |
@app.route('/health')
|
| 11 |
def health_check():
|
|
|
|
| 22 |
return jsonify({"error": "Question is required"}), 400
|
| 23 |
|
| 24 |
answer = generate_long_answer(question)
|
| 25 |
+
temp_data['answered']=answer
|
| 26 |
return jsonify({"question": question, "answer": answer})
|
| 27 |
|
| 28 |
except Exception as e:
|
|
|
|
| 30 |
|
| 31 |
@app.route('/get_video')
|
| 32 |
def get_video():
|
| 33 |
+
print(temp_data['answered'])
|
| 34 |
+
return redirect("https://videos.pexels.com/video-files/3052446/3052446-hd_1920_1080_30fps.mp4")
|
| 35 |
|
| 36 |
|
| 37 |
if __name__ == '__main__':
|