Atchtype / app.py
DetectiveShadow's picture
Update app.py
88956d7 verified
raw
history blame contribute delete
949 Bytes
import gradio as gr
from transformers import pipeline
# Load your fine-tuned model from Hugging Face Hub
generator = pipeline(
"text2text-generation",
model="DetectiveShadow/inspiration-message-generator" # ← your model name
)
# Function to create the input prompt and get the message
def 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 interface
iface = gr.Interface(
fn=generate_inspiration,
inputs=[
gr.Textbox(label="Age"),
gr.Textbox(label="Profession"),
gr.Textbox(label="Archetype")
],
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()