Omnibus commited on
Commit
0a761d9
·
1 Parent(s): 19f90e9

Update dl.py

Browse files
Files changed (1) hide show
  1. dl.py +16 -12
dl.py CHANGED
@@ -66,22 +66,26 @@ def show_f(repo,name,token):
66
  f_name=f'{pf}.{sf}'
67
  pass
68
 
69
-
70
- if (img for img in images) in f_name:
71
- #html_text += f'<object data="https://huggingface.co/spaces/{repo}/{name}/raw/main/{d_app}"'
72
- #out_text = "Image File"
73
- #https://huggingface.co/spaces/Omnibus/idefics_playground/resolve/main/example_images/cat_sketch.png
74
- sav_im = Image.open(f"https://huggingface.co/spaces/{repo}/{name}/resolve/main/{d_app}")
75
- sav_im.save(f'{name}/{f_name}')
76
- file_list.append(Path(f'{name}/{f_name}'))
77
- #file_out.append(f"https://huggingface.co/spaces/{repo}/{name}/raw/main/{d_app}")
78
- else:
 
 
 
 
 
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()