--- library_name: transformers tags: [phi3, fine-tuning, code-generation, matplotlib, seaborn, text-to-code] --- # Model Card for `ph3-FineTunned-matplotlib-seaborn-10k` This is a fine-tuned version of the **Phi-3** language model designed to generate Python data visualization code (using `matplotlib` and `seaborn`) from natural language prompts. It has been trained on 10,000 high-quality prompt–completion pairs focused on data plotting. --- ## Model Details ### Model Description - **Developed by:** [Prashant Suresh Shirgave](https://huggingface.co/prashantss1404) - **Shared by:** prashantss1404 - **Model type:** Text-to-Code Generation (Instruction-based) - **Language(s):** English (data viz-related queries) - **License:** Apache 2.0 - **Finetuned from model:** [Phi-3 Mini](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) ### Model Sources - **Model repository:** https://huggingface.co/prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k - **Training dataset:** https://huggingface.co/datasets/prashantss1404/Matplotlib_Seaborn_merged_prompt_completion_10k - **Training Colab:** [View notebook](upload-your-link-here-after-upload) --- ## Uses ### Direct Use This model is designed to: - Generate Python visualization code (`matplotlib`, `seaborn`) from natural language queries. - Help automate plotting tasks in notebooks, dashboards, or LLM-based assistants. ### Out-of-Scope Use - Not suitable for general-purpose coding outside of data visualization. - Not optimized for plotly or non-Python frameworks. --- ## Bias, Risks, and Limitations ### Limitations - Limited to matplotlib and seaborn APIs seen during training. - May hallucinate parameters or make invalid API calls under complex queries. - No error correction or code execution within the model loop. ### Recommendations Always **validate generated code** before executing. Combine with an execution sandbox (e.g., Streamlit, Jupyter) for best results. --- ## How to Get Started with the Model ```python from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k") model = AutoModelForCausalLM.from_pretrained("prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k") prompt = "Plot a bar chart of sales by region using seaborn" inputs = tokenizer(prompt, return_tensors="pt") outputs = model.generate(**inputs, max_new_tokens=200) print(tokenizer.decode(outputs[0]))