Omnibus commited on
Commit
95307a0
·
1 Parent(s): 985dd97

Update dl.py

Browse files
Files changed (1) hide show
  1. dl.py +3 -3
dl.py CHANGED
@@ -116,15 +116,15 @@ def show_f2(repo,name,token):
116
 
117
 
118
  def show_f_cont(repo,name,file,token):
119
- html_text = '<html>\n<body>\n<div id="my_div">\n'
120
 
121
  if (".png" or ".jpg" or ".gif" or ".webm" or ".mp4") in file:
122
- html_text += f'<object data="https://huggingface.co/spaces/{repo}/{name}/resolve/main/{file}"'
123
  out_text = "Image File"
124
  else:
125
  r = requests.get(f'https://huggingface.co/spaces/{repo}/{name}/raw/main/{file}')
126
  text=r.text
127
- html_text += f'<pre>{text}</pre>\n'
128
  out_text = r.text
129
  html_text += '</div>\n</body>\n</html>'
130
  return(html_text,out_text)
 
116
 
117
 
118
  def show_f_cont(repo,name,file,token):
119
+ html_text = '<html>\n<body>\n<div>\n'
120
 
121
  if (".png" or ".jpg" or ".gif" or ".webm" or ".mp4") in file:
122
+ html_text += f'<object data="https://huggingface.co/spaces/{repo}/{name}/resolve/main/{file}" width="100%"></object>'
123
  out_text = "Image File"
124
  else:
125
  r = requests.get(f'https://huggingface.co/spaces/{repo}/{name}/raw/main/{file}')
126
  text=r.text
127
+ html_text += f'<pre width="100%"">{text}</pre>\n'
128
  out_text = r.text
129
  html_text += '</div>\n</body>\n</html>'
130
  return(html_text,out_text)