helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: Add the suffix to cancelled view transition names

When a View Transition might not need to update we add it to a queue. If the parent are able to be reverted, we then cancel the already started view transitions. We do this by adding an animation that hides the "old" state and remove the view transition name from the old state.

There was a bug where if you have more than one child in a `<ViewTransition>` we didn't add the right suffix to the name we added in the queue so it wasn't adding an animation that hides the old state. The effect was that it playing an exit animation instead of being cancelled.

Changed files:
filename: packages/react-reconciler/src/ReactFiberCommitViewTransitions.js
patch: @@ -711,7 +711,11 @@ function measureViewTransitionHostInstancesRecursive(
         }
         viewTransitionCancelableChildren.push(
           instance,
-          oldName,
+          viewTransitionHostInstanceIdx === 0
+            ? oldName
+            : // If we have multiple Host Instances below, we add a suffix to the name to give
+              // each one a unique name.
+              oldName + '_' + viewTransitionHostInstanceIdx,
           child.memoizedProps,
         );
       }
Repository: rust-lang/rust
Pull request: Panic in Hermit clock_gettime

Follow-up to rust-lang/rust#154234.

r? @Mark-Simulacrum


Changed files:
filename: library/std/src/sys/time/hermit.rs
patch: @@ -6,7 +6,7 @@ use crate::time::Duration;
 
 fn clock_gettime(clock: hermit_abi::clockid_t) -> Timespec {
     let mut t = hermit_abi::timespec { tv_sec: 0, tv_nsec: 0 };
-    let _ = unsafe { hermit_abi::clock_gettime(clock, &raw mut t) };
+    unsafe { hermit_abi::clock_gettime(clock, &raw mut t) }.unwrap();
     Timespec::new(t.tv_sec, t.tv_nsec.into()).unwrap()
 }
Repository: huggingface/transformers
Pull request: Fix glm dsa

# What does this PR do?
Fixes #44360


Changed files:
filename: src/transformers/models/glm_moe_dsa/modeling_glm_moe_dsa.py
patch: @@ -216,7 +216,7 @@ def forward(
 
         # q·k^T per head: [B, S, H, D] @ [B, T, D]^T → [B, S, H, T]
         scores = torch.einsum("bshd,btd->bsht", q.float(), k_cached.float()) * self.softmax_scale
-
+        scores = F.relu(scores)
         # Weight per head and sum across heads → [B, S, T]
         index_scores = torch.einsum("bsht,bsh->bst", scores, weights)
 

filename: src/transformers/models/glm_moe_dsa/modular_glm_moe_dsa.py
patch: @@ -266,7 +266,7 @@ def forward(
 
         # q·k^T per head: [B, S, H, D] @ [B, T, D]^T → [B, S, H, T]
         scores = torch.einsum("bshd,btd->bsht", q.float(), k_cached.float()) * self.softmax_scale
-
+        scores = F.relu(scores)
         # Weight per head and sum across heads → [B, S, T]
         index_scores = torch.einsum("bsht,bsh->bst", scores, weights)
Repository: electron/electron
Pull request: ci: fix variable name when downloading previous object checkusms

#### Description of Change

<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md

NOTE: PRS submitted without this template will be automatically closed.
-->

Follow-up to #50390, it's `github.event.before`, not `github.event.push.before`. 😅

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included

#### Release Notes

Notes: none <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->


Changed files:
filename: .github/actions/build-electron/action.yml
patch: @@ -52,7 +52,7 @@ runs:
       if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && inputs.is-asan != 'true' }}
       with:
         name: object_checksums_${{ inputs.artifact-platform }}_${{ inputs.target-arch }}
-        commit: ${{ case(github.event_name == 'push', github.event.push.before, github.event.pull_request.base.sha) }}
+        commit: ${{ case(github.event_name == 'push', github.event.before, github.event.pull_request.base.sha) }}
         path: src
         if_no_artifact_found: ignore
     - name: Move previous object checksums
Repository: huggingface/transformers
Pull request: Fix KeyError in convert_to_native_format for dict vocab

## Fix KeyError in `convert_to_native_format` for dict vocab

Fixes #44451

### Problem

`AutoTokenizer.from_pretrained("vesteinn/ScandiBERT")` raises `KeyError: 0` in `convert_to_native_format`.

ScandiBERT's `tokenizer_config.json` specifies `tokenizer_class: "XLMRobertaTokenizer"`, which has `model = Unigram`. When `convert_to_native_format` reads the `tokenizer.json`, it enters the Unigram branch and executes:

