Run this model with HF Jobs

Run Maaac/CodeLLaMA-Linux-BugFix on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/Maaac/CodeLLaMA-Linux-BugFix. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/Maaac/CodeLLaMA-Linux-BugFix on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/Maaac/CodeLLaMA-Linux-BugFix. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/Maaac/CodeLLaMA-Linux-BugFix. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
CodeLLaMA-Linux-BugFix / dataset_builder /format_for_training.py
Mac
Refactor filenames and paths for clarity and structure
15eb8ca
Raw History Blame Contribute Delete
1.33 kB
import json
INPUT_FILE = './output/linux_bugfix_dataset.jsonl'
OUTPUT_FILE = '../dataset/training_data_prompt_completion.jsonl'
def format_prompt(original_code, instruction):
return (
"Given the following original C code:\n"
f"{original_code.strip()}\n\n"
"Instruction:\n"
f"{instruction.strip()}\n\n"
"Return the diff that fixes it:\n"
)
def format_completion(diff_code):
return diff_code.strip()
def convert_dataset(input_path, output_path):
with open(input_path, 'r', encoding='utf-8') as fin, \
open(output_path, 'w', encoding='utf-8') as fout:
for line in fin:
data = json.loads(line)
original_code = data["input"]["original code"]
instruction = data["input"]["instruction"]
diff_code = data["output"]["diff codes"]
prompt = format_prompt(original_code, instruction)
completion = format_completion(diff_code)
new_entry = {
"prompt": prompt,
"completion": completion
}
fout.write(json.dumps(new_entry, ensure_ascii=False) + '\n')
print(f"[DONE] Converted dataset saved to: {output_path}")
if __name__ == "__main__":
convert_dataset(INPUT_FILE, OUTPUT_FILE)