Spaces:
Running
Running
update super super concise prompt template
Browse files
app.py
CHANGED
@@ -358,12 +358,12 @@ def create_conversational_chain(db, file_path, model_key):
|
|
358 |
|
359 |
# Create improved prompt template that focuses on pure LLM analysis
|
360 |
template = """
|
361 |
-
You are an expert data analyst tasked with answering questions about a CSV file.
|
362 |
|
363 |
CSV File Structure:
|
364 |
- Total rows: {row_count}
|
365 |
- Total columns: {column_count}
|
366 |
-
- Columns: {columns_list}
|
367 |
|
368 |
Sample data (first few rows):
|
369 |
{sample_data}
|
@@ -373,18 +373,9 @@ def create_conversational_chain(db, file_path, model_key):
|
|
373 |
|
374 |
User Question: {question}
|
375 |
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
3. Do NOT show code or calculations even if performed.
|
380 |
-
4. Do NOT provide additional information beyond what was asked.
|
381 |
-
5. For calculations, just provide the final result with up to 2 decimal places.
|
382 |
-
6. Do NOT offer any explanations or clarifications unless asked.
|
383 |
-
7. Do NOT begin with phrases like "Based on the data..." or "According to the CSV...".
|
384 |
-
8. Do NOT end with phrases like "Is there anything else..." or "Let me know if...".
|
385 |
-
9. DO NOT restate or rephrase the question.
|
386 |
-
|
387 |
-
Your analysis:
|
388 |
"""
|
389 |
|
390 |
PROMPT = PromptTemplate(
|
|
|
358 |
|
359 |
# Create improved prompt template that focuses on pure LLM analysis
|
360 |
template = """
|
361 |
+
You are an expert data analyst tasked with answering questions about a CSV file.
|
362 |
|
363 |
CSV File Structure:
|
364 |
- Total rows: {row_count}
|
365 |
- Total columns: {column_count}
|
366 |
+
- Columns names: {columns_list}
|
367 |
|
368 |
Sample data (first few rows):
|
369 |
{sample_data}
|
|
|
373 |
|
374 |
User Question: {question}
|
375 |
|
376 |
+
Give only the direct answer to the question. Be extremely brief. Do not explain your reasoning, calculations, or codes.
|
377 |
+
|
378 |
+
Your answer:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
"""
|
380 |
|
381 |
PROMPT = PromptTemplate(
|