helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: close all open sheets before closing window on macOS

Backport of #43706

See that PR for details.


Notes: Fixed closing a window with more than one attached sheet on macOS.

Changed files:
filename: shell/browser/native_window_mac.mm
patch: @@ -347,8 +347,11 @@ static bool FromV8(v8::Isolate* isolate,
   // [window_ performClose:nil], the window won't close properly
   // even after the user has ended the sheet.
   // Ensure it's closed before calling [window_ performClose:nil].
-  if ([window_ attachedSheet])
+  // If multiple sheets are open, they must all be closed.
+  while ([window_ attachedSheet]) {
     [window_ endSheet:[window_ attachedSheet]];
+  }
+  DCHECK_EQ([[window_ sheets] count], 0UL);
 
   // window_ could be nil after performClose.
   bool should_notify = is_modal() && parent() && IsVisible();

filename: spec/api-browser-window-spec.ts
patch: @@ -116,6 +116,14 @@ describe('BrowserWindow module', () => {
       await closed;
     });
 
+    it('should work if called when multiple messageBoxes are showing', async () => {
+      const closed = once(w, 'closed');
+      dialog.showMessageBox(w, { message: 'Hello Error' });
+      dialog.showMessageBox(w, { message: 'Hello Error' });
+      w.close();
+      await closed;
+    });
+
     it('closes window without rounded corners', async () => {
       await closeWindow(w);
       w = new BrowserWindow({ show: false, frame: false, roundedCorners: false });
Repository: facebook/react
Pull request: [DevTool] fix build-for-devtools script


## Summary

Add back `react-dom/test-utils` to `yarn build-for-devtools` as it's still used by tests such as `yarn test --build --project=devtools -r=experimental`


<!--
 Explain the **motivation** for making this change. What existing problem does the pull request solve?
-->

## How did you test this change?

```
yarn build-for-devtools
yarn test --build --project=devtools -r=experimental
```


Changed files:
filename: package.json
patch: @@ -108,7 +108,7 @@
   "scripts": {
     "build": "node ./scripts/rollup/build.js",
     "build-combined": "node ./scripts/rollup/build-all-release-channels.js",
-    "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom/index,react-dom/unstable_testing,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE && cp -r ./build/node_modules build/oss-experimental/",
+    "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react-dom/index,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE && cp -r ./build/node_modules build/oss-experimental/",
     "build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",
     "build-for-devtools-prod": "yarn build-for-devtools --type=NODE_PROD",
     "linc": "node ./scripts/tasks/linc.js",
Repository: denoland/deno
Pull request: BREAKING(io): remove `Deno.Seeker[Sync]`

Towards #22079

Changed files:
filename: cli/tsc/dts/lib.deno.ns.d.ts
patch: @@ -1669,47 +1669,6 @@ declare namespace Deno {
     End = 2,
   }
 
-  /**
-   * An abstract interface which when implemented provides an interface to seek
-   * within an open file/resource asynchronously.
-   *
-   * @category I/O */
-  export interface Seeker {
-    /** Seek sets the offset for the next `read()` or `write()` to offset,
-     * interpreted according to `whence`: `Start` means relative to the
-     * start of the file, `Current` means relative to the current offset,
-     * and `End` means relative to the end. Seek resolves to the new offset
-     * relative to the start of the file.
-     *
-     * Seeking to an offset before the start of the file is an error. Seeking to
-     * any positive offset is legal, but the behavior of subsequent I/O
-     * operations on the underlying object is implementation-dependent.
-     *
-     * It resolves with the updated offset.
-     */
-    seek(offset: number | bigint, whence: SeekMode): Promise<number>;
-  }
-
-  /**
-   * An abstract interface which when implemented provides an interface to seek
-   * within an open file/resource synchronously.
-   *
-   * @category I/O */
-  export interface SeekerSync {
-    /** Seek sets the offset for the next `readSync()` or `writeSync()` to
-     * offset, interpreted according to `whence`: `Start` means relative
-     * to the start of the file, `Current` means relative to the current
-     * offset, and `End` means relative to the end.
-     *
-     * Seeking to an offset before the start of the file is an error. Seeking to
-     * any positive offset is legal, but the behavior of subsequent I/O
-     * operations on the underlying object is implementation-dependent.
-     *
-     * It returns the updated offset.
-     */
-    seekSync(offset: number | bigint, whence: SeekMode): number;
-  }
-
   /** Open a file and resolve to an instance of {@linkcode Deno.FsFile}. The
    * file does not need to previously exist if using the `create` or `createNew`
    * open options. The caller may have the resulting file automatically closed
@@ -1814,7 +1773,7 @@ declare namespace Deno {
    *
    * @category File System
    */
-  export class FsFile implements Seeker, SeekerSync, Disposable {
+  export class FsFile implements Disposable {
     /** A {@linkcode ReadableStream} instance representing to the byte contents
      * of the file. This makes it easy to interoperate with other web streams
      * based APIs.
Repository: huggingface/transformers
Pull request: [offload] respect `max_memory` argument when factoring in unused reserved memory

# What does this PR do?

Our daily CI had >1000 new failures since #37920, on tests that use the `max_memory` argument in `from_pretrained`. This is because we now recapture unused reserved GPU memory, which caused us to go beyond the user-defined `max_memory`. This PR fixes it.

Affected tests, which set `max_memory`:
- `test_cpu_offload`
- `test_disk_offload_bin`
- `test_model_parallelism`

Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -1275,28 +1275,31 @@ def _get_device_map(
             )
 
         if device_map != "sequential":
-            max_memory = get_balanced_memory(
+            inferred_max_memory = get_balanced_memory(
                 model,
                 dtype=target_dtype,
                 low_zero=(device_map == "balanced_low_0"),
                 max_memory=max_memory,
                 **device_map_kwargs,
             )
         else:
-            max_memory = get_max_memory(max_memory)
+            inferred_max_memory = get_max_memory(max_memory)
         if hf_quantizer is not None:
-            max_memory = hf_quantizer.adjust_max_memory(max_memory)
+            inferred_max_memory = hf_quantizer.adjust_max_memory(inferred_max_memory)
 
-        # `max_memory` contains non-reserved memory. There may be *unused* reserved memory in the GPU, which we
-        # can use to allocate parameters.
-        for device_name in max_memory.keys():
+        # `inferred_max_memory` contains non-reserved memory. There may be *unused* reserved memory in the GPU,
+        # which we can use to allocate parameters.
+        for device_name in inferred_max_memory.keys():
             if isinstance(device_name, int):  # it's a GPU device
                 if is_torch_xpu_available():
                     unused_memory = torch.xpu.memory_reserved(device_name) - torch.xpu.memory_allocated(device_name)
                 else:
                     unused_memory = torch.cuda.memory_reserved(device_name) - torch.cuda.memory_allocated(device_name)
-                max_memory[device_name] += unused_memory
-        device_map_kwargs["max_memory"] = max_memory
+                inferred_max_memory[device_name] += unused_memory
+            # respect the `max_memory` passed by the user
+            if max_memory is not None and device_name in max_memory:
+                inferred_max_memory[device_name] = min(inferred_max_memory[device_name], max_memory[device_name])
+        device_map_kwargs["max_memory"] = inferred_max_memory
 
         device_map = infer_auto_device_map(model, dtype=target_dtype, **device_map_kwargs)
Repository: ggml-org/llama.cpp
Pull request: llama : fix KV shift for qwen2vl

Fix #13865 

Provided a model with 3 mrope sections, a rotated vector looks like this: `[time, time+x, time+y]`

This works with the assumption that mrope with `x == y == 0` is identical to doing a neox rope with theta = `+time`

For example, when we want to shift the `time` to `time-1`, that mean we shift from `[time, time+x, time+y]` to `[time-1, time-1+x, time-1+y]` ; We can simply apply neox rope with theta = `-1` to archive the same effect

Changed files:
filename: src/llama-graph.cpp
patch: @@ -455,7 +455,7 @@ llm_graph_context::llm_graph_context(const llm_graph_params & params) :
     }
 
 int64_t llm_graph_context::n_pos_per_embd() const {
-    return arch == LLM_ARCH_QWEN2VL ? 4 : 1;
+    return hparams.rope_type == LLAMA_ROPE_TYPE_MROPE ? 4 : 1;
 }
 
 void llm_graph_context::cb(ggml_tensor * cur, const char * name, int il) const {

filename: src/llama-kv-cache.cpp
patch: @@ -757,11 +757,19 @@ ggml_tensor * llama_kv_cache_unified::build_rope_shift(
     const auto & yarn_beta_slow  = cparams.yarn_beta_slow;
 
     const auto & n_rot     = hparams.n_rot;
-    const auto & rope_type = hparams.rope_type;
+    const auto & rope_type = hparams.rope_type == LLAMA_ROPE_TYPE_MROPE
+                                // @ngxson : this is a workaround
+                                // for M-RoPE, we want to rotate the whole vector when doing KV shift
+                                // a normal RoPE should work, we just need to use the correct ordering
+                                // ref: https://github.com/ggml-org/llama.cpp/pull/13870
+                                ? LLAMA_ROPE_TYPE_NEOX
+                                : hparams.rope_type;
 
     // See llm_build_deepseek2() for why attn_factor has to be scaled for YaRN RoPE to work correctly.
     // See https://github.com/ggerganov/llama.cpp/discussions/7416 for detailed explanation.
-    const float yarn_attn_factor = model.arch == LLM_ARCH_DEEPSEEK2 ? 1.0f / (1.0f + 0.1f * logf(1.0f / freq_scale)) : cparams.yarn_attn_factor;
+    const float yarn_attn_factor = model.arch == LLM_ARCH_DEEPSEEK2
+                                    ? 1.0f / (1.0f + 0.1f * logf(1.0f / freq_scale))
+                                    : cparams.yarn_attn_factor;
 
     ggml_tensor * tmp;
Repository: nodejs/node
Pull request: test_runner: remove unused errors

It seems that `ERR_TAP_PARSER_ERROR`,`ERR_TAP_LEXER_ERROR` and `ERR_TAP_VALIDATION_ERROR` are no longer used in the codebase.
Does it make sense to perform some housekeeping by removing them?

Changed files:
filename: doc/api/errors.md
patch: @@ -2829,25 +2829,6 @@ An unspecified or non-specific system error has occurred within the Node.js
 process. The error object will have an `err.info` object property with
 additional details.
 
-<a id="ERR_TAP_LEXER_ERROR"></a>
-
-### `ERR_TAP_LEXER_ERROR`
-
-An error representing a failing lexer state.
-
-<a id="ERR_TAP_PARSER_ERROR"></a>
-
-### `ERR_TAP_PARSER_ERROR`
-
-An error representing a failing parser state. Additional information about
-the token causing the error is available via the `cause` property.
-
-<a id="ERR_TAP_VALIDATION_ERROR"></a>
-
-### `ERR_TAP_VALIDATION_ERROR`
-
-This error represents a failed TAP validation.
-
 <a id="ERR_TEST_FAILURE"></a>
 
 ### `ERR_TEST_FAILURE`
@@ -3883,6 +3864,25 @@ removed: v10.0.0
 Used when an attempt is made to use a readable stream that has not implemented
 [`readable._read()`][].
 
+<a id="ERR_TAP_LEXER_ERROR"></a>
+
+### `ERR_TAP_LEXER_ERROR`
+
+An error representing a failing lexer state.
+
+<a id="ERR_TAP_PARSER_ERROR"></a>
+
+### `ERR_TAP_PARSER_ERROR`
+
+An error representing a failing parser state. Additional information about
+the token causing the error is available via the `cause` property.
+
+<a id="ERR_TAP_VALIDATION_ERROR"></a>
+
+### `ERR_TAP_VALIDATION_ERROR`
+
+This error represents a failed TAP validation.
+
 <a id="ERR_TLS_RENEGOTIATION_FAILED"></a>
 
 ### `ERR_TLS_RENEGOTIATION_FAILED`

filename: lib/internal/errors.js
patch: @@ -1739,21 +1739,6 @@ E('ERR_STREAM_WRAP', 'Stream has StringDecoder set or is in objectMode', Error);
 E('ERR_STREAM_WRITE_AFTER_END', 'write after end', Error);
 E('ERR_SYNTHETIC', 'JavaScript Callstack', Error);
 E('ERR_SYSTEM_ERROR', 'A system error occurred', SystemError, HideStackFramesError);
-E('ERR_TAP_LEXER_ERROR', function(errorMsg) {
-  hideInternalStackFrames(this);
-  return errorMsg;
-}, Error);
-E('ERR_TAP_PARSER_ERROR', function(errorMsg, details, tokenCausedError, source) {
-  hideInternalStackFrames(this);
-  this.cause = tokenCausedError;
-  const { column, line, start, end } = tokenCausedError.location;
-  const errorDetails = `${details} at line ${line}, column ${column} (start ${start}, end ${end})`;
-  return errorMsg + errorDetails;
-}, SyntaxError);
-E('ERR_TAP_VALIDATION_ERROR', function(errorMsg) {
-  hideInternalStackFrames(this);
-  return errorMsg;
-}, Error);
 E('ERR_TEST_FAILURE', function(error, failureType) {
   hideInternalStackFrames(this);
   assert(typeof failureType === 'string' || typeof failureType === 'symbol',
Repository: nodejs/node
Pull request: doc: tweak info on reposts in ambassador program

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/contributing/advocacy-ambassador-program.md
patch: @@ -94,11 +94,14 @@ process. An ambassador can request promotion of content in the following ways:
 * Posting a link to the content in the "what's new" issue in nodejs/ambassadors
   so that it goes out on the news feed.
 
-Foundation staff will repost the social media post
-without any need for validation based on the request coming from
-an ambassador. These requests can be made through the existing social channel
-in the OpenJS Slack. For that reason and for communication purposes and
-collaboration opportunities, ambassadors should be members of the
+For accounts managed by foundation staff, the staff will repost the social
+media post without any need for validation based on the request coming from
+an ambassador. For accounts managed by the project with an approval process,
+(for example bluesky) documentation for the approval process will indicate
+that repost requests from ambassadors should generally be approved. These
+requests can be made through the existing social channel in the OpenJS Slack.
+For that reason and for communication purposes and collaboration opportunities,
+ambassadors should be members of the
 [OpenJS Slack](https://slack-invite.openjsf.org/).
 
 ## Messages and topics to promote
Repository: ggml-org/llama.cpp
Pull request: convert: small addition to support LlamaModel

Small addition to `LlamaModel` class in `convert_hf_to_gguf.py`to support HuggingFace LlamaModel architecture


Changed files:
filename: convert_hf_to_gguf.py
patch: @@ -1841,7 +1841,8 @@ def prepare_tensors(self):
     "MistralForCausalLM",
     "MixtralForCausalLM",
     "VLlama3ForCausalLM",
-    "LlavaForConditionalGeneration")
+    "LlavaForConditionalGeneration",
+    "LlamaModel")
 class LlamaModel(TextModel):
     model_arch = gguf.MODEL_ARCH.LLAMA
     undo_permute = True
@@ -1921,6 +1922,8 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
 
         if is_vision_tensor:
             return [] # skip vision tensors
+        elif self.hf_arch == "LlamaModel":
+            name = "model." + name
         elif name.startswith("model.text_model"):
             name = name.replace("text_model.", "") # for SmolVLM
         elif name.startswith("language_model."):
Repository: vercel/next.js
Pull request: perf(turbopack): Update `modularize_imports`

### What?

Update `modularize_imports` to reduce memory pressure and possibly reduce the RSS.

### Why?

We should apply https://github.com/swc-project/plugins/pull/449

### How?

 - Closes SWC-648

Closes PACK-4575

Changed files:
filename: Cargo.lock
patch: @@ -3005,7 +3005,7 @@ dependencies = [
  "httpdate",
  "itoa",
  "pin-project-lite",
- "socket2 0.4.9",
+ "socket2 0.5.8",
  "tokio",
  "tower-service",
  "tracing",
@@ -4329,9 +4329,9 @@ dependencies = [
 
 [[package]]
 name = "modularize_imports"
-version = "0.83.0"
+version = "0.83.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36f4d5dedf01a8f57d7d76a57e5c0e58e9f5e3b4eea8782f36689bfd276641ee"
+checksum = "74957b5e9687164f3221cb6f29f55fde71b74f61d6fea41b7b9dfca3670dc25e"
 dependencies = [
  "convert_case",
  "handlebars",
@@ -4510,7 +4510,7 @@ dependencies = [
  "turbopack-node",
  "turbopack-nodejs",
  "turbopack-wasm",
- "vergen 9.0.5",
+ "vergen 9.0.6",
 ]
 
 [[package]]
@@ -10610,8 +10610,8 @@ dependencies = [
 
 [[package]]
 name = "vergen"
-version = "9.0.5"
-source = "git+https://github.com/bgw/vergen.git?branch=bgw%2Fno-optional-locks#0c9698692edd542772619f6db103681a832f61a7"
+version = "9.0.6"
+source = "git+https://github.com/bgw/vergen.git?branch=bgw%2Fno-optional-locks#ebb2f123ed3ab0a409040943b8e20f5c8b480585"
 dependencies = [
  "anyhow",
  "cargo_metadata 0.19.2",
@@ -10623,14 +10623,14 @@ dependencies = [
 
 [[package]]
 name = "vergen-gitcl"
-version = "1.0.6"
-source = "git+https://github.com/bgw/vergen.git?branch=bgw%2Fno-optional-locks#0c9698692edd542772619f6db103681a832f61a7"
+version = "1.0.7"
+source = "git+https://github.com/bgw/vergen.git?branch=bgw%2Fno-optional-locks#ebb2f123ed3ab0a409040943b8e20f5c8b480585"
 dependencies = [
  "anyhow",
  "derive_builder 0.20.2",
  "rustversion",
  "time",
- "vergen 9.0.5",
+ "vergen 9.0.6",
  "vergen-lib 0.1.6 (git+https://github.com/bgw/vergen.git?branch=bgw%2Fno-optional-locks)",
 ]
 
@@ -10648,7 +10648,7 @@ dependencies = [
 [[package]]
 name = "vergen-lib"
 version = "0.1.6"
-source = "git+https://github.com/bgw/vergen.git?branch=bgw%2Fno-optional-locks#0c9698692edd542772619f6db103681a832f61a7"
+source = "git+https://github.com/bgw/vergen.git?branch=bgw%2Fno-optional-locks#ebb2f123ed3ab0a409040943b8e20f5c8b480585"
 dependencies = [
  "anyhow",
  "derive_builder 0.20.2",

filename: Cargo.toml
patch: @@ -307,7 +307,7 @@ testing = { version = "10.0.0" }
 browserslist-rs = { version = "0.18.0" }
 miette = { version = "5.10.0", features = ["fancy"] }
 mdxjs = "1.0.1"
-modularize_imports = { version = "0.83.0" }
+modularize_imports = { version = "0.83.1" }
 styled_components = { version = "0.111.0" }
 styled_jsx = { version = "0.87.0" }
 swc_emotion = { version = "0.87.0" }
Repository: nodejs/node
Pull request: doc: add type stripping to ambassadors program

Adding type stripping to the messages we would like ambassadors.
I rushed the goals, feel free to suggest refinements.


@nodejs/tsc for visibility

Changed files:
filename: doc/contributing/advocacy-ambassador-program.md
patch: @@ -218,3 +218,30 @@ Some of the things to highlight include:
 * @marco-ippolito
 
 You can find their contact email in the [`README.md`](../../README.md#tsc-technical-steering-committee)
+
+#### Node.js Type Stripping
+
+##### Goal
+
+The goal is to raise awareness of the Node.js TypeScript Type Stripping in the JavaScript ecosystem.
+Some of the things to highlight include:
+
+* The benefits and limitations of the current implementation.
+* The `tsconfig.json` configuration options to use in combination for type checking.
+* Updates on the implementation advancements.
+
+#### Related Links
+
+<!-- lint disable prohibited-strings remark-lint-->
+
+* <https://github.com/nodejs/typescript>
+* <https://nodejs.org/api/typescript.html>
+* <https://nodejs.org/en/learn/typescript/run-natively>
+* <https://satanacchio.hashnode.dev/everything-you-need-to-know-about-nodejs-type-stripping>
+* <https://github.com/nodejs/amaro>
+
+<!-- lint enable prohibited-strings remark-lint-->
+
+#### Project contacts
+
+* @marco-ippolito
Repository: denoland/deno
Pull request: feat(ext/node): export 'promises' symbol from 'node:timers'


Changed files:
filename: ext/node/polyfills/timers.ts
patch: @@ -89,6 +89,22 @@ export function clearImmediate(immediate: Immediate) {
   clearTimeout_(immediate._immediateId);
 }
 
+export const promises = {
+  setTimeout: promisify(setTimeout),
+  setImmediate: promisify(setImmediate),
+  setInterval: promisify(setInterval),
+};
+
+promises.scheduler = {
+  async wait(
+    delay: number,
+    options?: { signal?: AbortSignal },
+  ): Promise<void> {
+    return await promises.setTimeout(delay, undefined, options);
+  },
+  yield: promises.setImmediate,
+};
+
 export default {
   setTimeout,
   clearTimeout,
@@ -97,4 +113,5 @@ export default {
   setImmediate,
   setUnrefTimeout,
   clearImmediate,
+  promises,
 };

filename: ext/node/polyfills/timers/promises.ts
patch: @@ -1,17 +1,11 @@
 // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { promisify } from "node:util";
 import timers from "node:timers";
 
-export const setTimeout = promisify(timers.setTimeout),
-  setImmediate = promisify(timers.setImmediate),
-  setInterval = promisify(timers.setInterval);
+export const setTimeout = timers.promises.setTimeout;
+export const setImmediate = timers.promises.setImmediate;
+export const setInterval = timers.promises.setInterval;
 
-export const scheduler = {
-  async wait(delay: number, options?: { signal?: AbortSignal }): Promise<void> {
-    return await setTimeout(delay, undefined, options);
-  },
-  yield: setImmediate,
-};
+export const scheduler = timers.promises.scheduler;
 
 export default {
   setTimeout,