mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-06-07 11:35:29 +00:00
fix : none generator error
This commit is contained in:
parent
8106cff45f
commit
18f23db0fa
@ -49,7 +49,9 @@ def setup():
|
|||||||
|
|
||||||
@app.route('/get_updated_sentence')
|
@app.route('/get_updated_sentence')
|
||||||
def get_updated_sentence():
|
def get_updated_sentence():
|
||||||
return jsonify(generator.get_status())
|
if not generator:
|
||||||
|
return jsonify({"error": "Generator not initialized"}), 400
|
||||||
|
return generator.get_status()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(host='0.0.0.0', threaded=True, debug=True, port=args.port)
|
app.run(host='0.0.0.0', threaded=True, debug=True, port=args.port)
|
@ -41,7 +41,6 @@ class GeneratorLLM():
|
|||||||
|
|
||||||
def get_status(self) -> dict:
|
def get_status(self) -> dict:
|
||||||
with self.state.lock:
|
with self.state.lock:
|
||||||
print("Returning status:\n", self.state.status())
|
|
||||||
return jsonify(self.state.status())
|
return jsonify(self.state.status())
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
@ -121,7 +121,6 @@ class Provider:
|
|||||||
is_complete = False
|
is_complete = False
|
||||||
while not is_complete:
|
while not is_complete:
|
||||||
response = requests.get(f"http://{self.server_ip}/get_updated_sentence")
|
response = requests.get(f"http://{self.server_ip}/get_updated_sentence")
|
||||||
print("raw:", response.json())
|
|
||||||
thought = response.json()["sentence"]
|
thought = response.json()["sentence"]
|
||||||
is_complete = bool(response.json()["is_complete"])
|
is_complete = bool(response.json()["is_complete"])
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user