File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -59,20 +59,22 @@ def warning_if_invalid_install_dir():
59
59
60
60
This check should be removed when it's no longer applicable.
61
61
"""
62
+ from packaging .version import parse
62
63
from pathlib import Path
64
+ import gradio
63
65
64
- def abspath ( path ):
65
- """modified from Gradio 3.41.2 gradio.utils.abspath()"""
66
- if path . is_absolute ( ):
67
- return path
68
- is_symlink = path . is_symlink () or any ( parent . is_symlink () for parent in path .parents )
69
- if is_symlink or path == path . resolve ():
70
- return Path . cwd () / path
71
- else :
72
- return path . resolve ()
73
- webui_root = Path (__file__ ).parent
74
- if any (part .startswith ("." ) for part in abspath (webui_root ).parts ):
75
- print (f'''{ "!" * 25 } Warning { "!" * 25 }
66
+ if parse ( '3.32.0' ) <= parse ( gradio . __version__ ) < parse ( '4' ):
67
+
68
+ def abspath ( path ):
69
+ """modified from Gradio 3.41.2 gradio.utils.abspath()"""
70
+ if path .is_absolute ():
71
+ return path
72
+ is_symlink = path . is_symlink () or any ( parent . is_symlink () for parent in path . parents )
73
+ return Path . cwd () / path if ( is_symlink or path == path . resolve ()) else path . resolve ()
74
+
75
+ webui_root = Path (__file__ ).parent
76
+ if any (part .startswith ("." ) for part in abspath (webui_root ).parts ):
77
+ print (f'''{ "!" * 25 } Warning { "!" * 25 }
76
78
WebUI is installed in a directory that has a leading dot (.) in one of its parent directories.
77
79
This will prevent WebUI from functioning properly.
78
80
Please move the installation to a different directory.
You can’t perform that action at this time.
0 commit comments