Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
# β
Evo Showcase Mode: Gradio App with GPT-3.5 Comparison
|
2 |
|
3 |
import gradio as gr
|
4 |
import openai
|
5 |
from inference import predict as evo_predict
|
6 |
|
7 |
# π SET YOUR GPT-3.5 API KEY HERE
|
8 |
-
openai.api_key = "sk-..." #
|
9 |
|
10 |
# β
Use the new openai>=1.0.0 API
|
11 |
client = openai.OpenAI()
|
@@ -42,30 +42,39 @@ examples = [
|
|
42 |
["Start a fire", "Use a match", "Pour water"],
|
43 |
["Warm up food", "Use microwave", "Put it in fridge"],
|
44 |
["Charge a phone", "Plug it in", "Put it on grass"],
|
45 |
-
["
|
46 |
]
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
""
|
67 |
-
|
68 |
-
|
69 |
-
)
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# β
Evo Showcase Mode: Gradio App with Enhanced Info Panel + GPT-3.5 Comparison
|
2 |
|
3 |
import gradio as gr
|
4 |
import openai
|
5 |
from inference import predict as evo_predict
|
6 |
|
7 |
# π SET YOUR GPT-3.5 API KEY HERE
|
8 |
+
openai.api_key = "sk-..." # Replace with your actual key
|
9 |
|
10 |
# β
Use the new openai>=1.0.0 API
|
11 |
client = openai.OpenAI()
|
|
|
42 |
["Start a fire", "Use a match", "Pour water"],
|
43 |
["Warm up food", "Use microwave", "Put it in fridge"],
|
44 |
["Charge a phone", "Plug it in", "Put it on grass"],
|
45 |
+
["Stop a car", "Press the brake", "Press the horn"]
|
46 |
]
|
47 |
|
48 |
+
with gr.Blocks(title="βοΈ Evo vs GPT-3.5 β Real-Time Commonsense Showdown") as demo:
|
49 |
+
gr.Markdown("""
|
50 |
+
# π§ EvoTransformer v2.1
|
51 |
+
**PIQA Accuracy:** 69.7% | **Model Size:** ~13M Parameters | **Baseline:** GPT-3.5 β 81%
|
52 |
+
|
53 |
+
EvoTransformer is a scratch-built reasoning model trained on just 1K PIQA examples. No pretraining. No fine-tuning. Pure evolution.
|
54 |
+
|
55 |
+
Compare its decisions with GPT-3.5 in real-time and witness how intelligence can emerge even from lean, efficient architectures.
|
56 |
+
""")
|
57 |
+
|
58 |
+
with gr.Row():
|
59 |
+
goal = gr.Textbox(label="Goal")
|
60 |
+
with gr.Row():
|
61 |
+
sol1 = gr.Textbox(label="Solution 1")
|
62 |
+
sol2 = gr.Textbox(label="Solution 2")
|
63 |
+
|
64 |
+
evo_output = gr.Textbox(label="EvoTransformer Response")
|
65 |
+
gpt_output = gr.Textbox(label="GPT-3.5 Response")
|
66 |
+
verdict_output = gr.Textbox(label="Verdict")
|
67 |
+
|
68 |
+
submit = gr.Button("Submit")
|
69 |
+
submit.click(fn=compare, inputs=[goal, sol1, sol2], outputs=[evo_output, gpt_output, verdict_output])
|
70 |
+
|
71 |
+
gr.Examples(examples=examples, inputs=[goal, sol1, sol2], outputs=[evo_output, gpt_output, verdict_output], fn=compare, cache_examples=False)
|
72 |
+
|
73 |
+
gr.Markdown("""
|
74 |
+
> π§ͺ *Note: EvoTransformer is a scratch-built model trained on 1K PIQA examples. It may occasionally misinterpret context or idioms. Thatβs part of its evolution.*
|
75 |
+
|
76 |
+
---
|
77 |
+
Made with β€οΈ by Dr. Heman Mohabeer β EvoTransformer is not just code. It's evolution.
|
78 |
+
""")
|
79 |
+
|
80 |
+
demo.launch()
|