lvwerra HF staff commited on
Commit
4795aa0
1 Parent(s): afadb31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -37,7 +37,7 @@ kn_max = 2
37
 
38
  kns = np.linspace(0.05, 2, 100)
39
  overheads = []
40
- for kn in np.linspace(0.2, 2, 100):
41
  kd = compute_kd(kn)
42
  overheads.append(compute_overhead(kn, kd)*100)
43
 
@@ -74,14 +74,15 @@ Optimal model size:\t\t {N_opt/Bn:.2f}B
74
  Optimal datset size (tokens):\t {D_opt/Bn:.2f}
75
 
76
  ## Your setting trade-off:
77
- Training compute overhead (%):\t {100*compute_overhead(kn, kd):.2f}
78
 
79
- Inference cost fraction (%):\t {kn*100:.2f}"""
80
  return text, fig
81
 
82
  with gr.Blocks() as demo:
83
- N = gr.Number(value=1, label="Model size (in B parameters)")
84
- D = gr.Number(value=100, label="Dataset size (in B tokens")
 
85
  button = gr.Button("Compute!")
86
 
87
  plot = gr.Plot(value=plt)
 
37
 
38
  kns = np.linspace(0.05, 2, 100)
39
  overheads = []
40
+ for kn in kns:
41
  kd = compute_kd(kn)
42
  overheads.append(compute_overhead(kn, kd)*100)
43
 
 
74
  Optimal datset size (tokens):\t {D_opt/Bn:.2f}
75
 
76
  ## Your setting trade-off:
77
+ Training compute overhead:\t {100*compute_overhead(kn, kd):.2f}%
78
 
79
+ Inference cost fraction:\t {kn*100:.2f}%"""
80
  return text, fig
81
 
82
  with gr.Blocks() as demo:
83
+ gr.Markdown("# Harm's law")
84
+ N = gr.Number(value=1, label="Model size (in B parameters):")
85
+ D = gr.Number(value=100, label="Dataset size (in B tokens):")
86
  button = gr.Button("Compute!")
87
 
88
  plot = gr.Plot(value=plt)