Text Generation
Transformers
Safetensors
phi3
fine-tuning
code-generation
matplotlib
seaborn
text-to-code
conversational
custom_code
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k
- SGLang
How to use prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k with Docker Model Runner:
docker model run hf.co/prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k
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
- 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
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: https://huggingface.co/prashantss1404/ph3-FineTunned-matplotlib-seaborn-10k/blob/main/Fine_Tunned_Phi3_on_matplotlib_and_seaborn.ipynb
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
- The model was fine-tuned on text-based examples
- It may generate incorrect or non-working code for complex queries.
- No built-in code execution or error checking is included.
- Meant for educational and experimental use only.
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
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]))
- Downloads last month
- 4