NoeMartinezSanchez commited on
Commit
df41b1b
·
1 Parent(s): 275888b

se modifico el end point para el dashboard

Browse files
Files changed (2) hide show
  1. api/main.py +18 -0
  2. estructura_proyecto.txt +60 -1
api/main.py CHANGED
@@ -122,6 +122,24 @@ async def startup_event():
122
  logger.error(f"Error inicializando RAG: {e}")
123
  app.state.menu = {}
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  @app.get("/")
126
  async def root():
127
  """Servir la interfaz web principal"""
 
122
  logger.error(f"Error inicializando RAG: {e}")
123
  app.state.menu = {}
124
 
125
+ @app.get("/dashboard", response_class=HTMLResponse)
126
+ async def serve_dashboard():
127
+ """Servir el dashboard HTML de evaluación"""
128
+ dashboard_path = "/tmp/dashboard.html"
129
+ logger.info(f"📊 Intentando servir dashboard desde: {dashboard_path}")
130
+
131
+ if os.path.exists(dashboard_path):
132
+ with open(dashboard_path, "r", encoding="utf-8") as f:
133
+ content = f.read()
134
+ logger.info(f"✅ Dashboard encontrado, tamaño: {len(content)} bytes")
135
+ return HTMLResponse(content=content)
136
+
137
+ logger.warning(f"⚠️ Dashboard no encontrado en: {dashboard_path}")
138
+ return HTMLResponse(
139
+ content="<h1>Dashboard no encontrado</h1><p>La evaluación aún no ha terminado o el archivo no se generó.</p>",
140
+ status_code=404
141
+ )
142
+
143
  @app.get("/")
144
  async def root():
145
  """Servir la interfaz web principal"""
estructura_proyecto.txt CHANGED
@@ -6,6 +6,9 @@
6
  │ ├── 📄 models.py
7
  │ └── 📄 settings.py
8
  ├── 📁 data/
 
 
 
9
  │ ├── 📁 vector_store/
10
  │ │ ├── 📄 documents.pkl
11
  │ │ ├── 📄 faiss_index.bin
@@ -16,18 +19,30 @@
16
  │ ├── 📄 intents.json
17
  │ ├── 📄 menu.json
18
  │ └── 📄 tickets_config.json
 
 
 
 
 
 
 
19
  ├── 📁 logs/
 
20
  ├── 📁 models/
21
  │ ├── 📁 cache/
22
  │ │ ├── 📁 .locks/
23
- │ │ ── 📁 models--TinyLlama--TinyLlama-1.1B-Chat-v1.0/
 
24
  │ ├── 📄 __init__.py
 
25
  │ └── 📄 tinyllama_wrapper.py
26
  ├── 📁 rag/
27
  │ ├── 📄 __init__.py
28
  │ ├── 📄 core.py
29
  │ ├── 📄 embeddings.py
 
30
  │ ├── 📄 generator.py
 
31
  │ └── 📄 retriever.py
32
  ├── 📁 scripts/
33
  │ ├── 📄 debug_rag_loader.py
@@ -39,6 +54,48 @@
39
  ├── 📁 tests/
40
  │ ├── 📄 test_api.py
41
  │ └── 📄 test_rag.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  ├── 📄 .cursorrules
43
  ├── 📄 .dockerignore
44
  ├── 📄 .env
@@ -52,5 +109,7 @@
52
  ├── 📄 generate_tree.py
53
  ├── 📄 notas.txt
54
  ├── 📄 packages.txt
 
55
  ├── 📄 requirements.txt
 
56
  └── 📄 verificar_memoria.py
 
6
  │ ├── 📄 models.py
7
  │ └── 📄 settings.py
8
  ├── 📁 data/
9
+ │ ├── 📁 backups/
10
+ │ │ ├── 📁 backup_20260414_085008/
11
+ │ │ └── 📁 backup_20260414_225227/
12
  │ ├── 📁 vector_store/
13
  │ │ ├── 📄 documents.pkl
14
  │ │ ├── 📄 faiss_index.bin
 
19
  │ ├── 📄 intents.json
20
  │ ├── 📄 menu.json
21
  │ └── 📄 tickets_config.json
