helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: fix: register `PrintDialogLinuxFactory` on Linux

Backport of #50430

See that PR for details.


Notes: Fixed printing on Linux failing with "Invalid printer settings".

Changed files:
filename: shell/browser/electron_browser_main_parts.cc
patch: @@ -127,6 +127,10 @@
 #include "shell/common/plugin_info.h"
 #endif  // BUILDFLAG(ENABLE_PLUGINS)
 
+#if BUILDFLAG(ENABLE_PRINTING)
+#include "components/printing/common/print_dialog_linux_factory.h"
+#endif
+
 namespace electron {
 
 namespace {
@@ -415,6 +419,10 @@ void ElectronBrowserMainParts::ToolkitInitialized() {
 
   ui::LinuxUi::SetInstance(linux_ui);
 
+#if BUILDFLAG(ENABLE_PRINTING)
+  print_dialog_factory_ = std::make_unique<printing::PrintDialogLinuxFactory>();
+#endif
+
   // Cursor theme changes are tracked by LinuxUI (via a CursorThemeManager
   // implementation). Start observing them once it's initialized.
   ui::CursorFactory::GetInstance()->ObserveThemeChanges();

filename: shell/browser/electron_browser_main_parts.h
patch: @@ -14,8 +14,13 @@
 #include "content/public/browser/browser_main_parts.h"
 #include "electron/buildflags/buildflags.h"
 #include "mojo/public/cpp/bindings/remote.h"
+#include "printing/buildflags/buildflags.h"
 #include "services/device/public/mojom/geolocation_control.mojom.h"
 
+#if BUILDFLAG(ENABLE_PRINTING)
+#include "printing/printing_context_linux.h"
+#endif
+
 class BrowserProcessImpl;
 class IconManager;
 
@@ -179,6 +184,11 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
   std::unique_ptr<display::ScopedNativeScreen> screen_;
 #endif
 
+#if BUILDFLAG(ENABLE_PRINTING)
+  std::unique_ptr<printing::PrintingContextLinux::PrintDialogFactory>
+      print_dialog_factory_;
+#endif
+
   static ElectronBrowserMainParts* self_;
 };
Repository: nodejs/node
Pull request: tools: ignore CVE mention when linting release proposals

The job is failing on the security release proposal because it doesn't expect the CVE mention. A simple fix is to simply remove them.

<!--
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: .github/workflows/lint-release-proposal.yml
patch: @@ -39,7 +39,7 @@ jobs:
           EXPECTED_TRAILER="^$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pull/[[:digit:]]+\$"
           echo "Expected trailer format: $EXPECTED_TRAILER"
           PR_URL="$(git --no-pager log -1 --format='%(trailers:key=PR-URL,valueonly)')"
-          echo "Actual: $ACTUAL"
+          echo "Actual: $PR_URL"
           echo "$PR_URL" | grep -E -q "$EXPECTED_TRAILER"
 
           PR_HEAD="$(gh pr view "$PR_URL" --json headRefOid -q .headRefOid)"

filename: tools/actions/lint-release-proposal-commit-list.mjs
patch: @@ -34,6 +34,7 @@ if (commitListingStart === -1) {
 // Normalize for consistent comparison
 commitList = commitList
   .replaceAll('**(SEMVER-MINOR)** ', '')
+  .replaceAll(/(?<= - )\*\*\(CVE-\d{4}-\d+\)\*\* (?=\*\*)/g, '')
   .replaceAll('\\', '');
 
 let expectedNumberOfCommitsLeft = commitList.match(/\n\* \[/g)?.length ?? 0;
Repository: ollama/ollama
Pull request: anthropic: do not count image tokens for now


Changed files:
filename: anthropic/anthropic.go
patch: @@ -897,11 +897,5 @@ func countContentBlock(block any) int {
 		}
 	}
 
-	if source, ok := blockMap["source"].(map[string]any); ok {
-		if data, ok := source["data"].(string); ok {
-			total += len(data)
-		}
-	}
-
 	return total
 }
Repository: huggingface/transformers
Pull request: fix: set `clean_up_tokenization_spaces=False` in Llama 3 tokenizer conversion

## What does this PR do?

The `Llama3Converter` in `convert_llama_weights_to_hf.py` hardcodes `clean_up_tokenization_spaces=True` (line 468). This causes `tokenizer.decode()` to silently strip spaces before punctuation for all converted Llama 3 models, producing incorrect decoded text.

`clean_up_tokenization_spaces` applies BERT-era string replacements (` .` → `.`, ` ?` → `?`, etc.) that are destructive for Llama 3's BPE tokenizer. Llama 2's `LlamaTokenizer` explicitly set this to `False`, and Llama 4 ships with `False`. The `True` was introduced in #30334 by inheriting the library default, then explicitly hardcoded in #33778 for backward compatibility.

### Minimal reproduction

```python
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
text = "x != y and a.b == c"
ids = tokenizer.encode(text, add_special_tokens=False)
print(repr(tokenizer.decode(ids)))
# 'x!= y and a.b == c'  ← space before != silently dropped
print(repr(tokenizer.decode(ids, clean_up_tokenization_spaces=False)))
# 'x != y and a.b == c'  ← correct
```

Tested across every version of `transformers` from 4.40.0 through 5.3.0 — all produce incorrect decoded text.

Companion fix PRs have been opened on all 24 affected `meta-llama` model repos on the Hub: [Llama-3.1-8B-Instruct discussion #356](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct/discussions/356).

Fixes #35175
Fixes #31187

## 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?
- [x] 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. — #35175, #31187, #32575
- [ ] Did you make sure to update the documentation with your changes?
- [ ] Did you write any new necessary tests?

## Who can review?

@ArthurZucker @itazap — tokenizer maintainers. Arthur previously acknowledged this should be `False` in #35175.

Changed files:
filename: src/transformers/models/llama/convert_llama_weights_to_hf.py
patch: @@ -465,7 +465,7 @@ def __init__(self, vocab_file, special_tokens=None, instruct=False, llama_versio
             eos_token="
" if not instruct else "
",
             model_input_names=["input_ids", "attention_mask"],
             model_max_length=CONTEXT_LENGTH_FOR_VERSION[llama_version],
-            clean_up_tokenization_spaces=True,
+            clean_up_tokenization_spaces=False,
             **additional_kwargs,
         )
         self.update_post_processor(self.converted_tokenizer)
Repository: rust-lang/rust
Pull request: std::net: clamp linger timeout value to prevent silent truncation.

Duration::as_secs() returns u64 but l_linger field type is narrower, c_int on most unix platforms, c_ushort on cygwin and windows. clamping before the cast, consistent with how set_timeout handles this.

Changed files:
filename: library/std/src/sys/net/connection/socket/hermit.rs
patch: @@ -260,7 +260,7 @@ impl Socket {
     pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()> {
         let linger = netc::linger {
             l_onoff: linger.is_some() as i32,
-            l_linger: linger.unwrap_or_default().as_secs() as libc::c_int,
+            l_linger: cmp::min(linger.unwrap_or_default().as_secs(), c_int::MAX as u64) as c_int,
         };
 
         unsafe { setsockopt(self, netc::SOL_SOCKET, netc::SO_LINGER, linger) }

filename: library/std/src/sys/net/connection/socket/solid.rs
patch: @@ -319,7 +319,8 @@ impl Socket {
     pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()> {
         let linger = netc::linger {
             l_onoff: linger.is_some() as netc::c_int,
-            l_linger: linger.unwrap_or_default().as_secs() as netc::c_int,
+            l_linger: cmp::min(linger.unwrap_or_default().as_secs(), netc::c_int::MAX as u64)
+                as netc::c_int,
         };
 
         unsafe { setsockopt(self, netc::SOL_SOCKET, netc::SO_LINGER, linger) }

filename: library/std/src/sys/net/connection/socket/unix.rs
patch: @@ -432,8 +432,8 @@ impl Socket {
     #[cfg(not(target_os = "cygwin"))]
     pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()> {
         let linger = libc::linger {
-            l_onoff: linger.is_some() as libc::c_int,
-            l_linger: linger.unwrap_or_default().as_secs() as libc::c_int,
+            l_onoff: linger.is_some() as c_int,
+            l_linger: cmp::min(linger.unwrap_or_default().as_secs(), c_int::MAX as u64) as c_int,
         };
 
         unsafe { setsockopt(self, libc::SOL_SOCKET, SO_LINGER, linger) }
@@ -443,7 +443,8 @@ impl Socket {
     pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()> {
         let linger = libc::linger {
             l_onoff: linger.is_some() as libc::c_ushort,
-            l_linger: linger.unwrap_or_default().as_secs() as libc::c_ushort,
+            l_linger: cmp::min(linger.unwrap_or_default().as_secs(), libc::c_ushort::MAX as u64)
+                as libc::c_ushort,
         };
 
         unsafe { setsockopt(self, libc::SOL_SOCKET, SO_LINGER, linger) }

filename: library/std/src/sys/net/connection/socket/windows.rs
patch: @@ -413,7 +413,8 @@ impl Socket {
     pub fn set_linger(&self, linger: Option<Duration>) -> io::Result<()> {
         let linger = c::LINGER {
             l_onoff: linger.is_some() as c_ushort,
-            l_linger: linger.unwrap_or_default().as_secs() as c_ushort,
+            l_linger: cmp::min(linger.unwrap_or_default().as_secs(), c_ushort::MAX as u64)
+                as c_ushort,
         };
 
         unsafe { setsockopt(self, c::SOL_SOCKET, c::SO_LINGER, linger) }
Repository: vercel/next.js
Pull request: ci: relax adapter results upload gate

## Summary
- simplify `upload-adapter-test-results` condition to use the effective Next version value
- run upload when version does not start with `http` (allows `canary` and release tags)
- keep existing owner and deploy-script safeguards

## Why
- release runs can have `target_commitish` as a commit SHA, which caused valid canary release runs to skip upload


Changed files:
filename: .github/workflows/test_e2e_deploy_release.yml
patch: @@ -254,9 +254,9 @@ jobs:
         always() &&
         github.event.inputs.deployScriptPath == '' &&
         github.repository_owner == 'vercel' &&
-        (
-          (github.event_name == 'workflow_dispatch' && github.ref_name == 'canary') ||
-          (github.event_name == 'release' && github.event.release.target_commitish == 'canary')
+        !startsWith(
+          github.event.inputs.nextVersion || github.event.release.tag_name || 'canary',
+          'http'
         )
       }}
     runs-on: ubuntu-latest
Repository: nodejs/node
Pull request: deps: V8: override `depot_tools` version

For compatibility with Python >= 3.12 we need a newer version of `depot_tools` than is used for the older versions of V8.

Refs: https://github.com/nodejs/build/pull/4278

--- 

cc @nodejs/v8-update 

This will need to be cherry-picked onto all release lines that we want to run the V8 CI on as it is necessary to run on Ubuntu 24.04 where the default Python 3 is 3.12.

We should also undo it with/after https://github.com/nodejs/node/pull/61898 (or newer V8) as that will set a new enough version of `depot_tools` to be Python 3.12 compatible.

<!--
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: tools/v8/fetch_deps.py
patch: @@ -24,6 +24,8 @@
     "deps_file"   : "DEPS",
     "managed"     : False,
     "custom_deps" : {
+      # Update depot_tools for compatibility with Python 3.12.
+      "v8/third_party/depot_tools"            : "https://chromium.googlesource.com/chromium/tools/depot_tools.git@284c5ccb591c3de4e9f71be4a4beb5d1916d5383",
       # These deps are already part of Node.js.
       "v8/base/trace_event/common"            : None,
       "v8/third_party/abseil-cpp"             : None,
Repository: facebook/react
Pull request: Properly clean up gesture Animations

Follow up to #35337.

During a gesture, we always cancel the original animation and create a new one that we control. That's the one we need to add to the set that needs to be cancelled. Otherwise future gestures hang.

An unfortunate consequence is that any custom ones that you start e.g. with #35556 or through other means aren't automatically cleaned up (in fact there's not even a clean up callback yet). This can lead these to freeze the whole UI afterwards. It would be really good to get this fixed in browsers instead so we can revert #35337. 

Changed files:
filename: packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
patch: @@ -2372,6 +2372,7 @@ function animateGesture(
   targetElement: Element,
   pseudoElement: string,
   timeline: GestureTimeline,
+  viewTransitionAnimations: Array<Animation>,
   customTimelineCleanup: Array<() => void>,
   rangeStart: number,
   rangeEnd: number,
@@ -2464,7 +2465,7 @@ function animateGesture(
   if (timeline instanceof AnimationTimeline) {
     // Native Timeline
     // $FlowFixMe[incompatible-call]
-    targetElement.animate(keyframes, {
+    const animation = targetElement.animate(keyframes, {
       pseudoElement: pseudoElement,
       // Set the timeline to the current gesture timeline to drive the updates.
       timeline: timeline,
@@ -2482,6 +2483,7 @@ function animateGesture(
       rangeStart: (reverse ? rangeEnd : rangeStart) + '%',
       rangeEnd: (reverse ? rangeStart : rangeEnd) + '%',
     });
+    viewTransitionAnimations.push(animation);
   } else {
     // Custom Timeline
     // $FlowFixMe[incompatible-call]
@@ -2554,8 +2556,10 @@ export function startGestureTransition(
         // $FlowFixMe
         const pseudoElement: ?string = effect.pseudoElement;
         if (pseudoElement == null) {
-        } else if (pseudoElement.startsWith('::view-transition')) {
-          viewTransitionAnimations.push(animations[i]);
+        } else if (
+          pseudoElement.startsWith('::view-transition') &&
+          effect.target === documentElement
+        ) {
           const timing = effect.getTiming();
           const duration =
             // $FlowFixMe[prop-missing]
@@ -2648,6 +2652,7 @@ export function startGestureTransition(
             effect.target,
             pseudoElement,
             timeline,
+            viewTransitionAnimations,
             customTimelineCleanup,
             adjustedRangeStart,
             adjustedRangeEnd,
@@ -2675,6 +2680,7 @@ export function startGestureTransition(
                 effect.target,
                 pseudoElementName,
                 timeline,
+                viewTransitionAnimations,
                 customTimelineCleanup,
                 rangeStart,
                 rangeEnd,
@@ -2696,6 +2702,7 @@ export function startGestureTransition(
         duration: 1,
       });
       blockingAnim.pause();
+      viewTransitionAnimations.push(blockingAnim);
       animateCallback();
     };
     // In Chrome, "new" animations are not ready in the ready callback. We have to wait
Repository: huggingface/transformers
Pull request: Add backward compatibility for direct imports from legacy `image_processing_utils_fast`

# What does this PR do?

Add compatibility with remote code importing image_processing_utils_fast modules and methods using `from transformers.image_processing_utils_fast import ...`

Changed files:
filename: src/transformers/__init__.py
patch: @@ -119,6 +119,7 @@
     ],
     "hf_argparser": ["HfArgumentParser"],
     "hyperparameter_search": [],
+    "image_processing_utils_fast": [],
     "image_transforms": [],
     "integrations": [
         "is_clearml_available",
@@ -798,13 +799,15 @@
         extra_objects={"__version__": __version__},
     )
 
-    def _create_tokenization_alias(alias: str, target: str) -> None:
+    def _create_module_alias(alias: str, target: str) -> None:
         """
-        Lazily redirect legacy tokenization module paths to their replacements without importing heavy deps.
+        Lazily redirect legacy module paths to their replacements without importing heavy deps.
         """
-
         module = types.ModuleType(alias)
         module.__doc__ = f"Alias module for backward compatibility with `{target}`."
+        # Set __file__ explicitly so that inspect.py's hasattr(module, '__file__') check
+        # never falls through to __getattr__ and triggers a premature (possibly circular) import.
+        module.__file__ = None
 
         def _get_target():
             return importlib.import_module(target, __name__)
@@ -815,8 +818,9 @@ def _get_target():
         sys.modules[alias] = module
         setattr(sys.modules[__name__], alias.rsplit(".", 1)[-1], module)
 
-    _create_tokenization_alias(f"{__name__}.tokenization_utils_fast", ".tokenization_utils_tokenizers")
-    _create_tokenization_alias(f"{__name__}.tokenization_utils", ".tokenization_utils_sentencepiece")
+    _create_module_alias(f"{__name__}.tokenization_utils_fast", ".tokenization_utils_tokenizers")
+    _create_module_alias(f"{__name__}.tokenization_utils", ".tokenization_utils_sentencepiece")
+    _create_module_alias(f"{__name__}.image_processing_utils_fast", ".image_processing_backends")
 
 
 if not is_torch_available():

filename: src/transformers/image_processing_backends.py
patch: @@ -25,6 +25,7 @@
 )
 from .image_transforms import (
     convert_to_rgb,
+    divide_to_patches,  # noqa: F401 - re-exported for backward compat with image_processing_utils_fast
     get_resize_output_image_size,
     get_size_with_aspect_ratio,
     group_images_by_shape,
@@ -664,3 +665,7 @@ def to_dict(self) -> dict[str, Any]:
         if processor_dict.get("image_processor_type", "").endswith("Pil"):
             processor_dict["image_processor_type"] = processor_dict["image_processor_type"][:-3]
         return processor_dict
+
+
+# Backward-compatible alias: allow referring to TorchvisionBackend as BaseImageProcessorFast
+BaseImageProcessorFast = TorchvisionBackend
Repository: huggingface/transformers
Pull request: [`FA4`] Add kernels fallback

Depends on #44887 and kernels being version `12.3`

Works OOB with little changes! Example script for demonstration:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer


fa_version = 4
#model_id = "openai/gpt-oss-20b"
model_id = "meta-llama/Llama-3.2-3B-Instruct"


model = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map="auto",
    attn_implementation=f"flash_attention_{fa_version}",
).eval()
tokenizer = AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token = tokenizer.eos_token
inputs = tokenizer(
    ["Hello, how are you?", "How are you? Tell me the name of the president of"],
    padding=True,
    padding_side="left",
    return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=50, do_sample=False)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
```

Changed files:
filename: src/transformers/modeling_flash_attention_utils.py
patch: @@ -62,6 +62,7 @@ def is_flash_attn_available():
 FLASH_ATTN_KERNEL_FALLBACK = {
     "flash_attention_2": "kernels-community/flash-attn2",
     "flash_attention_3": "kernels-community/vllm-flash-attn3",
+    "flash_attention_4": "kernels-community/flash-attn4",
 }
 
 

filename: src/transformers/modeling_utils.py
patch: @@ -1814,10 +1814,6 @@ def _check_and_adjust_attn_implementation(
         if is_flash_attention_requested(requested_attention_implementation=attn_implementation):
             # If FA not installed, do not fail but use kernels instead if possible
             for fa_version in FLASH_ATTENTION_COMPATIBILITY_MATRIX.keys():
-                # No kernels support for FA4 for now
-                if fa_version == 4:
-                    continue
-
                 # Check whether we have an original FA requested but not available in the env
                 if requested_original_flash_attn := (
                     attn_implementation.removeprefix("paged|") == f"flash_attention_{fa_version}"