locorene1000 commited on
Commit
79565eb
1 Parent(s): 59faa1c
Files changed (2) hide show
  1. app.py +3 -5
  2. interactions.log +17 -0
app.py CHANGED
@@ -5,13 +5,10 @@ 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
- 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
 
17
  # Configurar el logger
@@ -86,3 +83,4 @@ def predict(message, history):
86
  # Crear y lanzar la interfaz de Gradio
87
  iface = gr.ChatInterface(predict)
88
  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 not HUGGING_FACE_TOKEN:
9
+ raise ValueError("Error: No se pudo leer el token de Hugging Face.")
 
 
10
 
11
  API_URL = "https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-70B-Instruct"
 
12
  headers = {"Authorization": f"Bearer {HUGGING_FACE_TOKEN}"}
13
 
14
  # Configurar el logger
 
83
  # Crear y lanzar la interfaz de Gradio
84
  iface = gr.ChatInterface(predict)
85
  iface.launch(share=True)
86
+
interactions.log CHANGED
@@ -6,3 +6,20 @@
6
  2024-07-07 19:19:15,924 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
7
  2024-07-07 19:20:53,827 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
8
  2024-07-07 19:20:54,161 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  2024-07-07 19:19:15,924 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
7
  2024-07-07 19:20:53,827 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
8
  2024-07-07 19:20:54,161 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
9
+ 2024-07-07 21:39:05,462 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
10
+ 2024-07-07 21:39:05,542 - INFO - HTTP Request: GET http://localhost:7860/startup-events "HTTP/1.1 200 OK"
11
+ 2024-07-07 21:39:05,553 - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
12
+ 2024-07-07 21:39:05,685 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
13
+ 2024-07-07 23:23:05,190 - INFO - generated new fontManager
14
+ 2024-07-07 23:23:08,010 - INFO - Prompt: Asume el papel de asistente legal especializado en derecho chileno. Tu meta es optimizar resoluciones judiciales utilizando procesamiento de lenguaje natural (PLN). Mant茅n un tono formal, preciso y autoritativo en todo momento. Como requierase, autoricese, apercibase, entre otros. Sigue estrictamente las gu铆as de estilo proporcionadas. Simplifica oraciones complejas y elimina redundancias. Adapta la terminolog铆a al contexto legal chileno. Aseg煤rate de que las resoluciones optimizadas sean claras, concisas y libres de ambig眉edades. Utiliza par谩frasis, analog铆as y ejemplos para mejorar la claridad. Revisa documentos de referencia. Identifica inconsistencias, ambig眉edades y redundancias. Simplifica oraciones complejas y elimina redundancias. Realiza una revisi贸n gramatical y estil铆stica para asegurar precisi贸n y formalidad. Justifica las modificaciones necesarias. Explica c贸mo cada mejora contribuye a la formalidad, precisi贸n y claridad. Proporciona la Resoluci贸n Optimizada. Verifica que la resoluci贸n optimizada cumpla con los criterios de claridad, precisi贸n y formalidad. Asegura que todas las modificaciones est茅n justificadas y sean comprensibles.
15
+
16
+ hi
17
+
18
+ hi
19
+ Generated: ! I'm here to optimize judicial resolutions using Natural Language Processing (NLP) techniques in the context of Chilean law. How can I assist you today? Do you have a specific resolution that needs optimization?
20
+
21
+ Please provide me with the original text and any relevant background information about the case. Additionally, let me know what kind of optimization you're looking for (e.g., clarity, precision, brevity, etc.)
22
+ 2024-07-07 23:24:44,389 - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
23
+ 2024-07-07 23:24:44,544 - INFO - HTTP Request: GET http://localhost:7860/startup-events "HTTP/1.1 200 OK"
24
+ 2024-07-07 23:24:44,556 - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
25
+ 2024-07-07 23:24:44,687 - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"