Skip to content

Commit

Permalink
No retry for HF error
Browse files Browse the repository at this point in the history
  • Loading branch information
danielz02 committed Oct 16, 2023
1 parent a8807b6 commit 9aa2166
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/helm/proxy/clients/huggingface_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
)
from threading import Lock

from ...common.request import ErrorFlags


class StopOnToken(StoppingCriteria):
"""
Expand Down Expand Up @@ -268,7 +270,10 @@ def do_it():
response, cached = self.cache.get(cache_key, wrap_request_time(do_it))
except Exception as e: # Do something if error is encountered.
error: str = f"HuggingFace error: {e}"
return RequestResult(success=False, cached=False, error=error, completions=[], embedding=[])
return RequestResult(
success=False, cached=False, error=error, completions=[], embedding=[],
error_flags=ErrorFlags(is_retriable=False, is_fatal=False),
)

completions = []
for raw_completion in response["completions"]:
Expand Down

0 comments on commit 9aa2166

Please sign in to comment.