How to pass trust_remote_code to API request?
API_URL = "https://api-inference.huggingface.co/models/microsoft/phi-2"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
def query(payload):
    response = requests.post(API_URL, headers=headers, json=payload)
    return response.json()
data = query({"inputs": prompt})
print(data)Got an error{'error': 'The repository for microsoft/phi-2 contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/microsoft/phi-2.\nPlease pass the argument `trust_remote_code=True` to allow custom code to be run.'}How to fix this, how to pass the argumenttrust_remote_code=True?
2023-12-23T11:14:36Z
cc@osanseviero. The inference API does not supporttrust_remote_code=Truefor now.
2024-07-10T08:00:14Z
got this error too
2024-08-13T01:47:39Z
Has there been any update? We have a model that uses custom code. We really would love our users to use the Inference API widget to try out our model.