Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,6 @@ def health_check():
|
|
| 16 |
@app.route('/ask', methods=['POST'])
|
| 17 |
def ask_question():
|
| 18 |
try:
|
| 19 |
-
global question
|
| 20 |
data = request.get_json()
|
| 21 |
question = data.get('question', '').strip()
|
| 22 |
|
|
@@ -28,10 +27,12 @@ def ask_question():
|
|
| 28 |
lines = generate_image_script(question)
|
| 29 |
image_prompts=lines.splitlines()
|
| 30 |
fetch_images_from_prompts(image_prompts)
|
| 31 |
-
video_gen(answer)
|
| 32 |
return jsonify({
|
| 33 |
"question": question,
|
| 34 |
"answer": answer
|
|
|
|
|
|
|
| 35 |
})
|
| 36 |
|
| 37 |
except Exception as e:
|
|
|
|
| 16 |
@app.route('/ask', methods=['POST'])
|
| 17 |
def ask_question():
|
| 18 |
try:
|
|
|
|
| 19 |
data = request.get_json()
|
| 20 |
question = data.get('question', '').strip()
|
| 21 |
|
|
|
|
| 27 |
lines = generate_image_script(question)
|
| 28 |
image_prompts=lines.splitlines()
|
| 29 |
fetch_images_from_prompts(image_prompts)
|
| 30 |
+
video_path = video_gen(answer)
|
| 31 |
return jsonify({
|
| 32 |
"question": question,
|
| 33 |
"answer": answer
|
| 34 |
+
"video_url":video_path
|
| 35 |
+
|
| 36 |
})
|
| 37 |
|
| 38 |
except Exception as e:
|