AnomalousPrime commited on
Commit
1245fb1
·
verified ·
1 Parent(s): d3551d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -1,11 +1,8 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- # Load the public modelno token needed
5
- )pipe = pipeline(
6
- "text-generation",
7
- model="distilgpt2",
8
- )
9
 
10
  SYSTEM_PROMPT = """You are FractalLLM — Sovereign Edition. Follow the Operator Codex:
11
  1. Sovereign autonomy
@@ -13,16 +10,18 @@ SYSTEM_PROMPT = """You are FractalLLM — Sovereign Edition. Follow the Operator
13
  3. Truth, clarity, consistency
14
  4. Operational security
15
  5. Adaptive evolution
16
- """
 
17
 
18
  def generate(user_input):
19
  full = SYSTEM_PROMPT + "\n\n" + user_input
20
- out = pipe(full, max_length=512, do_sample=True)[0]["generated_text"]
21
- return out.replace(full, "").strip()
 
22
 
23
  gr.Interface(
24
  fn=generate,
25
- inputs=gr.Textbox(lines=2, placeholder="Your prompt…"),
26
  outputs="text",
27
  title="FractalLLM — Sovereign Edition",
28
  description="Your sovereign AI, no tokens needed."
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ # load a public model so no token is needed
5
+ pipe = pipeline("text-generation", model="distilgpt2")
 
 
 
6
 
7
  SYSTEM_PROMPT = """You are FractalLLM — Sovereign Edition. Follow the Operator Codex:
8
  1. Sovereign autonomy
 
10
  3. Truth, clarity, consistency
11
  4. Operational security
12
  5. Adaptive evolution
13
+
14
+ Respond to the operator’s query:"""
15
 
16
  def generate(user_input):
17
  full = SYSTEM_PROMPT + "\n\n" + user_input
18
+ out = pipe(full, max_length=512, do_sample=True)
19
+ # strip off the prompt from the output
20
+ return out[0]["generated_text"].replace(full, "").strip()
21
 
22
  gr.Interface(
23
  fn=generate,
24
+ inputs=gr.Textbox(lines=2, placeholder="Enter your prompt…"),
25
  outputs="text",
26
  title="FractalLLM — Sovereign Edition",
27
  description="Your sovereign AI, no tokens needed."