Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import AutoProcessor,
|
| 3 |
from threading import Thread
|
| 4 |
import re
|
| 5 |
import time
|
|
@@ -11,7 +11,7 @@ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENT
|
|
| 11 |
from io import BytesIO
|
| 12 |
|
| 13 |
processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM2-2.2B-Instruct")
|
| 14 |
-
model =
|
| 15 |
_attn_implementation="flash_attention_2",
|
| 16 |
torch_dtype=torch.bfloat16).to("cuda:0")
|
| 17 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import AutoProcessor, AutoModelForImageTextToText, TextIteratorStreamer
|
| 3 |
from threading import Thread
|
| 4 |
import re
|
| 5 |
import time
|
|
|
|
| 11 |
from io import BytesIO
|
| 12 |
|
| 13 |
processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM2-2.2B-Instruct")
|
| 14 |
+
model = AutoModelForImageTextToText.from_pretrained("HuggingFaceTB/SmolVLM2-2.2B-Instruct",
|
| 15 |
_attn_implementation="flash_attention_2",
|
| 16 |
torch_dtype=torch.bfloat16).to("cuda:0")
|
| 17 |
|