diff options
Diffstat (limited to 'modules/ui_gradio_extensions.py')
-rw-r--r-- | modules/ui_gradio_extensions.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/ui_gradio_extensions.py b/modules/ui_gradio_extensions.py index b824b113..a86c368e 100644 --- a/modules/ui_gradio_extensions.py +++ b/modules/ui_gradio_extensions.py @@ -1,17 +1,12 @@ import os
import gradio as gr
-from modules import localization, shared, scripts
+from modules import localization, shared, scripts, util
from modules.paths import script_path, data_path
def webpath(fn):
- if fn.startswith(script_path):
- web_path = os.path.relpath(fn, script_path).replace('\\', '/')
- else:
- web_path = os.path.abspath(fn)
-
- return f'file={web_path}?{os.path.getmtime(fn)}'
+ return f'file={util.truncate_path(fn)}?{os.path.getmtime(fn)}'
def javascript_html():
|