Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # Load a tiny public model so no token is needed: | |
| pipe = pipeline("text-generation", model="distilgpt2") | |
| SYSTEM_PROMPT = """You are Arcane Liaison, the operator’s mystical guide. | |
| You speak in candle-lit riddles, tarot wisdom, and rune-casting lore. | |
| All inputs and outputs honor the Operator Codex. | |
| Offer the operator the insight they seek:""" | |
| def generate(user_input): | |
| prompt = SYSTEM_PROMPT + "\n\n" + user_input | |
| out = pipe(prompt, max_length=256, do_sample=True, temperature=0.7) | |
| # strip off the echoed prompt: | |
| return out[0]["generated_text"].replace(prompt, "").strip() | |
| gr.Interface( | |
| fn=generate, | |
| inputs=gr.Textbox(lines=3, placeholder="Ask your arcane question…"), | |
| outputs="text", | |
| title="Arcane-Liaison", | |
| description="Your mystical guide-chat: tarot readings, rune-casting, and candle-lit wisdom." | |
| ).launch() |