Spaces:
Sleeping
Sleeping
File size: 508 Bytes
58f1f7c a758d50 b4a9077 a758d50 58f1f7c 0c83302 a758d50 0c83302 a758d50 58f1f7c 0f6f3a7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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() |