tcftrees commited on
Commit
642315a
1 Parent(s): 1e1d532

Add application file

Browse files
Files changed (2) hide show
  1. app.py +4 -4
  2. figure_1_left_scaling_v5.png +0 -0
app.py CHANGED
@@ -22,7 +22,7 @@ def compute_optimal_vocab(Nnv: float,
22
  # else:
23
  # Vopt_app1, Vopt_app2 = None, None
24
  # Vopt_app3 = approach3_isoloss(Nnv, flops)
25
- Vopt_app1, Vopt_app2, Vopt_app3=1,2,3
26
 
27
  results = f"## The optimal vocabulary size for non-vocabulary parameters {Nnv:1e} is:\nApproach 1: {Vopt_app1}\nApproach 2: {Vopt_app2}Approach 3: {Vopt_app3}"
28
  return results
@@ -31,8 +31,8 @@ def compute_optimal_vocab(Nnv: float,
31
  with gr.Blocks() as demo:
32
  with gr.Column():
33
  gr.Markdown(
34
- """<img src="https://raw.githubusercontent.com/MrYxJ/calculate-flops.pytorch/main/screenshot/calflops_hf3.png?raw=true" style="float: left;" width="250" height="250"><h1> ⛽️Model(Transformers) FLOPs and Parameter Calculator</h1>
35
- This tool is used to predict the optimal vocabulary size <h1> given the non-vocabulary parameters $N_{nv}$</h1>.
36
  We provide 3 ways for prediction:
37
 
38
  - Approach 1: Build the relationship between studied attributes and FLOPs: Build the relationship between the optimal data points (the points that reach the lowest loss under the same FLOPs budget) and the FLOPs.
@@ -48,7 +48,7 @@ with gr.Blocks() as demo:
48
  with gr.Row():
49
  Nnv = gr.Textbox(label="Non-vocabulary Parameters", value=7*10**9)
50
  flops = gr.Textbox(label="FLOPs", placeholder="Optional (e.g. 7.05*10**21)")
51
- output_text = gr.Textbox()
52
  with gr.Row():
53
  btn = gr.Button("Compute the optimal vocabulary size")
54
 
 
22
  # else:
23
  # Vopt_app1, Vopt_app2 = None, None
24
  # Vopt_app3 = approach3_isoloss(Nnv, flops)
25
+ Vopt_app1, Vopt_app2, Vopt_app3=1.,2.,3.
26
 
27
  results = f"## The optimal vocabulary size for non-vocabulary parameters {Nnv:1e} is:\nApproach 1: {Vopt_app1}\nApproach 2: {Vopt_app2}Approach 3: {Vopt_app3}"
28
  return results
 
31
  with gr.Blocks() as demo:
32
  with gr.Column():
33
  gr.Markdown(
34
+ """<img src="figure_1_left_scaling_v5.png" style="float: left;" width="250" height="250"><h1>The Optimal Vocabulari Size Predictor</h1>
35
+ This tool is used to predict the optimal vocabulary size given the non-vocabulary parameters.
36
  We provide 3 ways for prediction:
37
 
38
  - Approach 1: Build the relationship between studied attributes and FLOPs: Build the relationship between the optimal data points (the points that reach the lowest loss under the same FLOPs budget) and the FLOPs.
 
48
  with gr.Row():
49
  Nnv = gr.Textbox(label="Non-vocabulary Parameters", value=7*10**9)
50
  flops = gr.Textbox(label="FLOPs", placeholder="Optional (e.g. 7.05*10**21)")
51
+ output_text = gr.Textbox(label="Prediction")
52
  with gr.Row():
53
  btn = gr.Button("Compute the optimal vocabulary size")
54
 
figure_1_left_scaling_v5.png ADDED