Views
No views yet
1from vllm import LLM, SamplingParams
2
3# Initialize the model
4llm = LLM(model="Vykyan/KAT-Dev-72B-Exp-GPTQ-INT4-gs128", trust_remote_code=True)
5
6# Create sampling parameters
7sampling_params = SamplingParams(
8 temperature=0.7,
9 top_p=0.9,
10 max_tokens=512,
11)
12
13# Generate text
14prompts = ["Hello, how are you?"]
15outputs = llm.generate(prompts, sampling_params)
16
17for output in outputs:
18 print(output.outputs[0].text)1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained(
4 "Vykyan/KAT-Dev-72B-Exp-GPTQ-INT4-gs128",
5 device_map="auto",
6 trust_remote_code=True
7)
8tokenizer = AutoTokenizer.from_pretrained(
9 "Vykyan/KAT-Dev-72B-Exp-GPTQ-INT4-gs128",
10 trust_remote_code=True
11)
12
13# Generate
14inputs = tokenizer("Hello, how are you?", return_tensors="pt").to(model.device)
15outputs = model.generate(**inputs, max_new_tokens=100)
16print(tokenizer.decode(outputs[0], skip_special_tokens=True))