You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This piece of code needs a retry because sometimes the request fails but rerunning this flow gets working.
My idea is to create a method only to do the call it with the retry and inside this try except invoke this method as simple as possible.
try:
llm=HuggingFaceEndpoint( # type: ignoreendpoint_url=endpoint_url,
task=task,
huggingfacehub_api_token=huggingfacehub_api_token,
model_kwargs=model_kwargs,
)
exceptExceptionase:
raiseValueError("Could not connect to HuggingFace Endpoints API.") frome
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This piece of code needs a retry because sometimes the request fails but rerunning this flow gets working.
My idea is to create a method only to do the call it with the retry and inside this
try except
invoke this method as simple as possible.Beta Was this translation helpful? Give feedback.
All reactions