Views
No views yet
meta-llama/Llama-2-7b-chat-hf, designed to act as a supportive conversational assistant for mental health–related discussions.1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4base_model = "meta-llama/Llama-2-7b-chat-hf"
5adapter_model = "your-username/your-model-name"
6
7tokenizer = AutoTokenizer.from_pretrained(base_model)
8model = AutoModelForCausalLM.from_pretrained(
9 base_model,
10 device_map="auto"
11)
12
13model = PeftModel.from_pretrained(model, adapter_model)
14model.eval()