aleclyu commited on
Commit
cfbd98d
·
1 Parent(s): b0b2eee

init commit

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -237,8 +237,8 @@ def _launch_demo(args, model, processor):
237
  # 下载图片
238
  response = requests.get(url, timeout=10)
239
  response.raise_for_status()
240
- img = Image.open(BytesIO(response.content))
241
- img.save(temp_path)
242
  return temp_path
243
  except Exception as e:
244
  print(f"下载图片失败: {url}, 错误: {e}")
 
237
  # 下载图片
238
  response = requests.get(url, timeout=10)
239
  response.raise_for_status()
240
+ with open(temp_path, 'wb') as f:
241
+ f.write(response.content)
242
  return temp_path
243
  except Exception as e:
244
  print(f"下载图片失败: {url}, 错误: {e}")