Spaces:
Runtime error
Runtime error
ivelin
commited on
Commit
•
fb4e118
1
Parent(s):
ba6d9e2
fix:example formatting
Browse filesSigned-off-by: ivelin <ivelin.eth@gmail.com>
app.py
CHANGED
@@ -14,7 +14,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
14 |
model.to(device)
|
15 |
|
16 |
|
17 |
-
def
|
18 |
# trim prompt to 80 characters and normalize to lowercase
|
19 |
prompt = prompt[:80].lower()
|
20 |
|
@@ -77,7 +77,7 @@ examples = [
|
|
77 |
["example_2.jpg", "enter the text field next to the name"]
|
78 |
],
|
79 |
|
80 |
-
demo = gr.Interface(fn=
|
81 |
outputs=[gr.inputs.Image(type='pil'), "textbox"],
|
82 |
title=title, description=description, article=article, examples=examples,
|
83 |
allow_flagging=False, allow_screenshot=False)
|
|
|
14 |
model.to(device)
|
15 |
|
16 |
|
17 |
+
def process_refexp(image: Image, prompt: str):
|
18 |
# trim prompt to 80 characters and normalize to lowercase
|
19 |
prompt = prompt[:80].lower()
|
20 |
|
|
|
77 |
["example_2.jpg", "enter the text field next to the name"]
|
78 |
],
|
79 |
|
80 |
+
demo = gr.Interface(fn=process_refexp, inputs=[gr.inputs.Image(type='pil'), "textbox"],
|
81 |
outputs=[gr.inputs.Image(type='pil'), "textbox"],
|
82 |
title=title, description=description, article=article, examples=examples,
|
83 |
allow_flagging=False, allow_screenshot=False)
|