Skip to content

Commit

Permalink
remove logs and add more timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
leoguillaumegouv committed Oct 15, 2024
1 parent a090e74 commit 3f28038
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion app/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def few_shots(prompt: str):
"k": 4,
"prompt": prompt,
}
response = requests.post(url=f"{ALBERT_BASE_URL}/search", json=data, headers={"Authorization": f"Bearer {ALBERT_API_KEY}"})
response = requests.post(url=f"{ALBERT_BASE_URL}/search", json=data, headers={"Authorization": f"Bearer {ALBERT_API_KEY}"}, timeout=120)
assert response.status_code == 200
response = response.json()

Expand Down
2 changes: 0 additions & 2 deletions app/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def __init__(self, r: Redis, channels):
def run(self):
logging.info("listener run")
for item in self.pubsub.listen():
logging.info(f"listener item: {item}")
if item["type"] == "message" and item["channel"] == self.KILL_PILL.encode():
break

Expand All @@ -42,7 +41,6 @@ def run(self):
logging.error(f"\nRequest prompt:\n{data["text"]}\n\nError:\n{error_traceback}")
answer = f"error on {data["id"]} request, please resend prompt later."

logging.info(f"send answer to {data['id']}")
self.redis.set(
name=data["id"], # key
value=answer, # model output
Expand Down

0 comments on commit 3f28038

Please sign in to comment.