tcftrees commited on
Commit
ff0c2b6
β€’
1 Parent(s): ea95cc8

Add application file

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -11,8 +11,6 @@
11
  Copyright (C) 2024 Chaofan Tao. All rights reserved.
12
  '''
13
  import gradio as gr
14
- import pandas as pd
15
-
16
  from utils import approach1_isoflops, approach2_derivative, approach3_isoloss
17
 
18
 
@@ -26,7 +24,7 @@ def compute_optimal_vocab(Nnv: float,
26
  Vopt_app3 = approach3_isoloss(Nnv)
27
  else:
28
  Vopt_app1, Vopt_app2 = None, None
29
- Vopt_app3 = approach3_isoloss(Nnv,flops)
30
 
31
  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}"
32
  return results
@@ -63,4 +61,4 @@ with gr.Blocks() as demo:
63
  inputs=[Nnv, flops],
64
  outputs=output_text
65
  )
66
- demo.launch()
 
11
  Copyright (C) 2024 Chaofan Tao. All rights reserved.
12
  '''
13
  import gradio as gr
 
 
14
  from utils import approach1_isoflops, approach2_derivative, approach3_isoloss
15
 
16
 
 
24
  Vopt_app3 = approach3_isoloss(Nnv)
25
  else:
26
  Vopt_app1, Vopt_app2 = None, None
27
+ Vopt_app3 = approach3_isoloss(Nnv, flops)
28
 
29
  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}"
30
  return results
 
61
  inputs=[Nnv, flops],
62
  outputs=output_text
63
  )
64
+ demo.launch(share=True)