Views
No views yet

1tokenizer = AutoTokenizer.from_pretrained("suayptalha/Komodo-7B-Instruct")
2model = AutoModelForCausalLM.from_pretrained("suayptalha/Komodo-7B-Instruct")
3
4example_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
5
6### Instruction:
7{}
8
9### Input:
10{}
11
12### Response:
13{}"""
14
15inputs = tokenizer(
16[
17 example_prompt.format(
18 "", #Your question here
19 "", #Given input here
20 "", #Output (for training)
21 )
22], return_tensors = "pt").to("cuda")
23
24outputs = model.generate(**inputs, max_new_tokens = 512, use_cache = True)
25tokenizer.batch_decode(outputs)