Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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,
|
| 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):
|