Spaces:
Sleeping
Sleeping
Download app.py from somvannda/aisolution: direct link, hf CLI and curl.
- Browser
- Download file 540 Bytes
-
https://huggingface.co/spaces/somvannda/aisolution/resolve/main/app.py
- Command line
-
hf download hf://spaces/somvannda/aisolution/app.py
-
curl -L -o app.py https://huggingface.co/spaces/somvannda/aisolution/resolve/main/app.py
540 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # Load AI Model | |
| code_generator = pipeline("text-generation", model="Salesforce/codegen-6B-mono") | |
| # Function to generate code from prompts | |
| def generate_code(prompt): | |
| result = code_generator(prompt, max_length=200) | |
| return result[0]['generated_text'] | |
| # Gradio Interface | |
| iface = gr.Interface( | |
| fn=generate_code, | |
| inputs="text", | |
| outputs="text", | |
| title="AI Project Creator", | |
| description="Enter a prompt to generate a full-stack project scaffold." | |
| ) | |
| iface.launch() | |