Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ model = AutoModelForVision2Seq.from_pretrained("HuggingFaceTB/SmolVLM-Instruct",
|
|
| 15 |
#_attn_implementation="flash_attention_2"
|
| 16 |
).to("cpu")
|
| 17 |
|
| 18 |
-
|
| 19 |
def model_inference(
|
| 20 |
images, text, assistant_prefix, decoding_strategy, temperature, max_new_tokens,
|
| 21 |
repetition_penalty, top_p
|
|
@@ -45,7 +45,7 @@ def model_inference(
|
|
| 45 |
|
| 46 |
prompt = processor.apply_chat_template(resulting_messages, add_generation_prompt=True)
|
| 47 |
inputs = processor(text=prompt, images=[images], return_tensors="pt")
|
| 48 |
-
inputs = {k: v.to("
|
| 49 |
|
| 50 |
generation_args = {
|
| 51 |
"max_new_tokens": max_new_tokens,
|
|
|
|
| 15 |
#_attn_implementation="flash_attention_2"
|
| 16 |
).to("cpu")
|
| 17 |
|
| 18 |
+
|
| 19 |
def model_inference(
|
| 20 |
images, text, assistant_prefix, decoding_strategy, temperature, max_new_tokens,
|
| 21 |
repetition_penalty, top_p
|
|
|
|
| 45 |
|
| 46 |
prompt = processor.apply_chat_template(resulting_messages, add_generation_prompt=True)
|
| 47 |
inputs = processor(text=prompt, images=[images], return_tensors="pt")
|
| 48 |
+
inputs = {k: v.to("cpu") for k, v in inputs.items()}
|
| 49 |
|
| 50 |
generation_args = {
|
| 51 |
"max_new_tokens": max_new_tokens,
|