返回提交历史
Modified
g4f/Provider/hf/HuggingFaceAPI.py
+2
-2
XFEstudio/gpt4free
Fix check pipline tag in HuggingFace
e66ee9e0
代码差异
1 个文件
+2
-2
@@ -64,9 +64,9 @@ class HuggingFaceAPI(OpenaiTemplate):
64
64
model = cls.model_aliases[model]
65
65
api_base = f"https://api-inference.huggingface.co/models/{model}/v1"
66
66
pipeline_tag = await cls.get_pipline_tag(model, api_key)
67
if images is None and pipeline_tag not in ("text-generation", "image-text-to-text"):
67
if pipeline_tag not in ("text-generation", "image-text-to-text"):
68
68
raise ModelNotSupportedError(f"Model is not supported: {model} in: {cls.__name__} pipeline_tag: {pipeline_tag}")
69
elif pipeline_tag != "image-text-to-text":
69
elif images and pipeline_tag != "image-text-to-text":
70
70
raise ModelNotSupportedError(f"Model does not support images: {model} in: {cls.__name__} pipeline_tag: {pipeline_tag}")
71
71
start = calculate_lenght(messages)
72
72
if start > max_inputs_lenght: