Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,58 @@
|
|
|
|
1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
x = st.slider('Select a value')
|
4 |
st.write(x, 'squared is', x * x)
|
|
|
1 |
+
import requests
|
2 |
import streamlit as st
|
3 |
+
import streamlit.components.v1 as components
|
4 |
+
|
5 |
+
def semanticComparativeClassification():
|
6 |
+
|
7 |
+
#API_URL = "https://api-inference.huggingface.co/models/Maite89/Roberta_finetuning_semantic_similarity_stsb_multi_mt"
|
8 |
+
API_URL = "https://api-inference.huggingface.co/models/symanto/sn-xlm-roberta-base-snli-mnli-anli-xnli"
|
9 |
+
headers = {"Authorization": "Bearer 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"}
|
10 |
+
|
11 |
+
def query(payload):
|
12 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
13 |
+
return response.json()
|
14 |
+
|
15 |
+
"""output = query({
|
16 |
+
"inputs": {
|
17 |
+
"wait_for_model" : True,
|
18 |
+
"source_sentence": "Uso de la agenda, crear eventos, borrar eventos, mover eventos",
|
19 |
+
"sentences": [
|
20 |
+
"Como creo un evento del calendario",
|
21 |
+
"He perdido la contrase帽a. Como la recupero.",
|
22 |
+
"Que dia m谩s bonito",
|
23 |
+
"Como sincronizo el m贸bil con Lya2"
|
24 |
+
]
|
25 |
+
},
|
26 |
+
})"""
|
27 |
+
|
28 |
+
output = query({
|
29 |
+
"inputs": {
|
30 |
+
"wait_for_model" : True,
|
31 |
+
"source_sentence": "Informaci贸n sobre Lya2",
|
32 |
+
"sentences": [
|
33 |
+
"Conoces Lya2",
|
34 |
+
"He perdido la contrase帽a. Como la recupero.",
|
35 |
+
"Que dia m谩s bonito",
|
36 |
+
"Como sincronizo el m贸bil con Lya2"
|
37 |
+
]
|
38 |
+
},
|
39 |
+
})
|
40 |
+
|
41 |
+
output = query({
|
42 |
+
"inputs": {
|
43 |
+
"wait_for_model" : True,
|
44 |
+
"source_sentence": "Sincronizaci贸n de Lya2 con el tel茅fono",
|
45 |
+
"sentences": [
|
46 |
+
"Conoces Lya2",
|
47 |
+
"He perdido la contrase帽a. Como la recupero.",
|
48 |
+
"Que dia m谩s bonito",
|
49 |
+
"Como sincronizo el m贸bil con Lya2"
|
50 |
+
]
|
51 |
+
},
|
52 |
+
})
|
53 |
+
|
54 |
+
return output
|
55 |
+
|
56 |
|
57 |
x = st.slider('Select a value')
|
58 |
st.write(x, 'squared is', x * x)
|