Spaces:
Runtime error
Runtime error
Commit
·
bc6e7dd
1
Parent(s):
0551a6a
Upload folder using huggingface_hub
Browse files
image_caption/get_caption.py
CHANGED
@@ -47,6 +47,8 @@ def get_image_caption(img_obj, prompt=None):
|
|
47 |
caption = json.loads(response.text)["captions"]
|
48 |
print(f"Caption = {caption}")
|
49 |
return caption
|
|
|
|
|
50 |
else:
|
51 |
return "Error in generating the caption!"
|
52 |
|
|
|
47 |
caption = json.loads(response.text)["captions"]
|
48 |
print(f"Caption = {caption}")
|
49 |
return caption
|
50 |
+
elif response.status_code == 502:
|
51 |
+
print("Model is getting loaded, please wait for 3-4 minutes and then try again.")
|
52 |
else:
|
53 |
return "Error in generating the caption!"
|
54 |
|