Skip to content

Commit

Permalink
fix: reduce attempt and timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
wenhwang97 committed Apr 19, 2024
1 parent 97c8f62 commit 8a18f73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classifier/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def classify():
break

for article in articles.get("list"):
attempts = 3
attempts = 2
while attempts > 0:
try:
originalEnglish = article["originalLanguage"] == "en"
Expand All @@ -48,7 +48,7 @@ def classify():
"body": article["originalContent"] if originalEnglish else article["translatedContent"],
})

res = requests.post(llm_url, data=form_data, timeout=120)
res = requests.post(llm_url, data=form_data, timeout=60)

if "yes" in res.json().get("Result").lower()[:3]:
article["status"] = "relevant"
Expand Down

0 comments on commit 8a18f73

Please sign in to comment.