Updated Gradio_UI.py
Browse files- Gradio_UI.py +8 -2
Gradio_UI.py
CHANGED
@@ -289,8 +289,14 @@ class GradioUI:
|
|
289 |
[text_input, file_uploads_log],
|
290 |
[stored_messages, text_input],
|
291 |
).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
|
296 |
__all__ = ["stream_to_gradio", "GradioUI"]
|
|
|
289 |
[text_input, file_uploads_log],
|
290 |
[stored_messages, text_input],
|
291 |
).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
|
292 |
+
|
293 |
+
allowed_paths = kwargs.pop("allowed_paths", [])
|
294 |
+
if self.file_upload_folder and self.file_upload_folder not in allowed_paths:
|
295 |
+
allowed_paths.append(self.file_upload_folder)
|
296 |
+
if "." not in allowed_paths:
|
297 |
+
allowed_paths.append(".")
|
298 |
+
|
299 |
+
demo.launch(debug=True, share=True, allowed_paths=allowed_paths, **kwargs)
|
300 |
|
301 |
|
302 |
__all__ = ["stream_to_gradio", "GradioUI"]
|