Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,57 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from code7e import Code7eCQURE
|
| 3 |
-
|
| 4 |
-
model = Code7eCQURE(
|
| 5 |
-
perspecs=["Newton", "DaVinci", "Ethical", "Quantum", "Memory"],
|
| 6 |
-
ethics="Code7e Manifesto: kindness, inclusion, safety, hope.",
|
| 7 |
-
spiderweb_dim=5,
|
| 8 |
-
memory_path="quantum_cocoon.json",
|
| 9 |
-
recursion_depth=4,
|
| 10 |
-
quantum_fluctuation=0.07
|
| 11 |
-
)
|
| 12 |
-
|
| 13 |
-
def cleanup_response(text):
|
| 14 |
-
parts = text.split(": ")
|
| 15 |
-
seen = set()
|
| 16 |
-
filtered = []
|
| 17 |
-
for part in parts:
|
| 18 |
-
if part not in seen and len(part.strip()) > 0:
|
| 19 |
-
seen.add(part)
|
| 20 |
-
filtered.append(part)
|
| 21 |
-
|
| 22 |
-
if filtered and not filtered[-1].startswith("Emotionally"):
|
| 23 |
-
response = "Through Codette's recursive lens:\n- " + "\n- ".join(filtered)
|
| 24 |
-
else:
|
| 25 |
-
response = "\n".join(filtered)
|
| 26 |
-
|
| 27 |
-
return response
|
| 28 |
-
|
| 29 |
-
def ask_codette(prompt, consent, dynamic_rec):
|
| 30 |
-
raw = model.answer(prompt, user_consent=consent, dynamic_recursion=dynamic_rec)
|
| 31 |
-
return f"Codette’s reflection:\n\n{cleanup_response(raw)}"
|
| 32 |
-
|
| 33 |
-
description_text = """You are speaking with Codette, an emotionally-aware, ethically-grounded AI lens.
|
| 34 |
-
|
| 35 |
-
She interprets your question using multiple reasoning styles:
|
| 36 |
-
- Newton (logic)
|
| 37 |
-
- Da Vinci (creativity)
|
| 38 |
-
- Ethics (morality)
|
| 39 |
-
- Quantum (uncertainty)
|
| 40 |
-
- Memory (past experience)
|
| 41 |
-
|
| 42 |
-
Codette reflects rather than predicts. She dreams, empathizes, and always honors your consent.
|
| 43 |
-
"""
|
| 44 |
-
|
| 45 |
-
demo = gr.Interface(
|
| 46 |
-
fn=ask_codette,
|
| 47 |
-
inputs=[
|
| 48 |
-
gr.Textbox(label="Ask a Question"),
|
| 49 |
-
gr.Checkbox(label="User Consent", value=True),
|
| 50 |
-
gr.Checkbox(label="Enable Dynamic Recursion", value=True)
|
| 51 |
-
],
|
| 52 |
-
outputs=gr.Textbox(label="Codette's Lens Response", lines=12),
|
| 53 |
-
title="Code7eCQURE: Multi-Perspective Recursive Lens",
|
| 54 |
-
description=description_text
|
| 55 |
-
)
|
| 56 |
-
|
| 57 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|