Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,12 @@ import gradio as gr
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
import torch
|
4 |
|
|
|
5 |
|
|
|
6 |
model = AutoModelForCausalLM.from_pretrained(
|
7 |
"mistralai/Mistral-7B-Instruct-v0.1",
|
|
|
8 |
torch_dtype=torch.bfloat16,
|
9 |
trust_remote_code=True,
|
10 |
device_map="auto",
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
import torch
|
4 |
|
5 |
+
import os
|
6 |
|
7 |
+
hf_token = os.environ.get('HF_TOKEN', None)
|
8 |
model = AutoModelForCausalLM.from_pretrained(
|
9 |
"mistralai/Mistral-7B-Instruct-v0.1",
|
10 |
+
token = hf_token,
|
11 |
torch_dtype=torch.bfloat16,
|
12 |
trust_remote_code=True,
|
13 |
device_map="auto",
|