helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Use Array.from to avoid @ts-ignore when copying i18n.locales

### What?
Replaces:
```ts
// @ts-ignore locales are readonly
const locales: string[] = i18n.locales;
```
with:
```ts
const locales = Array.from(i18n.locales);
```

### Why?
Avoids suppressing TypeScript errors via @ts-ignore.
Array.from safely creates a mutable copy without modifying the readonly original, making the code cleaner and more type-safe.

### How?
Used Array.from(i18n.locales) instead of a forced type assertion.<br>

<br>
No functional change, purely a lint-/type-safety improvement.


Changed files:
filename: examples/i18n-routing/middleware.ts
patch: @@ -11,8 +11,7 @@ function getLocale(request: NextRequest): string | undefined {
   const negotiatorHeaders: Record<string, string> = {};
   request.headers.forEach((value, key) => (negotiatorHeaders[key] = value));
 
-  // @ts-ignore locales are readonly
-  const locales: string[] = i18n.locales;
+  const locales = Array.from(i18n.locales);
 
   // Use negotiator and intl-localematcher to get best locale
   let languages = new Negotiator({ headers: negotiatorHeaders }).languages(
Repository: denoland/deno
Pull request: fix(ext/node): implement timeout and killSignal for spawn()

Closes https://github.com/denoland/deno/issues/19517

Fixes the `timeout` and `killSignal` options for `child_process.spawn()` (and `fork()`, which delegates to `spawn()`). Previously these options were accepted but silently ignored.

The fix sets a `setTimeout` after spawning that kills the child with the specified `killSignal` (default: `"SIGTERM"`) if the process hasn't exited within `timeout` ms. The timer is cleared if the process exits naturally before the deadline.


Changed files:
filename: ext/node/polyfills/child_process.ts
patch: @@ -222,9 +222,27 @@ export function spawn(
   options = normalizeSpawnArguments(command, args, options);
 
   validateAbortSignal(options?.signal, "options.signal");
+  validateTimeout(options?.timeout);
 
   const child = new ChildProcess();
   child.spawn(options);
+
+  const timeout = options?.timeout;
+  if (timeout != null && timeout > 0) {
+    const killSignal = options?.killSignal ?? "SIGTERM";
+    let timeoutId: ReturnType<typeof setTimeout> | null = setTimeout(() => {
+      timeoutId = null;
+      child.kill(killSignal as string);
+    }, timeout);
+
+    child.once("exit", () => {
+      if (timeoutId) {
+        clearTimeout(timeoutId);
+        timeoutId = null;
+      }
+    });
+  }
+
   return child;
 }
 

filename: ext/node/polyfills/internal/child_process.ts
patch: @@ -1471,13 +1471,7 @@ function _createSpawnError(
 }
 
 export interface SpawnOptions extends ChildProcessOptions {
-  /**
-   * NOTE: This option is not yet implemented.
-   */
   timeout?: number;
-  /**
-   * NOTE: This option is not yet implemented.
-   */
   killSignal?: string;
 }
 

filename: tests/node_compat/config.jsonc
patch: @@ -191,6 +191,7 @@
     "parallel/test-child-process-fork-no-shell.js": {},
     "parallel/test-child-process-fork-ref.js": {},
     "parallel/test-child-process-fork-ref2.js": {},
+    "parallel/test-child-process-fork-timeout-kill-signal.js": {},
     "parallel/test-child-process-fork3.js": {},
     "parallel/test-child-process-ipc-next-tick.js": {},
     "parallel/test-child-process-no-deprecation.js": {},
@@ -201,6 +202,7 @@
     "parallel/test-child-process-silent.js": {},
     "parallel/test-child-process-spawn-error.js": {},
     "parallel/test-child-process-spawn-event.js": {},
+    "parallel/test-child-process-spawn-timeout-kill-signal.js": {},
     "parallel/test-child-process-spawn-typeerror.js": {},
     "parallel/test-child-process-spawnsync-args.js": {},
     "parallel/test-child-process-spawnsync-env.js": {},
Repository: huggingface/transformers
Pull request: download and use HF Hub Cache

# What does this PR do?

I did the following

- run the tests
- collect the calls to `from_pretrained`
- run those `from_pretrained` calls within our CircleCI docker image build
- upload the `~/.cache/huggingface/hub` to a hub repository `hf-internal-testing/hf_hub_cache`
- during CircleCI runtime, download, unzip to the cache directory

I will work on putting all things together so it's easier to do in the future, but this PR could reduce the number of calls to Hub already.

Changed files:
filename: .circleci/create_circleci_config.py
patch: @@ -186,6 +186,7 @@ def to_dict(self):
             # During the CircleCI docker images build time, we might already (or not) download the data.
             # If it's done already, the files are inside the directory `/test_data/`.
             {"run": {"name": "fetch hub objects before pytest", "command": "cp -r /test_data/* . 2>/dev/null || true; python3 utils/fetch_hub_objects_for_ci.py"}},
+            {"run": {"name": "download and unzip hub cache", "command": 'curl -L -o huggingface-cache.tar.gz https://huggingface.co/datasets/hf-internal-testing/hf_hub_cache/resolve/main/huggingface-cache.tar.gz && apt-get install pigz && tar --use-compress-program="pigz -d -p 8" -xf huggingface-cache.tar.gz && mv -n hub/* /root/.cache/huggingface/hub/ && ls -la /root/.cache/huggingface/hub/'}},
             {"run": {
                 "name": "Run tests",
                 "command": f"({timeout_cmd} python3 -m pytest {marker_cmd} -n {self.pytest_num_workers} {junit_flags} {repeat_on_failure_flags} {' '.join(pytest_flags)} $(cat splitted_tests.txt) | tee tests_output.txt)"}
Repository: nodejs/node
Pull request: tools: check for std::vector<v8::Local> in lint

Adds a lint rule to disallow the usage of `std::vector<v8::Local<T>>`.
Follow up from the clean up of `std::vector<v8::Local<T>>` we did before. 
From pull request: https://github.com/nodejs/node/pull/57578:
> According to V8's public API documentation, local handles (i.e., objects of type v8::Local) "should never be allocated on the heap". This replaces the usage of heap-allocated data structures containing instances of v8::Local, specifically the std::vector<v8::Local<v8::String>> with recently introduced v8::LocalVector<T>.



Changed files:
filename: tools/cpplint.py
patch: @@ -6475,6 +6475,19 @@ def CheckItemIndentationInNamespace(filename, raw_lines_no_comments, linenum,
     error(filename, linenum, 'runtime/indentation_namespace', 4,
           'Do not indent within a namespace')
 
+def CheckLocalVectorUsage(filename, lines, error):
+  """Logs an error if std::vector<v8::Local<T>> is used.
+  Args:
+    filename: The name of the current file.
+    lines: An array of strings, each representing a line of the file.
+    error: The function to call with any errors found.
+  """
+  for linenum, line in enumerate(lines):
+    if (Search(r'\bstd::vector<v8::Local<[^>]+>>', line) or
+        Search(r'\bstd::vector<Local<[^>]+>>', line)):
+      error(filename, linenum, 'runtime/local_vector', 5,
+            'Do not use std::vector<v8::Local<T>>. '
+            'Use v8::LocalVector<T> instead.')
 
 def ProcessLine(filename, file_extension, clean_lines, line,
                 include_state, function_state, nesting_state, error,
@@ -6645,6 +6658,8 @@ def ProcessFileData(filename, file_extension, lines, error,
 
   CheckInlineHeader(filename, include_state, error)
 
+  CheckLocalVectorUsage(filename, lines, error)
+
 def ProcessConfigOverrides(filename):
   """ Loads the configuration files and processes the config overrides.
Repository: ollama/ollama
Pull request: Switch arm cuda base image to centos 7

We had started using rocky linux 8, but they've updated to GCC 10.3, which breaks NVCC.  10.2 is compatible (or 10.4, but that's not available from rocky linux 8 repos yet)

Changed files:
filename: Dockerfile
patch: @@ -20,11 +20,11 @@ WORKDIR /go/src/github.com/jmorganca/ollama/llm/generate
 ARG CGO_CFLAGS
 RUN OLLAMA_SKIP_CPU_GENERATE=1 sh gen_linux.sh
 
-FROM --platform=linux/arm64 nvidia/cuda:$CUDA_VERSION-devel-rockylinux8 AS cuda-build-arm64
+FROM --platform=linux/arm64 nvidia/cuda:$CUDA_VERSION-devel-centos7 AS cuda-build-arm64
 ARG CMAKE_VERSION
 COPY ./scripts/rh_linux_deps.sh /
 RUN CMAKE_VERSION=${CMAKE_VERSION} sh /rh_linux_deps.sh
-ENV PATH /opt/rh/gcc-toolset-10/root/usr/bin:$PATH
+ENV PATH /opt/rh/devtoolset-10/root/usr/bin:$PATH
 COPY --from=llm-code / /go/src/github.com/jmorganca/ollama/
 WORKDIR /go/src/github.com/jmorganca/ollama/llm/generate
 ARG CGO_CFLAGS
Repository: huggingface/transformers
Pull request: Fix README.md error when installing from source

# What does this PR do?

When running the `uv pip install .[torch]` in some shell, e.g., zsh, an error occurs `zsh: no matches found: .[torch]`. This PR fixed it by adding `''`.

## Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [x] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?

## CC
@stevhliu

Changed files:
filename: README.md
patch: @@ -111,10 +111,10 @@ git clone https://github.com/huggingface/transformers.git
 cd transformers
 
 # pip
-pip install .[torch]
+pip install '.[torch]'
 
 # uv
-uv pip install .[torch]
+uv pip install '.[torch]'
 ```
 
 ## Quickstart
Repository: ollama/ollama
Pull request: Add Community Integration: LibreChat

**LibreChat** is the leading ChatGPT-style Web UI that supports virtually every OpenAI-API-compatible endpoint, which now includes Ollama.

**Relevant docs:** https://docs.librechat.ai/install/configuration/ollama.html

**Screenshot**

![309832679-fcfe48cf-bbd6-4010-915f-66b4b238728d](https://github.com/ollama/ollama/assets/110412045/3756434e-1201-444e-b4b7-d4592b5c26cb)


Changed files:
filename: README.md
patch: @@ -259,6 +259,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 
 ### Web & Desktop
 
+- [LibreChat](https://github.com/danny-avila/LibreChat)
 - [Bionic GPT](https://github.com/bionic-gpt/bionic-gpt)
 - [Enchanted (macOS native)](https://github.com/AugustDev/enchanted)
 - [HTML UI](https://github.com/rtcfirefly/ollama-ui)
Repository: ggml-org/llama.cpp
Pull request: Make graph_max_nodes vary by ubatch size

Until now, graph node numbers have largely been constant for GGML graphs, however, with some hybrid attention models, the need for chunking arising from the O(n^3) complexity of recurrent updates in gating functions (for which we use `SOLVE_TRI`) makes the graph size dependent on the number of chunks, which is dependent on the size of the ubatch. This patch passes the ubatch size / context size to the function so that for models that need it, we can dynamically calculate the needed number of max nodes.

Fixes #17578 

Changed files:
filename: src/llama-context.cpp
patch: @@ -248,7 +248,10 @@ llama_context::llama_context(
 
         LLAMA_LOG_DEBUG("%s: backend_ptrs.size() = %zu\n", __func__, backend_ptrs.size());
 
-        const size_t max_nodes = this->graph_max_nodes();
+        const uint32_t n_seqs = cparams.n_seq_max;
+        const uint32_t n_tokens = std::min(cparams.n_ctx, cparams.n_ubatch);
+
+        const size_t max_nodes = this->graph_max_nodes(n_tokens);
 
         LLAMA_LOG_DEBUG("%s: max_nodes = %zu\n", __func__, max_nodes);
 
@@ -300,9 +303,6 @@ llama_context::llama_context(
 
         cross.v_embd.clear();
 
-        const uint32_t n_seqs = cparams.n_seq_max;
-        const uint32_t n_tokens = std::min(cparams.n_ctx, cparams.n_ubatch);
-
         // avoid reserving graphs with zero outputs - assume one output per sequence
         n_outputs = n_seqs;
 
@@ -1386,9 +1386,9 @@ void llama_context::output_reorder() {
 // graph
 //
 
-uint32_t llama_context::graph_max_nodes() const {
+uint32_t llama_context::graph_max_nodes(uint32_t n_tokens) const {
     if (model.arch == LLM_ARCH_QWEN3NEXT) {
-        return std::max<uint32_t>(8192u, 32u*model.n_tensors());
+        return std::max<uint32_t>(n_tokens * 40, 32u * model.n_tensors());
     }
     return std::max<uint32_t>(1024u, 8u*model.n_tensors());
 }

filename: src/llama-context.h
patch: @@ -197,7 +197,7 @@ struct llama_context {
     //
 
 public:
-    uint32_t graph_max_nodes() const;
+    uint32_t graph_max_nodes(uint32_t n_tokens) const;
 
     // can reuse the llm_graph_result instance of the context (for example to update a memory module)
     llm_graph_result * get_gf_res_reserve() const;
Repository: facebook/react
Pull request: [compiler] Correctly insert (Arrow)FunctionExpressions

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

Previously we would insert new (Arrow)FunctionExpressions as a sibling
of the original function. However this would break in the outlining case
as it would cause the original function expression's parent to become a
SequenceExpression, breaking a bunch of assumptions in the babel plugin.

To get around this, we synthesize a new VariableDeclaration to contain
the newly inserted function expression and therefore insert it as a true
sibling to the original function.

Yeah, it's kinda gross

Changed files:
filename: compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts
patch: @@ -223,19 +223,19 @@ function insertNewFunctionNode(
         {
           reason: 'Expected an (arrow) function expression to be created',
           description: `Got: ${funcExpr.type}`,
-          loc: null,
+          loc: funcExpr.loc ?? null,
         },
       );
       CompilerError.invariant(compiledFn.id != null, {
         reason: 'Expected compiled function to have an identifier',
-        loc: null,
+        loc: compiledFn.loc,
       });
       CompilerError.invariant(
         originalFn.parentPath.isVariableDeclarator() &&
           originalFn.parentPath.parentPath.isVariableDeclaration(),
         {
           reason: 'Expected a variable declarator parent',
-          loc: null,
+          loc: originalFn.node.loc ?? null,
         },
       );
       const varDecl = originalFn.parentPath.parentPath;
@@ -251,7 +251,7 @@ function insertNewFunctionNode(
         {
           reason: 'Expected inserted (arrow) function expression',
           description: `Got: ${insertedFuncExpr}`,
-          loc: null,
+          loc: insertedFuncExpr.node?.loc ?? null,
         },
       );
       return insertedFuncExpr;
Repository: vercel/next.js
Pull request: Turbopack: only replace edge dynamic calls in dev

This replacement should only happen in dev, it's really only to be able to have nicer error messages.

This previously failed the deployment tests.

Related: https://github.com/vercel/next.js/issues/40625

Closes PACK-5591

Changed files:
filename: crates/next-core/src/next_server/transforms.rs
patch: @@ -174,14 +174,18 @@ pub async fn get_next_server_transforms_rules(
     }
 
     if let NextRuntime::Edge = next_runtime {
-        rules.push(get_middleware_dynamic_assert_rule(mdx_rs));
+        let mode = *mode.await?;
+
+        if mode == NextMode::Development {
+            rules.push(get_middleware_dynamic_assert_rule(mdx_rs));
+        }
 
         if !foreign_code {
             rules.push(next_edge_node_api_assert(
                 mdx_rs,
                 matches!(context_ty, ServerContextType::Middleware { .. })
-                    && matches!(*mode.await?, NextMode::Build),
-                matches!(*mode.await?, NextMode::Build),
+                    && mode == NextMode::Build,
+                mode == NextMode::Build,
             ));
         }
 

filename: crates/next-custom-transforms/src/transforms/middleware_dynamic.rs
patch: @@ -12,12 +12,13 @@ enum WrappedExpr {
     WasmInstantiate,
 }
 
-/// Replaces call / expr to dynamic evaluation in the give code to
-/// wrapped expression (__next_eval__, __next_webassembly_compile__,..) to raise
-/// corresponding error.
+/// Replaces call / expr to dynamic evaluation in the give code to wrapped expression
+/// (__next_eval__, __next_webassembly_compile__,..) to raise a (nicer) error message.
 ///
-/// This transform is specific to edge runtime which are not allowed to
-/// call certain dynamic evaluation (eval, webassembly.instantiate, etc)
+/// This should only be only used in development mode.
+///
+/// This transform is specific to edge runtime which are not allowed to call certain dynamic
+/// evaluation (eval, webassembly.instantiate, etc)
 ///
 /// check middleware-plugin for corresponding webpack side transform.
 pub fn next_middleware_dynamic() -> MiddlewareDynamic {
Repository: denoland/deno
Pull request: fix(audit): gracefully handle malformed response

Fixes an issue where `deno audit` fails to deserialize npm registry responses when the `actions` field is missing.

## Changes Made

- Added `#[serde(default)]` attribute to the `actions` field in `AuditResponse` struct in `cli/tools/pm/audit.rs` - this makes the field default to an empty `Vec` when missing from the JSON response
- Added a unit test to verify the deserialization works when `actions` field is missing

## Fix Details

The issue was that the npm registry audit API response sometimes doesn't include the `actions` field. The Deno audit code was expecting this field to always be present, causing deserialization to fail with: `missing field 'actions' at line 1 column 33`

The fix adds `#[serde(default)]` to the `actions` field, which makes it default to an empty vector when the field is not present in the JSON response. This is the standard serde pattern for optional fields that should have a sensible default value.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>`deno audit` fails to deserialize npm registry response</issue_title>
> <issue_description>Version: Deno 2.6.10
> 
> error: Failed to deserialize response from the npm registry API
> 
> Caused by:
>     missing field `actions` at line 1 column 33</issue_description>
> 
> <agent_instructions>Update `AuditResponse` struct to have `actions` field be optional and default to empty vector. Add a test case for it, you can update test server in `tests/util/server/servers/npm_registry.rs` with relevant fixutre</agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes denoland/deno#32233

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).


Changed files:
filename: cli/tools/pm/audit.rs
patch: @@ -603,6 +603,7 @@ mod npm {
 
   #[derive(Debug, Deserialize)]
   pub struct AuditResponse {
+    #[serde(default)]
     pub actions: Vec<AuditAction>,
     pub advisories: HashMap<i32, AuditAdvisory>,
     pub metadata: AuditMetadata,
@@ -920,3 +921,30 @@ mod socket_dev {
     pub alerts: Vec<FirewallAlert>,
   }
 }
+
+#[cfg(test)]
+mod tests {
+  use deno_core::serde_json;
+
+  use super::npm::AuditResponse;
+
+  #[test]
+  fn test_audit_response_deserialize_without_actions() {
+    // Test that AuditResponse can be deserialized when the `actions` field is missing
+    // This can happen with some npm registry responses
+    let json = r#"{
+      "advisories": {},
+      "metadata": {
+        "vulnerabilities": {
+          "low": 0,
+          "moderate": 0,
+          "high": 0,
+          "critical": 0
+        }
+      }
+    }"#;
+    let response: AuditResponse = serde_json::from_str(json).unwrap();
+    assert!(response.actions.is_empty());
+    assert!(response.advisories.is_empty());
+  }
+}
Repository: ollama/ollama
Pull request: Bump llama.cpp to b2527


Changed files:
filename: llm/llama.cpp
patch: @@ -1 +1 @@
-Subproject commit 1b26aebe4de4f048ac99996efd8a2c9af150904d
+Subproject commit ad3a0505e3b6cd777259ee35e61d428357ffc565
Repository: electron/electron
Pull request: fix: printing PDF via `webContents.print()`

Backport of #47377

See that PR for details.


Notes: Partially fixes an issue with printing a PDF via `webContents.print()` where the callback would not be called.


Changed files:
filename: shell/browser/api/electron_api_web_contents.cc
patch: @@ -2956,12 +2956,15 @@ void OnGetDeviceNameToUse(base::WeakPtr<content::WebContents> web_contents,
     print_settings.Set(printing::kSettingDpiVertical, dpi.height());
   }
 
-  auto* print_view_manager =
-      PrintViewManagerElectron::FromWebContents(web_contents.get());
+  content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents.get());
+  if (!rfh)
+    return;
+
+  auto* print_view_manager = PrintViewManagerElectron::FromWebContents(
+      content::WebContents::FromRenderFrameHost(rfh));
   if (!print_view_manager)
     return;
 
-  content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents.get());
   print_view_manager->PrintNow(rfh, std::move(print_settings),
                                std::move(print_callback));
 }
@@ -3007,12 +3010,15 @@ void WebContents::Print(gin::Arguments* args) {
   }
 
   if (options.IsEmptyObject()) {
-    auto* print_view_manager =
-        PrintViewManagerElectron::FromWebContents(web_contents());
+    content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents());
+    if (!rfh)
+      return;
+
+    auto* print_view_manager = PrintViewManagerElectron::FromWebContents(
+        content::WebContents::FromRenderFrameHost(rfh));
     if (!print_view_manager)
       return;
 
-    content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents());
     print_view_manager->PrintNow(rfh, std::move(settings), std::move(callback));
     return;
   }