fix: hf hosted inference check (#1128)

This commit is contained in:
takatost
2023-09-09 00:29:48 +08:00
committed by GitHub
parent 681eb1cfcc
commit c4d8bdc3db
3 changed files with 69 additions and 4 deletions

View File

@@ -89,7 +89,8 @@ class HuggingfaceHubProvider(BaseModelProvider):
raise CredentialsValidateFailedError('Task Type must be provided.')
if credentials['task_type'] not in ("text2text-generation", "text-generation", "summarization"):
raise CredentialsValidateFailedError('Task Type must be one of text2text-generation, text-generation, summarization.')
raise CredentialsValidateFailedError('Task Type must be one of text2text-generation, '
'text-generation, summarization.')
try:
llm = HuggingFaceEndpointLLM(