seawolf2357 commited on
Commit
2d84b3b
Β·
verified Β·
1 Parent(s): 5a98a19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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, use_auth_token=hf_api_key)
15
  model = AutoModelForCausalLM.from_pretrained(
16
  model_id,
17
- use_auth_token=hf_api_key,
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(