aisolution / app.py
somvannda's picture
Create app.py
b2e810b verified
raw
history blame contribute delete
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()