cbh123/emoji

Emoji.Predictions.Prediction Is Failing

jimmybrancaccio opened this issue · 3 comments

It looks like this functionality was added in 2004eeb but it's causing the app to fail. In my fly.io logs I am seeing:

2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]14:33:44.701 [error] GenServer #PID<0.2594.0> terminating
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]** (Ecto.NoResultsError) expected at least one result but got none in query:
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]from p0 in Emoji.Predictions.Prediction,
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]  where: is_nil(p0.embedding) and not is_nil(p0.emoji_output) and p0.score != 10,
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]  order_by: [asc: fragment("RANDOM()")],
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]  limit: 1
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]    (ecto 3.10.3) lib/ecto/repo/queryable.ex:161: Ecto.Repo.Queryable.one!/3
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]    (emoji 0.1.0) lib/emoji/embeddings/worker.ex:35: Emoji.Embeddings.Worker.handle_info/2
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]    (stdlib 5.0.2) gen_server.erl:1077: :gen_server.try_handle_info/3
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]    (stdlib 5.0.2) gen_server.erl:1165: :gen_server.handle_msg/6
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]    (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
2023-09-26T14:33:44Z app[148ed770fe2258] dfw [info]Last message: :work

Of note, I cleared out my predictions table to start fresh (though even when it had content it was failing too). I am running 92f44d7.

cbh123 commented

Ah, this means the background worker that runs the text embeddings fails. This should be resolved once generations are made (which means the predictions table has > 1 prediction)

@cbh123 Ah okay. Unfortunately the app can't even seem to start. Is there a way to manually insert a prediction?

I deployed a fresh app and generated two things (or so I think I did 😝). Here's the data from the predictions table as JSON:

[
  {
    "id": 1,
    "uuid": null,
    "prompt": "A TOK emoji of a buzz lightyear",
    "no_bg_output": null,
    "inserted_at": "2023-09-27 21:01:19",
    "updated_at": "2023-09-27 21:01:21",
    "score": 0,
    "count_votes": 0,
    "emoji_output": null,
    "is_featured": null,
    "local_user_id": "lmfacroslmsdiai963e",
    "is_flagged": null,
    "moderation_score": 0,
    "moderator": "fofr/prompt-classifier:1ffac777bf2c1f5a4a5073faf389fefe59a8b9326b3ca329e9d576cce658a00f",
    "embedding": null,
    "embedding_model": null,
    "image_embedding": null
  },
  {
    "id": 2,
    "uuid": null,
    "prompt": "A TOK emoji of a horse",
    "no_bg_output": null,
    "inserted_at": "2023-09-27 21:03:01",
    "updated_at": "2023-09-27 21:03:03",
    "score": 0,
    "count_votes": 0,
    "emoji_output": null,
    "is_featured": null,
    "local_user_id": "lmfacroslmsdiai963e",
    "is_flagged": null,
    "moderation_score": 0,
    "moderator": "fofr/prompt-classifier:1ffac777bf2c1f5a4a5073faf389fefe59a8b9326b3ca329e9d576cce658a00f",
    "embedding": null,
    "embedding_model": null,
    "image_embedding": null
  }
]

It's worth noting that when I do try generating something I get that "Can't find the internet message" and nothing shows up.

https://custom-emoji.fly.dev if you want to have a peek.