Model Description

This model is a LoRA fine-tuned version of TinyLlama-1.1B-Chat-v1.0, trained to generate Python docstrings for given function code.

  • Base model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
  • Dataset: code_search_net (Python subset)
  • Method: Supervised Fine-Tuning (SFT) with LoRA
  • Developed by: Ubaid

Training Results

Epoch Training Loss Validation Loss Token Accuracy
1 1.165 1.195 72.8%

How to Use

```python from peft import AutoPeftModelForCausalLM from transformers import AutoTokenizer

repo = "ubaid0405/tinyllama-1.1b-docstring-gen" model = AutoPeftModelForCausalLM.from_pretrained(repo, device_map="auto") tok = AutoTokenizer.from_pretrained(repo)

code = "def add(a, b):\n return a + b" prompt = f"[INST] Write a docstring:\n{code} [/INST]"

ids = tok(prompt, return_tensors="pt").input_ids.to(model.device) out = model.generate(ids, max_new_tokens=100) print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True)) ```

Downloads last month
16
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ubaid0405/tinyllama-1.1b-docstring-gen

Adapter
(1592)
this model