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')