helloadhavan/github_issues huggingface dataset:
Repository: denoland/deno
Pull request: fix(lsp): discard quick fixes importing /node_modules/ paths

Fixes #28412.

Changed files:
filename: cli/lsp/analysis.rs
patch: @@ -594,7 +594,16 @@ impl<'a> TsResponseImportMapper<'a> {
         resolution_mode,
         NodeResolutionKind::Types,
       )
-      .is_ok()
+      .ok()
+      .filter(|s| {
+        let specifier = self
+          .tsc_specifier_map
+          .normalize(s.as_str())
+          .map(Cow::Owned)
+          .unwrap_or(Cow::Borrowed(s));
+        !specifier.as_str().contains("/node_modules/")
+      })
+      .is_some()
   }
 }
 

filename: tests/integration/lsp_tests.rs
patch: @@ -8890,6 +8890,74 @@ fn lsp_npm_reexport_from_non_export() {
   client.shutdown();
 }
 
+// Regression test for https://github.com/denoland/deno/issues/28412.
+#[test]
+#[timeout(300_000)]
+fn lsp_npm_reexport_from_non_export_add_import_quick_fix() {
+  let context = TestContextBuilder::new()
+    .use_http_server()
+    .use_temp_cwd()
+    .add_npm_env_vars()
+    .build();
+  let temp_dir = context.temp_dir();
+  temp_dir.write(
+    "deno.json",
+    json!({
+      "nodeModulesDir": "auto",
+    })
+    .to_string(),
+  );
+  context.run_deno("add npm:@denotest/reexport-from-non-export");
+  temp_dir.write(
+    "other.ts",
+    "import \"@denotest/reexport-from-non-export\";\n",
+  );
+  let file = temp_dir.source_file("file.ts", "getValue;\n");
+  let mut client = context.new_lsp_command().build();
+  client.initialize_default();
+  let diagnostics = client.did_open_file(&file);
+  let res = client.write_request(
+    "textDocument/codeAction",
+    json!(json!({
+      "textDocument": { "uri": file.uri() },
+      "range": {
+        "start": { "line": 0, "character": 0 },
+        "end": { "line": 0, "character": 8 },
+      },
+      "context": {
+        "diagnostics": diagnostics.all(),
+        "only": ["quickfix"],
+      },
+    })),
+  );
+  assert_eq!(
+    res,
+    json!([
+      {
+        "title": "Add import from \"@denotest/reexport-from-non-export\"",
+        "kind": "quickfix",
+        "diagnostics": diagnostics.all(),
+        "edit": {
+          "documentChanges": [{
+            "textDocument": {
+              "uri": file.uri(),
+              "version": 1,
+            },
+            "edits": [{
+              "range": {
+                "start": { "line": 0, "character": 0 },
+                "end": { "line": 0, "character": 0 },
+              },
+              "newText": "import { getValue } from \"@denotest/reexport-from-non-export\";\n\n",
+            }],
+          }],
+        },
+      },
+    ]),
+  );
+  client.shutdown();
+}
+
 // Regression test for https://github.com/denoland/deno/issues/28676.
 #[test]
 #[timeout(300_000)]
Repository: huggingface/transformers
Pull request: Defaults to adamw_torch_fused for  Pytorch>=2.8

# What does this PR do?
 
According to the comment, transformers should default to adamw_torch_fused after PT 2.1. However, the condition is lift to PT 2.8 to ensure that adamw_torch_fused is mature enough.

Changed files:
filename: src/transformers/pytorch_utils.py
patch: @@ -28,6 +28,7 @@
 
 logger = logging.get_logger(__name__)
 
+is_torch_greater_or_equal_than_2_8 = is_torch_greater_or_equal("2.8", accept_dev=True)
 is_torch_greater_or_equal_than_2_6 = is_torch_greater_or_equal("2.6", accept_dev=True)
 is_torch_greater_or_equal_than_2_4 = is_torch_greater_or_equal("2.4", accept_dev=True)
 is_torch_greater_or_equal_than_2_3 = is_torch_greater_or_equal("2.3", accept_dev=True)

