fix : response timeout
This commit is contained in:
@@ -36,6 +36,17 @@ def setup():
|
||||
generator.set_model(model)
|
||||
return jsonify({"message": "Model set"}), 200
|
||||
|
||||
@app.route('/get_complete_sentence', methods=['GET'])
|
||||
def get_complete_sentence():
|
||||
if not generator:
|
||||
return jsonify({"error": "Generator not initialized"}), 400
|
||||
while True:
|
||||
status = generator.get_status()
|
||||
print(status)
|
||||
if status["is_complete"]:
|
||||
return jsonify(status)
|
||||
return None
|
||||
|
||||
@app.route('/get_updated_sentence')
|
||||
def get_updated_sentence():
|
||||
if not generator:
|
||||
|
||||
Reference in New Issue
Block a user