Spaces:
Runtime error
Runtime error
import requests | |
import streamlit as st | |
import streamlit.components.v1 as components | |
def semanticComparativeClassification(): | |
#API_URL = "https://api-inference.huggingface.co/models/Maite89/Roberta_finetuning_semantic_similarity_stsb_multi_mt" | |
API_URL = "https://api-inference.huggingface.co/models/symanto/sn-xlm-roberta-base-snli-mnli-anli-xnli" | |
headers = {"Authorization": "Bearer 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"} | |
def query(payload): | |
response = requests.post(API_URL, headers=headers, json=payload) | |
return response.json() | |
output = query({ | |
"inputs": { | |
"wait_for_model" : True, | |
"source_sentence": "Sincronizaci贸n de Lya2 con el tel茅fono", | |
"sentences": [ | |
"Conoces Lya2", | |
"He perdido la contrase帽a. Como la recupero.", | |
"Que dia m谩s bonito", | |
"Como sincronizo el m贸bil con Lya2" | |
] | |
}, | |
}) | |
return output | |
#x = st.slider('Select a value') | |
#st.write(x, 'squared is', x * x) | |
x = semanticComparativeClassification() | |
for i in x: | |
print(i) | |
st.title('Uber pickups in NYC') | |
st.components.v1.html('sadasffas') |