Update app.py
Browse files
app.py
CHANGED
|
@@ -78,22 +78,14 @@ Format your response with clear sections and bullet points for readability."""
|
|
| 78 |
},
|
| 79 |
{
|
| 80 |
"role": "user",
|
| 81 |
-
"content": prompt
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
}
|
| 90 |
-
]
|
| 91 |
-
],
|
| 92 |
-
"stream": True,
|
| 93 |
-
"max_tokens": 3000,
|
| 94 |
-
"temperature": 0.2,
|
| 95 |
-
"top_p": 0.9
|
| 96 |
-
}
|
| 97 |
|
| 98 |
try:
|
| 99 |
timeout = aiohttp.ClientTimeout(total=30)
|
|
@@ -470,10 +462,7 @@ Format your response with clear sections and bullet points for readability."""
|
|
| 470 |
"""
|
| 471 |
|
| 472 |
template = Template(html_template)
|
| 473 |
-
# Convert markdown to HTML with proper formatting Sedarately formatting tables
|
| 474 |
ai_analysis_html = markdown.markdown(analysis_text, extensions=['extra', 'tables'])
|
| 475 |
-
# Clean up any unwanted markdown artifacts
|
| 476 |
-
ai_analysis_html = re.sub(r'(\|.*?\|)', lambda m: m.group(0).replace('|', ''), ai_analysis_html) # Remove table pipes
|
| 477 |
charts_content = "\n".join(self.current_charts) if self.current_charts else "<p>No visualizations available</p>"
|
| 478 |
|
| 479 |
return template.render(
|
|
|
|
| 78 |
},
|
| 79 |
{
|
| 80 |
"role": "user",
|
| 81 |
+
"content": prompt
|
| 82 |
+
}
|
| 83 |
+
],
|
| 84 |
+
"stream": True,
|
| 85 |
+
"max_tokens": 3000,
|
| 86 |
+
"temperature": 0.2,
|
| 87 |
+
"top_p": 0.9
|
| 88 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
try:
|
| 91 |
timeout = aiohttp.ClientTimeout(total=30)
|
|
|
|
| 462 |
"""
|
| 463 |
|
| 464 |
template = Template(html_template)
|
|
|
|
| 465 |
ai_analysis_html = markdown.markdown(analysis_text, extensions=['extra', 'tables'])
|
|
|
|
|
|
|
| 466 |
charts_content = "\n".join(self.current_charts) if self.current_charts else "<p>No visualizations available</p>"
|
| 467 |
|
| 468 |
return template.render(
|