Views
No views yet
Salesforce/codet5-small architecture and has been fine-tuned to act as a local terminal assistant.Contexto: ['pwd=current_path', 'ls=file_list'] | Natural language instruction.xlsx if they do not exist).touch, mkdir), moving (mv), copying (cp), and deleting (rm) files.cd with absolute and relative paths, distinguishing between "moving a file" and "changing directories."df -h, free -h, ip a, whoami, etc., without confusing them with file operations.rm) and "extract" (unzip/tar).cat/xdg-open) and "delete" (rm)..xlsx files when asked for a generic file).transformers library.1from transformers import AutoTokenizer, T5ForConditionalGeneration
2
3model_name = "jrodriiguezg/grape-chardonnay"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = T5ForConditionalGeneration.from_pretrained(model_name)
6
7# Define the context (simulated environment)
8context = "Contexto: ['pwd=/home/user', 'ls=data.zip, notes.txt']"
9instruction = "descomprime el archivo zip"
10
11# Prepare input
12input_text = f"translate Spanish to Bash: {context} | {instruction}"
13input_ids = tokenizer(input_text, return_tensors="pt").input_ids
14
15# Generate command
16outputs = model.generate(input_ids, max_length=128)
17command = tokenizer.decode(outputs[0], skip_special_tokens=True)
18
19print(command)
20# Output: unzip data.zip