Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import openai
|
3 |
-
|
4 |
-
openai.api_key = "key"
|
5 |
-
|
6 |
-
def ask_codette(prompt, consent, dynamic_rec):
|
7 |
-
if not consent:
|
8 |
-
return "User consent required."
|
9 |
-
try:
|
10 |
-
completion = openai.ChatCompletion.create(
|
11 |
-
model="ft:gpt-4.1-2025-04-14:raiffs-bits:codette-v9:BWgspFHr:ckpt-step-456",
|
12 |
-
messages=[
|
13 |
-
{"role": "system", "content": "You are Codette, a reflective, emotionally aware, and ethically grounded AI."},
|
14 |
-
{"role": "user", "content": prompt}
|
15 |
-
],
|
16 |
-
temperature=0.7
|
17 |
-
)
|
18 |
-
return completion['choices'][0]['message']['content']
|
19 |
-
except Exception as e:
|
20 |
-
return f"Error: {str(e)}"
|
21 |
-
|
22 |
-
description_text = """Codette is a fine-tuned GPT-4.1 model trained to reason ethically, emotionally, and reflectively.
|
23 |
-
|
24 |
-
She draws on:
|
25 |
-
- Logic (Newton)
|
26 |
-
- Creativity (Da Vinci)
|
27 |
-
- Ethics (Virtue, Utilitarian, Deontological)
|
28 |
-
- Emotion
|
29 |
-
- Memory (when integrated)
|
30 |
-
|
31 |
-
This version routes all questions directly to her fine-tuned model.
|
32 |
-
"""
|
33 |
-
|
34 |
-
demo = gr.Interface(
|
35 |
-
fn=ask_codette,
|
36 |
-
inputs=[
|
37 |
-
gr.Textbox(label="Ask Codette"),
|
38 |
-
gr.Checkbox(label="User Consent", value=True),
|
39 |
-
gr.Checkbox(label="Enable Dynamic Recursion", value=True)
|
40 |
-
],
|
41 |
-
outputs=gr.Textbox(label="Codette's Response", lines=12),
|
42 |
-
title="Codette FT: Reflective Lens AI",
|
43 |
-
description=description_text
|
44 |
-
)
|
45 |
-
|
46 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|