rohitnagareddy/gemma-2b-python-expert-lora
021
1---2license: apache-2.03base_model: google/gemma-2b-it4tags:5- text-to-lora6- sakana-ai7- peft8- lora9- python10- code-generation11- programming12library_name: peft13---14 15# gemma-2b-python-expert-lora(Text to Model)16 17This LoRA adapter specializes the base model for expert-level Python programming. Created using Sakana AI's Text-to-LoRA technology.18 19## Model Details20 21- **Base Model**: `google/gemma-2b-it`22- **LoRA Rank**: 1623- **Target Modules**: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj24- **Task**: Python Code Generation25 26## Usage27 28```python29from peft import PeftModel30from transformers import AutoModelForCausalLM, AutoTokenizer31 32# Load base model and tokenizer33model = AutoModelForCausalLM.from_pretrained("google/gemma-2b-it")34tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it")35 36# Load LoRA adapter37model = PeftModel.from_pretrained(model, "rohitnagareddy/gemma-2b-python-expert-lora")38 39# Generate Python code40prompt = "Write a Python function to implement binary search:"41inputs = tokenizer(prompt, return_tensors="pt")42outputs = model.generate(**inputs, max_new_tokens=256)43print(tokenizer.decode(outputs[0], skip_special_tokens=True))44```45 46## Capabilities47 48- Clean, documented Python code49- Type hints and error handling50- PEP 8 compliance51- Algorithm implementation52- Web development53- Data processing54- Testing and debugging55 56## Citation57 58```bibtex59@misc{sakana2024texttolora,60 title={Text-to-LoRA},61 author={Sakana AI},62 year={2024},63 url={https://github.com/SakanaAI/text-to-lora}64}65```66 