Taizun commited on
Commit
0086548
·
verified ·
1 Parent(s): 81b6e3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8,10 +8,10 @@ from huggingface_hub import login
8
  HF_TOKEN = os.getenv("HF_TOKEN") # Read token from environment variable
9
  login(token=HF_TOKEN)
10
 
11
- # ✅ Using a lightweight Llama-2 model that works on CPU
12
- model_name = "TheBloke/Llama-2-7B-Chat-GGML" # 4-bit quantized model (CPU-friendly)
13
- tokenizer = AutoTokenizer.from_pretrained(model_name)
14
- model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float32, device_map="cpu")
15
 
16
  # Define personalities
17
  personalities = {
 
8
  HF_TOKEN = os.getenv("HF_TOKEN") # Read token from environment variable
9
  login(token=HF_TOKEN)
10
 
11
+ # ✅ Use a CPU-optimized Llama-2 model that supports tokenizers
12
+ model_name = "NousResearch/Llama-2-7b-chat-hf"
13
+ tokenizer = AutoTokenizer.from_pretrained(model_name, use_auth_token=True)
14
+ model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float32, device_map="cpu", use_auth_token=True)
15
 
16
  # Define personalities
17
  personalities = {