Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,14 +8,25 @@ if not os.path.exists("trained_model/config.json"):
|
|
8 |
else:
|
9 |
print("✅ EvoTransformer already initialized.")
|
10 |
|
11 |
-
|
12 |
import gradio as gr
|
13 |
import random
|
14 |
-
|
15 |
from inference import generate_response
|
16 |
from logger import log_user_feedback
|
17 |
from dashboard import update_dashboard_plot
|
18 |
from watchdog import retrain_model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
# 🎲 Random examples
|
21 |
examples = [
|
@@ -120,5 +131,8 @@ with gr.Blocks(title="EvoTransformer v2.1 – Compare Options and Learn") as dem
|
|
120 |
|
121 |
retrain_button.click(fn=retrain_model, inputs=[], outputs=[retrain_status])
|
122 |
|
|
|
|
|
|
|
123 |
if __name__ == "__main__":
|
124 |
demo.launch(share=True)
|
|
|
8 |
else:
|
9 |
print("✅ EvoTransformer already initialized.")
|
10 |
|
|
|
11 |
import gradio as gr
|
12 |
import random
|
|
|
13 |
from inference import generate_response
|
14 |
from logger import log_user_feedback
|
15 |
from dashboard import update_dashboard_plot
|
16 |
from watchdog import retrain_model
|
17 |
+
from init_model import load_model
|
18 |
+
|
19 |
+
# === Load model to extract architecture
|
20 |
+
model = load_model()
|
21 |
+
|
22 |
+
def get_architecture_summary(model):
|
23 |
+
summary = {
|
24 |
+
"Layers": getattr(model, "num_layers", "N/A"),
|
25 |
+
"Attention Heads": getattr(model, "num_heads", "N/A"),
|
26 |
+
"FFN Dim": getattr(model, "ffn_dim", "N/A"),
|
27 |
+
"Memory Enabled": getattr(model, "use_memory", "N/A"),
|
28 |
+
}
|
29 |
+
return "\n".join(f"{k}: {v}" for k, v in summary.items())
|
30 |
|
31 |
# 🎲 Random examples
|
32 |
examples = [
|
|
|
131 |
|
132 |
retrain_button.click(fn=retrain_model, inputs=[], outputs=[retrain_status])
|
133 |
|
134 |
+
with gr.Accordion("🧬 EvoTransformer Architecture", open=False):
|
135 |
+
arch_box = gr.Textbox(label="Model Configuration", value=get_architecture_summary(model), lines=5, interactive=False)
|
136 |
+
|
137 |
if __name__ == "__main__":
|
138 |
demo.launch(share=True)
|