Spaces:
Sleeping
Sleeping
Commit ·
ab77b38
1
Parent(s): 0488aea
Add initial Gradio deployment interface
Browse filesFiles changed (9)
- api/__init__.pyAdded
- api/main.pyAdded
- app.pyAdded+43
- requirements.txtAdded+52
- src/plotcraft/__init__.pyAdded
- src/plotcraft/config.pyAdded
- src/plotcraft/model.pyAdded
- src/plotcraft/service.pyAdded
- tests/.gitkeepAdded
12345678910111213141516171819202122232425262728293031323334353637383940414243import gradio as gr
def generate_plot_code(prompt: str) -> str: """Return placeholder plotting code while deployment is being built.""" if not prompt.strip(): return "Please enter a plotting request."
return """import matplotlib.pyplot as plt
categories = ["Model A", "Model B", "Model C"]scores = [0.78, 0.85, 0.91]
plt.bar(categories, scores)plt.xlabel("Model")plt.ylabel("Score")plt.title("Model Comparison")plt.show()"""
demo = gr.Interface( fn=generate_plot_code, inputs=gr.Textbox( label="Plot description", placeholder="Create a bar chart comparing three models", lines=3, ), outputs=gr.Code(label="Generated Python code", language="python"), title="PlotCraft", description=( "Generate Matplotlib and TikZ visualization code from " "natural-language instructions." ), examples=[ ["Create a bar chart comparing three models"], ["Create a line chart showing monthly sales"], ],)
if __name__ == "__main__": demo.launch()12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152annotated-doc==0.0.5annotated-types==0.8.0anyio==4.15.1brotli==1.2.0certifi==2026.7.22click==8.5.0colorama==0.4.6exceptiongroup==1.3.1fastapi==0.141.1filelock==4.0.4fsspec==2026.9.0gradio==6.28.0gradio_client==2.7.1groovy==0.1.2h11==0.16.0hf-gradio==0.4.1hf-xet==1.6.0httpcore==1.0.9httpx==0.28.1huggingface_hub==1.33.0idna==3.20Jinja2==3.1.6markdown-it-py==4.2.0MarkupSafe==3.0.3mdurl==0.1.2numpy==2.2.6orjson==3.12.0packaging==26.3pandas==2.3.3pillow==12.3.0pydantic==2.13.5pydantic_core==2.46.5pydub==0.25.1Pygments==2.21.0python-dateutil==2.9.0.post0python-multipart==0.0.32pytz==2026.4PyYAML==6.0.3rich==15.0.0safehttpx==0.1.7semantic-version==2.10.0shellingham==1.5.4six==1.17.0starlette==1.7.0tomli==2.4.1tomlkit==0.14.0tqdm==4.70.1typer==0.27.2typing-inspection==0.4.4typing_extensions==4.16.0tzdata==2026.4uvicorn==0.54.0api/__init__.pyAdded
api/main.pyAdded
app.pyAdded+43
requirements.txtAdded+52
src/plotcraft/__init__.pyAdded
src/plotcraft/config.pyAdded
src/plotcraft/model.pyAdded
src/plotcraft/service.pyAdded
tests/.gitkeepAdded