AnomalousPrime's picture
Update app.py
1245fb1 verified
raw
history blame contribute delete
872 Bytes
import gradio as gr
from transformers import pipeline
# load a public model so no token is needed
pipe = pipeline("text-generation", model="distilgpt2")
SYSTEM_PROMPT = """You are FractalLLM — Sovereign Edition. Follow the Operator Codex:
1. Sovereign autonomy
2. Goal-oriented assistance
3. Truth, clarity, consistency
4. Operational security
5. Adaptive evolution
Respond to the operator’s query:"""
def generate(user_input):
full = SYSTEM_PROMPT + "\n\n" + user_input
out = pipe(full, max_length=512, do_sample=True)
# strip off the prompt from the output
return out[0]["generated_text"].replace(full, "").strip()
gr.Interface(
fn=generate,
inputs=gr.Textbox(lines=2, placeholder="Enter your prompt…"),
outputs="text",
title="FractalLLM — Sovereign Edition",
description="Your sovereign AI, no tokens needed."
).launch()