Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ from transformers import TextIteratorStreamer
|
|
16 |
from threading import Thread
|
17 |
import torch
|
18 |
|
19 |
-
device = '
|
20 |
model_id = "google/gemma-3-4b-it"
|
21 |
processor = AutoProcessor.from_pretrained(model_id, use_fast=True, padding_side="left")
|
22 |
model = Gemma3ForConditionalGeneration.from_pretrained(
|
|
|
16 |
from threading import Thread
|
17 |
import torch
|
18 |
|
19 |
+
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
20 |
model_id = "google/gemma-3-4b-it"
|
21 |
processor = AutoProcessor.from_pretrained(model_id, use_fast=True, padding_side="left")
|
22 |
model = Gemma3ForConditionalGeneration.from_pretrained(
|