Spaces:
Sleeping
Sleeping
“Transcendental-Programmer”
commited on
Commit
·
d5422a7
1
Parent(s):
a23ffc6
test:added logging
Browse files- llm_agent.py +12 -0
llm_agent.py
CHANGED
|
@@ -40,6 +40,15 @@ class LLM_Agent:
|
|
| 40 |
data_path = data.get('file_path')
|
| 41 |
model_choice = data.get('model', 'bart')
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
# Few-shot + persona prompt for Flan-UL2 (best model)
|
| 44 |
flan_prompt = (
|
| 45 |
"You are VizBot, an expert data visualization assistant. "
|
|
@@ -60,6 +69,9 @@ class LLM_Agent:
|
|
| 60 |
# Re-initialize data processor and chart generator if a file is specified
|
| 61 |
if data_path:
|
| 62 |
self.data_processor = DataProcessor(data_path)
|
|
|
|
|
|
|
|
|
|
| 63 |
self.chart_generator = ChartGenerator(self.data_processor.data)
|
| 64 |
|
| 65 |
if model_choice == 'bart':
|
|
|
|
| 40 |
data_path = data.get('file_path')
|
| 41 |
model_choice = data.get('model', 'bart')
|
| 42 |
|
| 43 |
+
# Log file path and check existence
|
| 44 |
+
if data_path:
|
| 45 |
+
logging.info(f"Data path received: {data_path}")
|
| 46 |
+
import os
|
| 47 |
+
if not os.path.exists(data_path):
|
| 48 |
+
logging.error(f"File does not exist at path: {data_path}")
|
| 49 |
+
else:
|
| 50 |
+
logging.info(f"File exists at path: {data_path}")
|
| 51 |
+
|
| 52 |
# Few-shot + persona prompt for Flan-UL2 (best model)
|
| 53 |
flan_prompt = (
|
| 54 |
"You are VizBot, an expert data visualization assistant. "
|
|
|
|
| 69 |
# Re-initialize data processor and chart generator if a file is specified
|
| 70 |
if data_path:
|
| 71 |
self.data_processor = DataProcessor(data_path)
|
| 72 |
+
# Log loaded columns
|
| 73 |
+
loaded_columns = self.data_processor.get_columns()
|
| 74 |
+
logging.info(f"Loaded columns from data: {loaded_columns}")
|
| 75 |
self.chart_generator = ChartGenerator(self.data_processor.data)
|
| 76 |
|
| 77 |
if model_choice == 'bart':
|