filename: src/transformers/training_args.py
patch: @@ -609,7 +609,7 @@ class TrainingArguments:
             - `"tpu_metrics_debug"`: print debug metrics on TPU
 
             The options should be separated by whitespaces.
-        optim (`str` or [`training_args.OptimizerNames`], *optional*, defaults to `"adamw_torch"`):
+        optim (`str` or [`training_args.OptimizerNames`], *optional*, defaults to `"adamw_torch"` (for torch>=2.8 `"adamw_torch_fused"`)):
             The optimizer to use, such as "adamw_torch", "adamw_torch_fused", "adamw_apex_fused", "adamw_anyprecision",
             "adafactor". See `OptimizerNames` in [training_args.py](https://github.com/huggingface/transformers/blob/main/src/transformers/training_args.py)
             for a full list of optimizers.
@@ -1280,11 +1280,11 @@ class TrainingArguments:
     )
 
     default_optim = "adamw_torch"
-    # XXX: enable when pytorch==2.0.1 comes out - we want to give it time to get all the bugs sorted out
-    # if is_torch_available():
-    #     default_optim = "adamw_torch_fused"
-    # and update the doc above to:
-    # optim (`str` or [`training_args.OptimizerNames`], *optional*, defaults to `"adamw_torch_fused"` (for torch<2.1.0 `"adamw_torch"`):
+    if is_torch_available():
+        from .pytorch_utils import is_torch_greater_or_equal_than_2_8
+
+        if is_torch_greater_or_equal_than_2_8:
+            default_optim = "adamw_torch_fused"
     optim: Union[OptimizerNames, str] = field(
         default=default_optim,
         metadata={"help": "The optimizer to use."},

filename: tests/models/git/test_modeling_git.py
patch: @@ -347,7 +347,8 @@ def _test_beam_search_generate(self, config, input_ids, input_mask, pixel_values
             num_return_sequences=2,
         )
 
-        self.parent.assertEqual(generated_ids.shape, (self.batch_size * 2, 20))
+        self.parent.assertEqual(generated_ids.shape[0], self.batch_size * 2)
+        self.parent.assertTrue(generated_ids.shape[1] < 20)
 
     def _test_batched_generate_captioning(self, config, input_ids, input_mask, pixel_values):
         model = GitForCausalLM(config=config)
Repository: facebook/react
Pull request: Convert ReactError-test to createRoot


Changed files:
filename: packages/shared/__tests__/ReactError-test.internal.js
patch: @@ -9,7 +9,8 @@
 'use strict';
 
 let React;
-let ReactDOM;
+let ReactDOMClient;
+let act;
 
 describe('ReactError', () => {
   let globalErrorMock;
@@ -27,7 +28,8 @@ describe('ReactError', () => {
     }
     jest.resetModules();
     React = require('react');
-    ReactDOM = require('react-dom');
+    ReactDOMClient = require('react-dom/client');
+    act = require('internal-test-utils').act;
   });
 
   afterEach(() => {
@@ -39,20 +41,35 @@ describe('ReactError', () => {
   // @gate build === "production"
   // @gate !source
   it('should error with minified error code', () => {
-    expect(() => ReactDOM.render('Hi', null)).toThrowError(
+    expect(() => {
+      ReactDOMClient.createRoot(null);
+    }).toThrowError(
       'Minified React error #200; visit ' +
         'https://react.dev/errors/200' +
         ' for the full message or use the non-minified dev environment' +
         ' for full errors and additional helpful warnings.',
     );
   });
 
-  it('should serialize arguments', () => {
+  // @gate build === "production"
+  // @gate !source
+  it('should serialize arguments', async () => {
     function Oops() {
-      return;
+      return {};
     }
     Oops.displayName = '#wtf';
+
     const container = document.createElement('div');
-    expect(() => ReactDOM.render(<Oops />, container)).not.toThrowError();
+    const root = ReactDOMClient.createRoot(container);
+    await expect(async () => {
+      await act(async () => {
+        root.render(<Oops />);
+      });
+    }).rejects.toThrow(
+      'Minified React error #152; visit ' +
+        'https://reactjs.org/docs/error-decoder.html?invariant=152&args[]=%23wtf' +
+        ' for the full message or use the non-minified dev environment' +
+        ' for full errors and additional helpful warnings.',
+    );
   });
 });
Repository: electron/electron
Pull request: fix: crash on `getUserMedia` with invalid `chromeMediaSourceId`

Backport of #45733

See that PR for details.


Notes: Fixed a potential crash when calling legacy `getUserMedia` with an invalid  `chromeMediaSourceId`.


Changed files:
filename: shell/browser/web_contents_permission_helper.cc
patch: @@ -101,16 +101,20 @@ void HandleUserMediaRequest(const content::MediaStreamRequest& request,
             : "");
   }
 
-  if (request.video_type == MediaStreamType::GUM_TAB_VIDEO_CAPTURE ||
-      request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE) {
+  if (request.video_type == MediaStreamType::GUM_TAB_VIDEO_CAPTURE) {
+    devices_ref.video_device =
+        blink::MediaStreamDevice(request.video_type, "", "");
+  } else if (request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE) {
+    // If the DesktopMediaID can't be successfully parsed, throw an
+    // Invalid state error to match upstream.
+    auto dm_id = GetScreenId(request.requested_video_device_ids);
+    if (dm_id.is_null()) {
+      std::move(callback).Run(blink::mojom::StreamDevicesSet(),
+                              MediaStreamRequestResult::INVALID_STATE, nullptr);
+      return;
+    }
     devices_ref.video_device = blink::MediaStreamDevice(
-        request.video_type,
-        request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE
-            ? GetScreenId(request.requested_video_device_ids).ToString()
-            : "",
-        request.video_type == MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE
-            ? "Screen"
-            : "");
+        request.video_type, dm_id.ToString(), "Screen");
   }
 
   bool empty = !devices_ref.audio_device.has_value() &&

filename: spec/api-media-handler-spec.ts
patch: @@ -401,6 +401,23 @@ describe('setDisplayMediaRequestHandler', () => {
     expect(ok).to.be.true(message);
   });
 
+  it('throws an error when calling legacy getUserMedia with invalid chromeMediaSourceId', async () => {
+    const w = new BrowserWindow({ show: false });
+    await w.loadURL(serverUrl);
+    const { ok, message } = await w.webContents.executeJavaScript(`
+      new Promise((resolve, reject) => navigator.getUserMedia({
+         video: {
+          mandatory: {
+            chromeMediaSource: 'desktop',
+            chromeMediaSourceId: undefined,
+          },
+        },
+      }, x => resolve({ok: x instanceof MediaStream}), e => resolve({ ok: false, message: e.message })))
+    `);
+    expect(ok).to.be.false();
+    expect(message).to.equal('Invalid state');
+  });
+
   it('can remove a displayMediaRequestHandler', async () => {
     const ses = session.fromPartition('' + Math.random());
Repository: nodejs/node
Pull request: doc: add HBSPS as triager

I would like to apply to be a triager for this project.

With the help of the community, I’ve been able to contribute to Node.js in various ways.
Now, I want to give back to the community that has supported me.
I’ll do my best to help more people and, through that, contribute to the growth of our community.

As part of this journey, I will continue to deepen my understanding of Node.js and stay actively involved.

I have read and agree to abide by the Code of Conduct.

Changed files:
filename: README.md
patch: @@ -755,6 +755,8 @@ maintaining the Node.js project.
   **Gireesh Punathil** <<gpunathi@in.ibm.com>> (he/him)
 * [gurgunday](https://github.com/gurgunday) -
   **Gürgün Dayıoğlu** <<hey@gurgun.day>>
+* [HBSPS](https://github.com/HBSPS) -
+  **Wiyeong Seo** <<hbsps.dev@gmail.com>>
 * [iam-frankqiu](https://github.com/iam-frankqiu) -
   **Frank Qiu** <<iam.frankqiu@gmail.com>> (he/him)
 * [KevinEady](https://github.com/KevinEady) -
Repository: huggingface/transformers
Pull request: [`CI`] Fix partially red CI

- #37358 modified a test which fails
- Make `fix-copies` revealed some strange behavior with the new modernbert docstrings -> "Args:..." is not necessary

Changed files:
filename: tests/models/git/test_modeling_git.py
patch: @@ -347,8 +347,7 @@ def _test_beam_search_generate(self, config, input_ids, input_mask, pixel_values
             num_return_sequences=2,
         )
 
-        self.parent.assertEqual(generated_ids.shape[0], self.batch_size * 2)
-        self.parent.assertTrue(generated_ids.shape[1] < 20)
+        self.parent.assertEqual(generated_ids.shape, (self.batch_size * 2, 20))
 
     def _test_batched_generate_captioning(self, config, input_ids, input_mask, pixel_values):
         model = GitForCausalLM(config=config)
Repository: huggingface/transformers
Pull request: Fixes #39204: add fallback if get_base_model missing

This PR adds a fallback mechanism to extract the base model from a PEFT-wrapped model in case the get_base_model() method is missing. Specifically, it attempts to retrieve model.base_model.model if get_base_model is not available. This improves compatibility with different PEFT wrappers and custom model classes.

The logic has been extracted into a dedicated try_get_base_model utility function to improve code reuse and robustness.

Fixes #39204.


## 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://github.com/huggingface/transformers/issues/39204)? 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?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Changed files:
filename: src/transformers/trainer.py
patch: @@ -631,7 +631,12 @@ def __init__(
         unwrapped_model = self.accelerator.unwrap_model(model)
         # We also unwrap peft model
         if _is_peft_model(unwrapped_model):
-            unwrapped_model = unwrapped_model.get_base_model()
+            if hasattr(unwrapped_model, "get_base_model"):
+                unwrapped_model = unwrapped_model.get_base_model()
+            elif hasattr(unwrapped_model, "base_model") and hasattr(unwrapped_model.base_model, "model"):
+                unwrapped_model = unwrapped_model.base_model.model
+            else:
+                raise AttributeError("Cannot extract base model safely from this PEFT wrapper.")
 
         # Check if the model has explicit setup for loss kwargs,
         # if not, check if `**kwargs` are in model.forward
Repository: denoland/deno
Pull request: perf(lsp): don't diff 10,000+ line files for formatting

Fixes https://github.com/denoland/vscode_deno/issues/1293.

Changed files:
filename: cli/lsp/text.rs
patch: @@ -73,10 +73,10 @@ pub fn get_edits(a: &str, b: &str, line_index: &LineIndex) -> Vec<TextEdit> {
   if a == b {
     return vec![];
   }
-  // Heuristic to detect things like minified files. `diff()` is expensive.
-  if b.chars().filter(|c| *c == '\n').count()
-    > line_index.inner.utf8_offsets_len() * 3
-  {
+  // Heuristic to detect things like large JSON or minified files. `diff()` is
+  // expensive.
+  let b_lines = b.chars().filter(|c| *c == '\n').count();
+  if b_lines > 10000 || b_lines > line_index.inner.utf8_offsets_len() * 3 {
     return vec![TextEdit {
       range: lsp::Range {
         start: lsp::Position::new(0, 0),
Repository: ggml-org/llama.cpp
Pull request: Hermes 2 tool calling : fixed crash when <tool_call> had a newline before it

Fixes #15608

Changed files:
filename: common/chat.cpp
patch: @@ -1892,7 +1892,7 @@ static common_chat_params common_chat_params_init_hermes_2_pro(const common_chat
                 // If thinking_forced_open, then we capture the </think> tag in the grammar,
                 // (important for required tool choice) and in the trigger's first capture (decides what is sent to the grammar)
                 std::string(data.thinking_forced_open ? "[\\s\\S]*?(</think>\\s*)" : "(?:<think>[\\s\\S]*?</think>\\s*)?") + (
-                    "(\\s*"
+                    "\\s*("
                     "(?:<tool_call>"
                     "|<function"
                     "|(?:```(?:json|xml)?\n\\s*)?(?:<function_call>|<tools>|<xml><json>|<response>)?"
Repository: electron/electron
Pull request: build: skip chromium git cookie on forks

Backport of #45735

See that PR for details.


Notes: none


Changed files:
filename: .github/actions/set-chromium-cookie/action.yml
patch: @@ -4,7 +4,7 @@ runs:
   using: "composite"
   steps:
   - name: Set the git cookie from chromium.googlesource.com (Unix)
-    if: ${{ runner.os != 'Windows' }}
+    if: ${{ runner.os != 'Windows' && env.CHROMIUM_GIT_COOKIE }}
     shell: bash
     run: |
       eval 'set +o history' 2>/dev/null || setopt HIST_IGNORE_SPACE 2>/dev/null
@@ -18,7 +18,7 @@ runs:
       __END__
       eval 'set -o history' 2>/dev/null || unsetopt HIST_IGNORE_SPACE 2>/dev/null
   - name: Set the git cookie from chromium.googlesource.com (Windows)
-    if: ${{ runner.os == 'Windows' }}
+    if: ${{ runner.os == 'Windows' && env.CHROMIUM_GIT_COOKIE_WINDOWS_STRING }}
     shell: cmd
     run: |
       git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
Repository: vercel/next.js
Pull request: Turbopack: cleanup NextConfig derives

`OperationValue` doesn't appear to be needed. Does that mean it can be removed without further consideration? Or can it still affect behavior?

Closes PACK-4946

Changed files:
filename: crates/next-core/src/next_config.rs
patch: @@ -60,8 +60,8 @@ impl Default for CacheKinds {
     }
 }
 
-#[turbo_tasks::value(serialization = "custom", eq = "manual")]
-#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, OperationValue)]
+#[turbo_tasks::value(eq = "manual")]
+#[derive(Clone, Debug, Default, PartialEq)]
 #[serde(default, rename_all = "camelCase")]
 pub struct NextConfig {
     // TODO all fields should be private and access should be wrapped within a turbo-tasks function
Repository: nodejs/node
Pull request: test: skip test-buffer-tostring-rangeerror when low on memory

This has shown up as RangeError: Array buffer allocation failed and it should be totally fine to skip this test in case the memory is low.

https://ci.nodejs.org/job/node-test-binary-windows-js-suites/33969/RUN_SUBSET=2,nodes=win2019-COMPILED_BY-vs2019/console

```
13:36:31 not ok 105 parallel/test-buffer-tostring-rangeerror
13:36:31   ---
13:36:31   duration_ms: 263.03700
13:36:31   severity: fail
13:36:31   exitcode: 1
13:36:31   stack: |-
13:36:31     node:assert:377
13:36:31           throw err;
13:36:31           ^
13:36:31     
13:36:31     AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
13:36:31     + actual - expected
13:36:31     
13:36:31       Comparison {
13:36:31     +   name: 'RangeError'
13:36:31     -   code: 'ERR_STRING_TOO_LONG',
13:36:31     -   name: 'Error'
13:36:31       }
13:36:31         at Object.<anonymous> (C:\workspace\node-test-binary-windows-js-suites\node\test\parallel\test-buffer-tostring-rangeerror.js:21:8)
13:36:31         at Module._compile (node:internal/modules/cjs/loader:1529:14)
13:36:31         at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
13:36:31         at Module.load (node:internal/modules/cjs/loader:1275:32)
13:36:31         at Module._load (node:internal/modules/cjs/loader:1096:12)
13:36:31         at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:164:12)
13:36:31         at node:internal/main/run_main_module:28:49 {
13:36:31       generatedMessage: true,
13:36:31       code: 'ERR_ASSERTION',
13:36:31       actual: RangeError: Array buffer allocation failed
13:36:31           at new ArrayBuffer (<anonymous>)
13:36:31           at new Uint8Array (<anonymous>)
13:36:31           at new FastBuffer (node:internal/buffer:961:5)
13:36:31           at Function.alloc (node:buffer:397:10)
13:36:31           at Buffer (node:buffer:275:19)
13:36:31           at C:\workspace\node-test-binary-windows-js-suites\node\test\parallel\test-buffer-tostring-rangeerror.js:21:21
13:36:31           at getActual (node:assert:498:5)
13:36:31           at Function.throws (node:assert:644:24)
13:36:31           at Object.<anonymous> (C:\workspace\node-test-binary-windows-js-suites\node\test\parallel\test-buffer-tostring-rangeerror.js:21:8)
13:36:31           at Module._compile (node:internal/modules/cjs/loader:1529:14),
13:36:31       expected: { code: 'ERR_STRING_TOO_LONG', name: 'Error' },
13:36:31       operator: 'throws'
13:36:31     }
13:36:31     
13:36:31     Node.js v20.19.2-pre
13:36:31   ...
```

Changed files:
filename: test/parallel/test-buffer-tostring-rangeerror.js
patch: @@ -1,10 +1,15 @@
 'use strict';
-require('../common');
+
+const common = require('../common');
 
 // This test ensures that Node.js throws an Error when trying to convert a
 // large buffer into a string.
 // Regression test for https://github.com/nodejs/node/issues/649.
 
+if (!common.enoughTestMem) {
+  common.skip('skipped due to memory requirements');
+}
+
 const assert = require('assert');
 const {
   Buffer,
Repository: facebook/react
Pull request: Convert ReactUpdaters-test.internal to createRoot

Convert ReactUpdaters-test.internal to createRoot


Changed files:
filename: packages/react-reconciler/src/__tests__/ReactUpdaters-test.internal.js
patch: @@ -106,15 +106,15 @@ describe('updaters', () => {
 
     const Parent = () => <Child />;
     const Child = () => null;
-    const container = document.createElement('div');
+    const root = ReactDOMClient.createRoot(document.createElement('div'));
 
     await act(() => {
-      ReactDOM.render(<Parent />, container);
+      root.render(<Parent />);
     });
     expect(allSchedulerTags).toEqual([[HostRoot]]);
 
     await act(() => {
-      ReactDOM.render(<Parent />, container);
+      root.render(<Parent />);
     });
     expect(allSchedulerTags).toEqual([[HostRoot], [HostRoot]]);
   });
@@ -141,8 +141,9 @@ describe('updaters', () => {
     };
     const Child = () => null;
 
+    const root = ReactDOMClient.createRoot(document.createElement('div'));
     await act(() => {
-      ReactDOM.render(<Parent />, document.createElement('div'));
+      root.render(<Parent />);
     });
     expect(scheduleForA).not.toBeNull();
     expect(scheduleForB).not.toBeNull();
@@ -174,8 +175,9 @@ describe('updaters', () => {
     }
     const Child = () => null;
     let instance;
+    const root = ReactDOMClient.createRoot(document.createElement('div'));
     await act(() => {
-      ReactDOM.render(<Parent />, document.createElement('div'));
+      root.render(<Parent />);
     });
     expect(allSchedulerTypes).toEqual([[null]]);