Instructions to use easytt1178/example-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use easytt1178/example-model with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("easytt1178/example-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download app.py from easytt1178/example-model: direct link, hf CLI and curl.
- Browser
- Download file 1.91 kB
-
https://huggingface.co/easytt1178/example-model/resolve/main/app.py
- Command line
-
hf download hf://easytt1178/example-model/app.py
-
curl -L -o app.py https://huggingface.co/easytt1178/example-model/resolve/main/app.py
1.91 kB
| import os | |
| import gradio as gr | |
| from PIL import Image | |
| from src.orchestrator import run_task | |
| def ui_generate_code(prompt, language): | |
| return run_task("code", {"prompt": prompt, "language": language}) | |
| def ui_generate_image(prompt): | |
| img = run_task("image", {"prompt": prompt}) | |
| return img | |
| def ui_create_bot(bot_type): | |
| path = run_task("bot", {"bot_type": bot_type}) | |
| return f"Created bot template at: {path}" | |
| def ui_plan(goal): | |
| steps = run_task("plan", {"goal": goal}) | |
| return "\n".join(f"- {s}" for s in steps) | |
| with gr.Blocks(title="Multi-Agent Orchestrator") as demo: | |
| gr.Markdown("# Multi-Agent: Code, Vision, Bot, Reasoning") | |
| with gr.Tab("Code"): | |
| prompt = gr.Textbox(label="What to build?", lines=6) | |
| lang = gr.Dropdown(choices=["python", "javascript", "typescript", "go", "rust"], value="python", label="Language") | |
| out = gr.Code(language="python", label="Generated Code") | |
| gr.Button("Generate").click(ui_generate_code, inputs=[prompt, lang], outputs=out) | |
| with gr.Tab("Image"): | |
| iprompt = gr.Textbox(label="Image prompt", lines=3) | |
| img = gr.Image(type="pil", label="Output") | |
| gr.Button("Generate Image").click(ui_generate_image, inputs=[iprompt], outputs=img) | |
| with gr.Tab("Bot"): | |
| btype = gr.Dropdown(choices=["telegram", "discord"], value="telegram", label="Bot type") | |
| bot_out = gr.Textbox(label="Result") | |
| gr.Button("Create Bot Template").click(ui_create_bot, inputs=[btype], outputs=bot_out) | |
| with gr.Tab("Reasoning / Plan"): | |
| goal = gr.Textbox(label="Goal description", lines=4) | |
| plan_out = gr.Textbox(label="Plan") | |
| gr.Button("Make Plan").click(ui_plan, inputs=[goal], outputs=plan_out) | |
| if __name__ == "__main__": | |
| # Expect HF_TOKEN to be set for InferenceClient usage. | |
| demo.launch(server_name="0.0.0.0", server_port=int(os.getenv("PORT", "7860"))) |