HemanM commited on
Commit
9344674
·
verified ·
1 Parent(s): af12592

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -43,9 +43,14 @@ with gr.Blocks(theme=gr.themes.Base(), css="body { background-color: #0f0f0f; co
43
  gpt_text = get_gpt_response(q)
44
  stats = get_model_config()
45
  stats_text = f"Layers: {stats['num_layers']} | Heads: {stats['num_heads']} | FFN: {stats['ffn_dim']} | Memory: {stats['memory_enabled']} | Phase: {stats['phase']} | Accuracy: {stats['accuracy']}"
 
46
  new_row = [q, opt1, opt2, result["answer"], result["confidence"], result["reasoning"], result["context_used"]]
47
- updated_df = pd.concat([hist, pd.DataFrame([new_row], columns=hist.columns)], ignore_index=True)
48
- return evo_text, gpt_text, stats_text, updated_df
 
 
 
 
49
 
50
  # 🔁 Actual retraining
51
  def retrain_evo():
 
43
  gpt_text = get_gpt_response(q)
44
  stats = get_model_config()
45
  stats_text = f"Layers: {stats['num_layers']} | Heads: {stats['num_heads']} | FFN: {stats['ffn_dim']} | Memory: {stats['memory_enabled']} | Phase: {stats['phase']} | Accuracy: {stats['accuracy']}"
46
+ # Update conversation history safely (avoids FutureWarning)
47
  new_row = [q, opt1, opt2, result["answer"], result["confidence"], result["reasoning"], result["context_used"]]
48
+ new_row_df = pd.DataFrame([new_row], columns=hist.columns)
49
+ if hist.empty:
50
+ updated_df = new_row_df
51
+ else:
52
+ updated_df = pd.concat([hist, new_row_df], ignore_index=True)
53
+
54
 
55
  # 🔁 Actual retraining
56
  def retrain_evo():