Spaces:
Runtime error
Runtime error
LE Quoc Dat
commited on
Commit
•
d3e1bea
1
Parent(s):
3c34a24
update
Browse files
app.py
CHANGED
@@ -131,6 +131,7 @@ def generate_flashcard():
|
|
131 |
return response
|
132 |
except Exception as e:
|
133 |
return jsonify({'error': str(e)}), 500
|
134 |
-
|
135 |
if __name__ == '__main__':
|
136 |
-
|
|
|
|
|
|
131 |
return response
|
132 |
except Exception as e:
|
133 |
return jsonify({'error': str(e)}), 500
|
|
|
134 |
if __name__ == '__main__':
|
135 |
+
# Use environment variables to determine the run mode
|
136 |
+
debug_mode = os.environ.get('FLASK_DEBUG', 'False').lower() == 'true'
|
137 |
+
app.run(debug=debug_mode, host='0.0.0.0', port=7860)
|