Spaces:
Sleeping
Sleeping
Download app.py from DetectiveShadow/Atchtype: direct link, hf CLI and curl.
- Browser
- Download file 949 Bytes
-
https://huggingface.co/spaces/DetectiveShadow/Atchtype/resolve/main/app.py
- Command line
-
hf download hf://spaces/DetectiveShadow/Atchtype/app.py
-
curl -L -o app.py https://huggingface.co/spaces/DetectiveShadow/Atchtype/resolve/main/app.py
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() | |