Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import os
|
2 |
import torch
|
3 |
import faiss
|
4 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
5 |
from sentence_transformers import SentenceTransformer
|
6 |
from datasets import load_dataset
|
7 |
import gradio as gr
|
@@ -11,10 +11,10 @@ hf_api_key = os.getenv('HF_API_KEY')
|
|
11 |
|
12 |
# λͺ¨λΈ ID λ° ν ν¬λμ΄μ μ€μ
|
13 |
model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
14 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id,
|
15 |
model = AutoModelForCausalLM.from_pretrained(
|
16 |
model_id,
|
17 |
-
|
18 |
torch_dtype=torch.bfloat16,
|
19 |
device_map="auto",
|
20 |
quantization_config=BitsAndBytesConfig(
|
|
|
1 |
import os
|
2 |
import torch
|
3 |
import faiss
|
4 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, Accelerate
|
5 |
from sentence_transformers import SentenceTransformer
|
6 |
from datasets import load_dataset
|
7 |
import gradio as gr
|
|
|
11 |
|
12 |
# λͺ¨λΈ ID λ° ν ν¬λμ΄μ μ€μ
|
13 |
model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1"
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, token=hf_api_key)
|
15 |
model = AutoModelForCausalLM.from_pretrained(
|
16 |
model_id,
|
17 |
+
token=hf_api_key,
|
18 |
torch_dtype=torch.bfloat16,
|
19 |
device_map="auto",
|
20 |
quantization_config=BitsAndBytesConfig(
|