Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ def get_caption(image_in):
|
|
| 9 |
image_in, # str representing input in 'raw_image' Image component
|
| 10 |
api_name="/predict"
|
| 11 |
)
|
| 12 |
-
print(fusecap_result)
|
| 13 |
return fusecap_result
|
| 14 |
|
| 15 |
import re
|
|
@@ -40,10 +40,11 @@ instruction = f"""
|
|
| 40 |
"""
|
| 41 |
|
| 42 |
def infer(image_in):
|
| 43 |
-
|
| 44 |
user_prompt = get_caption(image_in)
|
| 45 |
prompt = f"{instruction.strip()}\n{user_prompt}</s>"
|
| 46 |
print(f"PROMPT: {prompt}")
|
|
|
|
| 47 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 48 |
print(outputs)
|
| 49 |
|
|
|
|
| 9 |
image_in, # str representing input in 'raw_image' Image component
|
| 10 |
api_name="/predict"
|
| 11 |
)
|
| 12 |
+
print(f"IMAGE CAPTION: {fusecap_result}")
|
| 13 |
return fusecap_result
|
| 14 |
|
| 15 |
import re
|
|
|
|
| 40 |
"""
|
| 41 |
|
| 42 |
def infer(image_in):
|
| 43 |
+
gr.Info("Getting image caption from Fuse Cap...")
|
| 44 |
user_prompt = get_caption(image_in)
|
| 45 |
prompt = f"{instruction.strip()}\n{user_prompt}</s>"
|
| 46 |
print(f"PROMPT: {prompt}")
|
| 47 |
+
gr.Info("Building a system according to the image caption ...")
|
| 48 |
outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
| 49 |
print(outputs)
|
| 50 |
|