Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,10 +72,10 @@ def run_language_model(edit_prompt, caption, device):
|
|
| 72 |
|
| 73 |
output_generation_a, output_generation_b = response.split("\n")
|
| 74 |
to_replace = output_generation_a[2:].strip()
|
| 75 |
-
|
| 76 |
|
| 77 |
delete_model(language_model)
|
| 78 |
-
return (to_replace,
|
| 79 |
|
| 80 |
@spaces.GPU()
|
| 81 |
def run_image_captioner(image, device):
|
|
@@ -171,7 +171,7 @@ def run_open_gen_fill(image, edit_prompt):
|
|
| 171 |
|
| 172 |
# Run the langauge model to extract the object for segmentation
|
| 173 |
# and get the replaced caption
|
| 174 |
-
to_replace,
|
| 175 |
edit_prompt=edit_prompt, caption=caption, device=device
|
| 176 |
)
|
| 177 |
|
|
|
|
| 72 |
|
| 73 |
output_generation_a, output_generation_b = response.split("\n")
|
| 74 |
to_replace = output_generation_a[2:].strip()
|
| 75 |
+
replaced_caption = output_generation_b[2:].strip()
|
| 76 |
|
| 77 |
delete_model(language_model)
|
| 78 |
+
return (to_replace, replaced_caption)
|
| 79 |
|
| 80 |
@spaces.GPU()
|
| 81 |
def run_image_captioner(image, device):
|
|
|
|
| 171 |
|
| 172 |
# Run the langauge model to extract the object for segmentation
|
| 173 |
# and get the replaced caption
|
| 174 |
+
to_replace, replaced_caption = run_language_model(
|
| 175 |
edit_prompt=edit_prompt, caption=caption, device=device
|
| 176 |
)
|
| 177 |
|