Views
No views yet
cmd2cwl model is an instruction fine-tuned version of the unsloth/Llama-3.2-3B. This model has been trained on a custom dataset consisting of help documentation from various command-line tools and corresponding CWL (Common Workflow Language) scripts. Its purpose is to assist users in converting command-line tool documentation into clean and well-structured CWL scripts, enhancing automation and workflow reproducibility.1question = """
2Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
3
4### Instruction:
5Write a cwl script for md5sum with docker image alpine.
6
7### Input:
8
9 With no FILE, or when FILE is -, read standard input.
10
11 -b, --binary read in binary mode
12 -c, --check read MD5 sums from the FILEs and check them
13 --tag create a BSD-style checksum
14 -t, --text read in text mode (default)
15 -z, --zero end each output line with NUL, not newline,
16 and disable file name escaping
17
18 The following five options are useful only when verifying checksums:
19 --ignore-missing don't fail or report status for missing files
20 --quiet don't print OK for each successfully verified file
21 --status don't output anything, status code shows success
22 --strict exit non-zero for improperly formatted checksum lines
23 -w, --warn warn about improperly formatted checksum lines
24
25 --help display this help and exit
26 --version output version information and exit
27
28 The sums are computed as described in RFC 1321. When checking, the input
29 should be a former output of this program. The default mode is to print a
30 line with checksum, a space, a character indicating input mode ('*' for binary,
31 ' ' for text or where binary is insignificant), and name for each FILE.
32
33
34### Response:
35"""1from unsloth import FastLanguageModel
2from transformers import TextStreamer
3
4model, tokenizer = FastLanguageModel.from_pretrained(
5 model_name = "hubentu/cmd2cwl_Llama-3.2-3B",
6 load_in_4bit = False,
7)
8FastLanguageModel.for_inference(model)
9
10inputs = tokenizer(
11 [question],
12 return_tensors = "pt").to("cuda")
13
14text_streamer = TextStreamer(tokenizer)
15_ = model.generate(**inputs, streamer = text_streamer)
161from transformers import AutoTokenizer, AutoModelForCausalLM
2from transformers import TextStreamer
3
4model = AutoModelForCausalLM.from_pretrained("hubentu/cmd2cwl_Llama-3.2-3B")
5tokenizer = AutoTokenizer.from_pretrained("hubentu/cmd2cwl_Llama-3.2-3B")
6model.to('cuda')
7
8text_streamer = TextStreamer(tokenizer)
9_ = model.generate(**inputs, streamer = text_streamer, max_length=8192)1from transformers import pipeline
2generator = pipeline('text-generation', model="checkpoints/cmd2cwl_Llama-3.2-3B", device='cuda')
3resp = generator(question, max_length=8192)
4print(resp[0]['generated_text'].split("### Response:\n")[-1])cwlVersion: v1.0
class: CommandLineTool
baseCommand:
- md5sum
requirements:
- class: DockerRequirement
dockerPull: alpine:latest
label: md5sum
doc: Compute and check MD5 checksums
inputs:
files:
label: files
doc: Input files
type: File[]
inputBinding:
separate: true
outputs:
md5:
label: md5
doc: MD5 checksums
type: string[]
outputBinding:
glob: $(inputs.files.name)