locorene1000 commited on
Commit
fa74c14
1 Parent(s): ad54ecf
Files changed (2) hide show
  1. app.py +6 -4
  2. interactions.log +2 -0
app.py CHANGED
@@ -5,10 +5,12 @@ import os
5
 
6
  # Leer el token de Hugging Face desde las variables de entorno
7
  HUGGING_FACE_TOKEN = os.getenv("HUGGING_FACE_TOKEN")
8
- API_URL = "https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-70B-Instruct"
 
 
 
9
 
10
- if not HUGGING_FACE_TOKEN:
11
- raise ValueError("El token de Hugging Face no est谩 configurado en las variables de entorno")
12
 
13
  headers = {"Authorization": f"Bearer {HUGGING_FACE_TOKEN}"}
14
 
@@ -81,6 +83,6 @@ def predict(message, history):
81
  else:
82
  return "No se pudo mejorar la resoluci贸n."
83
 
84
- # Crear y lanzar la interfaz de Gradio con un enlace p煤blico
85
  iface = gr.ChatInterface(predict)
86
  iface.launch(share=True)
 
5
 
6
  # Leer el token de Hugging Face desde las variables de entorno
7
  HUGGING_FACE_TOKEN = os.getenv("HUGGING_FACE_TOKEN")
8
+ if HUGGING_FACE_TOKEN:
9
+ print("Token de Hugging Face le铆do correctamente.")
10
+ else:
11
+ print("Error: No se pudo leer el token de Hugging Face.")
12
 
13
+ API_URL = "https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-70B-Instruct"
 
14
 
15
  headers = {"Authorization": f"Bearer {HUGGING_FACE_TOKEN}"}
16
 
 
83
  else:
84
  return "No se pudo mejorar la resoluci贸n."
85
 
86
+ # Crear y lanzar la interfaz de Gradio
87
  iface = gr.ChatInterface(predict)
88
  iface.launch(share=True)
interactions.log CHANGED
@@ -1,2 +1,4 @@
1
  2024-07-07 19:11:06,925 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
2
  2024-07-07 19:11:07,217 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
 
 
 
1
  2024-07-07 19:11:06,925 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
2
  2024-07-07 19:11:07,217 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
3
+ 2024-07-07 19:11:56,338 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
4
+ 2024-07-07 19:11:56,621 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"