Spaces:
Sleeping
Sleeping
Update app.py
Browse files12345678910111213141516171819202122232425import gradio as grfrom transformers import pipeline# Load the model from the hubgenerator = pipeline("text2text-generation", model="DetectiveShadow/inspiration-message-generator")def generate_message(age, profession, archetype):prompt = f"Age: {age} | Profession: {profession} | Archetype: {archetype}"result = generator(prompt, max_new_tokens=100)[0]["generated_text"]return result# Gradio interfaceiface = gr.Interface(fn=generate_message,inputs=[gr.Textbox(label="Age"),gr.Textbox(label="Profession"),gr.Textbox(label="Archetype")],outputs="text",title="Inspiration Message Generator",description="Enter age, profession, and archetype to get a personalized inspirational message.")iface.launch()12345678910111213from transformers import pipeline# Load the fine-tuned model from Hugging Facegenerator = pipeline("text2text-generation", model="DetectiveShadow/inspiration-message-generator")# Define test promptprompt = "Age: 32 | Profession: Engineer | Archetype: Innovator"# Run modelresult = generator(prompt, max_new_tokens=100)[0]["generated_text"]# Print outputprint(result)
app.py+7-19