Spaces:
Sleeping
Sleeping
Commit ·
ab77b38
1
Parent(s): 0488aea
Add initial Gradio deployment interface
Browse files- api/__init__.py +0 -0
- api/main.py +0 -0
- app.py +43 -0
- requirements.txt +52 -0
- src/plotcraft/__init__.py +0 -0
- src/plotcraft/config.py +0 -0
- src/plotcraft/model.py +0 -0
- src/plotcraft/service.py +0 -0
- tests/.gitkeep +0 -0
api/__init__.py
ADDED
|
File without changes
|
api/main.py
ADDED
|
File without changes
|
app.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def generate_plot_code(prompt: str) -> str:
|
| 5 |
+
"""Return placeholder plotting code while deployment is being built."""
|
| 6 |
+
if not prompt.strip():
|
| 7 |
+
return "Please enter a plotting request."
|
| 8 |
+
|
| 9 |
+
return """import matplotlib.pyplot as plt
|
| 10 |
+
|
| 11 |
+
categories = ["Model A", "Model B", "Model C"]
|
| 12 |
+
scores = [0.78, 0.85, 0.91]
|
| 13 |
+
|
| 14 |
+
plt.bar(categories, scores)
|
| 15 |
+
plt.xlabel("Model")
|
| 16 |
+
plt.ylabel("Score")
|
| 17 |
+
plt.title("Model Comparison")
|
| 18 |
+
plt.show()
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
demo = gr.Interface(
|
| 23 |
+
fn=generate_plot_code,
|
| 24 |
+
inputs=gr.Textbox(
|
| 25 |
+
label="Plot description",
|
| 26 |
+
placeholder="Create a bar chart comparing three models",
|
| 27 |
+
lines=3,
|
| 28 |
+
),
|
| 29 |
+
outputs=gr.Code(label="Generated Python code", language="python"),
|
| 30 |
+
title="PlotCraft",
|
| 31 |
+
description=(
|
| 32 |
+
"Generate Matplotlib and TikZ visualization code from "
|
| 33 |
+
"natural-language instructions."
|
| 34 |
+
),
|
| 35 |
+
examples=[
|
| 36 |
+
["Create a bar chart comparing three models"],
|
| 37 |
+
["Create a line chart showing monthly sales"],
|
| 38 |
+
],
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
if __name__ == "__main__":
|
| 43 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
annotated-doc==0.0.5
|
| 2 |
+
annotated-types==0.8.0
|
| 3 |
+
anyio==4.15.1
|
| 4 |
+
brotli==1.2.0
|
| 5 |
+
certifi==2026.7.22
|
| 6 |
+
click==8.5.0
|
| 7 |
+
colorama==0.4.6
|
| 8 |
+
exceptiongroup==1.3.1
|
| 9 |
+
fastapi==0.141.1
|
| 10 |
+
filelock==4.0.4
|
| 11 |
+
fsspec==2026.9.0
|
| 12 |
+
gradio==6.28.0
|
| 13 |
+
gradio_client==2.7.1
|
| 14 |
+
groovy==0.1.2
|
| 15 |
+
h11==0.16.0
|
| 16 |
+
hf-gradio==0.4.1
|
| 17 |
+
hf-xet==1.6.0
|
| 18 |
+
httpcore==1.0.9
|
| 19 |
+
httpx==0.28.1
|
| 20 |
+
huggingface_hub==1.33.0
|
| 21 |
+
idna==3.20
|
| 22 |
+
Jinja2==3.1.6
|
| 23 |
+
markdown-it-py==4.2.0
|
| 24 |
+
MarkupSafe==3.0.3
|
| 25 |
+
mdurl==0.1.2
|
| 26 |
+
numpy==2.2.6
|
| 27 |
+
orjson==3.12.0
|
| 28 |
+
packaging==26.3
|
| 29 |
+
pandas==2.3.3
|
| 30 |
+
pillow==12.3.0
|
| 31 |
+
pydantic==2.13.5
|
| 32 |
+
pydantic_core==2.46.5
|
| 33 |
+
pydub==0.25.1
|
| 34 |
+
Pygments==2.21.0
|
| 35 |
+
python-dateutil==2.9.0.post0
|
| 36 |
+
python-multipart==0.0.32
|
| 37 |
+
pytz==2026.4
|
| 38 |
+
PyYAML==6.0.3
|
| 39 |
+
rich==15.0.0
|
| 40 |
+
safehttpx==0.1.7
|
| 41 |
+
semantic-version==2.10.0
|
| 42 |
+
shellingham==1.5.4
|
| 43 |
+
six==1.17.0
|
| 44 |
+
starlette==1.7.0
|
| 45 |
+
tomli==2.4.1
|
| 46 |
+
tomlkit==0.14.0
|
| 47 |
+
tqdm==4.70.1
|
| 48 |
+
typer==0.27.2
|
| 49 |
+
typing-inspection==0.4.4
|
| 50 |
+
typing_extensions==4.16.0
|
| 51 |
+
tzdata==2026.4
|
| 52 |
+
uvicorn==0.54.0
|
src/plotcraft/__init__.py
ADDED
|
File without changes
|
src/plotcraft/config.py
ADDED
|
File without changes
|
src/plotcraft/model.py
ADDED
|
File without changes
|
src/plotcraft/service.py
ADDED
|
File without changes
|
tests/.gitkeep
ADDED
|
File without changes
|