调用推理接口error:set the option `trust_remote_code=True` to remove this error.
#6
by
qqshao
- opened
使用模型托管服务调用fnlp/moss-moon-003-sft-int4模型接口,
import requests
API_URL = "https://api-inference.huggingface.co/models/fnlp/moss-moon-003-sft-int4"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
output = query({
"inputs": "Can you please let us know more details about your ",
})
报错内容:
"error": "Loading fnlp/moss-moon-003-sft-plugin-int4 requires you to execute the configuration file in that repo on your local machine. Make sure you have read the code there to avoid malicious use, then set the option trust_remote_code=True
to remove this error."