--- library_name: transformers tags: [] --- # Model Card for Model ID This is a LoRA fine-tuned causal language model trained on a PyTorch Q&A dataset. The base model was adapted using PEFT (Parameter-Efficient Fine-Tuning) with low-rank adapters. It is designed to answer questions related to PyTorch concepts, APIs, and usage examples. ## Model Details ### Model Description This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated. - **Developed by:** Arush Sharma - **Task:** Causal Language Modeling (Q&A style) - **Finetuned from model:** Qwen/Qwen2.5-3B ### Model Sources [optional] - **Repository:** https://github.com/Arush04/ML_Clutter/blob/main/PyTorch_Model.ipynb ## Uses - Educational purposes for learning PyTorch - Assisting developers with PyTorch-related queries - Small-scale research and experimentation ## Training Details #### Training Hyperparameters - **Training regime:** - LoRA rank (r): 32 - LoRA alpha: 32 - Dropout: 0.05 - Batch size: 2 (gradient accumulation: 8) - Epochs: 2 - Optimizer: paged_adamw_8bit - Precision: FP16 - Dataset: PyTorch Q&A dataset (custom curated) [https://huggingface.co/datasets/sharmaarush/Pytorch_QA] ## Evaluation ![image/png](https://cdn-uploads.huggingface.co/production/uploads/65b2ac56e4191ceeb406aa4b/A3xo8PCWdb9bJ7jC4cdet.png) ## How to Use ``` from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline from peft import PeftModel tokenizer = AutoTokenizer.from_pretrained("sharmaarush/pytorch_QA_model") base_model = AutoModelForCausalLM.from_pretrained( model, device_map="auto" ) model = PeftModel.from_pretrained(base_model, "sharmaarush/pytorch_QA_model") pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device_map="auto") # Run inference prompt = "Explain FSDP2 in easier terms" outputs = pipe(prompt, do_sample=True, temperature=0.7) print(outputs[0]["generated_text"]) ```