Update app.py
Browse files
app.py
CHANGED
@@ -41,6 +41,7 @@ def build_prompt(task="caption", input=None, sep="\n\n### "):
|
|
41 |
return p
|
42 |
|
43 |
# Define the function to generate text from the image and prompt
|
|
|
44 |
def generate_text(image, task, input_text=None):
|
45 |
prompt = build_prompt(task=task, input=input_text)
|
46 |
inputs = processor(images=image, return_tensors="pt")
|
|
|
41 |
return p
|
42 |
|
43 |
# Define the function to generate text from the image and prompt
|
44 |
+
@spaces.GPU(duration=120)
|
45 |
def generate_text(image, task, input_text=None):
|
46 |
prompt = build_prompt(task=task, input=input_text)
|
47 |
inputs = processor(images=image, return_tensors="pt")
|