```python
if vocab and isinstance(vocab[0], (list, tuple)):
```

However, the `vocab` from `tokenizer.json` is a **dict** (`{"token": score, ...}`), not a list. Indexing a dict with `[0]` raises `KeyError` because there is no key `0`.

### Fix

Add an `isinstance(vocab, list)` check before attempting to index `vocab[0]`:

```python
if isinstance(vocab, list) and vocab and isinstance(vocab[0], (list, tuple)):
```

This is consistent with the guards used in the other branches (e.g., BPE/WordPiece branch on line 163). When `vocab` is already a dict, no conversion is needed and it is passed through as-is.

### Regression

Introduced in v5 by #42894 (`use TokenizersBackend`).

Changed files:
filename: src/transformers/tokenization_utils_tokenizers.py
patch: @@ -155,7 +155,7 @@ def convert_to_native_format(cls, trust_remote_code=False, **kwargs):
                 if isinstance(vocab, list):
                     vocab = list(map(tuple, vocab))  # TODO just for now
             elif cls.model.__name__ == "Unigram":
-                if vocab and isinstance(vocab[0], (list, tuple)):
+                if isinstance(vocab, list) and vocab and isinstance(vocab[0], (list, tuple)):
                     vocab = [tuple(item) for item in vocab]
             elif cls.model.__name__ == "WordLevel":
                 vocab = {token: i for i, token in enumerate(vocab)}
Repository: rust-lang/rust
Pull request: Fix EII function aliases eliminated by LTO

Add EII function aliases to `llvm.compiler.used` so that LLVM's LTO passes do not eliminate them.

Fixes rust-lang/rust#153645

<!-- homu-ignore:start -->
<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r? <reviewer name>
-->
<!-- homu-ignore:end -->
Tracking issue: https://github.com/rust-lang/rust/issues/125418


Changed files:
filename: compiler/rustc_codegen_ssa/src/back/symbol_export.rs
patch: @@ -199,6 +199,14 @@ fn exported_non_generic_symbols_provider_local<'tcx>(
         }))
     }
 
+    symbols.extend(sorted.iter().flat_map(|&(&def_id, &info)| {
+        tcx.codegen_fn_attrs(def_id).foreign_item_symbol_aliases.iter().map(
+            move |&(foreign_item, _linkage, _visibility)| {
+                (ExportedSymbol::NonGeneric(foreign_item), info)
+            },
+        )
+    }));
+
     if tcx.entry_fn(()).is_some() {
         let exported_symbol =
             ExportedSymbol::NoDefId(SymbolName::new(tcx, tcx.sess.target.entry_name.as_ref()));
Repository: ollama/ollama
Pull request: anthropic: add InputTokens to streaming response

This PR adds `InputTokens` field into `Usage` field of response for streaming request to `/v1/messages` endpoint.

Additional details.
I wrote tiny HTTP-proxy script to collect tokens usage from Ollama's responses. For requests to `/v1/chat` endpoints it works fine. But for streaming variant for `/v1/messages` endpoint there is no data about prompt tokens usage. Non-streaming variant works fine.

Before this PR, response contains next data:
```
event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":62}}
```
In `usage` there is only `output_tokens` field.

After this PR, response will contain next data:
```
event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{{"input_tokens":74,"output_tokens":62}}
```


Changed files:
filename: anthropic/anthropic.go
patch: @@ -211,6 +211,7 @@ type MessageDelta struct {
 
 // DeltaUsage contains cumulative token usage
 type DeltaUsage struct {
+	InputTokens  int `json:"input_tokens"`
 	OutputTokens int `json:"output_tokens"`
 }
 
@@ -721,6 +722,7 @@ func (c *StreamConverter) Process(r api.ChatResponse) []StreamEvent {
 			})
 		}
 
+		c.inputTokens = r.Metrics.PromptEvalCount
 		c.outputTokens = r.Metrics.EvalCount
 		stopReason := mapStopReason(r.DoneReason, len(c.toolCallsSent) > 0)
 
@@ -732,6 +734,7 @@ func (c *StreamConverter) Process(r api.ChatResponse) []StreamEvent {
 					StopReason: stopReason,
 				},
 				Usage: DeltaUsage{
+					InputTokens:  c.inputTokens,
 					OutputTokens: c.outputTokens,
 				},
 			},

filename: anthropic/anthropic_test.go
patch: @@ -642,14 +642,32 @@ func TestStreamConverter_Basic(t *testing.T) {
 		},
 		Done:       true,
 		DoneReason: "stop",
