lvwerra HF staff commited on
Commit
a082eb0
1 Parent(s): 4110cfc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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.figure()
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], [100.0], marker="x", c="blue", label="Chinchilla optimal")
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