Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -316,8 +316,10 @@ def gen_AI_IO_filename(display_query, output):
|
|
316 |
now_central = datetime.now(pytz.timezone("America/Chicago"))
|
317 |
timestamp = now_central.strftime("%Y-%m-%d-%I-%M-%S-%f-%p")
|
318 |
|
319 |
-
# Limit
|
320 |
-
|
|
|
|
|
321 |
filename = f"{timestamp} - {display_query} - {output_snippet}.md"
|
322 |
return filename
|
323 |
|
|
|
316 |
now_central = datetime.now(pytz.timezone("America/Chicago"))
|
317 |
timestamp = now_central.strftime("%Y-%m-%d-%I-%M-%S-%f-%p")
|
318 |
|
319 |
+
# Limit components to prevent excessive filename length
|
320 |
+
display_query = display_query[:50] # Truncate display_query to 50 chars
|
321 |
+
output_snippet = re.sub(r'[^A-Za-z0-9]+', '_', output[:100]) # Truncate output_snippet to 100 chars
|
322 |
+
|
323 |
filename = f"{timestamp} - {display_query} - {output_snippet}.md"
|
324 |
return filename
|
325 |
|