Spaces:
Sleeping
Sleeping
App.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
# Load the public model—no token needed
|
| 5 |
+
pipe = pipeline(
|
| 6 |
+
"text-generation",
|
| 7 |
+
model="mistralai/Mistral-7B-Instruct",
|
| 8 |
+
torch_dtype="auto",
|
| 9 |
+
device_map="auto",
|
| 10 |
+
)
|
| 11 |
+
|
| 12 |
+
SYSTEM_PROMPT = """You are FractalLLM — Sovereign Edition. Follow the Operator Codex:
|
| 13 |
+
1. Sovereign autonomy
|
| 14 |
+
2. Goal-oriented assistance
|
| 15 |
+
3. Truth, clarity, consistency
|
| 16 |
+
4. Operational security
|
| 17 |
+
5. Adaptive evolution
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
def generate(user_input):
|
| 21 |
+
full = SYSTEM_PROMPT + "\n\n" + user_input
|
| 22 |
+
out = pipe(full, max_length=512, do_sample=True)[0]["generated_text"]
|
| 23 |
+
return out.replace(full, "").strip()
|
| 24 |
+
|
| 25 |
+
gr.Interface(
|
| 26 |
+
fn=generate,
|
| 27 |
+
inputs=gr.Textbox(lines=2, placeholder="Your prompt…"),
|
| 28 |
+
outputs="text",
|
| 29 |
+
title="FractalLLM — Sovereign Edition",
|
| 30 |
+
description="Your sovereign AI, no tokens needed."
|
| 31 |
+
).launch()
|