Spaces:
Runtime error
Runtime error
Update app_t.py
Browse files
app_t.py
CHANGED
@@ -1,9 +1,29 @@
|
|
|
|
1 |
import shutil
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
#import gradio as gr
|
9 |
#import git
|
|
|
1 |
+
import os
|
2 |
import shutil
|
3 |
+
from os import path
|
4 |
+
from zipfile import ZipFile
|
5 |
+
from shutil import make_archive
|
6 |
+
|
7 |
+
def main():
|
8 |
+
filename = "clipseg-master.zip"
|
9 |
+
extract_dir = "clipseg"
|
10 |
+
archive_format = "zip"
|
11 |
+
|
12 |
+
if path.exists(filename):
|
13 |
+
print("yes zip location exists.")
|
14 |
+
src=path.realpath(filename)
|
15 |
+
print("zip location:", src)
|
16 |
+
root_dir,tail = path.split(src)
|
17 |
+
extract_dir=root_dir+'/'+extract_dir
|
18 |
+
shutil.unpack_archive(filename, extract_dir, archive_format)
|
19 |
+
#shutil.make_archive("test","zip",root_dir)
|
20 |
+
print("Archive file unpacked successfully.")
|
21 |
+
else
|
22 |
+
print("Archive file unpacked un-successfully.")
|
23 |
+
|
24 |
+
if __name__=="__main__":
|
25 |
+
main()
|
26 |
+
|
27 |
|
28 |
#import gradio as gr
|
29 |
#import git
|