22
+ ├── 📁 evaluation/
23
+ │ ├── 📄 __init__.py
24
+ │ ├── 📄 automated_evaluator.py
25
+ │ ├── 📄 generate_dashboard.py
26
+ │ ├── 📄 logger.py
27
+ │ ├── 📄 performance_logger.py
28
+ │ └── 📄 test_set.json
29
  ├── 📁 logs/
30
+ │ └── 📄 gemma_wrapper.log
31
  ├── 📁 models/
32
  │ ├── 📁 cache/
33
  │ │ ├── 📁 .locks/
34
+ │ │ ── 📁 models--TinyLlama--TinyLlama-1.1B-Chat-v1.0/
35
+ │ │ └── 📁 models--google--gemma-1.1-2b-it/
36
  │ ├── 📄 __init__.py
37
+ │ ├── 📄 gemma_wrapper.py
38
  │ └── 📄 tinyllama_wrapper.py
39
  ├── 📁 rag/
40
  │ ├── 📄 __init__.py
41
  │ ├── 📄 core.py
42
  │ ├── 📄 embeddings.py
43
+ │ ├── 📄 gemma_generator.py
44
  │ ├── 📄 generator.py
45
+ │ ├── 📄 optimized_retriever.py
46
  │ └── 📄 retriever.py
47
  ├── 📁 scripts/
48
  │ ├── 📄 debug_rag_loader.py
 
54
  ├── 📁 tests/
55
  │ ├── 📄 test_api.py
56
  │ └── 📄 test_rag.py
57
+ ├── 📁 tinyllama_env/
58
+ │ ├── 📁 Include/
59
+ │ ├── 📁 Lib/
60
+ │ │ └── 📁 site-packages/
61
+ │ ├── 📁 Library/
62
+ │ │ ├── 📁 bin/
63
+ │ │ ├── 📁 lib/
64
+ │ │ └── 📁 share/
65
+ │ ├── 📁 Scripts/
66
+ │ │ ├── 📄 Activate.ps1
67
+ │ │ ├── 📄 accelerate-config.exe
68
+ │ │ ├── 📄 accelerate-estimate-memory.exe
69
+ │ │ ├── 📄 accelerate-launch.exe
70
+ │ │ ├── 📄 accelerate-merge-weights.exe
71
+ │ │ ├── 📄 accelerate.exe
72
+ │ │ ├── 📄 activate
73
+ │ │ ├── 📄 activate.bat
74
+ │ │ ├── 📄 convert-caffe2-to-onnx.exe
75
+ │ │ ├── 📄 convert-onnx-to-caffe2.exe
76
+ │ │ ├── 📄 deactivate.bat
77
+ │ │ ├── 📄 dotenv.exe
78
+ │ │ ├── 📄 f2py.exe
79
+ │ │ ├── 📄 httpx.exe
80
+ │ │ ├── 📄 huggingface-cli.exe
81
+ │ │ ├── 📄 isympy.exe
82
+ │ │ ├── 📄 normalizer.exe
83
+ │ │ ├── 📄 pip.exe
84
+ │ │ ├── 📄 pip3.12.exe
85
+ │ │ ├── 📄 pip3.exe
86
+ │ │ ├── 📄 py.test.exe
87
+ │ │ ├── 📄 pytest.exe
88
+ │ │ ├── 📄 python.exe
89
+ │ │ ├── 📄 pythonw.exe
90
+ │ │ ├── 📄 torchrun.exe
91
+ │ │ ├── 📄 tqdm.exe
92
+ │ │ ├── 📄 transformers-cli.exe
93
+ │ │ ├── 📄 uvicorn.exe
94
+ │ │ ├── 📄 watchfiles.exe
95
+ │ │ ├── 📄 websockets.exe
96
+ │ │ └── 📄 wheel.exe
97
+ │ └── 📁 share/
98
+ │ └── 📁 man/
99
  ├── 📄 .cursorrules
100
  ├── 📄 .dockerignore
101
  ├── 📄 .env
 
109
  ├── 📄 generate_tree.py
110
  ├── 📄 notas.txt
111
  ├── 📄 packages.txt
112
+ ├── 📄 reporte.html
113
  ├── 📄 requirements.txt
114
+ ├── 📄 reset_faiss.py
115
  └── 📄 verificar_memoria.py