|
import gradio as gr |
|
from transformers import pipeline |
|
from transformers import AutoModelForCausalLM |
|
|
|
|
|
|
|
|
|
classifier = pipeline("text-classification") |
|
|
|
|
|
def generate_mini_apps(theme): |
|
|
|
classification = classifier(theme) |
|
|
|
|
|
if classification[0]['label'] == 'Productivity': |
|
mini_apps = [ |
|
'Idea-to-Codebase Generator', |
|
'Automated GitHub Repo Guardian Angel', |
|
'AI-Powered IDE' |
|
] |
|
elif classification[0]['label'] == 'Creativity': |
|
mini_apps = [ |
|
'Brainstorming Assistant', |
|
'Mood Board Generator', |
|
'Writing Assistant' |
|
] |
|
elif classification[0]['label'] == 'Well-being': |
|
mini_apps = [ |
|
'Meditation Guide', |
|
'Mood Tracker', |
|
'Sleep Tracker' |
|
] |
|
|
|
|
|
return mini_apps |
|
|
|
|
|
demo = gr.Interface( |
|
fn=generate_mini_apps, |
|
inputs=gr.Textbox(label="Enter a theme for your life"), |
|
outputs=gr.Textbox(label="Generated Mini-Apps"), |
|
title="AI4ME: Personalized AI Tools", |
|
description="Enter a theme for your life and we'll generate a set of AI-powered mini-apps tailored to your specific needs." |
|
) |
|
|
|
|
|
demo.launch() |