Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
# Load free AI code generation model (small and mobile-friendly) | |
generator = pipeline("text-generation", model="Salesforce/codegen-350M-mono") | |
def generate_code(prompt): | |
response = generator(prompt, max_length=256, do_sample=True)[0]["generated_text"] | |
return response | |
demo = gr.Interface(fn=generate_code, inputs="text", outputs="text", title="Super Coder Bot", description="Enter instructions in plain English. Get real code.") | |
demo.launch() |