Spaces:
Sleeping
Sleeping
Fix: Correctly replace '/' with '_' in space ID for temp directory prefix
Browse filesThe division operator was causing a TypeError when creating the temporary directory. Replacing '/' with '_' resolves this. Previous attempts had errors in the replace command.
app.py
CHANGED
@@ -348,7 +348,7 @@ class GradioUI:
|
|
348 |
return new_space_id, None, None, None, gr.Textbox("Please enter a Space ID to initialize agents.", visible=True)
|
349 |
|
350 |
# Create new temporary directory
|
351 |
-
temp_dir = tempfile.mkdtemp(prefix=f"ai_workspace_{new_space_id.replace('
|
352 |
file_upload_folder = Path(temp_dir) / "uploads"
|
353 |
file_upload_folder.mkdir(parents=True, exist_ok=True)
|
354 |
|
|
|
348 |
return new_space_id, None, None, None, gr.Textbox("Please enter a Space ID to initialize agents.", visible=True)
|
349 |
|
350 |
# Create new temporary directory
|
351 |
+
temp_dir = tempfile.mkdtemp(prefix=f"ai_workspace_{new_space_id.replace('/', '_')}_")
|
352 |
file_upload_folder = Path(temp_dir) / "uploads"
|
353 |
file_upload_folder.mkdir(parents=True, exist_ok=True)
|
354 |
|