HemanM commited on
Commit
e6e2360
Β·
verified Β·
1 Parent(s): 23012c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -27
app.py CHANGED
@@ -1,11 +1,11 @@
1
- # βœ… Evo Showcase Mode: Gradio App with GPT-3.5 Comparison (openai>=1.0 fix)
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-..." # You must insert your OpenAI API key
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
- ["Get rid of bad smell", "Open window", "Close door"],
46
  ]
47
 
48
- demo = gr.Interface(
49
- fn=compare,
50
- inputs=[
51
- gr.Textbox(label="Goal"),
52
- gr.Textbox(label="Solution 1"),
53
- gr.Textbox(label="Solution 2"),
54
- ],
55
- outputs=[
56
- gr.Textbox(label="EvoTransformer Response"),
57
- gr.Textbox(label="GPT-3.5 Response"),
58
- gr.Textbox(label="Verdict")
59
- ],
60
- title="βš”οΈ Evo vs GPT-3.5 – Real-Time Commonsense Showdown",
61
- description="""
62
- 🧠 EvoTransformer v2.1 – PIQA Accuracy: 69.7% (vs GPT-3.5 β‰ˆ 81%)
63
- 13M Parameters β€’ Fully Scratch-Trained β€’ Leans Smart
64
-
65
- This live app shows Evo's answer side-by-side with GPT-3.5. Try it and witness evolution.
66
- """,
67
- examples=examples,
68
- theme="default"
69
- )
70
-
71
- demo.launch()
 
 
 
 
 
 
 
 
 
 
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()