Spaces:
Runtime error
Runtime error
import streamlit as st | |
import requests | |
texte = st.text_input("Entrez un texte") | |
API_URL = "https://api-inference.huggingface.co/models/t5-large" | |
headers = {"Authorization": "xxxxxxxxxxxxxxxxxxxxxxx"} | |
if texte: | |
def main(payload): | |
response = requests.post(API_URL, headers=headers, json=payload) | |
return response.json() | |
output = main({"inputs": texte}) | |
st.write("**TRADUCTION** is : {}".format(output[0]["translation_text"])) |