Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from gradio_client import Client
|
|
3 |
|
4 |
fuse_client = Client("https://noamrot-fusecap-image-captioning.hf.space/")
|
5 |
clipi_client = Client("https://fffiloni-clip-interrogator-2.hf.space/")
|
|
|
6 |
|
7 |
def compare(image):
|
8 |
|
@@ -17,8 +18,16 @@ def compare(image):
|
|
17 |
image, # str representing input in 'raw_image' Image component
|
18 |
api_name="/predict"
|
19 |
)
|
20 |
-
|
21 |
-
coca_cap =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
return ci_cap[0], coca_cap, fuse_cap
|
24 |
|
|
|
3 |
|
4 |
fuse_client = Client("https://noamrot-fusecap-image-captioning.hf.space/")
|
5 |
clipi_client = Client("https://fffiloni-clip-interrogator-2.hf.space/")
|
6 |
+
coca_client = Client("https://fffiloni-coca-clone.hf.space/")
|
7 |
|
8 |
def compare(image):
|
9 |
|
|
|
18 |
image, # str representing input in 'raw_image' Image component
|
19 |
api_name="/predict"
|
20 |
)
|
21 |
+
|
22 |
+
coca_cap = coca_client.predict(
|
23 |
+
image, # filepath in 'parameter_6' Image component
|
24 |
+
Beam search, # Literal[Beam search, Nucleus sampling] in 'Text Decoding Method' Radio component
|
25 |
+
1, # float (numeric value between 1.0 and 5.0) in 'Repeat Penalty (larger value prevents repetition)' Slider component
|
26 |
+
0.5, # float (numeric value between 0.0 and 1.0) in 'Top p (used with nucleus sampling)' Slider component
|
27 |
+
5, # float in 'Minimum Sequence Length' Number component
|
28 |
+
20, # float in 'Maximum Sequence Length (has to higher than Minimum)' Number component
|
29 |
+
api_name="/inference_caption"
|
30 |
+
)
|
31 |
|
32 |
return ci_cap[0], coca_cap, fuse_cap
|
33 |
|