ziwaixian009 commited on
Commit
ded79ec
·
verified ·
1 Parent(s): 8c9c8c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -57,7 +57,7 @@ def translate_to_chinese(text):
57
  def generate_caption(image):
58
  try:
59
  # 如果输入是 URL,下载图片
60
- if isinstance(image, str):
61
  print("Downloading image from URL...")
62
  try:
63
  response = requests.get(image, stream=True, timeout=10)
 
57
  def generate_caption(image):
58
  try:
59
  # 如果输入是 URL,下载图片
60
+ if isinstance(image, str) and (image.startswith("http://") or image.startswith("https://")):
61
  print("Downloading image from URL...")
62
  try:
63
  response = requests.get(image, stream=True, timeout=10)