Views
No views yet
wc -l /tmp/data/log.txt1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name="jalva182/cli-agent-model",
5 max_seq_length=512,
6 load_in_4bit=True,
7)
8
9messages = [
10 {"role": "system", "content": "You are a CLI expert. Given a task, output exactly the shell commands required. No explanation, no markdown, no backticks."},
11 {"role": "user", "content": "Count the number of lines in /tmp/data/log.txt"},
12]
13
14inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
15outputs = model.generate(input_ids=inputs, max_new_tokens=64)
16print(tokenizer.decode(outputs[0], skip_special_tokens=True))