Spaces:
Runtime error

markshep68 commited on
Commit
2ec8626
·
verified ·
1 Parent(s): 8b9c28a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2,10 +2,10 @@ import gradio as gr
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
  import torch
4
 
5
- # Load the Mistral-7B model
6
  model_name = "mistralai/Mistral-7B-v0.1"
7
- tokenizer = AutoTokenizer.from_pretrained(model_name, use_auth_token=True)
8
- model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype=torch.float16)
9
 
10
  # Define chatbot function
11
  def chat_with_mistral(user_input):
 
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
  import torch
4
 
5
+ # Load the Mistral-7B model with correct authentication method
6
  model_name = "mistralai/Mistral-7B-v0.1"
7
+ tokenizer = AutoTokenizer.from_pretrained(model_name, token=True)
8
+ model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype=torch.float16, token=True)
9
 
10
  # Define chatbot function
11
  def chat_with_mistral(user_input):