Spaces:
Running
Running
Add application file
Browse files
app.py
CHANGED
@@ -15,16 +15,17 @@ def compute_optimal_vocab(Nnv: float,
|
|
15 |
flops: float,
|
16 |
):
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
Vopt_app1, Vopt_app2, Vopt_app3=1.,2.,3.
|
26 |
|
27 |
-
results =
|
|
|
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
|