CoolFace
Modelpublic

rohitnagareddy/gemma-2b-python-expert-lora

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes21downloads
Model Card

gemma-2b-python-expert-lora(Text to Model)

This LoRA adapter specializes the base model for expert-level Python programming. Created using Sakana AI's Text-to-LoRA technology.

Model Details

  • Base Model: google/gemma-2b-it
  • LoRA Rank: 16
  • Target Modules: qproj, kproj, vproj, oproj, gateproj, upproj, down_proj
  • Task: Python Code Generation

Usage

python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

# Load base model and tokenizer
model = AutoModelForCausalLM.from_pretrained("google/gemma-2b-it")
tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it")

# Load LoRA adapter
model = PeftModel.from_pretrained(model, "rohitnagareddy/gemma-2b-python-expert-lora")

# Generate Python code
prompt = "Write a Python function to implement binary search:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Capabilities

  • Clean, documented Python code
  • Type hints and error handling
  • PEP 8 compliance
  • Algorithm implementation
  • Web development
  • Data processing
  • Testing and debugging

Citation

bibtex
@misc{sakana2024texttolora,
    title={Text-to-LoRA},
    author={Sakana AI},
    year={2024},
    url={https://github.com/SakanaAI/text-to-lora}
}