Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
|
@@ -50,8 +50,11 @@ def query_caption_api(
|
|
| 50 |
):
|
| 51 |
|
| 52 |
url = endpoint.url
|
| 53 |
-
|
| 54 |
|
|
|
|
|
|
|
|
|
|
| 55 |
headers = {
|
| 56 |
"User-Agent": "BLIP-2 HuggingFace Space",
|
| 57 |
"Auth-Token": get_token(),
|
|
@@ -161,7 +164,7 @@ with gr.Blocks(
|
|
| 161 |
|
| 162 |
with gr.Row():
|
| 163 |
with gr.Column(scale=1):
|
| 164 |
-
image_input = gr.Image(type="pil"
|
| 165 |
|
| 166 |
# with gr.Row():
|
| 167 |
sampling = gr.Radio(
|
|
|
|
| 50 |
):
|
| 51 |
|
| 52 |
url = endpoint.url
|
| 53 |
+
if url!=None:
|
| 54 |
|
| 55 |
+
url = url + "/api/caption"
|
| 56 |
+
else:
|
| 57 |
+
return None
|
| 58 |
headers = {
|
| 59 |
"User-Agent": "BLIP-2 HuggingFace Space",
|
| 60 |
"Auth-Token": get_token(),
|
|
|
|
| 164 |
|
| 165 |
with gr.Row():
|
| 166 |
with gr.Column(scale=1):
|
| 167 |
+
image_input = gr.Image(type="pil")
|
| 168 |
|
| 169 |
# with gr.Row():
|
| 170 |
sampling = gr.Radio(
|