helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: [DevTools] Use documentElement to override cmd+F

We override Cmd+F to jump to our search input instead of searching through the HTML. This is ofc critical since our view virtualized.

However, Chrome DevTools installs its own listener on the document as well (in the bubble phase) so if we prevent it at the document level it's too late and it ends up stealing the focus instead. If we instead listen at the documentElement it works as intended.

Changed files:
filename: packages/react-devtools-shared/src/devtools/views/SearchInput.js
patch: @@ -64,8 +64,9 @@ export default function SearchInput({
     const handleKeyDown = (event: KeyboardEvent) => {
       const {key, metaKey} = event;
       if (key === 'f' && metaKey) {
-        if (inputRef.current !== null) {
-          inputRef.current.focus();
+        const inputElement = inputRef.current;
+        if (inputElement !== null) {
+          inputElement.focus();
           event.preventDefault();
           event.stopPropagation();
         }
@@ -75,10 +76,14 @@ export default function SearchInput({
     // It's important to listen to the ownerDocument to support the browser extension.
     // Here we use portals to render individual tabs (e.g. Profiler),
     // and the root document might belong to a different window.
-    const ownerDocument = inputRef.current.ownerDocument;
-    ownerDocument.addEventListener('keydown', handleKeyDown);
+    const ownerDocumentElement = inputRef.current.ownerDocument.documentElement;
+    if (ownerDocumentElement === null) {
+      return;
+    }
+    ownerDocumentElement.addEventListener('keydown', handleKeyDown);
 
-    return () => ownerDocument.removeEventListener('keydown', handleKeyDown);
+    return () =>
+      ownerDocumentElement.removeEventListener('keydown', handleKeyDown);
   }, []);
 
   return (
Repository: vercel/next.js
Pull request: [ci] Use `NEXT_TEST_CI` instead of `CI` for e2e test retry guard

`run-tests.js` explicitly unsets `CI` in the spawned Jest child process and preserves the original value as `NEXT_TEST_CI`. Since `test/lib/e2e-utils/index.ts` runs inside that child process, `process.env.CI` is always empty, making the `jest.retryTimes(1)` call effectively dead code in CI.

Changed files:
filename: test/lib/e2e-utils/index.ts
patch: @@ -126,7 +126,7 @@ if (!e2eGlobal.__NEXT_E2E_TEST_CONFIG_PATCHED__) {
       global.test = wrapJestTestFn(global.test) as jest.It
     }
 
-    if (process.env.CI) {
+    if (process.env.NEXT_TEST_CI) {
       jest.retryTimes(1)
     }
   }
Repository: huggingface/transformers
Pull request: Fix failed test case for exaone_moe model

@ydshieh This PR fixes failed case: `tests/models/exaone_moe/test_modeling_exaone_moe.py::ExaoneMoeIntegrationTest::test_model_logits`, pls help review, thx!

Changed files:
filename: tests/models/exaone_moe/test_modeling_exaone_moe.py
patch: @@ -22,6 +22,7 @@
     is_torch_available,
 )
 from transformers.testing_utils import (
+    Expectations,
     cleanup,
     require_flash_attn,
     require_torch,
@@ -90,12 +91,28 @@ def test_model_logits(self):
         with torch.no_grad():
             out = model(input_ids).logits.float().cpu()
 
-        EXPECTED_MEAN = torch.tensor(
-            [[-2.2663, -3.0659, -3.0922, -3.2575, -3.2033, -3.4042, -3.1595, -3.2739, -3.8887, -0.6917]]
-        )
-        EXPECTED_SLICE = torch.tensor(
-            [-2.3906, -3.0781, 2.7500, -3.0469, 0.5312, -1.4297, -1.8984, -2.6875, -1.7734, -2.1094]
-        )
+        # fmt: off
+        EXPECTED_MEAN = Expectations(
+            {
+                ("xpu", None): torch.tensor(
+                    [[-2.2315, -3.0070, -3.2105, -3.2688, -3.2211, -3.3958, -3.1049, -3.2591, -3.8714, -0.6801]]
+                ),
+                ("cuda", None): torch.tensor(
+                    [[-2.2491, -3.0824, -3.2191, -3.2712, -3.1991, -3.4087, -3.1384, -3.2601, -3.8869, -0.6940]]
+                ),
+            }
+        ).get_expectation()
+        EXPECTED_SLICE = Expectations(
+            {
+                ("xpu", None): torch.tensor(
+                    [-2.3750, -3.0156, 2.6875, -3.0000, 0.5078, -1.4141, -1.8516, -2.6719, -1.7578, -2.0781]
+                ),
+                ("cuda", None): torch.tensor(
+                    [-2.3906, -3.0469, 2.6875, -3.0156, 0.4941, -1.4219, -1.8672, -2.6719, -1.7656, -2.0938]
+                ),
+            }
+        ).get_expectation()
+        # fmt: on
         torch.testing.assert_close(out.mean(-1), EXPECTED_MEAN, atol=1e-2, rtol=1e-2)
         torch.testing.assert_close(out[0, 0, :10], EXPECTED_SLICE, atol=1e-4, rtol=1e-4)
Repository: facebook/react
Pull request: [eprh] Add compiler rules to recommended preset


Adds back the compiler rules to the recommended preset, intended for the next release.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34675).
* #34703
* #34700
* #34699
* __->__ #34675

Changed files:
filename: packages/eslint-plugin-react-hooks/src/index.ts
patch: @@ -7,7 +7,11 @@
 import type {Linter, Rule} from 'eslint';
 
 import ExhaustiveDeps from './rules/ExhaustiveDeps';
-import {allRules} from './shared/ReactCompiler';
+import {
+  allRules,
+  mapErrorSeverityToESlint,
+  recommendedRules,
+} from './shared/ReactCompiler';
 import RulesOfHooks from './rules/RulesOfHooks';
 
 // All rules
@@ -23,6 +27,15 @@ const rules = {
 const ruleConfigs = {
   'react-hooks/rules-of-hooks': 'error',
   'react-hooks/exhaustive-deps': 'warn',
+  // Compiler rules
+  ...Object.fromEntries(
+    Object.entries(recommendedRules).map(([name, ruleConfig]) => {
+      return [
+        'react-hooks/' + name,
+        mapErrorSeverityToESlint(ruleConfig.severity),
+      ];
+    }),
+  ),
 } satisfies Linter.RulesRecord;
 
 const plugin = {
Repository: huggingface/transformers
Pull request: update glm image model expected out for tests

@ydshieh , pls help review, thx!

Changed files:
filename: tests/models/glm_image/test_modeling_glm_image.py
patch: @@ -29,7 +29,9 @@
 from transformers.models.auto import get_values
 from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES
 from transformers.testing_utils import (
+    Expectations,
     cleanup,
+    require_deterministic_for_xpu,
     require_flash_attn,
     require_torch,
     require_torch_accelerator,
@@ -579,6 +581,7 @@ def test_text_to_image_generation(self):
             f"Expected first 30 tokens:\n{expected_tokens.tolist()}\nGot:\n{generated_tokens[:30].tolist()}",
         )
 
+    @require_deterministic_for_xpu
     def test_image_to_image_generation(self):
         """Test image-to-image generation produces valid image tokens."""
         model = self.get_model()
@@ -597,44 +600,18 @@ def test_image_to_image_generation(self):
         self.assertTrue(all(t.item() < model.config.text_config.vision_vocab_size for t in generated_tokens))
 
         # Check actual token values (first 30 tokens) to catch implementation errors
-        expected_tokens = torch.tensor(
-            [
-                9223,
-                11045,
-                7240,
-                14581,
-                4759,
-                11667,
-                1275,
-                10094,
-                1275,
-                9223,
-                9223,
-                1275,
-                9223,
-                9223,
-                9223,
-                10543,
-                2007,
-                4759,
-                10543,
-                1153,
-                1153,
-                1153,
-                10094,
-                16304,
-                9223,
-                11045,
-                11045,
-                14581,
-                4759,
-                10094,
-            ],
-            device=torch_device,
+        # fmt: off
+        expected_tokens = Expectations(
+            {
+                ("cuda", None): [9223, 11045, 5705, 14581, 4759, 11667, 1275, 10094, 572, 10543, 9223, 1275, 9223, 10543, 12265, 10543, 2007, 8200, 10543, 1153, 1153, 1153, 10094, 16304, 9223, 11045, 3114, 14581, 4759, 10094],
+                ("xpu", 3): [9223, 11045, 11045, 14581, 4759, 11667, 10543, 10094, 572, 10543, 9223, 1275, 9223, 9223, 4759, 10543, 2007, 4759, 10543, 1153, 1153, 1153, 8932, 9223, 10094, 11045, 5705, 14581, 4759, 10094],
+            }
         )
+        # fmt: on
+        expected = torch.tensor(expected_tokens.get_expectation(), device=torch_device)
         self.assertTrue(
-            torch.equal(generated_tokens[:30], expected_tokens),
-            f"Expected first 30 tokens:\n{expected_tokens.tolist()}\nGot:\n{generated_tokens[:30].tolist()}",
+            torch.equal(generated_tokens[:30], expected),
+            f"Expected first 30 tokens:\n{expected.tolist()}\nGot:\n{generated_tokens[:30].tolist()}",
         )
 
     @run_first
Repository: facebook/react
Pull request: [eprh] 6.1.1 changelog


Update changelog for 6.1.1


Changed files:
filename: packages/eslint-plugin-react-hooks/CHANGELOG.md
patch: @@ -1,6 +1,17 @@
+## 6.1.1
+
+**Note:** 6.1.0 accidentally allowed use of `recommended` without flat config, causing errors when used with ESLint v9's `defineConfig()` helper. This has been fixed in 6.1.1.
+
+- Fix `recommended` config for flat config compatibility. The `recommended` config has been converted to flat config format. Non-flat config users should use `recommended-legacy` instead. ([@poteto](https://github.com/poteto) in [#34700](https://github.com/facebook/react/pull/34700))
+- Add `recommended-latest` and `recommended-latest-legacy` configs that include React Compiler rules. ([@poteto](https://github.com/poteto) in [#34675](https://github.com/facebook/react/pull/34675))
+- Remove unused `NoUnusedOptOutDirectives` rule. ([@poteto](https://github.com/poteto) in [#34703](https://github.com/facebook/react/pull/34703))
+- Remove `hermes-parser` and dependency. ([@poteto](https://github.com/poteto) in [#34719](https://github.com/facebook/react/pull/34719))
+- Remove `@babel/plugin-proposal-private-methods` dependency. ([@ArnaudBarre](https://github.com/ArnaudBarre) and [@josephsavona](https://github.com/josephsavona) in [#34715](https://github.com/facebook/react/pull/34715))
+- Update for Zod v3/v4 compatibility. ([@kolian](https://github.com/kolvian) and [@josephsavona](https://github.com/josephsavona) in [#34717](https://github.com/facebook/react/pull/34717))
+
 ## 6.1.0
 
-**Note:** Version 6.0.0 was mistakenly released and immediately deprecated and untagged on npm. This is the first official 6.x major release and includes breaking changes. 
+**Note:** Version 6.0.0 was mistakenly released and immediately deprecated and untagged on npm. This is the first official 6.x major release and includes breaking changes.
 
 - **Breaking:** Require Node.js 18 or newer. ([@michaelfaith](https://github.com/michaelfaith) in [#32458](https://github.com/facebook/react/pull/32458))
 - **Breaking:** Flat config is now the default `recommended` preset. Legacy config moved to `recommended-legacy`. ([@michaelfaith](https://github.com/michaelfaith) in [#32457](https://github.com/facebook/react/pull/32457))
Repository: ollama/ollama
Pull request: interactive generate

generate prompt is now optional. if a prompt is omitted, it will start an interactive session

previous behaviour with prompt

```
$ ollama generate ~/Downloads/vicuna-7b-v1.3.ggmlv3.q4_0.bin 'Hi!'
>>> Hi!

 Hello! How can I help you today?

```

new behaviour without a prompt. ctrl-c to exit interactive mode

```
$ ollama generate ~/Downloads/vicuna-7b-v1.3.ggmlv3.q4_0.bin
>>> Hi!

 Hello! How can I help you today?

>>> How are you?

 I am just a computer program, so I don't have feelings or emotions like humans do. I exist solely to provide information and assist with tasks to the best of my abilities. Is there anything specific you would like help with today?

>>>
```

new behaviour with a input file
```
$ ollama generate orca-mini-3b.ggmlv3.q4_0 <questions.txt
>>> Hi!

 Hello! How can I assist you today?

>>> How are you?

 I'm doing well, thank you for asking. How about you?

>>>
```

Changed files:
filename: ollama/cmd/cli.py
patch: @@ -1,4 +1,5 @@
 import os
+import sys
 import json
 from pathlib import Path
 from argparse import ArgumentParser
@@ -20,7 +21,7 @@ def main():
 
     generate_parser = subparsers.add_parser("generate")
     generate_parser.add_argument("model")
-    generate_parser.add_argument("prompt")
+    generate_parser.add_argument("prompt", nargs="?")
     generate_parser.set_defaults(fn=generate)
 
     add_parser = subparsers.add_parser("add")
@@ -37,6 +38,8 @@ def main():
     try:
         fn = args.pop("fn")
         fn(**args)
+    except KeyboardInterrupt:
+        pass
     except KeyError:
         parser.print_help()
     except Exception as e:
@@ -49,12 +52,37 @@ def list_models(*args, **kwargs):
 
 
 def generate(*args, **kwargs):
+    if prompt := kwargs.get('prompt'):
+        print('>>>', prompt, flush=True)
+        print(flush=True)
+        generate_oneshot(*args, **kwargs)
+        print(flush=True)
+        return
+
+    return generate_interactive(*args, **kwargs)
+
+
+def generate_oneshot(*args, **kwargs):
     for output in engine.generate(*args, **kwargs):
         output = json.loads(output)
-
         choices = output.get("choices", [])
         if len(choices) > 0:
-            print(choices[0].get("text", ""), end="")
+            print(choices[0].get("text", ""), end="", flush=True)
+
+    print()
+
+
+def generate_interactive(*args, **kwargs):
+    print('>>> ', end='', flush=True)
+    for line in sys.stdin:
+        if not sys.stdin.isatty():
+            print(line, end='')
+
+        print(flush=True)
+        kwargs.update({'prompt': line})
+        generate_oneshot(*args, **kwargs)
+        print(flush=True)
+        print('>>> ', end='', flush=True)
 
 
 def add(model, models_home):

filename: ollama/engine.py
patch: @@ -27,7 +27,7 @@ def generate(model, prompt, models_home=".", llms={}, *args, **kwargs):
         kwargs.update({"max_tokens": 16384})
 
     if "stop" not in kwargs:
-        kwargs.update({"stop": ["Q:", "\n"]})
+        kwargs.update({"stop": ["Q:"]})
 
     if "stream" not in kwargs:
         kwargs.update({"stream": True})
Repository: electron/electron
Pull request: ci: add workflow to remove 'needs-signed-commits' label

#### Description of Change

This PR adds the ability for the label `needs-signed-commits` to be automatically removed when the author of the PR comments that they have signed their commits. This is a temporary functionality while a programmatic solution is explored for checking the status of the commits themselves.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included
- [ ] I have built and tested this PR
- [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: .github/workflows/issue-commented.yml
patch: @@ -33,7 +33,31 @@ jobs:
           ISSUE_URL: ${{ github.event.issue.html_url }}
         run: |
           gh issue edit $ISSUE_URL --remove-label 'blocked/need-repro','blocked/need-info ❌'
-
+  
+  pr-needs-signed-commits-commented:
+    name: Remove needs-signed-commits on comment
+    if: ${{ github.event.issue.pull_request && (contains(github.event.issue.labels.*.name, 'needs-signed-commits')) && (github.event.comment.user.login == github.event.issue.user.login) }}
+    runs-on: ubuntu-slim
+    steps:
+      - name: Get author association
+        id: get-author-association
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: *get-author-association
+      - name: Generate GitHub App token
+        uses: electron/github-app-auth-action@e14e47722ed120360649d0789e25b9baece12725 # v2.0.0
+        if: ${{ !contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), steps.get-author-association.outputs.author_association) }}
+        id: generate-token
+        with:
+          creds: ${{ secrets.ISSUE_TRIAGE_GH_APP_CREDS }}
+      - name: Remove label
+        if: ${{ !contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), steps.get-author-association.outputs.author_association) }}
+        env:
+          GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
+          ISSUE_URL: ${{ github.event.issue.html_url }}
+        run: |
+          gh issue edit $ISSUE_URL --remove-label 'needs-signed-commits'
+  
   pr-reviewer-requested:
     name: Maintainer requested reviewer on PR
     if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/request-review') && github.event.comment.user.type != 'Bot' }}
Repository: rust-lang/rust
Pull request: `std`: include `dlmalloc` for all non-wasi Wasm targets

Currently, building std for a custom Wasm target with an OS other than `unknown` will fail, because `sys/alloc/mod.rs` will attempt to use `sys/alloc/wasm.rs`, the dlmalloc-based allocator used on `wasm32-unknown-unknown`.  However, currently dlmalloc is only pulled in when `target_os = "unknown"`.

Instead, we should make `Cargo.toml` and `alloc/mod.rs` match: either
- disable `wasm.rs` in `alloc/mod.rs` where `not(target_os = "unknown")`, or
- pull in `dlmalloc` for all Wasm targets with  `target_family = "wasm32"` that aren't covered by the [upper branches of `alloc/mod.rs`](https://github.com/rust-lang/rust/blob/main/library/std/src/sys/alloc/mod.rs#L72-L100).

This PR takes the latter approach, because it allows more code to compile without a custom allocator.

<!-- 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 -->


Changed files:
filename: library/std/Cargo.toml
patch: @@ -62,7 +62,7 @@ path = "../windows_link"
 rand = { version = "0.9.0", default-features = false, features = ["alloc"] }
 rand_xorshift = "0.4.0"
 
-[target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), target_os = "xous", target_os = "vexos", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
+[target.'cfg(any(all(target_family = "wasm", not(any(unix, target_os = "wasi"))), target_os = "xous", target_os = "vexos", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
 dlmalloc = { version = "0.2.10", features = ['rustc-dep-of-std'] }
 
 [target.x86_64-fortanix-unknown-sgx.dependencies]
Repository: facebook/react
Pull request: [DevTools] Bump version for extensions

`./scripts/devtools/prepare-release.js` actually does automate the version bump, but only path / minor ones.

Changed files:
filename: packages/react-devtools-extensions/chrome/manifest.json
patch: @@ -2,8 +2,8 @@
   "manifest_version": 3,
   "name": "React Developer Tools",
   "description": "Adds React debugging tools to the Chrome Developer Tools.",
-  "version": "6.1.5",
-  "version_name": "6.1.5",
+  "version": "7.0.0",
+  "version_name": "7.0.0",
   "minimum_chrome_version": "114",
   "icons": {
     "16": "icons/16-production.png",

filename: packages/react-devtools-extensions/edge/manifest.json
patch: @@ -2,8 +2,8 @@
   "manifest_version": 3,
   "name": "React Developer Tools",
   "description": "Adds React debugging tools to the Microsoft Edge Developer Tools.",
-  "version": "6.1.5",
-  "version_name": "6.1.5",
+  "version": "7.0.0",
+  "version_name": "7.0.0",
   "minimum_chrome_version": "114",
   "icons": {
     "16": "icons/16-production.png",

filename: packages/react-devtools-extensions/firefox/manifest.json
patch: @@ -2,7 +2,7 @@
   "manifest_version": 3,
   "name": "React Developer Tools",
   "description": "Adds React debugging tools to the Firefox Developer Tools.",
-  "version": "6.1.5",
+  "version": "7.0.0",
   "browser_specific_settings": {
     "gecko": {
       "id": "@react-devtools",
Repository: facebook/react
Pull request: [ci] Fix incorrect filtering logic for prereleases


The workflow was correctly publishing the package(s) specified in `only`, but due to incorrect logic it would also run the 'Publish all packages' step.


Changed files:
filename: .github/workflows/runtime_prereleases.yml
patch: @@ -93,7 +93,7 @@ jobs:
             --tags=${{ inputs.dist_tag }} \
             --skipPackages=${{ inputs.skip_packages }} ${{ (inputs.dry && '') || '\'}}
             ${{ inputs.dry && '--dry' || '' }}
-      - if: '${{ !(inputs.skip_packages && inputs.only_packages) }}'
+      - if: '${{ !inputs.skip_packages && !inputs.only_packages }}'
         name: 'Publish all packages'
         run: |
           scripts/release/publish.js \
Repository: nodejs/node
Pull request: doc: fix some policy scope typos


Changed files:
filename: doc/api/permissions.md
patch: @@ -178,7 +178,7 @@ different strings to point to the same module (such as excluding the extension).
 
 Specifier strings are canonicalized but not resolved prior to be used for
 matching in order to have some compatibility with import maps, for example if a
-resource `file:///C:/app/server.js` was given the following redirection from a
+resource `file:///C:/app/utils.js` was given the following redirection from a
 policy located at `file:///C:/app/policy.json`:
 
 ```json
@@ -303,15 +303,15 @@ delegate to the next relevant scope for `file:///C:/app/bin/main.js`, `"file:"`.
 
 This determines the policy for all file based resources within `"file:///C:/"`.
 This is not in the `"scopes"` field of the policy and would be skipped. It would
-not be used for `file:///C:/app/bin/main.js` unless `"file:///"` is set to
-cascade or is not in the `"scopes"` of the policy.
+not be used for `file:///C:/app/bin/main.js` unless `"file:///C:/app/"` is set
+to cascade or is not in the `"scopes"` of the policy.
 
 4. `"file:///"`
 
 This determines the policy for all file based resources on the `localhost`. This
 is not in the `"scopes"` field of the policy and would be skipped. It would not
-be used for `file:///C:/app/bin/main.js` unless `"file:///"` is set to cascade
-or is not in the `"scopes"` of the policy.
+be used for `file:///C:/app/bin/main.js` unless `"file:///C:/"` is set to
+cascade or is not in the `"scopes"` of the policy.
 
 5. `"file:"`