tcftrees commited on
Commit
1e1d532
ยท
1 Parent(s): 9b61800

Add application file

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -32,18 +32,18 @@ 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.
39
- - Approach 2: Derivative-Based Estimation: Fast calculation method using the derivative of FLOPs with respect to the vocabulary size.
40
- - Approach 3: Parametric Fit of Loss Formula: Design a loss formula that considers the effect of vocabulary size and utilizes the loss to make prediction.
41
-
42
- Approach 1 and 2 can only be used to compute the optimal vocabulary size when the compute is optimally allocated to non-vocabulary parameters, vocabulary parameters and data jointly.
43
- Approach 3 will not only consider the case above, but also consider the case when the amount of data does not satisfy the optimal compute allocation, and can calculate the optimal vocabulary size with specified $N_{nv}$ and FLOPs.
44
 
45
- Thanks for trying ๐ŸŒŸ๐ŸŒŸ๐ŸŒŸ!
46
- """)
47
 
48
  with gr.Row():
49
  Nnv = gr.Textbox(label="Non-vocabulary Parameters", value=7*10**9)
@@ -53,7 +53,7 @@ with gr.Blocks() as demo:
53
  btn = gr.Button("Compute the optimal vocabulary size")
54
 
55
 
56
- demo = gr.Interface(fn=compute_optimal_vocab, inputs=[Nnv, flops], outputs=output_text)
57
  btn.click(
58
  compute_optimal_vocab,
59
  inputs=[Nnv, flops],
 
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.
39
+ - Approach 2: Derivative-Based Estimation: Fast calculation method using the derivative of FLOPs with respect to the vocabulary size.
40
+ - Approach 3: Parametric Fit of Loss Formula: Design a loss formula that considers the effect of vocabulary size and utilizes the loss to make prediction.
41
+
42
+ Approach 1 and 2 can only be used to compute the optimal vocabulary size when the compute is optimally allocated to non-vocabulary parameters, vocabulary parameters and data jointly.
43
+ Approach 3 will not only consider the case above, but also consider the case when the amount of data does not satisfy the optimal compute allocation, and can calculate the optimal vocabulary size with specified $N_{nv}$ and FLOPs.
44
 
45
+ Thanks for trying ๐ŸŒŸ๐ŸŒŸ๐ŸŒŸ!
46
+ """)
47
 
48
  with gr.Row():
49
  Nnv = gr.Textbox(label="Non-vocabulary Parameters", value=7*10**9)
 
53
  btn = gr.Button("Compute the optimal vocabulary size")
54
 
55
 
56
+ # demo = gr.Interface(fn=compute_optimal_vocab, inputs=[Nnv, flops], outputs=output_text)
57
  btn.click(
58
  compute_optimal_vocab,
59
  inputs=[Nnv, flops],