<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="295734" data-post-id="295734">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="steffend" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/steffend/120/20548_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  steffend
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Phoenix Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I experimented with running a model through ortex today, but I don’t see how this improves the situation with different sequence lengths. As soon as I send inputs with different sizes to my serving, I get an error that I cannot merge batches due to incompatible templates, which makes sense. Sending the full tokenizer output to the Ortex model does not offer a performance gain compared to running EXLA with the full sequence length.</p>
<p>Running different servings for each sequence length I see similar performance running the all-MiniLM-L6-v2 model on EXLA (see <a href="https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/18" class="inline-onebox" rel="nofollow">Nx vs. Python performance for sentence-transformer encoding - #18 by steffend</a>) and Ortex:</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/1/9/190bfab5b2640b76728b9d191b563b791cda7dcc.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/190bfab5b2640b76728b9d191b563b791cda7dcc" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/1/9/190bfab5b2640b76728b9d191b563b791cda7dcc_2_690x388.jpeg" alt="image" data-base62-sha1="3zzBlvaxwrFlWpMuzt9ZjkIJiyM" width="690" height="388" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/1/9/190bfab5b2640b76728b9d191b563b791cda7dcc_2_690x388.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/1/9/190bfab5b2640b76728b9d191b563b791cda7dcc_2_1035x582.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/original/3X/1/9/190bfab5b2640b76728b9d191b563b791cda7dcc.jpeg 2x" data-dominant-color="FCFDFD"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1200×676 36.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>For small inputs, Ortex seems to perform a little better, for larger inputs a little worse.</p>
<p>Here is the Livebook I used:</p>
<aside class="onebox githubgist" data-onebox-src="https://gist.github.com/SteffenDE/1f0e146a405bc4885f281bd1fd50ae14">
  <header class="source">

      <a href="https://gist.github.com/SteffenDE/1f0e146a405bc4885f281bd1fd50ae14" target="_blank" rel="noopener nofollow ugc">gist.github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://gist.github.com/SteffenDE/1f0e146a405bc4885f281bd1fd50ae14" target="_blank" rel="noopener nofollow ugc">https://gist.github.com/SteffenDE/1f0e146a405bc4885f281bd1fd50ae14</a></h4>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>Notice the part that uses the smallest input sequence length (by looking at the attention mask) in the client_preprocessing:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def serving(model, tokenizer) do
    Nx.Serving.new(Ortex.Serving, model)
    |&gt; Nx.Serving.client_preprocessing(fn inputs -&gt;
      {:ok, encodings} = Tokenizers.Tokenizer.encode_batch(tokenizer, inputs)

      # get the maximum sequence length from the input by looking at the attention mask
      max_length =
        encodings
        |&gt; Enum.map(&amp;Tokenizers.Encoding.get_attention_mask/1)
        |&gt; Enum.map(fn tensor -&gt; Enum.sum(tensor) end)
        |&gt; Enum.max(fn -&gt; nil end)

      encodings =
        if max_length do
          for e &lt;- encodings, do: Tokenizers.Encoding.truncate(e, max_length)
        else
          encodings
        end

      input_ids = for i &lt;- encodings, do: Tokenizers.Encoding.get_ids(i)
      input_mask = for i &lt;- encodings, do: Tokenizers.Encoding.get_attention_mask(i)
      token_type_ids = for i &lt;- encodings, do: Tokenizers.Encoding.get_type_ids(i)

      inputs =
        Enum.zip_with([input_ids, input_mask, token_type_ids], fn [a, b, c] -&gt;
          {Nx.tensor(a), Nx.tensor(b), Nx.tensor(c)}
        end)
        |&gt; Nx.Batch.stack()

      {inputs, %{attention_mask: Nx.tensor(input_mask)}}
    end)
    |&gt; Nx.Serving.client_postprocessing(fn {{output}, _meta}, client_info -&gt;
      mean_pooling(output, client_info.attention_mask)
    end)
  end
</code></pre>
<p>I have to say that besides that Ortex works flawlessly and I’m able to run models that Bumblebee does not support yet (e.g. all-mpnet-base-v2): <a href="https://gist.github.com/SteffenDE/893a9f00b4b95a2d0df3331a665b67ba" class="inline-onebox" rel="noopener nofollow ugc">Running the all-mpnet-base-v2 sentence transformer in Elixir using Ortex · GitHub</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295734" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-295734" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295734"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #31"></div>
  </section>
</div>
    <div class="postbit" id="295739" data-post-id="295739">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Could you benchmark Ortex without the serving? Basically calling it as the input arrives (which is what PyTorch would do)? Because otherwise, you are right, serving will still be the limitation (unless you want to give the main branch a try and provide multiple functions for different sequence lengths sizes).</p>
<p>And thanks for sharing the Ortex notebook!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295739" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-295739" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295739"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="295748" data-post-id="295748">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="steffend" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/steffend/120/20548_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  steffend
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Phoenix Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ah that makes sense. Ortex embeds/second by sequence length:</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/7/3/73e0f6180dfaefa893f553dcf0eb43c4273099a3.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/73e0f6180dfaefa893f553dcf0eb43c4273099a3" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/7/3/73e0f6180dfaefa893f553dcf0eb43c4273099a3_2_690x392.jpeg" alt="image" data-base62-sha1="gx6SXBwiAsFVpfZ8lLPj4MOOth1" width="690" height="392" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/7/3/73e0f6180dfaefa893f553dcf0eb43c4273099a3_2_690x392.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/7/3/73e0f6180dfaefa893f553dcf0eb43c4273099a3_2_1035x588.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/original/3X/7/3/73e0f6180dfaefa893f553dcf0eb43c4273099a3.jpeg 2x" data-dominant-color="FDFDFD"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1200×683 30.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>This also achieves full CPU utilization on my MacBook in comparison to EXLA <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p>
<p>So it seems like Ortex does not benefit that much from using Nx.Serving, as the model does not need to be precompiled to certain input shapes, in contrast to when using EXLA, is that right?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295748" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-295748" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295748"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
    <div class="postbit" id="295752" data-post-id="295752">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-Phoenix-Core-Team" data-username="steffend" data-post="34" data-topic="56502">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/steffend/48/20548_2.png" class="avatar"> steffend:</div>
<blockquote>
<p>So it seems like Ortex does not benefit that much from using Nx.Serving, as the model does not need to be precompiled to certain input shapes, in contrast to when using EXLA, is that right?</p>
</blockquote>
</aside>
<p>I am not sure if we should generalize that to Ortex but we can conclude that’s true for Ortex+sberts running on CPU. I assume GPUs will be happier with batching than CPUs, even if not compiled. <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295752" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-295752" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295752"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #34"></div>
  </section>
</div>
    <div class="postbit" id="296405" data-post-id="296405">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jonatanklosko" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jonatanklosko/120/37940_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jonatanklosko
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Livebook</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/steffend" rel="nofollow">@steffend</a> on Bumblebee main you can specify multiple sequence lengths, in which case we compile multiple versions of the computation and inputs are batched depending on the length. This way short sequences don’t have overly long padding. Here’s an example:</p>
<pre data-code-wrap="markdown"><code class="lang-markdown"># Text embedding with multiple lengths

```elixir
Mix.install([
  {:bumblebee, github: "elixir-nx/bumblebee"},
  {:rustler, "&gt;= 0.0.0", optional: true},
  {:nx, github: "elixir-nx/nx", sparse: "nx", override: true},
  {:exla, github: "elixir-nx/nx", sparse: "exla", override: true},
  {:kino, "~&gt; 0.10.0"}
])

Nx.global_default_backend(EXLA.Backend)
```

## 🐈‍⬛

```elixir
repo = "sentence-transformers/all-MiniLM-L6-v2"
{:ok, model_info} = Bumblebee.load_model({:hf, repo})
{:ok, tokenizer} = Bumblebee.load_tokenizer({:hf, repo})

serving =
  Bumblebee.Text.TextEmbedding.text_embedding(model_info, tokenizer,
    compile: [batch_size: 32, sequence_length: [16, 32, 64, 128, 512]],
    defn_options: [compiler: EXLA]
  )

Kino.start_child({Nx.Serving, serving: serving, name: MyServing})
```

```elixir
short_text = "this is a test"
Nx.Serving.batched_run(MyServing, short_text)
```

```elixir
long_text = String.duplicate("this is a test with a much longer text", 50)
Nx.Serving.batched_run(MyServing, long_text)
```

The first input falls under a shorter sequence length, meaning we use less padding and the computation is faster. The second input falls under the largest length, so we pad to 512 and the computation takes longer.
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="296405" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-296405" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="296405"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #35"></div>
  </section>
</div>
    <div class="postbit" id="296496" data-post-id="296496">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="steffend" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/steffend/120/20548_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  steffend
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Phoenix Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you very much, this is awesome. Indeed a quick benchmark shows a staircase like pattern with the configured batch sizes:</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/e/5/e504998f80a7e2e940bf108813bd0a2a8b7e3237.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/e504998f80a7e2e940bf108813bd0a2a8b7e3237" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/e/5/e504998f80a7e2e940bf108813bd0a2a8b7e3237_2_690x392.jpeg" alt="image" data-base62-sha1="wFZc8SgVCzTkwWJ3Q1dOP58T3tZ" width="690" height="392" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/e/5/e504998f80a7e2e940bf108813bd0a2a8b7e3237_2_690x392.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/e/5/e504998f80a7e2e940bf108813bd0a2a8b7e3237_2_1035x588.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/original/3X/e/5/e504998f80a7e2e940bf108813bd0a2a8b7e3237.jpeg 2x" data-dominant-color="FDFDFD"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1200×682 32.1 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="296496" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-296496" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="296496"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #36"></div>
  </section>
</div>
    <div class="postbit" id="296500" data-post-id="296500">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="steffend" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/steffend/120/20548_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  steffend
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Phoenix Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>So to summarize this topic: Elixir + Nx perform quite well for generating sentence embeddings. It is very important to make sure that the model is compiled for the right sequence lengths though, as the input is padded.<br>
For varying input lengths, the newest Bumblebee code on GitHub now supports specifying multiple sequence lengths, as seen in <a href="https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/36" rel="nofollow">post 36</a>.</p>
<p>Another option is using Ortex and an ONNX model. Here is an example livebook that uses this approach: <a href="https://gist.github.com/SteffenDE/893a9f00b4b95a2d0df3331a665b67ba" class="inline-onebox" rel="noopener nofollow ugc">Running the all-mpnet-base-v2 sentence transformer in Elixir using Ortex · GitHub</a>. In that case, using a serving does not improve the performance that much, at least when running on CPU. Therefore one can also just call <code>Ortex.run</code> directly.</p>
<p>Thanks for all the replies and insights. I’m happy to see that this lead to some improvements in Bumblebee and Nx!</p>
<p>I’m also happy to report that we’re currently working on moving our production setup from Python to Elixir+Nx at my job <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="296500" data-batch-url="/posts/batch_likers">
                        12
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/nx-vs-python-performance-for-sentence-transformer-encoding/56502/38">Post #37</a>
	                </div>
	            </div>
              <div id="likers-container-296500" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="296500"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>