Spaces:
Sleeping
Sleeping
Update dl.py
Browse files
dl.py
CHANGED
@@ -66,22 +66,26 @@ def show_f(repo,name,token):
|
|
66 |
f_name=f'{pf}.{sf}'
|
67 |
pass
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
79 |
r = requests.get(f'https://huggingface.co/spaces/{repo}/{name}/raw/main/{d_app}')
|
80 |
print(d_app)
|
81 |
#print (r.text)
|
82 |
uid = uuid.uuid4()
|
83 |
-
|
84 |
-
|
85 |
file = open(f'{name}/{f_name}','w')
|
86 |
file.writelines(r.text)
|
87 |
file.close()
|
|
|
66 |
f_name=f'{pf}.{sf}'
|
67 |
pass
|
68 |
|
69 |
+
numbers = [x for x in images if img in f_name]
|
70 |
+
img_tog=False
|
71 |
+
for img in images:
|
72 |
+
if img in f_name:
|
73 |
+
#html_text += f'<object data="https://huggingface.co/spaces/{repo}/{name}/raw/main/{d_app}"'
|
74 |
+
#out_text = "Image File"
|
75 |
+
#https://huggingface.co/spaces/Omnibus/idefics_playground/resolve/main/example_images/cat_sketch.png
|
76 |
+
sav_im = Image.open(f"https://huggingface.co/spaces/{repo}/{name}/resolve/main/{d_app}")
|
77 |
+
sav_im.save(f'{name}/{f_name}')
|
78 |
+
file_list.append(Path(f'{name}/{f_name}'))
|
79 |
+
#file_out.append(f"https://huggingface.co/spaces/{repo}/{name}/raw/main/{d_app}")
|
80 |
+
img_tog=True
|
81 |
+
else:
|
82 |
+
pass
|
83 |
+
if img_tog == False:
|
84 |
r = requests.get(f'https://huggingface.co/spaces/{repo}/{name}/raw/main/{d_app}')
|
85 |
print(d_app)
|
86 |
#print (r.text)
|
87 |
uid = uuid.uuid4()
|
88 |
+
|
|
|
89 |
file = open(f'{name}/{f_name}','w')
|
90 |
file.writelines(r.text)
|
91 |
file.close()
|