-		Metrics:    api.Metrics{EvalCount: 5},
+		Metrics:    api.Metrics{PromptEvalCount: 10, EvalCount: 5},
 	}
 
 	events2 := conv.Process(resp2)
 
 	// Should have content_block_delta, content_block_stop, message_delta, message_stop
 	hasStop := false
 	for _, e := range events2 {
+		if e.Event == "message_delta" {
+			if data, ok := e.Data.(MessageDeltaEvent); ok {
+				if data.Type != "message_delta" {
+					t.Errorf("unexpected data type: %+v", data)
+				}
+
+				if data.Delta.StopReason != "end_turn" {
+					t.Errorf("unexpected stop reason: %+v", data.Delta.StopReason)
+				}
+
+				if data.Usage.InputTokens != 10 || data.Usage.OutputTokens != 5 {
+					t.Errorf("unexpected usage: %+v", data.Usage)
+				}
+			} else {
+				t.Errorf("unexpected data: %+v", e.Data)
+			}
+		}
+
 		if e.Event == "message_stop" {
 			hasStop = true
 		}
Repository: ollama/ollama
Pull request: llm: Make "do load request" error message more informative

"do load request" basically means that the model failed to load, which can have many reasons. However, many people think this is a specific error and either report only this message or group together unrelated bugs. This replaces it with a more friendly and helpful message.

Changed files:
filename: llm/server.go
patch: @@ -1201,7 +1201,8 @@ func (s *llmServer) initModel(ctx context.Context, req LoadRequest, operation Lo
 
 	resp, err := http.DefaultClient.Do(r)
 	if err != nil {
-		return nil, fmt.Errorf("do load request: %w", err)
+		slog.Error("do load request", "error", err)
+		return nil, errors.New("model failed to load, this may be due to resource limitations or an internal error, check ollama server logs for details")
 	}
 	defer resp.Body.Close()
Repository: nodejs/node
Pull request: doc(api): typo in environment variables

tiny typo in https://nodejs.org/docs/latest/api/environment_variables.html#programmatic-apis

<!--
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/api/environment_variables.md
patch: @@ -145,7 +145,7 @@ There following two functions allow you to directly interact with `.env` files:
 
 * [`process.loadEnvFile`][] loads an `.env` file and populates `process.env` with its variables
 
-* [`util.parseEnv`][] parses the row content of an `.env` file and returns its value in an object
+* [`util.parseEnv`][] parses the raw content of an `.env` file and returns its value in an object
 
 [CLI Environment Variables documentation]: cli.md#environment-variables_1
 [`--env-file-if-exists=file`]: cli.md#--env-file-if-existsfile
Repository: vercel/next.js
Pull request: adapters: remove unused suffix code

The regex associated with this flag was the same value in both the true/false case and the underlying flag was only used to control this regex. This appears to be dead code, so removing it. 

Changed files:
filename: packages/next/src/build/adapter/build-complete.ts
patch: @@ -1958,8 +1958,6 @@ export async function handleBuildComplete({
       const isFallbackFalse =
         prerenderManifest.dynamicRoutes[route.page]?.fallback === false
 
-      const { hasFallbackRootParams } = route
-
       const sourceRegex = routeRegex.namedRegex.replace(
         '^',
         `^${config.basePath && config.basePath !== '/' ? path.posix.join('/', config.basePath || '') : ''}[/]?${shouldLocalize ? '(?<nextLocale>[^/]{1,})' : ''}`
@@ -1973,23 +1971,11 @@ export async function handleBuildComplete({
         ) + getDestinationQuery(route.routeKeys)
 
       if (appPageKeys && appPageKeys.length > 0) {
-        // If we have fallback root params (implying we've already
-        // emitted a rewrite for the /_tree request), or if the route
-        // has PPR enabled and client param parsing is enabled, then
-        // we don't need to include any other suffixes.
-        const shouldSkipSuffixes = hasFallbackRootParams
-
         dynamicRoutes.push({
           source: route.page + '.rsc',
           sourceRegex: sourceRegex.replace(
             new RegExp(escapeStringRegexp('(?:/)?$')),
-            // Now than the upstream issues has been resolved, we can safely
-            // add the suffix back, this resolves a bug related to segment
-            // rewrites not capturing the correct suffix values when
-            // enabled.
-            shouldSkipSuffixes
-              ? '(?<rscSuffix>\\.rsc|\\.segments/.+\\.segment\\.rsc)(?:/)?$'
-              : '(?<rscSuffix>\\.rsc|\\.segments/.+\\.segment\\.rsc)(?:/)?$'
+            '(?<rscSuffix>\\.rsc|\\.segments/.+\\.segment\\.rsc)(?:/)?$'
           ),
           destination: destination?.replace(/($|\?)/, '$rscSuffix$1'),
           has:

filename: packages/next/src/build/index.ts
patch: @@ -401,12 +401,6 @@ export type ManifestRoute = ManifestBuiltRoute & {
   namedRegex: string
   routeKeys: { [key: string]: string }
 
-  /**
-   * If true, this indicates that the route has fallback root params. This is
-   * used to simplify the route regex for matching.
-   */
-  hasFallbackRootParams?: boolean
-
   /**
    * The prefetch segment data routes for this route. This is used to rewrite
    * the prefetch segment data routes (or the inverse) to the correct
Repository: huggingface/transformers
Pull request: fix: XLNet: relative_positional_encoding computes on CPU every forward

Fixes #44737

`XLNetModel.relative_positional_encoding` was creating all `torch.arange` tensors on CPU by default, then calling `.to(output_h.device)` at the call site to move them. Adds a `device` parameter to `relative_positional_encoding` in `src/transformers/models/xlnet/modeling_xlnet.py` and passes it through to all four `torch.arange` calls (`freq_seq`, `fwd_pos_seq`, `bwd_pos_seq`). The call site in `XLNetModel.forward` is updated to pass `device=output_h.device` directly, eliminating the redundant `.to()` transfer. Verified by running the XLNet model forward pass on GPU and confirming no CPU-GPU tensor transfers occur in `relative_positional_encoding`.

Changed files:
filename: src/transformers/models/xlnet/modeling_xlnet.py
patch: @@ -937,9 +937,9 @@ def positional_embedding(pos_seq, inv_freq, bsz=None):
 
         return pos_emb
 
-    def relative_positional_encoding(self, qlen, klen, bsz=None):
+    def relative_positional_encoding(self, qlen, klen, bsz=None, device=None):
         # create relative positional encoding.
-        freq_seq = torch.arange(0, self.d_model, 2.0, dtype=torch.int64).float()
+        freq_seq = torch.arange(0, self.d_model, 2.0, dtype=torch.int64, device=device).float()
         inv_freq = 1 / torch.pow(10000, (freq_seq / self.d_model))
 
         if self.attn_type == "bi":
@@ -952,8 +952,8 @@ def relative_positional_encoding(self, qlen, klen, bsz=None):
             raise ValueError(f"Unknown `attn_type` {self.attn_type}.")
 
         if self.bi_data:
-            fwd_pos_seq = torch.arange(beg, end, -1.0, dtype=torch.int64).float()
-            bwd_pos_seq = torch.arange(-beg, -end, 1.0, dtype=torch.int64).float()
+            fwd_pos_seq = torch.arange(beg, end, -1.0, dtype=torch.int64, device=device).float()
+            bwd_pos_seq = torch.arange(-beg, -end, 1.0, dtype=torch.int64, device=device).float()
 
             if self.clamp_len > 0:
                 fwd_pos_seq = fwd_pos_seq.clamp(-self.clamp_len, self.clamp_len)
@@ -968,7 +968,7 @@ def relative_positional_encoding(self, qlen, klen, bsz=None):
 
             pos_emb = torch.cat([fwd_pos_emb, bwd_pos_emb], dim=1)
         else:
-            fwd_pos_seq = torch.arange(beg, end, -1.0, dtype=torch.int64).float()
+            fwd_pos_seq = torch.arange(beg, end, -1.0, dtype=torch.int64, device=device).float()
             if self.clamp_len > 0:
                 fwd_pos_seq = fwd_pos_seq.clamp(-self.clamp_len, self.clamp_len)
             pos_emb = self.positional_embedding(fwd_pos_seq, inv_freq, bsz)
@@ -1139,8 +1139,7 @@ def forward(
             seg_mat = None
 
         # Positional encoding
-        pos_emb = self.relative_positional_encoding(qlen, klen, bsz=bsz)
-        pos_emb = pos_emb.to(output_h.device)
+        pos_emb = self.relative_positional_encoding(qlen, klen, bsz=bsz, device=output_h.device)
         pos_emb = self.dropout(pos_emb)
 
         new_mems = ()
Repository: rust-lang/rust
Pull request: delete several `ui/consts` tests

* `tests/ui/consts/const.rs`: meaningless
* `tests/ui/consts/const-bound.rs`: has nothing to do with const bounds or const at all (anymore?)
* `tests/ui/consts/const-enum-tuplestruct2.rs`, `tests/ui/consts/const-enum-tuple2.rs`, `tests/ui/consts/const-enum-tuple.rs`: duplicates of `tests/ui/consts/const-enum-tuplestruct.rs`
r? @Kivooeo 

Changed files:
filename: tests/ui/consts/const-bound.rs
patch: @@ -1,19 +0,0 @@
-//@ run-pass
-#![allow(dead_code)]
-// Make sure const bounds work on things, and test that a few types
-// are const.
-
-
-fn foo<T: Sync>(x: T) -> T { x }
-
-struct F { field: isize }
-
-pub fn main() {
-    /*foo(1);
-    foo("hi".to_string());
-    foo(vec![1, 2, 3]);
-    foo(F{field: 42});
-    foo((1, 2));
-    foo(@1);*/
-    foo(Box::new(1));
-}

filename: tests/ui/consts/const-enum-tuple.rs
patch: @@ -1,11 +0,0 @@
-//@ run-pass
-#![allow(dead_code)]
-
-enum E { V16(u16), V32(u32) }
-static C: (E, u16, u16) = (E::V16(0xDEAD), 0x600D, 0xBAD);
-
-pub fn main() {
-    let (_, n, _) = C;
-    assert!(n != 0xBAD);
-    assert_eq!(n, 0x600D);
-}

filename: tests/ui/consts/const-enum-tuple2.rs
patch: @@ -1,11 +0,0 @@
-//@ run-pass
-#![allow(dead_code)]
-
-enum E { V0, V16(u16) }
-static C: (E, u16, u16) = (E::V0, 0x600D, 0xBAD);
-
-pub fn main() {
-    let (_, n, _) = C;
-    assert!(n != 0xBAD);
-    assert_eq!(n, 0x600D);
-}

filename: tests/ui/consts/const-enum-tuplestruct2.rs
patch: @@ -1,12 +0,0 @@
-//@ run-pass
-#![allow(dead_code)]
-
-enum E { V0, V16(u16) }
-struct S(E, u16, u16);
-static C: S = S(E::V0, 0x600D, 0xBAD);
-
-pub fn main() {
-    let S(_, n, _) = C;
-    assert!(n != 0xBAD);
-    assert_eq!(n, 0x600D);
-}

filename: tests/ui/consts/const.rs
patch: @@ -1,6 +0,0 @@
-//@ run-pass
-#![allow(non_upper_case_globals)]
-
-static i: isize = 10;
-
-pub fn main() { println!("{}", i); }
Repository: ollama/ollama
Pull request: runner: fix typo 'baackend' -> 'backend' in error messages

Fix typo in three error messages where 'baackend' was written instead of 'backend' in the /health endpoint handler when initializing the dummy model load.

Changed files:
filename: runner/ollamarunner/runner.go
patch: @@ -1358,7 +1358,7 @@ func (s *Server) info(w http.ResponseWriter, r *http.Request) {
 		// Dummy load to get the backend wired up
 		f, err := os.CreateTemp("", "*.bin")
 		if err != nil {
-			http.Error(w, fmt.Sprintf("failed to initialize baackend: %v", err), http.StatusInternalServerError)
+			http.Error(w, fmt.Sprintf("failed to initialize backend: %v", err), http.StatusInternalServerError)
 			return
 		}
 		defer f.Close()
@@ -1368,13 +1368,13 @@ func (s *Server) info(w http.ResponseWriter, r *http.Request) {
 			"general.architecture": "llama",
 			"tokenizer.ggml.model": "gpt2",
 		}, nil); err != nil {
-			http.Error(w, fmt.Sprintf("failed to initialize baackend: %v", err), http.StatusInternalServerError)
+			http.Error(w, fmt.Sprintf("failed to initialize backend: %v", err), http.StatusInternalServerError)
 			return
 		}
 
 		m, err = model.New(f.Name(), ml.BackendParams{NumThreads: runtime.NumCPU(), AllocMemory: false, GPULayers: ml.GPULayersList{{}}})
 		if err != nil {
-			http.Error(w, fmt.Sprintf("failed to initialize baackend: %v", err), http.StatusInternalServerError)
+			http.Error(w, fmt.Sprintf("failed to initialize backend: %v", err), http.StatusInternalServerError)
 			return
 		}
 		slog.Debug("dummy model load took", "duration", time.Since(startLoad))