Spaces:
Sleeping
Sleeping
Update app.py
Browse files123456789101112131415163 unmodified lines202122232425262728import gradio as grfrom transformers import pipeline# Load your model from the Hubgenerator = pipeline("text2text-generation", model="DetectiveShadow/inspiration-message-generator")# Define your message functiondef generate_inspiration(age, profession, archetype):prompt = f"Age: {age} | Profession: {profession} | Archetype: {archetype}"result = generator(prompt, max_new_tokens=100)[0]["generated_text"]return result# Gradio interface layoutiface = gr.Interface(fn=generate_inspiration,inputs=[3 unmodified lines],outputs=gr.Textbox(label="Inspirational Message"),title="Inspiration Message Generator",description="Enter your age, profession, and archetype to receive a personalized message.")# Run the appiface.launch()123456789101112131415161718193 unmodified lines2324252627282930import gradio as grfrom transformers import pipeline# Load your fine-tuned model from Hugging Face Hubgenerator = pipeline("text2text-generation",model="DetectiveShadow/inspiration-message-generator" # ← your model name)# Function to create the input prompt and get the messagedef generate_inspiration(age, profession, archetype):prompt = f"Age: {age} | Profession: {profession} | Archetype: {archetype}"result = generator(prompt, max_new_tokens=100)return result[0]["generated_text"]# Gradio interfaceiface = gr.Interface(fn=generate_inspiration,inputs=[3 unmodified lines],outputs=gr.Textbox(label="Inspirational Message"),title="Inspiration Message Generator",description="Get a personalized motivational message based on your age, profession, and life archetype.")iface.launch()
app.py+10-8