blank image issue on multiple req
Browse files- controller.py +10 -1
controller.py
CHANGED
@@ -151,10 +151,11 @@ def groq_chat(csv_url: str, question: str):
|
|
151 |
|
152 |
try:
|
153 |
# Delete cache file if exists
|
154 |
-
cache_db_path = "/
|
155 |
if os.path.exists(cache_db_path):
|
156 |
try:
|
157 |
os.remove(cache_db_path)
|
|
|
158 |
except Exception as e:
|
159 |
print(f"Error deleting cache DB file: {e}")
|
160 |
|
@@ -596,6 +597,14 @@ def groq_chart(csv_url: str, question: str):
|
|
596 |
for attempt in range(len(groq_api_keys)):
|
597 |
try:
|
598 |
# Instead of deleting a global cache file, you might later configure a per-request cache.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
data = clean_data(csv_url)
|
600 |
with current_groq_chart_lock:
|
601 |
current_api_key = groq_api_keys[current_groq_chart_key_index]
|
|
|
151 |
|
152 |
try:
|
153 |
# Delete cache file if exists
|
154 |
+
cache_db_path = "/app/cache/cache_db_0.11.db"
|
155 |
if os.path.exists(cache_db_path):
|
156 |
try:
|
157 |
os.remove(cache_db_path)
|
158 |
+
print(f"Deleted cache DB file: {cache_db_path}")
|
159 |
except Exception as e:
|
160 |
print(f"Error deleting cache DB file: {e}")
|
161 |
|
|
|
597 |
for attempt in range(len(groq_api_keys)):
|
598 |
try:
|
599 |
# Instead of deleting a global cache file, you might later configure a per-request cache.
|
600 |
+
cache_db_path = "/app/cache/cache_db_0.11.db"
|
601 |
+
if os.path.exists(cache_db_path):
|
602 |
+
try:
|
603 |
+
os.remove(cache_db_path)
|
604 |
+
print(f"Deleted cache DB file: {cache_db_path}")
|
605 |
+
except Exception as e:
|
606 |
+
print(f"Error deleting cache DB file: {e}")
|
607 |
+
|
608 |
data = clean_data(csv_url)
|
609 |
with current_groq_chart_lock:
|
610 |
current_api_key = groq_api_keys[current_groq_chart_key_index]
|