Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,10 +43,11 @@ for kn in np.linspace(0.2, 2, 100):
|
|
43 |
|
44 |
def plot_curve(kn, kd):
|
45 |
fig = plt.figure()
|
46 |
-
plt.plot(kns, overheads)
|
47 |
-
plt.scatter([kn], [kd])
|
48 |
plt.xlabel("Fraction of compute optimal model size")
|
49 |
plt.ylabel("Compute overhead (%)")
|
|
|
50 |
return fig
|
51 |
|
52 |
|
@@ -63,7 +64,17 @@ def compute(N, D):
|
|
63 |
|
64 |
fig = plot_curve(kn, kd)
|
65 |
|
66 |
-
text = f"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
return text, fig
|
68 |
|
69 |
with gr.Blocks() as demo:
|
|
|
43 |
|
44 |
def plot_curve(kn, kd):
|
45 |
fig = plt.figure()
|
46 |
+
plt.plot(kns, overheads, color="black")
|
47 |
+
plt.scatter([kn], [compute_overhead(kn, kd)*100], marker="D", markerfacecolor="red", markeredgecolor="black", label="You are here!")
|
48 |
plt.xlabel("Fraction of compute optimal model size")
|
49 |
plt.ylabel("Compute overhead (%)")
|
50 |
+
plt.legend(loc="best")
|
51 |
return fig
|
52 |
|
53 |
|
|
|
64 |
|
65 |
fig = plot_curve(kn, kd)
|
66 |
|
67 |
+
text = f"""\
|
68 |
+
## Compute:
|
69 |
+
Compute budget (TFLOPs): {C:.2E}
|
70 |
+
|
71 |
+
## Chinchilla optimal:
|
72 |
+
Optimal model size:\t\t {N_opt/Bn:.2f}B
|
73 |
+
Optimal datset size (tokens):\t {D_opt/Bn:.2f}
|
74 |
+
|
75 |
+
## Your setting trade-off:
|
76 |
+
Training compute overhead (%):\t {100*compute_overhead(kn, kd):.2f}
|
77 |
+
Inference cost fraction (%):\t {kn*100:.2f}"""
|
78 |
return text, fig
|
79 |
|
80 |
with gr.Blocks() as demo:
|