Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,7 @@ def get_caption_from_MD(image_in):
|
|
| 59 |
client = Client("https://vikhyatk-moondream1.hf.space/")
|
| 60 |
result = client.predict(
|
| 61 |
image_in, # filepath in 'image' Image component
|
| 62 |
-
"Describe
|
| 63 |
api_name="/answer_question"
|
| 64 |
)
|
| 65 |
print(result)
|
|
@@ -99,7 +99,7 @@ instruction = f"""
|
|
| 99 |
|
| 100 |
def infer(image_in):
|
| 101 |
gr.Info("Getting image caption with Kosmos2...")
|
| 102 |
-
user_prompt =
|
| 103 |
|
| 104 |
prompt = f"{instruction.strip()}\n{user_prompt}</s>"
|
| 105 |
#print(f"PROMPT: {prompt}")
|
|
|
|
| 59 |
client = Client("https://vikhyatk-moondream1.hf.space/")
|
| 60 |
result = client.predict(
|
| 61 |
image_in, # filepath in 'image' Image component
|
| 62 |
+
"Describe character like if it was fictional", # str in 'Question' Textbox component
|
| 63 |
api_name="/answer_question"
|
| 64 |
)
|
| 65 |
print(result)
|
|
|
|
| 99 |
|
| 100 |
def infer(image_in):
|
| 101 |
gr.Info("Getting image caption with Kosmos2...")
|
| 102 |
+
user_prompt = get_caption_from_MD(image_in)
|
| 103 |
|
| 104 |
prompt = f"{instruction.strip()}\n{user_prompt}</s>"
|
| 105 |
#print(f"PROMPT: {prompt}")
|