Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import matplotlib.pyplot as plt
|
3 |
import numpy as np
|
|
|
4 |
|
5 |
INTRO = """# Harm's law
|
6 |
|
@@ -48,14 +49,16 @@ for kn in kns:
|
|
48 |
overheads.append(compute_overhead(kn, kd)*100)
|
49 |
|
50 |
def plot_curve(kn, kd):
|
51 |
-
fig = plt.
|
52 |
plt.plot(kns, overheads, color="black")
|
53 |
plt.scatter([kn], [compute_overhead(kn, kd)*100], marker="x", c="red", label="You are here!")
|
54 |
-
plt.scatter([1.0], [
|
55 |
-
plt.grid(True)
|
56 |
plt.xlabel("Fraction of compute optimal model size")
|
57 |
plt.ylabel("Compute overhead (%)")
|
58 |
plt.legend(loc="best")
|
|
|
|
|
|
|
59 |
return fig
|
60 |
|
61 |
|
|
|
1 |
import gradio as gr
|
2 |
import matplotlib.pyplot as plt
|
3 |
import numpy as np
|
4 |
+
from matplotlib.ticker import MultipleLocator
|
5 |
|
6 |
INTRO = """# Harm's law
|
7 |
|
|
|
49 |
overheads.append(compute_overhead(kn, kd)*100)
|
50 |
|
51 |
def plot_curve(kn, kd):
|
52 |
+
fig, ax = plt.subplots()
|
53 |
plt.plot(kns, overheads, color="black")
|
54 |
plt.scatter([kn], [compute_overhead(kn, kd)*100], marker="x", c="red", label="You are here!")
|
55 |
+
plt.scatter([1.0], [0.0], marker="x", c="blue", label="Chinchilla optimal")
|
|
|
56 |
plt.xlabel("Fraction of compute optimal model size")
|
57 |
plt.ylabel("Compute overhead (%)")
|
58 |
plt.legend(loc="best")
|
59 |
+
plt.grid(True, which="both")
|
60 |
+
ax.yaxis.set_minor_locator(MultipleLocator(10))
|
61 |
+
|
62 |
return fig
|
63 |
|
64 |
|