helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: anthropic: allow non-thinking models when using Anthropic API

Set anthropic_api flag in middleware context and modify ChatHandler to gracefully ignore the 'think' parameter for requests originating from the Anthropic API. This allows tools like claude code to work with models that don't support thinking without errors.

Changes:
- Add anthropic_api flag to context in AnthropicMessagesMiddleware
- Add test for anthropic_api flag setting
- Update ChatHandler to check anthropic_api flag and set req.Think=nil
- Log warnings when thinking is ignored for non-thinking models

Changed files:
filename: middleware/anthropic.go
patch: @@ -118,6 +118,9 @@ func AnthropicMessagesMiddleware() gin.HandlerFunc {
 			return
 		}
 
+		// Set think to nil when being used with Anthropic API to connect to tools like claude code
+		c.Set("relax_thinking", true)
+
 		var b bytes.Buffer
 		if err := json.NewEncoder(&b).Encode(chatReq); err != nil {
 			c.AbortWithStatusJSON(http.StatusInternalServerError, anthropic.NewError(http.StatusInternalServerError, err.Error()))

filename: middleware/anthropic_test.go
patch: @@ -582,3 +582,26 @@ func TestAnthropicWriter_ErrorFromRoutes(t *testing.T) {
 		})
 	}
 }
+
+func TestAnthropicMessagesMiddleware_SetsRelaxThinkingFlag(t *testing.T) {
+	gin.SetMode(gin.TestMode)
+
+	var flagSet bool
+	router := gin.New()
+	router.Use(AnthropicMessagesMiddleware())
+	router.POST("/v1/messages", func(c *gin.Context) {
+		_, flagSet = c.Get("relax_thinking")
+		c.Status(http.StatusOK)
+	})
+
+	body := `{"model": "test-model", "max_tokens": 100, "messages": [{"role": "user", "content": "Hi"}]}`
+	req, _ := http.NewRequest(http.MethodPost, "/v1/messages", strings.NewReader(body))
+	req.Header.Set("Content-Type", "application/json")
+
+	resp := httptest.NewRecorder()
+	router.ServeHTTP(resp, req)
+
+	if !flagSet {
+		t.Error("expected relax_thinking flag to be set in context")
+	}
+}

filename: server/routes.go
patch: @@ -2072,8 +2072,14 @@ func (s *Server) ChatHandler(c *gin.Context) {
 		}
 	} else {
 		if req.Think != nil && req.Think.Bool() {
-			c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("%q does not support thinking", req.Model)})
-			return
+			// Set think to nil when being used with Anthropic API to connect to tools like claude code
+			if _, ok := c.Get("relax_thinking"); ok {
+				slog.Warn("model does not support thinking, relaxing thinking to nil", "model", req.Model)
+				req.Think = nil
+			} else {
+				c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("%q does not support thinking", req.Model)})
+				return
+			}
 		}
 	}
Repository: huggingface/transformers
Pull request: Update Nvidia CI docker file to use torch 2.10

# What does this PR do?

torch 2.11 is going to be released soon, but we still use 2.9.

Let's update it to 2.10 so at least a run with torch 2.10, before we update to torch 2.11 later.

Changed files:
filename: docker/transformers-all-latest-gpu/Dockerfile
patch: @@ -9,12 +9,12 @@ SHELL ["sh", "-lc"]
 # The following `ARG` are mainly used to specify the versions explicitly & directly in this docker file, and not meant
 # to be used as arguments for docker build (so far).
 
-ARG PYTORCH='2.9.0'
+ARG PYTORCH='2.10.0'
 # Example: `cu102`, `cu113`, etc.
 ARG CUDA='cu126'
 
 # This needs to be compatible with the above `PYTORCH`.
-ARG TORCHCODEC='0.8.0'
+ARG TORCHCODEC='0.10.0'
 
 ARG FLASH_ATTN='false'
Repository: facebook/react
Pull request: [test] Fix Error Proxy in Node.js 21+

In draft so that I don't accidentally merge while CI is disabled.

