Update app.py
Browse files
app.py
CHANGED
|
@@ -65,6 +65,7 @@ def generate_and_export_animation(prompt):
|
|
| 65 |
os.remove(temp_video_path)
|
| 66 |
response_data = {'video_base64': '','status':None}
|
| 67 |
response_data['video_base64'] = video_base64
|
|
|
|
| 68 |
return response_data
|
| 69 |
|
| 70 |
except Exception as e:
|
|
@@ -74,7 +75,6 @@ def generate_and_export_animation(prompt):
|
|
| 74 |
def background(prompt):
|
| 75 |
with app.app_context():
|
| 76 |
temp_response = generate_and_export_animation(prompt)
|
| 77 |
-
print('temp_response',temp_response)
|
| 78 |
# json_content = temp_response.get_json()
|
| 79 |
app.config['temp_response'] = temp_response
|
| 80 |
|
|
@@ -102,6 +102,7 @@ def check_animation_status():
|
|
| 102 |
if generation_thread and generation_thread.is_alive():
|
| 103 |
return jsonify({"status": "in_progress"}), 200
|
| 104 |
elif app.config.get('temp_response'):
|
|
|
|
| 105 |
# app.config['temp_response']['status'] = 'completed'
|
| 106 |
final_response = app.config['temp_response']
|
| 107 |
return jsonify(final_response)
|
|
|
|
| 65 |
os.remove(temp_video_path)
|
| 66 |
response_data = {'video_base64': '','status':None}
|
| 67 |
response_data['video_base64'] = video_base64
|
| 68 |
+
print('response_data',response_data)
|
| 69 |
return response_data
|
| 70 |
|
| 71 |
except Exception as e:
|
|
|
|
| 75 |
def background(prompt):
|
| 76 |
with app.app_context():
|
| 77 |
temp_response = generate_and_export_animation(prompt)
|
|
|
|
| 78 |
# json_content = temp_response.get_json()
|
| 79 |
app.config['temp_response'] = temp_response
|
| 80 |
|
|
|
|
| 102 |
if generation_thread and generation_thread.is_alive():
|
| 103 |
return jsonify({"status": "in_progress"}), 200
|
| 104 |
elif app.config.get('temp_response'):
|
| 105 |
+
print('final',app.config.get('temp_response'))
|
| 106 |
# app.config['temp_response']['status'] = 'completed'
|
| 107 |
final_response = app.config['temp_response']
|
| 108 |
return jsonify(final_response)
|