Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,14 @@ import gradio as gr
|
|
3 |
|
4 |
# Cargar modelo y tokenizador desde Hugging Face Hub
|
5 |
repo_id = "Blandskron/ModelChatBot" # Nombre del repositorio en Hugging Face Hub
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# Funci贸n para generar respuestas
|
10 |
def responder(pregunta):
|
|
|
3 |
|
4 |
# Cargar modelo y tokenizador desde Hugging Face Hub
|
5 |
repo_id = "Blandskron/ModelChatBot" # Nombre del repositorio en Hugging Face Hub
|
6 |
+
|
7 |
+
try:
|
8 |
+
model = AutoModelForCausalLM.from_pretrained(repo_id)
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained(repo_id)
|
10 |
+
except Exception as e:
|
11 |
+
print(f"Error al cargar el modelo: {e}")
|
12 |
+
print("Aseg煤rate de que el repositorio contiene todos los archivos necesarios.")
|
13 |
+
exit(1)
|
14 |
|
15 |
# Funci贸n para generar respuestas
|
16 |
def responder(pregunta):
|