Only affects production tests with Node.js 21+. See https://github.com/nodejs/node/issues/60862.

Probably has to do with how v8 treats Error.prototype.stack (https://github.com/tc39/proposal-error-stacks#compatibility) and setting .stack on the wrong object.

## test plan

In Node.js 21+:
```console
$ yarn test packages/react-server/src/__tests__/ReactServer-test.js --env production
```

CI (older Node.js) still green: https://github.com/eps1lon/react/actions/runs/19782704658?pr=12


Changed files:
filename: scripts/jest/setupTests.js
patch: @@ -136,6 +136,13 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
           }
           return Reflect.set(target, key, value, receiver);
         },
+        get(target, key, receiver) {
+          if (key === 'stack') {
+            // https://github.com/nodejs/node/issues/60862
+            return Reflect.get(target, key);
+          }
+          return Reflect.get(target, key, receiver);
+        },
       });
       originalErrorInstances.set(proxy, error);
       return proxy;
Repository: electron/electron
Pull request: fix: don't re-parse URL unnecessarily when handling dialogs

Backport of #50062

See that PR for details.


Notes: Fixed crash when handling JavaScript dialogs from windows opened with invalid or empty URLs.


Changed files:
filename: lib/browser/api/web-contents.ts
patch: @@ -782,8 +782,7 @@ WebContents.prototype._init = function () {
   const originCounts = new Map<string, number>();
   const openDialogs = new Set<AbortController>();
   this.on('-run-dialog', async (info, callback) => {
-    const originUrl = new URL(info.frame.url);
-    const origin = originUrl.protocol === 'file:' ? originUrl.href : originUrl.origin;
+    const origin = info.frame.origin === 'file://' ? info.frame.url : info.frame.origin;
     if ((originCounts.get(origin) ?? 0) < 0) return callback(false, '');
 
     const prefs = this.getLastWebPreferences();

filename: spec/fixtures/crash-cases/dialog-on-invalid-url/index.html
patch: @@ -0,0 +1,7 @@
+<html>
+<body>
+<script>
+window.open('javascript:alert()');
+</script>
+</body>
+</html>

filename: spec/fixtures/crash-cases/dialog-on-invalid-url/index.js
patch: @@ -0,0 +1,22 @@
+const { app, BrowserWindow } = require('electron');
+
+process.on('uncaughtException', (err) => {
+  console.error(err);
+  process.exit(1);
+});
+
+process.on('unhandledRejection', (reason) => {
+  console.error(reason);
+  process.exit(1);
+});
+
+app.on('browser-window-created', (_, window) => {
+  window.webContents.once('did-frame-navigate', () => {
+    process.exit(0);
+  });
+});
+
+app.whenReady().then(() => {
+  const win = new BrowserWindow({ show: false });
+  win.loadFile('index.html');
+});
Repository: vercel/next.js
Pull request: Bump tar from 7.5.7 to 7.5.11 in /packages/next

Security bump for [`tar`](https://github.com/isaacs/node-tar) in `packages/next` from 7.5.7 → 7.5.11, along with updated `pnpm-lock.yaml` to reflect the new resolution.

### What?

- Bumped `tar` to 7.5.11 in `packages/next/package.json`
- Updated `pnpm-lock.yaml` with the new `tar@7.5.11` resolution entry

<!-- 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: pnpm-lock.yaml
patch: @@ -1726,8 +1726,8 @@ importers:
         specifier: 1.0.3
         version: 1.0.3
       tar:
-        specifier: 7.5.7
-        version: 7.5.7
+        specifier: 7.5.11
+        version: 7.5.11
       taskr:
         specifier: 1.1.0
         version: 1.1.0(patch_hash=utitb3olraq7egc3hk7waltisu)
@@ -17669,6 +17669,10 @@ packages:
     engines: {node: '>=10'}
     deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
 
+  tar@7.5.11:
+    resolution: {integrity: sha512-ChjMH33/KetonMTAtpYdgUFr0tbz69Fp2v7zWxQfYZX4g5ZN2nOBXm1R2xyA+lMIKrLKIoKAwFj93jE/avX9cQ==}
+    engines: {node: '>=18'}
+
   tar@7.5.7:
     resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==}
     engines: {node: '>=18'}
@@ -24117,7 +24121,7 @@ snapshots:
   '@tailwindcss/oxide@4.1.13':
     dependencies:
       detect-libc: 2.1.0
-      tar: 7.5.7
+      tar: 7.5.11
     optionalDependencies:
       '@tailwindcss/oxide-android-arm64': 4.1.13
       '@tailwindcss/oxide-darwin-arm64': 4.1.13
@@ -26094,7 +26098,7 @@ snapshots:
       minipass-pipeline: 1.2.4
       p-map: 7.0.4
       ssri: 12.0.0
-      tar: 7.5.7
+      tar: 7.5.11
       unique-filename: 4.0.0
 
   cacache@20.0.3:
@@ -34142,7 +34146,7 @@ snapshots:
       nopt: 8.1.0
       proc-log: 5.0.0
       semver: 7.6.3
-      tar: 7.5.7
+      tar: 7.5.11
       tinyglobby: 0.2.15
       which: 5.0.0
     transitivePeerDependencies:
@@ -34823,7 +34827,7 @@ snapshots:
       promise-retry: 2.0.1
       sigstore: 4.0.0
       ssri: 12.0.0
-      tar: 7.5.7
+      tar: 7.5.11
     transitivePeerDependencies:
       - supports-color
 
@@ -34845,7 +34849,7 @@ snapshots:
       promise-retry: 2.0.1
       sigstore: 4.0.0
       ssri: 13.0.0
-      tar: 7.5.7
+      tar: 7.5.11
     transitivePeerDependencies:
       - supports-color
 
@@ -38372,6 +38376,14 @@ snapshots:
       mkdirp: 1.0.4
       yallist: 4.0.0
 
+  tar@7.5.11:
+    dependencies:
+      '@isaacs/fs-minipass': 4.0.1
+      chownr: 3.0.0
+      minipass: 7.1.2
+      minizlib: 3.1.0(patch_hash=o4nv5mg6kfnuzlknbdln3azhvu)
+      yallist: 5.0.0
+
   tar@7.5.7:
     dependencies:
       '@isaacs/fs-minipass': 4.0.1
Repository: huggingface/transformers
Pull request: Fix `set_encoder`

The typo in the `elif` chain meant that `image` and `video` modalidty encoders could not be set using this method.

This PR fixes the typo so that they can.

Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -2222,7 +2222,7 @@ def set_encoder(self, encoder, modality: str | None = None):
         # NOTE: new models need to use existing names for layers if possible, so this list doesn't grow infinitely
         if modality in ["image", "video"]:
             possible_module_names = ["vision_tower", "visual", "vision_model", "vision_encoder", "image_tower"]
-        if modality == "audio":
+        elif modality == "audio":
             possible_module_names = ["audio_tower", "audio_encoder"]
         elif modality is None:
             possible_module_names = ["text_encoder", "encoder"]
Repository: rust-lang/rust
Pull request: Constify comparisons and `Clone` for `core::mem::Alignment`

As suggested in https://github.com/rust-lang/rust/pull/153261#issuecomment-4136817185

Changed files:
filename: library/core/src/mem/alignment.rs
patch: @@ -11,7 +11,8 @@ use crate::{cmp, fmt, hash, mem, num};
 /// Note that particularly large alignments, while representable in this type,
 /// are likely not to be supported by actual allocators and linkers.
 #[unstable(feature = "ptr_alignment_type", issue = "102070")]
-#[derive(Copy, Clone, PartialEq, Eq)]
+#[derive(Copy)]
+#[derive_const(Clone, PartialEq, Eq)]
 #[repr(transparent)]
 pub struct Alignment {
     // This field is never used directly (nor is the enum),
@@ -303,15 +304,17 @@ impl const From<Alignment> for usize {
 }
 
 #[unstable(feature = "ptr_alignment_type", issue = "102070")]
-impl cmp::Ord for Alignment {
+#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
+impl const cmp::Ord for Alignment {
     #[inline]
     fn cmp(&self, other: &Self) -> cmp::Ordering {
         self.as_nonzero_usize().cmp(&other.as_nonzero_usize())
     }
 }
 
 #[unstable(feature = "ptr_alignment_type", issue = "102070")]
-impl cmp::PartialOrd for Alignment {
+#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
+impl const cmp::PartialOrd for Alignment {
     #[inline]
     fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
         Some(self.cmp(other))
@@ -336,7 +339,8 @@ impl const Default for Alignment {
 }
 
 #[cfg(target_pointer_width = "16")]
-#[derive(Copy, Clone, PartialEq, Eq)]
+#[derive(Copy)]
+#[derive_const(Clone, PartialEq, Eq)]
 #[repr(usize)]
 enum AlignmentEnum {
     _Align1Shl0 = 1 << 0,
@@ -358,7 +362,8 @@ enum AlignmentEnum {
 }
 
 #[cfg(target_pointer_width = "32")]
-#[derive(Copy, Clone, PartialEq, Eq)]
+#[derive(Copy)]
+#[derive_const(Clone, PartialEq, Eq)]
 #[repr(usize)]
 enum AlignmentEnum {
     _Align1Shl0 = 1 << 0,
@@ -396,7 +401,8 @@ enum AlignmentEnum {
 }
 
 #[cfg(target_pointer_width = "64")]
-#[derive(Copy, Clone, PartialEq, Eq)]
+#[derive(Copy)]
+#[derive_const(Clone, PartialEq, Eq)]
 #[repr(usize)]
 enum AlignmentEnum {
     _Align1Shl0 = 1 << 0,
Repository: ollama/ollama
Pull request: server: fix slow 'ollama rm' of models with many blobs

RemoveLayers was calling Manifests() for each layer to check if it was shared with other models. For models with many blobs (e.g., tensor models), this caused O(N*M) manifest reads. Now loads manifests once and builds a set of in-use digests. Our existing tests should cover this case well

Changed files:
filename: server/manifest.go
patch: @@ -47,16 +47,40 @@ func (m *Manifest) Remove() error {
 }
 
 func (m *Manifest) RemoveLayers() error {
-	for _, layer := range append(m.Layers, m.Config) {
-		if layer.Digest != "" {
-			if err := layer.Remove(); errors.Is(err, os.ErrNotExist) {
-				slog.Debug("layer does not exist", "digest", layer.Digest)
-			} else if err != nil {
-				return err
+	ms, err := Manifests(true)
+	if err != nil {
+		return err
+	}
+
+	// Build set of digests still in use by other manifests
+	inUse := make(map[string]struct{})
+	for _, other := range ms {
+		for _, layer := range append(other.Layers, other.Config) {
+			if layer.Digest != "" {
+				inUse[layer.Digest] = struct{}{}
 			}
 		}
 	}
 
+	// Remove layers not used by any other manifest
+	for _, layer := range append(m.Layers, m.Config) {
+		if layer.Digest == "" {
+			continue
+		}
+		if _, used := inUse[layer.Digest]; used {
+			continue
+		}
+		blob, err := GetBlobsPath(layer.Digest)
+		if err != nil {
+			return err
+		}
+		if err := os.Remove(blob); errors.Is(err, os.ErrNotExist) {
+			slog.Debug("layer does not exist", "digest", layer.Digest)
+		} else if err != nil {
+			return err
+		}
+	}
+
 	return nil
 }
Repository: facebook/react
Pull request: [test] Only run tests overriding fallback and error states in supported versions

Fixes https://github.com/eps1lon/react/actions/runs/19184729130/job/54849190660

`overrideSuspense` was only added in 16.9: https://github.com/facebook/react/commit/7a2dc4853948a70a599124b7f47513df793d472a
`overrideError` in 18.0: https://github.com/facebook/react/commit/8b4201535c6068147d61d0ed3f02d21d6dcd6927

We could separate the tests to test `overrideSuspense` for earlier versions but [this test was only recently added](https://github.com/facebook/react/issues/34929) so doesn't seem worth the extended regression test.


Changed files:
filename: packages/react-devtools-shared/src/__tests__/storeComponentFilters-test.js
patch: @@ -753,7 +753,7 @@ describe('Store component filters', () => {
     });
   });
 
-  // @reactVersion >= 16.6
+  // @reactVersion >= 18.0
   it('resets forced error and fallback states when filters are changed', async () => {
     store.componentFilters = [];
     class ErrorBoundary extends React.Component {
Repository: huggingface/transformers
Pull request: Fix more model tester missing `parent` issue

# What does this PR do?

For tiny model creation script - new added model test files still miss this argument ...

Changed files:
filename: tests/models/pp_lcnet/test_modeling_pp_lcnet.py
patch: @@ -52,6 +52,7 @@
 class PPLCNetModelTester:
     def __init__(
         self,
+        parent,
         batch_size=3,
         image_size=128,
         num_channels=3,
@@ -68,6 +69,7 @@ def __init__(
         out_indices=[2, 3, 4],
         stem_channels=16,
     ):
+        self.parent = parent
         self.batch_size = batch_size
         self.num_channels = num_channels
         self.image_size = image_size
@@ -134,7 +136,7 @@ class PPLCNetBackboneTest(BackboneTesterMixin, unittest.TestCase):
     config_class = PPLCNetConfig
 
     def setUp(self):
-        self.model_tester = PPLCNetModelTester()
+        self.model_tester = PPLCNetModelTester(self)
         self.config_tester = ConfigTester(
             self,
             config_class=PPLCNetConfig,
@@ -153,7 +155,7 @@ class PPLCNetModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase)
     test_resize_embeddings = False
 
     def setUp(self):
-        self.model_tester = PPLCNetModelTester()
+        self.model_tester = PPLCNetModelTester(self)
         self.config_tester = ConfigTester(
             self,
             config_class=PPLCNetConfig,

filename: tests/models/pp_lcnet_v3/test_modeling_pp_lcnet_v3.py
patch: @@ -33,6 +33,7 @@
 class PPLCNetV3ModelTester:
     def __init__(
         self,
+        parent,
         batch_size=3,
         image_size=128,
         num_channels=3,
@@ -49,6 +50,7 @@ def __init__(
         out_indices=[2, 3, 4],
         stem_channels=16,
     ):
+        self.parent = parent
         self.batch_size = batch_size
         self.num_channels = num_channels
         self.image_size = image_size
@@ -112,7 +114,7 @@ class PPLCNetBackboneTest(BackboneTesterMixin, unittest.TestCase):
     config_class = PPLCNetV3Config
 
     def setUp(self):
-        self.model_tester = PPLCNetV3ModelTester()
+        self.model_tester = PPLCNetV3ModelTester(self)
         self.config_tester = ConfigTester(
             self,
             config_class=PPLCNetV3Config,

filename: tests/models/pp_ocrv5_mobile_det/test_modeling_pp_ocrv5_mobile_det.py
patch: @@ -50,6 +50,7 @@
 class PPOCRV5MobileDetModelTester:
     def __init__(
         self,
+        parent,
         batch_size=3,
         image_size=128,
         num_channels=3,
@@ -62,6 +63,7 @@ def __init__(
         kernel_list=[3, 2, 2],
         interpolate_mode="nearest",
     ):
+        self.parent = parent
         self.batch_size = batch_size
         self.image_size = image_size
         self.num_channels = num_channels
@@ -138,6 +140,7 @@ class PPOCRV5MobileDetModelTest(ModelTesterMixin, unittest.TestCase):
 
     def setUp(self):
         self.model_tester = PPOCRV5MobileDetModelTester(
+            self,
             batch_size=3,
             is_training=False,
             image_size=128,
Repository: rust-lang/rust
Pull request: Add doc links to `ExtractIf` of `BTree{Set,Map}` and `LinkedList`

There were links for `Hash{Set,Map}` and `Vec{,Deque}` versions, but not these three.


Changed files:
filename: library/alloc/src/collections/btree/map.rs
patch: @@ -2102,7 +2102,9 @@ impl<K, V> Default for Values<'_, K, V> {
     }
 }
 
-/// An iterator produced by calling `extract_if` on BTreeMap.
+/// This `struct` is created by the [`extract_if`] method on [`BTreeMap`].
+///
+/// [`extract_if`]: BTreeMap::extract_if
 #[stable(feature = "btree_extract_if", since = "1.91.0")]
 #[must_use = "iterators are lazy and do nothing unless consumed; \
     use `retain` or `extract_if().for_each(drop)` to remove and discard elements"]

filename: library/alloc/src/collections/btree/set.rs
patch: @@ -1547,7 +1547,9 @@ impl<'a, T, A: Allocator + Clone> IntoIterator for &'a BTreeSet<T, A> {
     }
 }
 
-/// An iterator produced by calling `extract_if` on BTreeSet.
+/// This `struct` is created by the [`extract_if`] method on [`BTreeSet`].
+///
+/// [`extract_if`]: BTreeSet::extract_if
 #[stable(feature = "btree_extract_if", since = "1.91.0")]
 #[must_use = "iterators are lazy and do nothing unless consumed; \
     use `retain` or `extract_if().for_each(drop)` to remove and discard elements"]

filename: library/alloc/src/collections/linked_list.rs
patch: @@ -1942,7 +1942,9 @@ impl<'a, T, A: Allocator> CursorMut<'a, T, A> {
     }
 }
 
-/// An iterator produced by calling `extract_if` on LinkedList.
+/// This `struct` is created by the [`extract_if`] method on [`LinkedList`].
+///
+/// [`extract_if`]: LinkedList::extract_if
 #[stable(feature = "extract_if", since = "1.87.0")]
 #[must_use = "iterators are lazy and do nothing unless consumed; \
     use `extract_if().for_each(drop)` to remove and discard elements"]
Repository: huggingface/transformers
Pull request: Add register method for `ParallelInterface`

# What does this PR do?

- Add `"embedding_colwise"` tp plan
- Add register methods for `ParallelInterface`. Without it, we can register plans with the register method, but not the corresponding `plan_to_weight_dim` and `plan_to_bias_dim`.

Changed files:
filename: src/transformers/integrations/tensor_parallel.py
patch: @@ -1218,6 +1218,7 @@ class ParallelInterface(GeneralInterface):
     _global_mapping = (
         {
             "embedding_rowwise": EmbeddingParallel(embedding_dim_sharding=0),
+            "embedding_colwise": EmbeddingParallel(embedding_dim_sharding=1),
             "colwise_gather_output": ColwiseParallel(gather_output=True),
             "colwise": ColwiseParallel(),
             "rowwise": RowwiseParallel(),
@@ -1247,6 +1248,7 @@ class ParallelInterface(GeneralInterface):
         "rowwise_split_input": -1,
         "packed_rowwise": -1,
         "embedding_rowwise": 0,
+        "embedding_colwise": 1,
         "sequence_parallel": None,
         "replicated_with_grad_allreduce": None,
         "mla_kv_a_proj": None,
@@ -1261,11 +1263,20 @@ class ParallelInterface(GeneralInterface):
         "rowwise_split_input": None,
         "packed_rowwise": None,
         "embedding_rowwise": None,
+        "embedding_colwise": None,
         "sequence_parallel": None,
         "replicated_with_grad_allreduce": None,
         "mla_kv_a_proj": None,
     }
 
+    @classmethod
+    def register_plan_to_weight_dim(cls, key: str, value: int | None):
+        cls.plan_to_weight_dim[key] = value
+
+    @classmethod
+    def register_plan_to_bias_dim(cls, key: str, value: int | None):
+        cls.plan_to_bias_dim[key] = value
+
 
 ALL_PARALLEL_STYLES: ParallelInterface = ParallelInterface()