Spaces:
Running on Zero
Download README.md from omargam220/PlotCraft: direct link, hf CLI and curl.
- Browser
- Download file 2.3 kB
-
https://huggingface.co/spaces/omargam220/PlotCraft/resolve/main/README.md
- Command line
-
hf download hf://spaces/omargam220/PlotCraft/README.md
-
curl -L -o README.md https://huggingface.co/spaces/omargam220/PlotCraft/resolve/main/README.md
A newer version of the Gradio SDK is available: 6.30.0
title: PlotCraft
sdk: gradio
sdk_version: 6.28.0
python_version: 3.12
app_file: app.py
models:
- PlotCraft
short_description: Generate Python visualization code from natural language.
PlotCraft
PlotCraft is a fine-tuned Qwen2.5-3B assistant that converts natural-language requests into executable Python visualization code. This repository contains the Gradio application, FastAPI service, Docker configuration, automated tests, and GitHub Actions deployment pipeline.
Generated code is displayed for review and can be rendered as a PNG inside an isolated browser worker. Generated code is never executed on the server.
Use the live application
- Open the live demo.
- Describe the Python visualization you want.
- Select Generate Python Code.
- Review the generated Python code.
- Select Render Preview to display the chart in the browser.
- Copy the code if you want to use it in your own project.
Example request:
Create a Matplotlib bar chart with categories A, B, C and values 2, 5, 3.
Run locally
Create and activate a virtual environment in Git Bash:
python -m venv .venv
source .venv/Scripts/activate
Install the dependencies and start the application:
pip install -r requirements.txt
python app.py
Local execution uses the lightweight mock mode by default, so it does not download the production model.
Run the tests with:
python -m pytest
Run the API with Docker
Build and start the container:
docker compose up --build
Open the interactive API documentation at:
http://localhost:8000/docs
Available endpoints:
GET /healthchecks whether the service is running.POST /generateaccepts a prompt and returns generated Python code.
Stop the container with:
docker compose down