dmarx / notebooks

misc notebooks i wanted to put in tracking
17 stars 2 forks source link

[klmc2] Error running notebook in Google Colab - 'bisect_left_keyframe' is not defined #14

Closed jakeodb closed 1 year ago

jakeodb commented 1 year ago

Having the following NameError occur when running the notebook in Google Colab:

NameError                                 Traceback (most recent call last)
[<ipython-input-8-7a6a917fa6d0>](https://localhost:8080/#) in <module>
     26     ytot=np.array([0 for _ in range(n)])
     27     for prompt in prompts:
---> 28         ys = np.array([prompt.weight[x] for x in xs])
     29         ytot=ytot+ys
     30         plt.plot(xs, ys)

2 frames
[<ipython-input-2-05c39e6b8483>](https://localhost:8080/#) in eased_lerp(k, curve, ease)
     51 # to do: turn this into a decorator in dmarx/Keyframed
     52 def eased_lerp(k, curve, ease=sin2):
---> 53     left = bisect_left_keyframe(k, curve)
     54     right = bisect_right_keyframe(k, curve)
     55     xs = [left.t, right.t]

NameError: name 'bisect_left_keyframe' is not defined

It's not clear if these functions should have been imported from one of the dependencies or not. All other code blocks executed without issue.

optisynapsis commented 1 year ago

I managed to use this notebook to generate a few videos successfully, but the last few attempts have thrown the same error here. Rudimentary online search doesn't seem to find any results for 'bisect_left_keyframe' so no clues there.

optisynapsis commented 1 year ago

(bisect_left_keyframe also doesn't seem to be utilized in the original unmodified notebook)

dmarx commented 1 year ago

sorry about that, should be fixed now!