Update handler.py
Browse files7 unmodified lines891011121314151617189 unmodified lines282930313233347 unmodified linesclass EndpointHandler:def __init__(self, path=""):self.tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf")base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-hf",torch_dtype=torch.float16,device_map="auto")lora_config = LoraConfig(9 unmodified linesadapter_path = hf_hub_download(repo_id="vignesh0007/Anime-Gen-Llama-2-7B",filename="adapter_model.safetensors",repo_type="model")lora_state = load_file(adapter_path)self.model.load_state_dict(lora_state, strict=False)7 unmodified lines89101112131415161718199 unmodified lines29303132333435367 unmodified linesclass EndpointHandler:def __init__(self, path=""):self.tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf", token=token)base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-hf",torch_dtype=torch.float16,device_map="auto",token=token)lora_config = LoraConfig(9 unmodified linesadapter_path = hf_hub_download(repo_id="vignesh0007/Anime-Gen-Llama-2-7B",filename="adapter_model.safetensors",repo_type="model",token=token)lora_state = load_file(adapter_path)self.model.load_state_dict(lora_state, strict=False)
handler.py+5-3