i'm quite new to Hugging face API. All i need is how to add target lagnuage and source language parameters to this code:
import requests
API_URL = "https://api-inference.huggingface.co/models/facebook/m2m100_418M"
headers = {"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
output = query({"inputs": "The answer to the universe is", "parameters": "src_lang=en, tgt_lang=fr"})
print(output)
my code does not work. I have been trying the whole day. I don't want to use pipeline, i want to use API
Thank you in advance