Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("emozilla/landmark-llama-7b", use_fast=False)
5model = AutoModelForCausalLM.from_pretrained("emozilla/landmark-llama-7b", \
6 torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
7pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
8
9print(pipe("Somebody once told me the world is gonna roll me", \
10 max_new_tokens=256, temperature=0.8, do_sample=True))mem_freq, mem_top_k, mem_max_seq_len, and mem_max_cache_size.1config = AutoConfig.from_pretrained("emozilla/landmark-llama-7b", trust_remote_code=True)
2config.mem_top_k = 6
3model = AutoModelForCausalLM.from_pretrained("emozilla/landmark-llama-7b", \
4 torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto", config=config)