Spaces:
Running
Running
seapoe1809
commited on
Update darnabot.py
Browse files- darnabot.py +7 -6
darnabot.py
CHANGED
@@ -69,16 +69,17 @@ from threading import Thread
|
|
69 |
import spaces
|
70 |
|
71 |
# Initialize device and model
|
72 |
-
|
73 |
-
|
74 |
-
MODEL = os.environ.get("MODEL_ID")
|
75 |
|
76 |
-
device = "cuda"
|
77 |
|
78 |
|
79 |
# Authenticate if needed
|
80 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
81 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
82 |
device_map="auto",
|
83 |
ignore_mismatched_sizes=True)
|
84 |
|
|
|
69 |
import spaces
|
70 |
|
71 |
# Initialize device and model
|
72 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
73 |
+
MODEL = "mistralai/Mistral-Nemo-Instruct-2407"
|
|
|
74 |
|
75 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
76 |
|
77 |
|
78 |
# Authenticate if needed
|
79 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL)
|
80 |
+
model = AutoModelForCausalLM.from_pretrained(
|
81 |
+
MODEL,
|
82 |
+
torch_dtype=torch.bfloat16,
|
83 |
device_map="auto",
|
84 |
ignore_mismatched_sizes=True)
|
85 |
|