Spaces:
Sleeping
Sleeping
Commit
·
d5324b6
1
Parent(s):
c03d4e3
Miscellaneous
Browse files
app.py
CHANGED
@@ -3,8 +3,10 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
3 |
import torch
|
4 |
|
5 |
# deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct
|
6 |
-
|
7 |
-
|
|
|
|
|
8 |
|
9 |
def generate_code(prompt, style="Clean & Pythonic"):
|
10 |
if style == "Verbose like a 15th-century manuscript":
|
|
|
3 |
import torch
|
4 |
|
5 |
# deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct
|
6 |
+
model_id = "deepseek-ai/deepseek-coder-1.3b-instruct"
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id) # Or your own!
|
8 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, device_map=None, torch_dtype=torch.float32, trust_remote_code=True)
|
9 |
+
model.to("cpu")
|
10 |
|
11 |
def generate_code(prompt, style="Clean & Pythonic"):
|
12 |
if style == "Verbose like a 15th-century manuscript":
|