File size: 949 Bytes
e2b0d86
31bc8c5
 
88956d7
 
 
 
 
31bc8c5
88956d7
e2b0d86
 
88956d7
 
31bc8c5
88956d7
e2b0d86
 
 
 
 
 
 
 
 
88956d7
e2b0d86
 
 
31bc8c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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()