tcftrees commited on
Commit
330338a
β€’
1 Parent(s): 642315a

Add application file

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -15,16 +15,17 @@ def compute_optimal_vocab(Nnv: float,
15
  flops: float,
16
  ):
17
 
18
- # if flops is None:
19
- # Vopt_app1 = approach1_isoflops(Nnv)
20
- # Vopt_app2 = approach2_derivative(Nnv)
21
- # Vopt_app3 = approach3_isoloss(Nnv)
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
29
 
30
 
@@ -52,9 +53,7 @@ with gr.Blocks() as demo:
52
  with gr.Row():
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],
60
  outputs=output_text
 
15
  flops: float,
16
  ):
17
 
18
+ if flops is None:
19
+ Vopt_app1 = approach1_isoflops(Nnv)
20
+ Vopt_app2 = approach2_derivative(Nnv)
21
+ Vopt_app3 = approach3_isoloss(Nnv)
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 = 'test'
28
+ # results = f"The optimal vocabulary size is:\nApproach 1: {Vopt_app1}\nApproach 2: {Vopt_app2}\nApproach 3: {Vopt_app3}"
29
  return results
30
 
31
 
 
53
  with gr.Row():
54
  btn = gr.Button("Compute the optimal vocabulary size")
55
 
56
+ btn.click(
 
 
57
  compute_optimal_vocab,
58
  inputs=[Nnv, flops],
59
  outputs=output_text