ocdevel / gnothi

Gnothi is an open-source AI journal and toolkit for self-discovery. If you're interested in getting involved, we'd love to hear from you.
https://gnothiai.com
GNU Affero General Public License v3.0
174 stars 19 forks source link

Themes: prevent submission if < x entries #125

Closed lefnire closed 1 year ago

lefnire commented 3 years ago

Getting GPU error x and y arrays must have at least 2 entries from KneeLocator. I thought I was already hiding the Themes feature, and sending a 400 if not enough entries. I need to dive in & make sure

jgpu   |   File "/paperspace/common/models.py", line 894, in wrap_job
jgpu   |     res = fn()
jgpu   |   File "app/run.py", line 53, in fn
jgpu   |     def fn(): return m[k](*args, **kwargs)
jgpu   |   File "/paperspace/app/themes.py", line 53, in themes
jgpu   |     chain = chain.normalize().cluster(algo=algo)
jgpu   |   File "/opt/conda/lib/python3.8/site-packages/ml_tools/similars.py", line 32, in wrapper
jgpu   |     res = fn(self, *x_y, *args, **kwargs)
jgpu   |   File "/opt/conda/lib/python3.8/site-packages/ml_tools/similars.py", line 287, in cluster
jgpu   |     kn = KneeLocator(list(K), scores, S=S, curve='convex', direction='decreasing')
jgpu   |   File "/opt/conda/lib/python3.8/site-packages/kneed/knee_locator.py", line 164, in __init__
jgpu   |     uspline = interpolate.interp1d(self.x, self.y)
jgpu   |   File "/opt/conda/lib/python3.8/site-packages/scipy/interpolate/interpolate.py", line 536, in __init__
jgpu   |     raise ValueError("x and y arrays must have at "
jgpu   | ValueError: x and y arrays must have at least 2 entries
lefnire commented 1 year ago

Themes now generated by tisuth