Spaces:
Running
Running
update
Browse files
app.py
CHANGED
@@ -6,16 +6,17 @@ st.write("This page in a demonstration interface of the Eurovoc Tagger API. It a
|
|
6 |
q = st.text_area('Enter a text:', 'The Union condemns the continuing grave human rights violations by the Myanmar armed forces, including torture, sexual and gender-based violence, the persecution of civil society actors, human rights defenders and journalists, and attacks on the civilian population, including ethnic and religious minorities.',
|
7 |
height=200, max_chars=5000)
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
k = st.slider('How many tags', 1, 20, 5)
|
10 |
t = st.slider("Threshold", 0.0, 1.0, 0.1)
|
11 |
-
lang = st.selectbox("Language",
|
12 |
-
|
13 |
-
|
14 |
-
API_URL_EN = "https://xizrpi3gdk25o8lm.eu-west-1.aws.endpoints.huggingface.cloud"
|
15 |
-
API_URL_FR = "https://hshbzvevs03wq4io.eu-west-1.aws.endpoints.huggingface.cloud"
|
16 |
-
apis = {"en": API_URL_EN, "fr": API_URL_FR}
|
17 |
|
18 |
-
hf_token =
|
19 |
headers = {
|
20 |
"Authorization": f"Bearer {hf_token}",
|
21 |
"Content-Type": "application/json"
|
|
|
6 |
q = st.text_area('Enter a text:', 'The Union condemns the continuing grave human rights violations by the Myanmar armed forces, including torture, sexual and gender-based violence, the persecution of civil society actors, human rights defenders and journalists, and attacks on the civilian population, including ethnic and religious minorities.',
|
7 |
height=200, max_chars=5000)
|
8 |
|
9 |
+
API_URL_EN = "https://lcs3f8pwcn03ri5q.eu-west-1.aws.endpoints.huggingface.cloud"
|
10 |
+
API_URL_EU = "https://a933b0hcdb86onmt.eu-west-1.aws.endpoints.huggingface.cloud"
|
11 |
+
apis = {"Multilingual 🇪🇺": API_URL_EU,
|
12 |
+
"English 🇬🇧 (Deprecated) ": API_URL_EU
|
13 |
+
}
|
14 |
+
|
15 |
k = st.slider('How many tags', 1, 20, 5)
|
16 |
t = st.slider("Threshold", 0.0, 1.0, 0.1)
|
17 |
+
lang = st.selectbox("Language", apis.keys())
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
+
hf_token = st.secrets["HF_TOKEN"]
|
20 |
headers = {
|
21 |
"Authorization": f"Bearer {hf_token}",
|
22 |
"Content-Type": "application/json"
|