Hello @seanmor5! Thanks a lot for the amazing book and new chapter
I got a couple of errors when trying to run the examples in Chap. 13 and they don’t seem to have been reported yet:
- p.313 The
:sequence_length
and:batch_size
keys oftext_embedding
had to be popped and nested in a:compile
key:
opts = Keyword.validate!(opts, [
:defn_options, sequence_length: 64, batch_size: 16 ])
{model_info, tokenizer} = load()
Bumblebee.Text.TextEmbedding.text_embedding(model_info, tokenizer, opts)
- p.316
predict/1
returns an%{embedding: Nx.Tensor.t()}
, should return aNx.Tensor.t()
to work when adding it to the changeset later:
def predict(text) do
- Nx.Serving.batched_run(BookSearchModel, text)
+ Nx.Serving.batched_run(BookSearchModel, text).embedding
end
- p.320 needs to assign
:query
def mount(_params, _session, socket) do
- {:ok, assign(socket, :results, [])}
+ {:ok, assign(socket, results: [], query: nil)}
end
- p.321 Typo in HTML template
<a
- href{~p"/book/#{result.id}"}
+ href={~p"/book/#{result.id}"}