Update app.py
Browse files
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 |
-
# ✅
|
12 |
-
model_name = "
|
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 = {
|