Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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)
|