Spaces:
Sleeping
Sleeping
Alejadro Sanchez-Giraldo
commited on
Commit
·
35d2683
1
Parent(s):
10c16c2
add also GPU options
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-1.3b-instr
|
|
8 |
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-1.3b-instruct", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
9 |
|
10 |
# Use CPU if CUDA is not available
|
11 |
-
device = torch.device("cpu")
|
12 |
model = model.to(device)
|
13 |
|
14 |
# Theme builder
|
|
|
8 |
model = AutoModelForCausalLM.from_pretrained("deepseek-ai/deepseek-coder-1.3b-instruct", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
9 |
|
10 |
# Use CPU if CUDA is not available
|
11 |
+
device = torch.device("cpu" if not torch.cuda.is_available() else "cuda")
|
12 |
model = model.to(device)
|
13 |
|
14 |
# Theme builder
|