Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -104,7 +104,7 @@ def run(image: Image.Image | None, instruction: str, max_new_tokens: int = 768):
|
|
| 104 |
{"type": "image", "image": image},
|
| 105 |
{"type": "text", "text": instruction},
|
| 106 |
]}]
|
| 107 |
-
prompt = processor.apply_chat_template(msgs, add_generation_prompt=True, tokenize=False)
|
| 108 |
inputs = processor(text=prompt, images=[image], return_tensors="pt").to(device)
|
| 109 |
out = model.generate(
|
| 110 |
**inputs,
|
|
|
|
| 104 |
{"type": "image", "image": image},
|
| 105 |
{"type": "text", "text": instruction},
|
| 106 |
]}]
|
| 107 |
+
prompt = processor.apply_chat_template(msgs, add_generation_prompt=True, enable_thinking=True, tokenize=False)
|
| 108 |
inputs = processor(text=prompt, images=[image], return_tensors="pt").to(device)
|
| 109 |
out = model.generate(
|
| 110 |
**inputs,
|