helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: Fix convert to original state dict for VLMs

# What does this PR do?

#37033 introduces the base models for all VLMs. The model weights will be converted by mapping the original keys according to
https://github.com/huggingface/transformers/blob/701caef704e356dc2f9331cc3fd5df0eccb4720a/src/transformers/models/qwen2_vl/modeling_qwen2_vl.py#L1735-L1738

However, the previous implementation of Transformers could not properly convert the weights back due to existing bugs (`replacement = re.sub(r"\(.*?\)", "", pattern)` -> `replacement = re.sub(r"\(.*?\)", "", replacement)`) and the lack of support for nested parentheses
https://github.com/huggingface/transformers/blob/701caef704e356dc2f9331cc3fd5df0eccb4720a/src/transformers/modeling_utils.py#L3644-L3657

We want to provide a more accurate weight conversion implementation to prevent issues with third-party apps.
https://github.com/hiyouga/LLaMA-Factory/issues/8147

## Before submitting
- [ ] 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.
- [ ] 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?


## Who can review?

@ArthurZucker @zucchini-nlp 

Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -3653,7 +3653,7 @@ def save_pretrained(
             for key, value in state_dict.items():
                 for pattern, replacement in reverse_key_mapping.items():
                     replacement = replacement.lstrip("^")  # strip off un-needed chars and patterns
-                    replacement = re.sub(r"\(.*?\)", "", pattern)
+                    replacement = re.sub(r"\(.*\)", "", replacement)
                     key, n_replace = re.subn(pattern, replacement, key)
                     # Early exit of the loop
                     if n_replace > 0:
Repository: huggingface/transformers
Pull request: protect dtensor import 

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/38494
The import was not protected correctly, hence users who had torch < 2.5 faced issue when saving the model. This PR fixes this. 

Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -37,7 +37,6 @@
 from zipfile import is_zipfile
 
 import torch
-import torch.distributed.tensor
 from huggingface_hub import split_torch_state_dict_into_shards
 from packaging import version
 from torch import Tensor, nn

filename: src/transformers/pytorch_utils.py
patch: @@ -42,9 +42,6 @@
 # Cache this result has it's a C FFI call which can be pretty time-consuming
 _torch_distributed_available = torch.distributed.is_available()
 
-if is_torch_greater_or_equal("2.5") and _torch_distributed_available:
-    pass
-
 
 def softmax_backward_data(parent, grad_output, output, dim, self):
     """
@@ -296,7 +293,7 @@ def id_tensor_storage(tensor: torch.Tensor) -> tuple[torch.device, int, int]:
     guaranteed to be unique and constant for this tensor's storage during its lifetime. Two tensor storages with
     non-overlapping lifetimes may have the same id.
     """
-    if is_torch_greater_or_equal_than_2_0:
+    if _torch_distributed_available and is_torch_greater_or_equal("2.5"):
         from torch.distributed.tensor import DTensor
 
         if isinstance(tensor, DTensor):
Repository: denoland/deno
Pull request: fix(ext/cache): gracefully error when cache creation failed

Removes panic reported in https://github.com/denoland/deno/issues/26893

Changed files:
filename: ext/cache/sqlite.rs
patch: @@ -8,6 +8,7 @@ use std::time::SystemTime;
 use std::time::UNIX_EPOCH;
 
 use async_trait::async_trait;
+use deno_core::anyhow::Context;
 use deno_core::error::AnyError;
 use deno_core::futures::future::poll_fn;
 use deno_core::parking_lot::Mutex;
@@ -45,7 +46,13 @@ impl SqliteBackedCache {
   pub fn new(cache_storage_dir: PathBuf) -> Result<Self, CacheError> {
     {
       std::fs::create_dir_all(&cache_storage_dir)
-        .expect("failed to create cache dir");
+        .with_context(|| {
+          format!(
+            "Failed to create cache storage directory {}",
+            cache_storage_dir.display()
+          )
+        })
+        .map_err(CacheError::Other)?;
       let path = cache_storage_dir.join("cache_metadata.db");
       let connection = rusqlite::Connection::open(&path).unwrap_or_else(|_| {
         panic!("failed to open cache db at {}", path.display())
Repository: facebook/react
Pull request: [DiffTrain] Use original commit message

Instead of the current commit message (which just shows "Build for
<sha>", re-use the commit message from the origin commit instead.

Changed files:
filename: .github/workflows/commit_artifacts.yml
patch: @@ -146,7 +146,10 @@ jobs:
       - name: Commit changes to branch
         uses: stefanzweifel/git-auto-commit-action@v4
         with:
-          commit_message: Build for ${{ github.sha }}
+          commit_message: |
+            ${{ github.event.head_commit.message }}
+
+            DiffTrain build for `${{ github.sha }}`
           branch: builds/facebook-www
           commit_user_name: ${{ github.actor }}
           commit_user_email: ${{ github.actor }}@users.noreply.github.com
Repository: electron/electron
Pull request: perf: use v8::String::NewFromUtf8Literal in ToV8() gin converter

#### Description of Change

Use `v8::String::NewFromUtf8Literal()` instead of `v8::String::NewFromUtf8()` when the string literal size is known at compile time. This avoids a little bit of overhead of v8 having to call strlen() and ToLocalChecked().

#### Checklist

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [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: shell/common/gin_converters/std_converter.h
patch: @@ -70,12 +70,10 @@ struct Converter<char[]> {
   }
 };
 
-template <size_t n>
-struct Converter<char[n]> {
-  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const char* val) {
-    return v8::String::NewFromUtf8(isolate, val, v8::NewStringType::kNormal,
-                                   n - 1)
-        .ToLocalChecked();
+template <size_t N>
+struct Converter<char[N]> {
+  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const char (&val)[N]) {
+    return v8::String::NewFromUtf8Literal(isolate, val);
   }
 };
Repository: huggingface/transformers
Pull request: Update docker image to use `av==10.0.0`

# What does this PR do?

Docker image is failing to build, as 9.2.0 wheel is removed, see 

https://github.com/PyAV-Org/PyAV/issues/1906#issuecomment-2899577746

Failing job: https://github.com/huggingface/transformers/actions/runs/15079790825/job/42394494171

Changed files:
filename: docker/transformers-all-latest-gpu/Dockerfile
patch: @@ -45,7 +45,7 @@ RUN python3 -m pip install --no-cache-dir git+https://github.com/huggingface/pef
 RUN python3 -m pip install --no-cache-dir git+https://github.com/huggingface/optimum@main#egg=optimum
 
 # For video model testing
-RUN python3 -m pip install --no-cache-dir av==9.2.0
+RUN python3 -m pip install --no-cache-dir av
 
 # Some slow tests require bnb
 RUN python3 -m pip install --no-cache-dir bitsandbytes
Repository: huggingface/transformers
Pull request: Don't use default attn if pre-set in sub-config

# What does this PR do?

As per title, so we can do smth like below. In current state the value will be overwritten with default `None`

Might be breaking if the configs on the hub have a certain attention implementation saved in sub-config level only. Though I don't think any model has it saved that way

```python
config.text_config.attn_implementation = "vllm"
AutoMode.from_config(config)
```



Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -2277,8 +2277,13 @@ def _autoset_attn_implementation(
                 if not isinstance(requested_attn_implementation, dict)
                 else requested_attn_implementation.get(key, None)
             )
-            # For models with backbone sub-config might be not initialized
-            if sub_config is not None:
+            # For models with backbone sub-config might be not initialized. Set the requested att
+            # if the config hasn't got any attn pre-set and the requested attn in not `None` (i.e not the default attn)
+            if (
+                sub_config is not None
+                and sub_config._attn_implementation_internal is None
+                and curr_attn_implementation is not None
+            ):
                 sub_config._attn_implementation_internal = curr_attn_implementation
 
         if config._attn_implementation == "flash_attention_2":

filename: tests/test_modeling_common.py
patch: @@ -3425,6 +3425,13 @@ def test_attn_implementation_composite_models(self):
                         f"The eager model should not have SDPA/FA2 attention layers but got `{class_name}.config._attn_implementation={submodule.config._attn_implementation}`"
                     )
 
+            # Set the attention to default `None` but the text config to `eager`
+            # The model should load encoders in SDPA but not the text attention
+            config._attn_implementation = None
+            config.get_text_config(decoder=True)._attn_implementation = "eager"
+            model = model_class(config)
+            self.assertTrue(model.config.get_text_config(decoder=True)._attn_implementation == "eager")
+
     @require_torch_sdpa
     def test_sdpa_can_dispatch_non_composite_models(self):
         """
Repository: denoland/deno
Pull request: fix: update message for unsupported schemes with npm and jsr

Not the pretties fix, but does the job.

Closes https://github.com/denoland/deno/issues/26596

Changed files:
filename: cli/file_fetcher.rs
patch: @@ -164,8 +164,19 @@ fn get_validated_scheme(
 ) -> Result<String, AnyError> {
   let scheme = specifier.scheme();
   if !SUPPORTED_SCHEMES.contains(&scheme) {
+    // NOTE(bartlomieju): this message list additional `npm` and `jsr` schemes, but they should actually be handled
+    // before `file_fetcher.rs` APIs are even hit.
+    let mut all_supported_schemes = SUPPORTED_SCHEMES.to_vec();
+    all_supported_schemes.extend_from_slice(&["npm", "jsr"]);
+    all_supported_schemes.sort();
+    let scheme_list = all_supported_schemes
+      .iter()
+      .map(|scheme| format!(" - \"{}\"", scheme))
+      .collect::<Vec<_>>()
+      .join("\n");
     Err(generic_error(format!(
-      "Unsupported scheme \"{scheme}\" for module \"{specifier}\". Supported schemes: {SUPPORTED_SCHEMES:#?}"
+      "Unsupported scheme \"{scheme}\" for module \"{specifier}\". Supported schemes:\n{}", 
+      scheme_list
     )))
   } else {
     Ok(scheme.to_string())

filename: tests/specs/npm/typo_in_npm/__test__.jsonc
patch: @@ -0,0 +1,5 @@
+{
+  "args": "run np:cowsay",
+  "output": "main.out",
+  "exitCode": 1
+}

filename: tests/specs/npm/typo_in_npm/main.out
patch: @@ -0,0 +1,8 @@
+error: Unsupported scheme "np" for module "np:cowsay". Supported schemes:
+ - "blob"
+ - "data"
+ - "file"
+ - "http"
+ - "https"
+ - "jsr"
+ - "npm"

filename: tests/specs/run/unsupported_dynamic_import_scheme/unsupported_dynamic_import_scheme.out
patch: @@ -1,7 +1,8 @@
-error: Uncaught (in promise) TypeError: Unsupported scheme "xxx" for module "xxx:". Supported schemes: [
-    "data",
-    "blob",
-    "file",
-    "http",
-    "https",
-]
+error: Uncaught (in promise) TypeError: Unsupported scheme "xxx" for module "xxx:". Supported schemes:
+ - "blob"
+ - "data"
+ - "file"
+ - "http"
+ - "https"
+ - "jsr"
+ - "npm"

filename: tests/testdata/run/extension_import.ts.out
patch: @@ -1,8 +1,9 @@
-error: Unsupported scheme "ext" for module "ext:runtime/01_errors.js". Supported schemes: [
-    "data",
-    "blob",
-    "file",
-    "http",
-    "https",
-]
+error: Unsupported scheme "ext" for module "ext:runtime/01_errors.js". Supported schemes:
+ - "blob"
+ - "data"
+ - "file"
+ - "http"
+ - "https"
+ - "jsr"
+ - "npm"
     at [WILDCARD]/extension_import.ts:1:8
Repository: nodejs/node
Pull request: test: resolve race condition in test-net-write-fully-async-*


Changed files:
filename: test/parallel/test-net-write-fully-async-buffer.js
patch: @@ -11,14 +11,14 @@ const data = Buffer.alloc(1000000);
 
 const server = net.createServer(common.mustCall(function(conn) {
   conn.resume();
+  server.close();
 })).listen(0, common.mustCall(function() {
   const conn = net.createConnection(this.address().port, common.mustCall(() => {
     let count = 0;
 
     function writeLoop() {
-      if (count++ === 200) {
-        conn.destroy();
-        server.close();
+      if (count++ === 20) {
+        conn.end();
         return;
       }
 

filename: test/parallel/test-net-write-fully-async-hex-string.js
patch: @@ -9,14 +9,14 @@ const data = Buffer.alloc(1000000).toString('hex');
 
 const server = net.createServer(common.mustCall(function(conn) {
   conn.resume();
+  server.close();
 })).listen(0, common.mustCall(function() {
   const conn = net.createConnection(this.address().port, common.mustCall(() => {
     let count = 0;
 
     function writeLoop() {
       if (count++ === 20) {
-        conn.destroy();
-        server.close();
+        conn.end();
         return;
       }
Repository: vercel/next.js
Pull request: Turbopack Build: Fix CSS test

## What?

Updates the check as it's slightly different with Turbopack.

Closes PACK-4752

Changed files:
filename: test/integration/css-features/test/css-modules.test.js
patch: @@ -56,9 +56,16 @@ describe('Custom Properties: Fail for global element in CSS Modules', () => {
           stderr: true,
         })
         expect(code).not.toBe(0)
-        expect(stderr).toContain('Failed to compile')
-        expect(stderr).toContain('pages/styles.module.css')
-        expect(stderr).toContain('Selector "h1" is not pure')
+        if (process.env.IS_TURBOPACK_TEST) {
+          expect(stderr).toContain('pages/styles.module.css')
+          expect(stderr).toContain(
+            'Selector is not pure (pure selectors must contain at least one local class or id)'
+          )
+        } else {
+          expect(stderr).toContain('Failed to compile')
+          expect(stderr).toContain('pages/styles.module.css')
+          expect(stderr).toContain('Selector "h1" is not pure')
+        }
       })
     }
   )

filename: test/turbopack-build-tests-manifest.json
patch: @@ -10208,11 +10208,11 @@
   },
   "test/integration/css-features/test/css-modules.test.js": {
     "passed": [
-      "CSS Modules: Import Global CSS production mode should've emitted a single CSS file"
+      "CSS Modules: Import Global CSS production mode should've emitted a single CSS file",
+      "Custom Properties: Fail for global element in CSS Modules production mode should fail to build"
     ],
     "failed": [
-      "CSS Modules: Importing Invalid Global CSS production mode should fail to build",
-      "Custom Properties: Fail for global element in CSS Modules production mode should fail to build"
+      "CSS Modules: Importing Invalid Global CSS production mode should fail to build"
     ],
     "pending": [
       "CSS Modules: Import Exports production mode should've emitted a single CSS file",
Repository: facebook/react
Pull request: Add component name to StrictMode error message

The error message to warn user about state update coming from inside an update function does not contain name of the offending component. Other warnings StrictMode has, always have offending component mentioned in top level error message. 


Previous error message:
```
An update (setState, replaceState, or forceUpdate) was scheduled 
from inside an update function. Update functions should be pure
with zero side-effects. Consider using componentDidUpdate or a
callback.
```

New error message:
```
An update (setState, replaceState, or forceUpdate) was scheduled 
from inside an update function. Update functions should be pure
with zero side-effects. Consider using componentDidUpdate or a
callback.

Please update the following component: Foo
```

Changed files:
filename: packages/react-reconciler/src/ReactFiberClassUpdateQueue.js
patch: @@ -108,6 +108,7 @@ import {
   ShouldCapture,
   DidCapture,
 } from './ReactFiberFlags';
+import getComponentNameFromFiber from './getComponentNameFromFiber';
 
 import {debugRenderPhaseSideEffectsForStrictMode} from 'shared/ReactFeatureFlags';
 
@@ -239,11 +240,13 @@ export function enqueueUpdate<State>(
       currentlyProcessingQueue === sharedQueue &&
       !didWarnUpdateInsideUpdate
     ) {
+      const componentName = getComponentNameFromFiber(fiber);
       console.error(
         'An update (setState, replaceState, or forceUpdate) was scheduled ' +
           'from inside an update function. Update functions should be pure, ' +
           'with zero side-effects. Consider using componentDidUpdate or a ' +
-          'callback.',
+          'callback.\n\nPlease update the following component: %s',
+        componentName,
       );
       didWarnUpdateInsideUpdate = true;
     }

filename: packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js
patch: @@ -474,7 +474,7 @@ describe('ReactIncrementalUpdates', () => {
       'An update (setState, replaceState, or forceUpdate) was scheduled ' +
         'from inside an update function. Update functions should be pure, ' +
         'with zero side-effects. Consider using componentDidUpdate or a ' +
-        'callback.',
+        'callback.\n\nPlease update the following component: Foo',
     );
     expect(instance.state).toEqual({a: 'a', b: 'b'});
Repository: huggingface/transformers
Pull request: Remove type annotation in Siglip Attention Module

As per the title, it removes the type annotation that causes issues when using Modular as we don't usually have both text and vision config for all the models. Since SigLIP is commonly used in VLMs as vision backbone, and the Attention module is a quite generic so this allows us more flexibility in using Modular.


Changed files:
filename: src/transformers/models/siglip/modeling_siglip.py
patch: @@ -370,7 +370,7 @@ def eager_attention_forward(
 class SiglipAttention(nn.Module):
     """Multi-headed attention from 'Attention Is All You Need' paper"""
 
-    def __init__(self, config: Union[SiglipVisionConfig, SiglipTextConfig]):
+    def __init__(self, config):
         super().__init__()
         self.config = config
         self.embed_dim = config.hidden_size

filename: src/transformers/models/siglip2/modeling_siglip2.py
patch: @@ -264,7 +264,7 @@ def eager_attention_forward(
 class Siglip2Attention(nn.Module):
     """Multi-headed attention from 'Attention Is All You Need' paper"""
 
-    def __init__(self, config: Union[Siglip2VisionConfig, Siglip2TextConfig]):
+    def __init__(self, config):
         super().__init__()
         self.config = config
         self.embed_dim = config.hidden_size

filename: tests/test_modeling_common.py
patch: @@ -739,7 +739,6 @@ def check_determinism(first, second):
             model = model_class(config)
             model.to(torch_device)
             model.eval()
-            print(model_class)
             with torch.no_grad():
                 first = model(**self._prepare_for_class(inputs_dict, model_class))[0]
                 second = model(**self._prepare_for_class(inputs_dict, model_class))[0]
Repository: nodejs/node
Pull request: doc: reserve NMV 135 for Electron 36

<!--
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.
-->

Reserving NMV 135 for Electron 36.

Changed files:
filename: doc/abi_version_registry.json
patch: @@ -1,5 +1,6 @@
 {
   "NODE_MODULE_VERSION": [
+    { "modules": 135,"runtime": "electron", "variant": "electron",             "versions": "36" },
     { "modules": 134,"runtime": "node",     "variant": "v8_13.0",              "versions": "24.0.0-pre" },
     { "modules": 133,"runtime": "electron", "variant": "electron",             "versions": "35" },
     { "modules": 132,"runtime": "electron", "variant": "electron",             "versions": "34" },
Repository: ggml-org/llama.cpp
Pull request: Add CMake presets for Linux and GCC


Changed files:
filename: CMakePresets.json
patch: @@ -55,6 +55,17 @@
             "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/arm64-apple-clang.cmake"
         }
     },
+    {
+        "name": "x64-linux-gcc", "hidden": true,
+        "cacheVariables": {
+            "CMAKE_C_COMPILER": "gcc",
+            "CMAKE_CXX_COMPILER": "g++"
+        }
+    },
+    { "name": "x64-linux-gcc-debug", "inherits": [ "base", "x64-linux-gcc", "debug" ] },
+    { "name": "x64-linux-gcc-release", "inherits": [ "base", "x64-linux-gcc", "release" ] },
+    { "name": "x64-linux-gcc-reldbg", "inherits": [ "base", "x64-linux-gcc", "reldbg" ] },
+    { "name": "x64-linux-gcc+static-release", "inherits": [ "base", "x64-linux-gcc", "release", "static" ] },
 
     { "name": "arm64-windows-llvm-debug", "inherits": [ "base", "arm64-windows-llvm", "debug" ] },
     { "name": "arm64-windows-llvm-release", "inherits": [ "base", "arm64-windows-llvm", "reldbg" ] },