Spaces:
Sleeping
Sleeping
bego
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,13 @@ from transformers import DistilBertTokenizer, DistilBertModel
|
|
8 |
from huggingface_hub import hf_hub_download, login
|
9 |
import os
|
10 |
|
|
|
11 |
hf_token = os.getenv("HF_TOKEN")
|
|
|
|
|
|
|
|
|
|
|
12 |
login(token=hf_token)
|
13 |
|
14 |
def corregir_codificacion(texto):
|
@@ -54,4 +60,4 @@ iface = gr.Interface(
|
|
54 |
description="Ingresa un texto de opini贸n para obtener las etiquetas correspondientes."
|
55 |
)
|
56 |
|
57 |
-
iface.launch()
|
|
|
8 |
from huggingface_hub import hf_hub_download, login
|
9 |
import os
|
10 |
|
11 |
+
# Obtener el token de Hugging Face desde la variable de entorno
|
12 |
hf_token = os.getenv("HF_TOKEN")
|
13 |
+
|
14 |
+
if hf_token is None:
|
15 |
+
raise ValueError("HF_TOKEN no est谩 configurado en las variables de entorno.")
|
16 |
+
|
17 |
+
# Iniciar sesi贸n en Hugging Face Hub
|
18 |
login(token=hf_token)
|
19 |
|
20 |
def corregir_codificacion(texto):
|
|
|
60 |
description="Ingresa un texto de opini贸n para obtener las etiquetas correspondientes."
|
61 |
)
|
62 |
|
63 |
+
iface.launch(share=True)
|