Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ pipe = pipeline("image-to-text", model=model_id)
|
|
7 |
def generate_text(prompt, image):
|
8 |
# Generate text description
|
9 |
prompt = f"USER: <image>\n{prompt}\nASSISTANT:"
|
10 |
-
text_description = pipe(images=image, prompt=prompt,generate_kwargs={"max_new_tokens": 200})
|
11 |
return text_description[0]
|
12 |
|
13 |
# Create Gradio interface
|
|
|
7 |
def generate_text(prompt, image):
|
8 |
# Generate text description
|
9 |
prompt = f"USER: <image>\n{prompt}\nASSISTANT:"
|
10 |
+
text_description = pipe(images=image, prompt=prompt,generate_kwargs={"max_new_tokens": 200}) # Batch for efficiency
|
11 |
return text_description[0]
|
12 |
|
13 |
# Create Gradio interface
|