helloadhavan/github_issues huggingface dataset:
Repository: denoland/deno
Pull request: fix(ext/node): fix grpc error_handling example

When we're emitting the 'response' event, we currently have the flags argument set to 0 instead of extracting it from the headers frame. We currently don't have a low level API to extract the flags field from HEADERS frame.

gRPC depends only on the END_STREAM flag to emit "trailers" event which is reponsible to propagate the errors correctly. This PR uses Body::is_end_stream() to determine if a stream will end and set the END_STREAM flag.

TODO:
- [x] test (added a smoke test in internal repo)

Towards #23714 

Changed files:
filename: ext/node/ops/http2.rs
patch: @@ -423,7 +423,7 @@ pub struct Http2ClientResponse {
 pub async fn op_http2_client_get_response(
   state: Rc<RefCell<OpState>>,
   #[smi] stream_rid: ResourceId,
-) -> Result<Http2ClientResponse, AnyError> {
+) -> Result<(Http2ClientResponse, bool), AnyError> {
   let resource = state
     .borrow()
     .resource_table
@@ -439,6 +439,7 @@ pub async fn op_http2_client_get_response(
   for (key, val) in parts.headers.iter() {
     res_headers.push((key.as_str().into(), val.as_bytes().into()));
   }
+  let end_stream = body.is_end_stream();
 
   let (trailers_tx, trailers_rx) = tokio::sync::oneshot::channel();
   let body_rid =
@@ -450,11 +451,14 @@ pub async fn op_http2_client_get_response(
         trailers_rx: AsyncRefCell::new(Some(trailers_rx)),
         trailers_tx: AsyncRefCell::new(Some(trailers_tx)),
       });
-  Ok(Http2ClientResponse {
-    headers: res_headers,
-    body_rid,
-    status_code: status.into(),
-  })
+  Ok((
+    Http2ClientResponse {
+      headers: res_headers,
+      body_rid,
+      status_code: status.into(),
+    },
+    end_stream,
+  ))
 }
 
 enum DataOrTrailers {

filename: ext/node/polyfills/http2.ts
patch: @@ -822,7 +822,7 @@ export class ClientHttp2Stream extends Duplex {
         session[kDenoClientRid],
         this.#rid,
       );
-      const response = await op_http2_client_get_response(
+      const [response, endStream] = await op_http2_client_get_response(
         this.#rid,
       );
       debugHttp2(">>> after get response", response);
@@ -831,7 +831,13 @@ export class ClientHttp2Stream extends Duplex {
         ...Object.fromEntries(response.headers),
       };
       debugHttp2(">>> emitting response", headers);
-      this.emit("response", headers, 0);
+      this.emit(
+        "response",
+        headers,
+        endStream
+          ? constants.NGHTTP2_FLAG_END_STREAM
+          : constants.NGHTTP2_FLAG_NONE,
+      );
       this[kDenoResponse] = response;
       this.emit("ready");
     })();
Repository: facebook/react
Pull request: Typo fix

emitted instead of emmitted

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `master`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

## Test Plan

<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. -->


Changed files:
filename: packages/react-server/src/ReactFizzServer.js
patch: @@ -1612,7 +1612,7 @@ function flushSegment(
     // Assign an ID to refer to the future content by.
     boundary.rootSegmentID = request.nextSegmentId++;
     if (boundary.completedSegments.length > 0) {
-      // If this is at least partially complete, we can queue it to be partially emmitted early.
+      // If this is at least partially complete, we can queue it to be partially emitted early.
       request.partialBoundaries.push(boundary);
     }
Repository: ggml-org/llama.cpp
Pull request: llama : use n_embd_head_v instead of n_embd_head_k when reshaping kqv

When reshaping kqv at the end of llm_build_kqv() n_embd_head_k is incorrectly used instead of n_embd_head_v to calculate kqv dimensions.

Changed files:
filename: llama.cpp
patch: @@ -6622,6 +6622,7 @@ static struct ggml_tensor * llm_build_kqv(
     const int64_t n_embd_head_k = hparams.n_embd_head_k;
     const int64_t n_embd_k_gqa  = hparams.n_embd_k_gqa();
     const int64_t n_embd_head_v = hparams.n_embd_head_v;
+    const int64_t n_embd_v_gqa  = hparams.n_embd_v_gqa();
 
     struct ggml_tensor * q = ggml_permute(ctx, q_cur, 0, 2, 1, 3);
     cb(q, "q", il);
@@ -6644,8 +6645,8 @@ static struct ggml_tensor * llm_build_kqv(
         struct ggml_tensor * v =
             ggml_view_3d(ctx, kv.v_l[il],
                     n_embd_head_v, n_kv, n_head_kv,
-                    ggml_row_size(kv.v_l[il]->type, n_embd_k_gqa),
-                    ggml_row_size(kv.v_l[il]->type, n_embd_head_k),
+                    ggml_row_size(kv.v_l[il]->type, n_embd_v_gqa),
+                    ggml_row_size(kv.v_l[il]->type, n_embd_head_v),
                     0);
         cb(v, "v", il);
 
@@ -6655,7 +6656,7 @@ static struct ggml_tensor * llm_build_kqv(
             ggml_flash_attn_ext_set_prec(cur, GGML_PREC_F32);
         }
 
-        cur = ggml_reshape_2d(ctx, cur, n_embd_head_k*n_head, n_tokens);
+        cur = ggml_reshape_2d(ctx, cur, n_embd_head_v*n_head, n_tokens);
     } else {
         struct ggml_tensor * kq = ggml_mul_mat(ctx, k, q);
         cb(kq, "kq", il);
@@ -6700,7 +6701,7 @@ static struct ggml_tensor * llm_build_kqv(
         struct ggml_tensor * kqv_merged = ggml_permute(ctx, kqv, 0, 2, 1, 3);
         cb(kqv_merged, "kqv_merged", il);
 
-        cur = ggml_cont_2d(ctx, kqv_merged, n_embd_head_k*n_head, n_tokens);
+        cur = ggml_cont_2d(ctx, kqv_merged, n_embd_head_v*n_head, n_tokens);
         cb(cur, "kqv_merged_cont", il);
     }
Repository: huggingface/transformers
Pull request: Minor Gemma 3 fixes 

# What does this PR do?

In the attention block, Gemma3 enforces dtype/device matching of the attention mask and query states, which fails if there is no attention mask provided. This fixes it.

Changed files:
filename: src/transformers/models/gemma3/modeling_gemma3.py
patch: @@ -361,13 +361,15 @@ def forward(
                 )
             else:
                 attention_interface = ALL_ATTENTION_FUNCTIONS[self.config._attn_implementation]
-
+        if attention_mask is not None:
+            # backwards compatibility
+            attention_mask = attention_mask.to(query_states)
         attn_output, attn_weights = attention_interface(
             self,
             query_states,
             key_states,
             value_states,
-            attention_mask.to(query_states),
+            attention_mask,
             dropout=self.attention_dropout if self.training else 0.0,
             scaling=self.scaling,
             sliding_window=self.sliding_window,
@@ -1360,7 +1362,7 @@ def forward(
             **lm_kwargs,
         )
 
-        logits = outputs.logits
+        logits = outputs[0]
         loss = None
         if labels is not None:
             # Upcast to float if we need to compute the loss to avoid potential precision issues

filename: src/transformers/models/gemma3/modular_gemma3.py
patch: @@ -418,13 +418,15 @@ def forward(
                 )
             else:
                 attention_interface = ALL_ATTENTION_FUNCTIONS[self.config._attn_implementation]
-
+        if attention_mask is not None:
+            # backwards compatibility
+            attention_mask = attention_mask.to(query_states)
         attn_output, attn_weights = attention_interface(
             self,
             query_states,
             key_states,
             value_states,
-            attention_mask.to(query_states),
+            attention_mask,
             dropout=self.attention_dropout if self.training else 0.0,
             scaling=self.scaling,
             sliding_window=self.sliding_window,
@@ -974,7 +976,7 @@ def forward(
             **lm_kwargs,
         )
 
-        logits = outputs.logits
+        logits = outputs[0]
         loss = None
         if labels is not None:
             # Upcast to float if we need to compute the loss to avoid potential precision issues
Repository: denoland/deno
Pull request: fix(node): error when throwing `FS_EISDIR`

The `EISDIR` error code is not available as a global variable, but must be accessed through the `osConstants.errno` object.

Fixes https://github.com/denoland/deno/issues/23695 

Changed files:
filename: ext/node/polyfills/internal/fs/utils.mjs
patch: @@ -891,7 +891,7 @@ export const validateRmOptionsSync = hideStackFrames(
           message: "is a directory",
           path,
           syscall: "rm",
-          errno: EISDIR,
+          errno: osConstants.errno.EISDIR,
         });
       }
     }
Repository: ggml-org/llama.cpp
Pull request: Fix tensor groups for encoder-decoder models in gguf-dump.py


[t5-small-dump.txt](https://github.com/user-attachments/files/15952176/t5-small-dump.txt)
This PR corrects tensor groups for encoder-decoder models like T5 and FLAN-T5 family. Separate tensor groups are created for each enc.blk.[bid], additional tensor groups are created for remaining non-blk enc and dec tensors. Example:

```
## Tensors Overview ~61M Elements

Total number of elements in all tensors: 60506880 Elements

- [Decoder Block 0 Tensor Group - ~4M Elements](#dec_blk_0)
- [Decoder Block 1 Tensor Group - ~4M Elements](#dec_blk_1)
- [Decoder Block 2 Tensor Group - ~4M Elements](#dec_blk_2)
- [Decoder Block 3 Tensor Group - ~4M Elements](#dec_blk_3)
- [Decoder Block 4 Tensor Group - ~4M Elements](#dec_blk_4)
- [Decoder Block 5 Tensor Group - ~4M Elements](#dec_blk_5)
- [Decoder Tensor Group - 512 Elements](#dec)
- [Encoder Block 0 Tensor Group - ~3M Elements](#enc_blk_0)
- [Encoder Block 1 Tensor Group - ~3M Elements](#enc_blk_1)
- [Encoder Block 2 Tensor Group - ~3M Elements](#enc_blk_2)
- [Encoder Block 3 Tensor Group - ~3M Elements](#enc_blk_3)
- [Encoder Block 4 Tensor Group - ~3M Elements](#enc_blk_4)
- [Encoder Block 5 Tensor Group - ~3M Elements](#enc_blk_5)
- [Encoder Tensor Group - 512 Elements](#enc)
- [Base Tensor Group - ~16M Elements](#base)
```

In attached file there is a complete output from `python3 gguf-py/scripts/gguf-dump.py --markdown /mnt/md0/models/t5-small.gguf` command.

- [x] I have read the [contributing guidelines](https://github.com/ggerganov/llama.cpp/blob/master/CONTRIBUTING.md)
- Self-reported review complexity:
  - [x] Low
  - [ ] Medium
  - [ ] High


Changed files:
filename: gguf-py/scripts/gguf-dump.py
patch: @@ -208,7 +208,9 @@ def translate_tensor_name(name):
         'ssm_d': 'State space model skip connection',
         'ssm_dt': 'State space model time step',
         'ssm_out': 'State space model output projection',
-        'blk': 'Block'
+        'blk': 'Block',
+        'enc': 'Encoder',
+        'dec': 'Decoder',
     }
 
     expanded_words = []
@@ -291,6 +293,10 @@ def dump_markdown_metadata(reader: GGUFReader, args: argparse.Namespace) -> None
             tensor_group_name = "base"
             if tensor_components[0] == 'blk':
                 tensor_group_name = f"{tensor_components[0]}.{tensor_components[1]}"
+            elif tensor_components[0] in ['enc', 'dec'] and tensor_components[1] == 'blk':
+                tensor_group_name = f"{tensor_components[0]}.{tensor_components[1]}.{tensor_components[2]}"
+            elif tensor_components[0] in ['enc', 'dec']:
+                tensor_group_name = f"{tensor_components[0]}"
 
             # Check if new Tensor Group
             if tensor_group_name not in tensor_groups:
Repository: huggingface/transformers
Pull request: Gemma 3 tests expect greedy decoding

# What does this PR do?

Slow tests in gemma 3 expect greedy decoding. Recently hub config has changed https://huggingface.co/google/gemma-3-4b-pt/commit/2166bd1fba050eab3ed4fdd0b591ad1e11c96802 so it is preferred to enforce greedy decoding.

Changed files:
filename: tests/models/gemma3/test_modeling_gemma3.py
patch: @@ -567,7 +567,7 @@ def test_generation_beyond_sliding_window(self, attn_implementation: str):
         input_size = inputs.input_ids.shape[-1]
         self.assertTrue(input_size > model.config.sliding_window)
 
-        out = model.generate(**inputs, max_new_tokens=20)[:, input_size:]
+        out = model.generate(**inputs, max_new_tokens=20, do_sample=False)[:, input_size:]
         output_text = tokenizer.batch_decode(out)
 
         EXPECTED_COMPLETIONS = [" and I'm going to take a walk.\n\nI really enjoy the scenery, and I'", ", green, yellow, orange, purple, brown, black, white, gray.\n\nI'"]  # fmt: skip
@@ -599,6 +599,11 @@ def test_generation_beyond_sliding_window_with_generation_config(self):
         generation_config = GenerationConfig(max_new_tokens=5, min_new_tokens=5)
         out = model.generate(**inputs, generation_config=generation_config)
 
+        out = model.generate(**inputs, generation_config=generation_config, do_sample=False)[:, input_size:]
+        output_text = tokenizer.batch_decode(out)
+        EXPECTED_COMPLETIONS = [" and I'm going to take a walk.\n\nI really enjoy the scenery, and I'", ", green, yellow, orange, purple, brown, black, white, gray.\n\nI'"]  # fmt: skip
+        self.assertEqual(output_text, EXPECTED_COMPLETIONS)
+
         # Generation works beyond sliding window
         self.assertGreater(out.shape[1], model.config.sliding_window)
         self.assertEqual(out.shape[1], input_size + 5)
Repository: denoland/deno
Pull request: fix(ext/node): export geteuid from node:process

Fixes https://github.com/denoland/deno/issues/23827

Changed files:
filename: ext/node/polyfills/process.ts
patch: @@ -301,6 +301,16 @@ export function kill(pid: number, sig: string | number = "SIGTERM") {
   return true;
 }
 
+let getgid, getuid, geteuid;
+
+if (!isWindows) {
+  getgid = () => Deno.gid();
+  getuid = () => Deno.uid();
+  geteuid = () => op_geteuid();
+}
+
+export { geteuid, getgid, getuid };
+
 // deno-lint-ignore no-explicit-any
 function uncaughtExceptionHandler(err: any, origin: string) {
   // The origin parameter can be 'unhandledRejection' or 'uncaughtException'
@@ -638,19 +648,13 @@ class Process extends EventEmitter {
   }
 
   /** This method is removed on Windows */
-  getgid?(): number {
-    return Deno.gid()!;
-  }
+  getgid = getgid;
 
   /** This method is removed on Windows */
-  getuid?(): number {
-    return Deno.uid()!;
-  }
+  getuid = getuid;
 
   /** This method is removed on Windows */
-  geteuid?(): number {
-    return op_geteuid();
-  }
+  geteuid = geteuid;
 
   // TODO(kt3k): Implement this when we added -e option to node compat mode
   _eval: string | undefined = undefined;

filename: tests/unit_node/process_test.ts
patch: @@ -6,6 +6,7 @@ import process, {
   argv,
   argv0 as importedArgv0,
   env,
+  geteuid,
   pid as importedPid,
   platform as importedPlatform,
 } from "node:process";
@@ -879,6 +880,7 @@ Deno.test("process.geteuid", () => {
   if (Deno.build.os === "windows") {
     assertEquals(process.geteuid, undefined);
   } else {
+    assert(geteuid);
     assert(typeof process.geteuid?.() === "number");
   }
 });
Repository: ggml-org/llama.cpp
Pull request: context : clear sets of encoder output sequence ids before storing new values

This PR fixes a bug that results in accumulation of sequence ids in `seq_ids_enc` vector of sets when processing batches containing multiple sequences in encoder-decoder models (T5 and family). By clearing sets before storing sequence ids of current encoder output previously stored values are removed which prevents possible accumulation of sequence ids.

Changed files:
filename: src/llama-context.cpp
patch: @@ -1153,6 +1153,7 @@ int llama_context::encode(llama_batch & inp_batch) {
         // remember the sequence ids used during the encoding - needed for cross attention later
         cross.seq_ids_enc.resize(n_tokens);
         for (int32_t i = 0; i < n_tokens; i++) {
+            cross.seq_ids_enc[i].clear();
             for (int s = 0; s < ubatch.n_seq_id[i]; s++) {
                 llama_seq_id seq_id = ubatch.seq_id[i][s];
                 cross.seq_ids_enc[i].insert(seq_id);
Repository: denoland/deno
Pull request: perf(compile): Do not checksum eszip content

Related: https://github.com/denoland/eszip/pull/181

eszip < v0.69.0 hashes all its contents to ensure data integrity. This feature is not necessary in Deno CLI as the binary integrity guarantee is deemed an external responsibility (ie it is to be assumed that, if necessary, the compiled binary will be checksumed externally prior to being executed). 

eszip >= v0.69.0 no longer performs this checksum by default. This reduces the cold-start time of the compiled binaries, proportionally to their size. 

Changed files:
filename: Cargo.lock
patch: @@ -2504,9 +2504,9 @@ dependencies = [
 
 [[package]]
 name = "eszip"
-version = "0.68.5"
+version = "0.69.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd4261ccce6111115c5b536e7f76222a779d69a038bb4c13958575f12ffe5606"
+checksum = "8f606daca1ce18c69ccdabc59aa1c7e077356b8ffcd74e12c7646f545320a2fd"
 dependencies = [
  "anyhow",
  "base64",

filename: cli/Cargo.toml
patch: @@ -77,7 +77,7 @@ deno_runtime = { workspace = true, features = ["include_js_files_for_snapshottin
 deno_semver = "=0.5.4"
 deno_task_shell = "=0.16.1"
 deno_terminal.workspace = true
-eszip = "=0.68.5"
+eszip = "=0.69.0"
 napi_sym.workspace = true
 
 async-trait.workspace = true
Repository: facebook/react
Pull request: react-devtools: set icon on macos

## Summary

Running `react-devtools` on MacOS shows the default electron icon in the dock.

## Test Plan
```bash
cd packages/react-devtools/
yarn start
```
Observe that the dock icon is now the correct react icon.


Changed files:
filename: packages/react-devtools/app.js
patch: @@ -9,6 +9,7 @@
 
 const {app, BrowserWindow} = require('electron'); // Module to create native browser window.
 const {join} = require('path');
+const os = require('os');
 
 const argv = require('minimist')(process.argv.slice(2));
 const projectRoots = argv._;
@@ -32,6 +33,11 @@ app.on('ready', function() {
     },
   });
 
+  // set dock icon for macos
+  if (os.platform() === 'darwin') {
+    app.dock.setIcon(join(__dirname, 'icons/icon128.png'));
+  }
+
   // https://stackoverflow.com/questions/32402327/
   mainWindow.webContents.on('new-window', function(event, url) {
     event.preventDefault();
Repository: denoland/deno
Pull request: fix(doc): --lint - private ref diagnostic was displaying incorrect information

* https://github.com/denoland/deno_doc/pull/576

Closes #23303

Changed files:
filename: Cargo.lock
patch: @@ -1377,9 +1377,9 @@ dependencies = [
 
 [[package]]
 name = "deno_doc"
-version = "0.134.0"
+version = "0.135.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65c98a53f8456aed1fe2a0ead89df31d75e41e1b50f17933aa43e6297b6e8bf6"
+checksum = "c2c39bbe2769f6e8bfba1a99d7656e6994474c48fd2085ed82b59556e9d398dd"
 dependencies = [
  "ammonia",
  "anyhow",

filename: cli/Cargo.toml
patch: @@ -67,7 +67,7 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa
 deno_cache_dir = { workspace = true }
 deno_config = "=0.16.3"
 deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
-deno_doc = { version = "=0.134.0", features = ["html", "syntect"] }
+deno_doc = { version = "=0.135.0", features = ["html", "syntect"] }
 deno_emit = "=0.40.3"
 deno_graph = { version = "=0.75.1", features = ["tokio_executor"] }
 deno_lint = { version = "=0.58.4", features = ["docs"] }
Repository: ggml-org/llama.cpp
Pull request: tests : add missing comma in grammar integration tests

This PR adds a missing comma in the list of failing strings in `test_special_chars()` of grammar integration tests.

- [x] I have read the [contributing guidelines](https://github.com/ggerganov/llama.cpp/blob/master/CONTRIBUTING.md)
- Self-reported review complexity:
  - [x] Low
  - [ ] Medium
  - [ ] High


Changed files:
filename: tests/test-grammar-integration.cpp
patch: @@ -503,7 +503,7 @@ static void test_special_chars() {
             "aaaaabcccc",
             "aaaabccc",
             "aaaabccccc",
-            "🔵🟠✅❌abc❌✅🟠🔵"
+            "🔵🟠✅❌abc❌✅🟠🔵",
             "🔵🟠abc🟠🔵"
         }
     );
Repository: ggml-org/llama.cpp
Pull request: llava : zero-initialize clip_ctx structure fields with aggregate initialization

Without the initialization struct fields have garbage values causing crashes reported in #9066.
Fixes #9066.

- [x] I have read the [contributing guidelines](https://github.com/ggerganov/llama.cpp/blob/master/CONTRIBUTING.md)
- Self-reported review complexity:
  - [x] Low
  - [ ] Medium
  - [ ] High


Changed files:
filename: examples/llava/clip.cpp
patch: @@ -1112,7 +1112,7 @@ struct clip_ctx * clip_model_load(const char * fname, const int verbosity = 1) {
         }
     }
 
-    clip_ctx * new_clip = new clip_ctx;
+    clip_ctx * new_clip = new clip_ctx{};
 
     // update projector type
     {
Repository: ggml-org/llama.cpp
Pull request: Check all graph nodes when searching for result_embd_pooled (needed for gemma-2)

This PR replaces checking only two last graph nodes when searching for `result_embd_pooled` tensor with a full search of all graph nodes starting from the last one. This is needed for models that perform some additional operations after `result_norm` (e.g. Gemma-2, MiniCPM) resulting in `result_embd_pooled` tensor position in the graph node list earlier than the second-to-last one.
Fixes #8956.

- [x] I have read the [contributing guidelines](https://github.com/ggerganov/llama.cpp/blob/master/CONTRIBUTING.md)
- Self-reported review complexity:
  - [x] Low
  - [ ] Medium
  - [ ] High


Changed files:
filename: src/llama.cpp
patch: @@ -14722,12 +14722,15 @@ static int llama_decode_internal(
             res  = nullptr;
             embd = nullptr;
         } else if (cparams.embeddings) {
-            res = nullptr; // do not extract logits for embedding case
-            embd = gf->nodes[gf->n_nodes - 1];
-            if (strcmp(embd->name, "result_embd_pooled") != 0) {
-                embd = gf->nodes[gf->n_nodes - 2];
+            res  = nullptr; // do not extract logits for embedding case
+            embd = nullptr;
+            for (int i = gf->n_nodes - 1; i >= 0; --i) {
+                if (strcmp(gf->nodes[i]->name, "result_embd_pooled") == 0) {
+                    embd = gf->nodes[i];
+                    break;
+                }
             }
-            GGML_ASSERT(strcmp(embd->name, "result_embd_pooled") == 0 && "missing embeddings tensor");
+            GGML_ASSERT(embd != nullptr && "missing embeddings tensor");
         } else {
             embd = nullptr; // do not extract embeddings when not needed
             GGML_ASSERT(strcmp(res->name, "result_output") == 0 && "missing result_output tensor");