helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: [generate] misc fixes

# What does this PR do?

Fixes/todos for minor issues I encountered while working on #40833 

Changed files:
filename: src/transformers/generation/utils.py
patch: @@ -575,6 +575,9 @@ def prepare_inputs_for_generation(
         # 2. Generic cache-dependent input preparation
         if past_key_values is not None:
             model_inputs["past_key_values"] = past_key_values
+            # TODO (joao): handle the case where cache length == input_ids length. The function below results in an
+            # exception because we get empty input_ids after slicing. In essence, we need to roll back the cache 1
+            # token to recompute the logits for the first token to be generated (but not all caches support roll backs)
             inputs_embeds, input_ids = self._cache_dependant_input_preparation(
                 input_ids, inputs_embeds, cache_position
             )
@@ -2631,19 +2634,19 @@ def heal_tokens(
         # replace bos with pad to not condition healing on it
         input_ids = torch.where(input_ids == bos_token_id, pad_token_id, input_ids)
 
-        """
-        the latter code assumes the input_ids is not empty,
-        input_id has to be checked if contains elements
-		"""
+        # the latter code assumes the input_ids is not empty, input_id has to be checked if contains elements
         if input_ids.numel() == 0:
             return input_ids
 
         tail_ids = input_ids[:, -1].tolist()
 
-        space_tok = tokenizer.convert_ids_to_tokens(tokenizer.convert_tokens_to_ids(" "))[0]
         # tail tokens are used for a prefix search, thus, whitespaces are replaced with
         # their tokenization (e.g. 'Ġ') to enable search for tokens prefixed with a whitespace
-        tail_toks = (tokenizer.decode(t).replace(" ", space_tok) for t in tail_ids)
+        if tokenizer.convert_tokens_to_ids(" ") is not None:
+            space_tok = tokenizer.convert_ids_to_tokens(tokenizer.convert_tokens_to_ids(" "))[0]
+            tail_toks = (tokenizer.decode(t).replace(" ", space_tok) for t in tail_ids)
+        else:
+            tail_toks = (tokenizer.decode(t) for t in tail_ids)
 
         for batch_idx, (tail_id, tail_tok) in enumerate(zip(tail_ids, tail_toks)):
             batch_ids = input_ids[batch_idx]
Repository: electron/electron
Pull request: build: move release script to new hasher function

Backport of #46989

See that PR for details.


Notes: none


Changed files:
filename: script/release/get-url-hash.ts
patch: @@ -2,12 +2,12 @@ import got from 'got';
 
 import * as url from 'node:url';
 
-const HASHER_FUNCTION_HOST = 'electron-artifact-hasher.azurewebsites.net';
-const HASHER_FUNCTION_ROUTE = '/api/HashArtifact';
+const HASHER_FUNCTION_HOST = 'electron-hasher.azurewebsites.net';
+const HASHER_FUNCTION_ROUTE = '/api/hashRemoteAsset';
 
 export async function getUrlHash (targetUrl: string, algorithm = 'sha256', attempts = 3) {
   const options = {
-    code: process.env.ELECTRON_ARTIFACT_HASHER_FUNCTION_KEY!,
+    code: process.env.ELECTRON_HASHER_FUNCTION_KEY!,
     targetUrl,
     algorithm
   };
Repository: denoland/deno
Pull request: Revert "fix(ext/node): stub out Module.register and Module.registerHooks"

Reverts denoland/deno#31666

Changed files:
filename: ext/node/polyfills/01_require.js
patch: @@ -1322,21 +1322,13 @@ Module.findSourceMap = findSourceMap;
  * @param {{ parentURL: string | URL, data: any, transferList: any[] }} [_options]
  */
 export function register(_specifier, _parentUrl, _options) {
-  throw new Error(
-    "Module loader hooks are not yet supported in Deno. Follow https://github.com/denoland/deno/issues/31665 for updates.",
-  );
-}
-
-Module.register = register;
+  // TODO(@marvinhagemeister): Stub implementation for programs registering
+  // TypeScript loaders. We don't support registering loaders for file
+  // types that Deno itself doesn't support at the moment.
 
-export function registerHooks(_hooks) {
-  throw new Error(
-    "Module loader hooks are not yet supported in Deno. Follow https://github.com/denoland/deno/issues/31665 for updates.",
-  );
+  return undefined;
 }
 
-Module.registerHooks = registerHooks;
-
 export { builtinModules, createRequire, getBuiltinModule, isBuiltin, Module };
 export const _cache = Module._cache;
 export const _extensions = Module._extensions;

filename: tests/unit_node/module_test.ts
patch: @@ -6,10 +6,13 @@ import {
   findSourceMap,
   isBuiltin,
   Module,
+  // @ts-ignore Our internal @types/node is at v18.16.19 which predates
+  // this change. Updating it is difficult due to different types in Node
+  // for `import.meta.filename` and `import.meta.dirname` that Deno
+  // provides.
   register,
-  registerHooks,
 } from "node:module";
-import { assert, assertEquals, assertThrows } from "@std/assert";
+import { assert, assertEquals } from "@std/assert";
 import process from "node:process";
 import * as path from "node:path";
 
@@ -104,14 +107,7 @@ Deno.test("[node/module findSourceMap] is a function", () => {
 
 // https://github.com/denoland/deno/issues/24902
 Deno.test("[node/module register] is a function", () => {
-  // @ts-ignore types are not important here
-  assertThrows(() => register("foo"));
-  // @ts-ignore types are not important here
-  assertThrows(() => registerHooks("foo"));
-  // @ts-ignore types are not important here
-  assertThrows(() => Module.register("foo"));
-  // @ts-ignore types are not important here
-  assertThrows(() => Module.registerHooks("foo"));
+  assertEquals(register("foo"), undefined);
 });
 
 Deno.test("[node/module] overriding Module._compile is possible and Node globals work", () => {
Repository: ggml-org/llama.cpp
Pull request: Add build-essential to Ubuntu 26.04 image

This is no longer passing the build, needs more packages.



Changed files:
filename: .devops/vulkan.Dockerfile
patch: @@ -50,6 +50,7 @@ WORKDIR /app
 
 RUN apt-get update \
     && apt-get install -y \
+    build-essential \
     git \
     python3 \
     python3-pip \
Repository: ollama/ollama
Pull request: Probe GPUs before backend init

Detect potential error scenarios so we can fallback to CPU mode without hitting asserts.

This won't fix the underlying errors we're seeing in #1940 and #1877 but it should hopefully allow us to detect the non-working scenario and fallback to CPU.  We still need to understand why `cudaGetDevice` is failing on these systems (maybe incompatible cuda libs or drivers?)

Changed files:
filename: llm/ext_server/ext_server.cpp
patch: @@ -3,6 +3,27 @@
 // Necessary evil since the server types are not defined in a header
 #include "server.cpp"
 
+// Low level API access to verify GPU access
+#if defined(GGML_USE_CUBLAS)
+#if defined(GGML_USE_HIPBLAS)
+#include <hip/hip_runtime.h>
+#include <hipblas/hipblas.h>
+#include <hip/hip_fp16.h>
+#ifdef __HIP_PLATFORM_AMD__
+// for rocblas_initialize()
+#include "rocblas/rocblas.h"
+#endif // __HIP_PLATFORM_AMD__
+#define cudaGetDevice hipGetDevice
+#define cudaError_t hipError_t
+#define cudaSuccess hipSuccess
+#define cudaGetErrorString hipGetErrorString
+#else
+#include <cuda_runtime.h>
+#include <cublas_v2.h>
+#include <cuda_fp16.h>
+#endif // defined(GGML_USE_HIPBLAS)
+#endif // GGML_USE_CUBLAS
+
 // Expose the llama server as a callable extern "C" API
 llama_server_context *llama = NULL;
 std::atomic<bool> ext_server_running(false);
@@ -12,7 +33,7 @@ void llama_server_init(ext_server_params *sparams, ext_server_resp_t *err) {
 #if SERVER_VERBOSE != 1
   log_disable();
 #endif
-  LOG_TEE("system info: %s", llama_print_system_info());
+  LOG_TEE("system info: %s\n", llama_print_system_info());
   assert(err != NULL && sparams != NULL);
   err->id = 0;
   err->msg[0] = '\0';
@@ -60,6 +81,18 @@ void llama_server_init(ext_server_params *sparams, ext_server_resp_t *err) {
       params.mmproj = std::string(sparams->mmproj);
     }
 
+#if defined(GGML_USE_CUBLAS)
+    // Before attempting to init the backend which will assert on error, verify the CUDA/ROCM GPU is accessible
+    LOG_TEE("Performing pre-initialization of GPU\n");
+    int id;
+    cudaError_t cudaErr = cudaGetDevice(&id);
+    if (cudaErr != cudaSuccess) {
+      err->id = -1;
+      snprintf(err->msg, err->msg_len, "Unable to init GPU: %s", cudaGetErrorString(cudaErr));
+      return;
+    }
+#endif
+
     llama_backend_init(params.numa);
 
     // load the model
Repository: nodejs/node
Pull request: lib: prefer AsyncIteratorPrototype primordial

Technically, it's a mutable prototype chain.

Changed files:
filename: lib/events.js
patch: @@ -28,6 +28,7 @@ const {
   ArrayPrototypeSlice,
   ArrayPrototypeSplice,
   ArrayPrototypeUnshift,
+  AsyncIteratorPrototype,
   Boolean,
   Error,
   ErrorCaptureStackTrace,
@@ -1000,9 +1001,6 @@ async function once(emitter, name, options = kEmptyObject) {
   });
 }
 
-const AsyncIteratorPrototype = ObjectGetPrototypeOf(
-  ObjectGetPrototypeOf(async function* () {}).prototype);
-
 function createIterResult(value, done) {
   return { value, done };
 }

filename: lib/internal/freeze_intrinsics.js
patch: @@ -31,6 +31,7 @@ const {
   ArrayPrototype,
   ArrayPrototypeForEach,
   ArrayPrototypePush,
+  AsyncIteratorPrototype,
   Atomics,
   BigInt,
   BigInt64Array,
@@ -212,10 +213,7 @@ module.exports = function() {
     // 27 Control Abstraction Objects
     // 27.1 Iteration
     IteratorPrototype, // 27.1.2 IteratorPrototype
-    // 27.1.3 AsyncIteratorPrototype
-    ObjectGetPrototypeOf(ObjectGetPrototypeOf(ObjectGetPrototypeOf(
-      (async function*() {})(),
-    ))),
+    AsyncIteratorPrototype, // 27.1.3 AsyncIteratorPrototype
     PromisePrototype, // 27.2
 
     // Other APIs / Web Compatibility
Repository: facebook/react
Pull request: [compiler] Type `ref` prop as a ref

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #29834

Adds a shape type for component props, which has one defined property: "ref". This means that if the ref property exists, we can type usage of `props.ref` (or via destructuring) the same as the result of `useRef()` and infer downstream usage similarly.

Changed files:
filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-write-ref-prop-in-render.expect.md
patch: @@ -0,0 +1,27 @@
+
+## Input
+
+```javascript
+// @validateRefAccessDuringRender @compilationMode(infer)
+function Component(props) {
+  const ref = props.ref;
+  ref.current = true;
+  return <div>{value}</div>;
+}
+
+```
+
+
+## Error
+
+```
+  2 | function Component(props) {
+  3 |   const ref = props.ref;
+> 4 |   ref.current = true;
+    |   ^^^^^^^^^^^ InvalidReact: Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef) (4:4)
+  5 |   return <div>{value}</div>;
+  6 | }
+  7 |
+```
+          
+      
\ No newline at end of file

filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-write-ref-prop-in-render.js
patch: @@ -0,0 +1,6 @@
+// @validateRefAccessDuringRender @compilationMode(infer)
+function Component(props) {
+  const ref = props.ref;
+  ref.current = true;
+  return <div>{value}</div>;
+}
Repository: electron/electron
Pull request: build: move release script to new hasher function

#### Description of Change

Conversation here: https://electronhq.slack.com/archives/CC80G2R6H/p1745119875976869?thread_ts=1745000386.480629&cid=CC80G2R6H. Following some modernizations to the electron/hasher repo, this PR moves us to use the new Azure function for the artifact hasher during releases.

The corresponding env variable has also been updated in Sudowoodo.

_NOTE:_ This is targeting all active release branches, but we should merge into main and ensure the new function works with nightly before actually merging the backports. Because we're using a new variable for the new function and haven't removed the variable for the old key/function, upload will still work for other release branches in the meantime.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [x] relevant API documentation, tutorials, and examples are updated and follow the [documentation style guide](https://github.com/electron/electron/blob/main/docs/development/style-guide.md)
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none


Changed files:
filename: script/release/get-url-hash.ts
patch: @@ -2,12 +2,12 @@ import got from 'got';
 
 import * as url from 'node:url';
 
-const HASHER_FUNCTION_HOST = 'electron-artifact-hasher.azurewebsites.net';
-const HASHER_FUNCTION_ROUTE = '/api/HashArtifact';
+const HASHER_FUNCTION_HOST = 'electron-hasher.azurewebsites.net';
+const HASHER_FUNCTION_ROUTE = '/api/hashRemoteAsset';
 
 export async function getUrlHash (targetUrl: string, algorithm = 'sha256', attempts = 3) {
   const options = {
-    code: process.env.ELECTRON_ARTIFACT_HASHER_FUNCTION_KEY!,
+    code: process.env.ELECTRON_HASHER_FUNCTION_KEY!,
     targetUrl,
     algorithm
   };
Repository: vercel/next.js
Pull request: Fix validateTurboNextConfig isDev field

Noticed the `phase` value being provided to `loadConfig` was incorrect with turbopack and `next start` which was due to this field being hard coded. 

Changed files:
filename: packages/next/src/server/lib/start-server.ts
patch: @@ -465,7 +465,7 @@ export async function startServer(
         if (process.env.TURBOPACK) {
           await validateTurboNextConfig({
             dir: serverOptions.dir,
-            isDev: true,
+            isDev: serverOptions.isDev,
           })
         }
       } catch (err) {
Repository: ggml-org/llama.cpp
Pull request: vulkan: use a fixed 1KB buffer for the add_rms_fusion opt

See https://github.com/ggml-org/llama.cpp/pull/16900#issuecomment-3577934473. I did verify that this resolves the failure.

I see qwen3moe and deepseek2 using in the range 400-800 bytes, so 1KB should be fine for now.


Changed files:
filename: ggml/src/ggml-vulkan/ggml-vulkan.cpp
patch: @@ -5289,7 +5289,8 @@ static void ggml_vk_init(ggml_backend_vk_context * ctx, size_t idx) {
     ctx->prealloc_size_x = 0;
     ctx->prealloc_size_y = 0;
     ctx->prealloc_size_split_k = 0;
-    ctx->prealloc_size_add_rms_partials = 0;
+    // Fixed size of 1KB, for deterministic behavior
+    ctx->prealloc_size_add_rms_partials = 1024;
 
     ctx->fence = ctx->device->device.createFence({});
     ctx->almost_ready_fence = ctx->device->device.createFence({});
@@ -13095,7 +13096,6 @@ static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cg
         ctx->fused_ops_write_mask = 0;
     }
 
-    ctx->prealloc_size_add_rms_partials = std::max(ctx->prealloc_size_add_rms_partials, ctx->prealloc_size_add_rms_partials_offset);
     ctx->last_total_mul_mat_bytes = total_mul_mat_bytes;
 
     if (vk_perf_logger_enabled) {
Repository: denoland/deno
Pull request: fix(ext/node): stub out Module.register and Module.registerHooks

Stubs out `Module.register` and `Module.registerHooks` functions that are meant to be used for Module Loader hooks as per https://nodejs.org/api/module.html#customization-hooks. 

This is a follow up to https://github.com/denoland/deno/pull/24965

Ref https://github.com/denoland/deno/issues/31665.
Improves error message from https://github.com/denoland/deno/issues/30538#issuecomment-3658925471.

Changed files:
filename: ext/node/polyfills/01_require.js
patch: @@ -1322,13 +1322,21 @@ Module.findSourceMap = findSourceMap;
  * @param {{ parentURL: string | URL, data: any, transferList: any[] }} [_options]
  */
 export function register(_specifier, _parentUrl, _options) {
-  // TODO(@marvinhagemeister): Stub implementation for programs registering
-  // TypeScript loaders. We don't support registering loaders for file
-  // types that Deno itself doesn't support at the moment.
+  throw new Error(
+    "Module loader hooks are not yet supported in Deno. Follow https://github.com/denoland/deno/issues/31665 for updates.",
+  );
+}
 
-  return undefined;
+Module.register = register;
+
+export function registerHooks(_hooks) {
+  throw new Error(
+    "Module loader hooks are not yet supported in Deno. Follow https://github.com/denoland/deno/issues/31665 for updates.",
+  );
 }
 
+Module.registerHooks = registerHooks;
+
 export { builtinModules, createRequire, getBuiltinModule, isBuiltin, Module };
 export const _cache = Module._cache;
 export const _extensions = Module._extensions;

filename: tests/unit_node/module_test.ts
patch: @@ -6,13 +6,10 @@ import {
   findSourceMap,
   isBuiltin,
   Module,
-  // @ts-ignore Our internal @types/node is at v18.16.19 which predates
-  // this change. Updating it is difficult due to different types in Node
-  // for `import.meta.filename` and `import.meta.dirname` that Deno
-  // provides.
   register,
+  registerHooks,
 } from "node:module";
-import { assert, assertEquals } from "@std/assert";
+import { assert, assertEquals, assertThrows } from "@std/assert";
 import process from "node:process";
 import * as path from "node:path";
 
@@ -107,7 +104,14 @@ Deno.test("[node/module findSourceMap] is a function", () => {
 
 // https://github.com/denoland/deno/issues/24902
 Deno.test("[node/module register] is a function", () => {
-  assertEquals(register("foo"), undefined);
+  // @ts-ignore types are not important here
+  assertThrows(() => register("foo"));
+  // @ts-ignore types are not important here
+  assertThrows(() => registerHooks("foo"));
+  // @ts-ignore types are not important here
+  assertThrows(() => Module.register("foo"));
+  // @ts-ignore types are not important here
+  assertThrows(() => Module.registerHooks("foo"));
 });
 
 Deno.test("[node/module] overriding Module._compile is possible and Node globals work", () => {
Repository: facebook/react
Pull request: compiler: Log metrics on pruned memo blocks/values

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* #29820
* __->__ #29810
* #29790
* #29789
* #29781

Adds additional information to the CompileSuccess LoggerEvent:
* `prunedMemoBlocks` is the number of reactive scopes that were pruned for some reason.
* `prunedMemoValues` is the number of unique _values_ produced by those scopes.

Both numbers exclude blocks that are just a hook call - ie although we create and prune a scope for eg `useState()`, that's just an artifact of the sequencing of our pipeline. So what this metric is counting is cases of _other_ values that go unmemoized. See the new fixture, which takes advantage of improvements in the snap runner to optionally emit the logger events in the .expect.md file if you include the "@logger" pragma in a fixture.

Changed files:
filename: compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts
patch: @@ -169,6 +169,7 @@ export type LoggerEvent =
       fnName: string | null;
       memoSlots: number;
       memoBlocks: number;
+      memoValues: number;
       prunedMemoBlocks: number;
       prunedMemoValues: number;
     }

filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/log-pruned-memoization.expect.md
patch: @@ -87,7 +87,7 @@ export const FIXTURE_ENTRYPOINT = {
 ## Logs
 
 ```
-{"kind":"CompileSuccess","fnLoc":{"start":{"line":5,"column":0,"index":121},"end":{"line":26,"column":1,"index":813},"filename":"log-pruned-memoization.ts"},"fnName":"Component","memoSlots":5,"memoBlocks":2,"prunedMemoBlocks":2,"prunedMemoValues":3}
+{"kind":"CompileSuccess","fnLoc":{"start":{"line":5,"column":0,"index":121},"end":{"line":26,"column":1,"index":813},"filename":"log-pruned-memoization.ts"},"fnName":"Component","memoSlots":5,"memoBlocks":2,"memoValues":2,"prunedMemoBlocks":2,"prunedMemoValues":3}
 ```
       
 ### Eval output
Repository: denoland/deno
Pull request: fix(compile): ensure temp dir exists during x64 codesign

Closes https://github.com/denoland/deno/issues/31664

Changed files:
filename: Cargo.lock
patch: @@ -5773,9 +5773,9 @@ dependencies = [
 
 [[package]]
 name = "libsui"
-version = "0.12.4"
+version = "0.12.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31c0d3e44c406dd59a3366bf17b79bf60d22c4d47fe903b7bf84cb57e7b1314b"
+checksum = "2d68355a1ba8740fde49a5dbd4ba3e0f3f36dbd122a39f8a3e362e43107226ff"
 dependencies = [
  "editpe",
  "image",

filename: Cargo.toml
patch: @@ -316,7 +316,7 @@ dprint-plugin-markdown = "=0.20.0"
 dprint-plugin-typescript = "=0.95.13"
 env_logger = "=0.11.6"
 fancy-regex = "=0.14.0"
-libsui = "0.12.4"
+libsui = "0.12.5"
 malva = "=0.12.1"
 markup_fmt = "=0.22.0"
 open = "5.0.1"
Repository: huggingface/transformers
Pull request: remove dummy EncodingFast

# What does this PR do?

Remove the dummy EncodingFast class. It's safer to always use the real EncodingFast.

Changed files:
filename: src/transformers/tokenization_utils_base.py
patch: @@ -98,9 +98,11 @@ def flatten(arr: list):
     return res
 
 
+if is_tokenizers_available() or TYPE_CHECKING:
+    from tokenizers import Encoding as EncodingFast
+
 if is_tokenizers_available():
     from tokenizers import AddedToken
-    from tokenizers import Encoding as EncodingFast
 else:
 
     @dataclass(frozen=False, eq=True)
@@ -129,12 +131,6 @@ def __getstate__(self):
         def __str__(self):
             return self.content
 
-    @dataclass
-    class EncodingFast:
-        """This is dummy class because without the `tokenizers` library we don't have these objects anyway"""
-
-        pass
-
 
 logger = logging.get_logger(__name__)
 
@@ -238,7 +234,8 @@ def __init__(
     ):
         super().__init__(data)
 
-        if isinstance(encoding, EncodingFast):
+        # If encoding is not None, the fast tokenization is used
+        if encoding is not None and isinstance(encoding, EncodingFast):
             encoding = [encoding]
 
         self._encodings = encoding
Repository: vercel/next.js
Pull request: Update generate-metadata.mdx


Changed files:
filename: docs/01-app/03-api-reference/04-functions/generate-metadata.mdx
patch: @@ -105,6 +105,7 @@ For type completion of `params` and `searchParams`, you can type the first argum
 > - You cannot export both the `metadata` object and `generateMetadata` function from the same route segment.
 > - `fetch` requests inside `generateMetadata` are automatically [memoized](/docs/app/guides/caching#request-memoization) for the same data across `generateMetadata`, `generateStaticParams`, Layouts, Pages, and Server Components.
 > - Resolving `generateMetadata` is part of rendering the page. If the page can be pre-rendered and `generateMetadata` doesn't introduce dynamic behavior, its result is included in the page’s initial HTML.
+> - `generateMetadata` [can stream results](/docs/app/api-reference/functions/generate-metadata#streaming-metadata) to improve page load performance.
 > - React [`cache` can be used](/docs/app/guides/caching#react-cache-function) if `fetch` is unavailable.
 > - [File-based metadata](/docs/app/api-reference/file-conventions/metadata) has the higher priority and will override the `metadata` object and `generateMetadata` function.
Repository: ollama/ollama
Pull request: Unlock mutex when failing to load model

Avoids `ollama serve` hanging with `concurrent llm servers not yet supported, waiting for prior server to complete` when a model fails to load

I believe this also fixes https://github.com/jmorganca/ollama/issues/1641

Changed files:
filename: llm/dyn_ext_server.go
patch: @@ -141,6 +141,7 @@ func newDynExtServer(library, model string, adapters, projectors []string, opts
 	defer freeExtServerResp(initResp)
 	C.dyn_llama_server_init(llm.s, &sparams, &initResp)
 	if initResp.id < 0 {
+		mutex.Unlock()
 		return nil, extServerResponseToErr(initResp)
 	}