seapoe1809 commited on
Commit
23b6f13
·
verified ·
1 Parent(s): d242df3

Update darnabot.py

Browse files
Files changed (1) hide show
  1. darnabot.py +5 -4
darnabot.py CHANGED
@@ -75,14 +75,15 @@ MODEL = os.environ.get("MODEL_ID")
75
 
76
  device = "cuda"
77
 
78
- tokenizer = AutoTokenizer.from_pretrained(MODEL)
79
- model = AutoModelForCausalLM.from_pretrained(
80
- MODEL,
81
- torch_dtype=torch.bfloat16,
82
  device_map="auto",
83
  ignore_mismatched_sizes=True)
84
 
85
 
 
86
  async def chat(messages):
87
  # Convert messages to the format required for the model
88
  conversation = [{"role": "user", "content": msg['content']} if msg['role'] == "user"
 
75
 
76
  device = "cuda"
77
 
78
+
79
+ # Authenticate if needed
80
+ tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-Nemo-Instruct-2407", use_auth_token="mistral_ai")
81
+ model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-Nemo-Instruct-2407", use_auth_token="mistral_ai", torch_dtype=torch.bfloat16,
82
  device_map="auto",
83
  ignore_mismatched_sizes=True)
84
 
85
 
86
+
87
  async def chat(messages):
88
  # Convert messages to the format required for the model
89
  conversation = [{"role": "user", "content": msg['content']} if msg['role'] == "user"