Skip to content

Commit

Permalink
Merge branch 'main' of github.com:danielz02/helm
Browse files Browse the repository at this point in the history
  • Loading branch information
danielz02 committed Oct 20, 2023
2 parents 5d87a03 + 9aa2166 commit d04e91c
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 @@ -269,7 +271,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 d04e91c

Please sign in to comment.