abdouramandalil's picture
Create app.py
09e95b9
raw history blame
No virus
453 Bytes
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"]))