Spaces:
Running
Running
jonathanjordan21
commited on
Commit
•
ff3c774
1
Parent(s):
786bff6
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,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]['generated_text']
|
12 |
|
13 |
# Create Gradio interface
|
14 |
inputs = [gr.Textbox(label="Input Text"), gr.Image(type="pil")] # Input for uploading an 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]['generated_text'].split("\nASSISTANT:")[-1]
|
12 |
|
13 |
# Create Gradio interface
|
14 |
inputs = [gr.Textbox(label="Input Text"), gr.Image(type="pil")] # Input for uploading an image
|