helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: [`CI`] Fix post merge ernie 4.5

#39339 was merged right before the Ernie 4.5 models and I didn't check with main again :/ fixes the repo consistency based on that

cc @molbap @ArthurZucker 

Changed files:
filename: src/transformers/models/ernie4_5/modeling_ernie4_5.py
patch: @@ -350,12 +350,6 @@ def __init__(self, config: Ernie4_5Config):
         # Initialize weights and apply final processing
         self.post_init()
 
-    def get_input_embeddings(self):
-        return self.embed_tokens
-
-    def set_input_embeddings(self, value):
-        self.embed_tokens = value
-
     @check_model_inputs
     @auto_docstring
     def forward(
@@ -432,18 +426,6 @@ def __init__(self, config):
         # Initialize weights and apply final processing
         self.post_init()
 
-    def get_input_embeddings(self):
-        return self.model.embed_tokens
-
-    def set_input_embeddings(self, value):
-        self.model.embed_tokens = value
-
-    def get_output_embeddings(self):
-        return self.lm_head
-
-    def set_output_embeddings(self, new_embeddings):
-        self.lm_head = new_embeddings
-
     def set_decoder(self, decoder):
         self.model = decoder
 

filename: src/transformers/models/ernie4_5_moe/modeling_ernie4_5_moe.py
patch: @@ -516,12 +516,6 @@ def __init__(self, config: Ernie4_5_MoEConfig):
         # Initialize weights and apply final processing
         self.post_init()
 
-    def get_input_embeddings(self):
-        return self.embed_tokens
-
-    def set_input_embeddings(self, value):
-        self.embed_tokens = value
-
     @check_model_inputs
     @auto_docstring
     def forward(
@@ -687,18 +681,6 @@ def __init__(self, config):
         # Initialize weights and apply final processing
         self.post_init()
 
-    def get_input_embeddings(self):
-        return self.model.embed_tokens
-
-    def set_input_embeddings(self, value):
-        self.model.embed_tokens = value
-
-    def get_output_embeddings(self):
-        return self.lm_head
-
-    def set_output_embeddings(self, new_embeddings):
-        self.lm_head = new_embeddings
-
     def set_decoder(self, decoder):
         self.model = decoder
Repository: facebook/react
Pull request: Importing React for the first example.

Importing react in the example to have consistency in relation to the others.

Changed files:
filename: packages/react-is/README.md
patch: @@ -17,6 +17,7 @@ npm install react-is
 ### Determining if a Component is Valid
 
 ```js
+import React from "react";
 import * as ReactIs from "react-is";
 
 class ClassComponent extends React.Component {
Repository: nodejs/node
Pull request: url: runtime deprecate url.parse

We documentation-only deprecated URL.parse on v18, almost 2 years ago. Without a runtime deprecation people will continue to use it and be exposed to security flaws. This is a nudge on the direction for a possible EOL in 3-5 years?

cc @nodejs/tsc

Changed files:
filename: doc/api/deprecations.md
patch: @@ -3453,6 +3453,10 @@ Node-API callbacks.
 
 <!-- YAML
 changes:
+  - version:
+      - REPLACEME
+    pr-url: https://github.com/nodejs/node/pull/55017
+    description: Application deprecation.
   - version:
       - v19.9.0
       - v18.17.0
@@ -3465,7 +3469,7 @@ changes:
     description: Documentation-only deprecation.
 -->
 
-Type: Documentation-only (supports [`--pending-deprecation`][])
+Type: Application (non-`node_modules` code only)
 
 [`url.parse()`][] behavior is not standardized and prone to errors that
 have security implications. Use the [WHATWG URL API][] instead. CVEs are not

filename: lib/url.js
patch: @@ -46,6 +46,7 @@ const {
 // This ensures setURLConstructor() is called before the native
 // URL::ToObject() method is used.
 const { spliceOne } = require('internal/util');
+const { isInsideNodeModules } = internalBinding('util');
 
 // WHATWG URL implementation provided by internal/url
 const {
@@ -63,8 +64,6 @@ const {
 
 const bindingUrl = internalBinding('url');
 
-const { getOptionValue } = require('internal/options');
-
 // Original url.parse() API
 
 function Url() {
@@ -125,7 +124,7 @@ const {
 let urlParseWarned = false;
 
 function urlParse(url, parseQueryString, slashesDenoteHost) {
-  if (!urlParseWarned && getOptionValue('--pending-deprecation')) {
+  if (!urlParseWarned && !isInsideNodeModules(100, true)) {
     urlParseWarned = true;
     process.emitWarning(
       '`url.parse()` behavior is not standardized and prone to ' +

filename: test/parallel/test-url-parse-invalid-input.js
patch: @@ -90,12 +90,12 @@ if (common.hasIntl) {
   });
 
   // Warning should only happen once per process.
-  const expectedWarning = [
-    `The URL ${badURLs[0]} is invalid. Future versions of Node.js will throw an error.`,
-    'DEP0170',
-  ];
   common.expectWarning({
-    DeprecationWarning: expectedWarning,
+    DeprecationWarning: {
+      // eslint-disable-next-line @stylistic/js/max-len
+      DEP0169: '`url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.',
+      DEP0170: `The URL ${badURLs[0]} is invalid. Future versions of Node.js will throw an error.`,
+    },
   });
   badURLs.forEach((badURL) => {
     url.parse(badURL);

filename: typings/internalBinding/util.d.ts
patch: @@ -45,4 +45,5 @@ export interface UtilBinding {
   guessHandleType(fd: number): 'TCP' | 'TTY' | 'UDP' | 'FILE' | 'PIPE' | 'UNKNOWN';
   parseEnv(content: string): Record<string, string>;
   styleText(format: Array<string> | string, text: string): string;
+  isInsideNodeModules(frameLimit: number, defaultValue: unknown): boolean;
 }
Repository: denoland/deno
Pull request: fix(ext/node): use primordials in `ext/node/polyfills/internal/querystring.ts`

Towards #24236. Replaces JS intrinsics with equivalent primordial versions.

<!--
Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label.
-->


Changed files:
filename: ext/node/polyfills/internal/querystring.ts
patch: @@ -1,13 +1,22 @@
 // Copyright 2018-2025 the Deno authors. MIT license.
 
-// TODO(petamoriken): enable prefer-primordials for node polyfills
-// deno-lint-ignore-file prefer-primordials
-
 import { ERR_INVALID_URI } from "ext:deno_node/internal/errors.ts";
+import { primordials } from "ext:core/mod.js";
+const {
+  Array,
+  Int8Array,
+  NumberPrototypeToString,
+  StringPrototypeCharCodeAt,
+  StringPrototypeSlice,
+  StringPrototypeToUpperCase,
+} = primordials;
 
 export const hexTable = new Array(256);
 for (let i = 0; i < 256; ++i) {
-  hexTable[i] = "%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase();
+  hexTable[i] = "%" +
+    StringPrototypeToUpperCase(
+      (i < 16 ? "0" : "") + NumberPrototypeToString(i, 16),
+    );
 }
 
 // deno-fmt-ignore
@@ -42,17 +51,17 @@ export function encodeStr(
   let lastPos = 0;
 
   for (let i = 0; i < len; i++) {
-    let c = str.charCodeAt(i);
+    let c = StringPrototypeCharCodeAt(str, i);
     // ASCII
     if (c < 0x80) {
       if (noEscapeTable[c] === 1) continue;
-      if (lastPos < i) out += str.slice(lastPos, i);
+      if (lastPos < i) out += StringPrototypeSlice(str, lastPos, i);
       lastPos = i + 1;
       out += hexTable[c];
       continue;
     }
 
-    if (lastPos < i) out += str.slice(lastPos, i);
+    if (lastPos < i) out += StringPrototypeSlice(str, lastPos, i);
 
     // Multi-byte characters ...
     if (c < 0x800) {
@@ -75,7 +84,7 @@ export function encodeStr(
     // completion's sake anyway.
     if (i >= len) throw new ERR_INVALID_URI();
 
-    const c2 = str.charCodeAt(i) & 0x3ff;
+    const c2 = StringPrototypeCharCodeAt(str, i) & 0x3ff;
 
     lastPos = i + 1;
     c = 0x10000 + (((c & 0x3ff) << 10) | c2);
@@ -85,7 +94,7 @@ export function encodeStr(
       hexTable[0x80 | (c & 0x3f)];
   }
   if (lastPos === 0) return str;
-  if (lastPos < len) return out + str.slice(lastPos);
+  if (lastPos < len) return out + StringPrototypeSlice(str, lastPos);
   return out;
 }
Repository: ggml-org/llama.cpp
Pull request: server : adjust prompt similarity thold + add logs

fix #15894

The default prompt similarity threshold for reusing server slots is arguably too high (`0.5` on `master`). Reduce it to `0.1`. Also add a couple of logs to make the decisions about selecting a slot more clear.

Changed files:
filename: common/common.h
patch: @@ -452,7 +452,7 @@ struct common_params {
 
     std::string slot_save_path;
 
-    float slot_prompt_similarity = 0.5f;
+    float slot_prompt_similarity = 0.1f;
 
     // batched-bench params
     bool is_pp_shared = false;

filename: tools/server/server.cpp
patch: @@ -2372,7 +2372,7 @@ struct server_context {
             }
 
             if (ret != nullptr) {
-                SLT_DBG(*ret, "selected slot by lcs similarity, lcs_len = %d, similarity = %f\n", lcs_len, similarity);
+                SLT_INF(*ret, "selected slot by lcs similarity, lcs_len = %d, similarity = %.3f (> %.3f thold)\n", lcs_len, similarity, slot_prompt_similarity);
             }
         }
 
@@ -2394,7 +2394,7 @@ struct server_context {
             }
 
             if (ret != nullptr) {
-                SLT_DBG(*ret, "selected slot by lru, t_last = %" PRId64 "\n", t_last);
+                SLT_INF(*ret, "selected slot by LRU, t_last = %" PRId64 "\n", t_last);
             }
         }
Repository: ggml-org/llama.cpp
Pull request: vulkan: Make device memory check more portable

Slightly changing the device memory check allows the ggml Vulkan backend to build again on Debian 12/bookworm.

Closes #15914


Changed files:
filename: ggml/src/ggml-vulkan/ggml-vulkan.cpp
patch: @@ -1960,7 +1960,7 @@ static vk_buffer ggml_vk_create_buffer(vk_device& device, size_t size, const std
         }
     }
 
-    if (buf->device_memory == VK_NULL_HANDLE) {
+    if (!buf->device_memory) {
         device->device.destroyBuffer(buf->buffer);
         throw vk::OutOfDeviceMemoryError("No suitable memory type found");
     }
Repository: denoland/deno
Pull request: fix(ext/node): export CallTracker as named export

#29226 added CallTracker via default export of `node:assert`. This PR adds it as named export of `node:assert` as well.

Changed files:
filename: ext/node/polyfills/assert.ts
patch: @@ -938,6 +938,7 @@ export default Object.assign(assert, {
 
 export {
   AssertionError,
+  CallTracker_ as CallTracker,
   deepEqual,
   deepStrictEqual,
   doesNotMatch,

filename: tests/unit_node/assert_test.ts
patch: @@ -24,3 +24,9 @@ Deno.test("[node/assert] deepStrictEqual(0, -0)", () => {
     },
   );
 });
+
+Deno.test("[node/assert] CallTracker correctly exported", () => {
+  assert.strictEqual(typeof assert.CallTracker, "function");
+  assert.strictEqual(typeof assert.default.CallTracker, "function");
+  assert.strictEqual(assert.CallTracker, assert.default.CallTracker);
+});
Repository: nodejs/node
Pull request: test: remove unnecessary `console.log` from test-repl-null-thrown

Super minor, but I noticed this rouge `console.log` and figured that we might just as well get rid of it :slightly_smiling_face: 

<!--
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: test/parallel/test-repl-null-thrown.js
patch: @@ -19,6 +19,5 @@ replserver.emit('line', 'process.nextTick(() => { throw null; })');
 replserver.emit('line', '.exit');
 
 setTimeout(() => {
-  console.log(text);
   assert(text.includes('Uncaught null'));
 }, 0);
Repository: electron/electron
Pull request: ci: preserve `blocked/*` labels on collaborator comments

#### Description of Change

We have a CI task that removes the `blocked/need-repro` and `blocked/need-info` labels when a user comments on an issue.

That task is already disabled for members and owners.

This PR updates the task to not run for collaborators either.

(In particular, this will make my own life easier as a collaborator with triage permissions.)

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [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: @@ -10,7 +10,7 @@ permissions: {}
 jobs:
   issue-commented:
     name: Remove blocked/{need-info,need-repro} on comment
-    if: ${{ (contains(github.event.issue.labels.*.name, 'blocked/need-repro') || contains(github.event.issue.labels.*.name, 'blocked/need-info ❌')) && !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) && github.event.comment.user.type != 'Bot' }}
+    if: ${{ (contains(github.event.issue.labels.*.name, 'blocked/need-repro') || contains(github.event.issue.labels.*.name, 'blocked/need-info ❌')) && !contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.comment.author_association) && github.event.comment.user.type != 'Bot' }}
     runs-on: ubuntu-latest
     steps:
       - name: Generate GitHub App token
Repository: vercel/next.js
Pull request: Temporarily disable failing `fallback-shells` deploy test

Something may have changed in infra that causes a fallback shell revalidation instead of the expected route shell revalidation. Until this is resolved we disable the deploy test to unblock.

Changed files:
filename: test/e2e/app-dir/fallback-shells/fallback-shells.test.ts
patch: @@ -259,24 +259,28 @@ describe('fallback-shells', () => {
             }
           })
 
-          it('does not render a fallback shell when using a params placeholder', async () => {
-            // This should trigger a blocking prerender of the route shell.
-            const { browser, response } = await next.browserWithResponse(
-              '/with-cached-io/with-static-params/without-suspense/params-in-page/[slug]'
-            )
+          // TODO: Re-enable as deploy test when (potential) infra issue is
+          // resolved.
+          if (!isNextDeploy) {
+            it('does not render a fallback shell when using a params placeholder', async () => {
+              // This should trigger a blocking prerender of the route shell.
+              const { browser, response } = await next.browserWithResponse(
+                '/with-cached-io/with-static-params/without-suspense/params-in-page/[slug]'
+              )
 
-            expect(response.status()).toBe(200)
+              expect(response.status()).toBe(200)
 
-            // This should render the encoded param in the route shell, and not
-            // interpret the param as a fallback param, and subsequently try to
-            // render the fallback shell instead, which would fail because of the
-            // missing parent suspense boundary.
-            const lastModified = await browser
-              .elementById('last-modified')
-              .text()
-            expect(lastModified).toInclude('Page /%5Bslug%5D')
-            expect(lastModified).toInclude('runtime')
-          })
+              // This should render the encoded param in the route shell, and not
+              // interpret the param as a fallback param, and subsequently try to
+              // render the fallback shell instead, which would fail because of the
+              // missing parent suspense boundary.
+              const lastModified = await browser
+                .elementById('last-modified')
+                .text()
+              expect(lastModified).toInclude('Page /%5Bslug%5D')
+              expect(lastModified).toInclude('runtime')
+            })
+          }
         })
 
         describe('and the params accessed in a cached non-page function', () => {
Repository: facebook/react
Pull request: Upgrade flow to 0.227.0

Upgrade flow to 0.227.0


Changed files:
filename: package.json
patch: @@ -62,8 +62,8 @@
     "eslint-plugin-react-internal": "link:./scripts/eslint-rules",
     "fbjs-scripts": "^3.0.1",
     "filesize": "^6.0.1",
-    "flow-bin": "^0.226.0",
-    "flow-remove-types": "^2.226.0",
+    "flow-bin": "^0.227.0",
+    "flow-remove-types": "^2.227.0",
     "glob": "^7.1.6",
     "glob-stream": "^6.1.0",
     "google-closure-compiler": "^20230206.0.0",

filename: yarn.lock
patch: @@ -7855,15 +7855,15 @@ flatted@^3.1.0:
   resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
   integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
 
-flow-bin@^0.226.0:
-  version "0.226.0"
-  resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.226.0.tgz#b245847b749ab20756ef74c91d96619f68d18430"
-  integrity sha512-q8hXSRhZ+I14jS0KGDDsPYCvPufvBexk6nJXSOsSP6DgCuXbvCOByWhsXRAjPtmXKmO8v9RKSJm1kRaWaf0fZw==
-
-flow-remove-types@^2.226.0:
-  version "2.226.0"
-  resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.226.0.tgz#08ff7e195137ce43042e11bfa04303184971dac2"
-  integrity sha512-/FEjOCgjW/s1OYPWhlq6aV8Bp0VMU3iZMqZfJgWtFXSRRpI19IhQKFXz+rsx91/r5ZH+MtuZZ+PlmZ5uB/gmAA==
+flow-bin@^0.227.0:
+  version "0.227.0"
+  resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.227.0.tgz#64eba189d2b233d04171828983dd5e6b2abadc3b"
+  integrity sha512-UkIzYbyUDmfztEbvS39ksR+vSu9WwUJQ4D+UvIW0ILrDuhPRN3XjheB1+mv2b/4H011HCM5y9nENXrDEaiIKtg==
+
+flow-remove-types@^2.227.0:
+  version "2.227.0"
+  resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.227.0.tgz#315c9a0422e7120d30fae49b5a9d2cc6b709ce5d"
+  integrity sha512-Z5zTUBx/6ay8UAcz3Qva8huMCLwIj0ESDl9Wjagix0uc4yEGqgSWWsm5WhRDcVg6qxSrdBQ8TxPCOYVaWZfMaw==
   dependencies:
     hermes-parser "0.18.2"
     pirates "^3.0.2"
Repository: vercel/next.js
Pull request: fix: revert focus trap dependency change

Reverts a change in #81531 which updated how `useFocusTrap` behaved- which caused some accessibility features to break

Changed files:
filename: packages/next/src/next-devtools/dev-overlay/components/errors/dev-tools-indicator/dev-tools-indicator.tsx
patch: @@ -163,7 +163,7 @@ function DevToolsPopover({
   )
 
   // Features to make the menu accessible
-  useFocusTrap(menuRef, triggerRef, menuMounted)
+  useFocusTrap(menuRef, triggerRef, isMenuOpen)
   useClickOutside(menuRef, triggerRef, menuMounted, closeMenu)
   useShortcuts(hideShortcut ? { [hideShortcut]: hideDevTools } : {}, triggerRef)
 

filename: packages/next/src/next-devtools/dev-overlay/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.tsx
patch: @@ -33,7 +33,7 @@ export function DevToolsInfo({
     exitDelay: MENU_DURATION_MS,
   })
 
-  useFocusTrap(ref, triggerRef, mounted, () => {
+  useFocusTrap(ref, triggerRef, isOpen, () => {
     // Bring focus to close button, so the user can easily close the overlay
     closeButtonRef.current?.focus()
   })
Repository: huggingface/transformers
Pull request: 🚨🚨🚨 [Trainer] Enable `average_tokens_across_devices` by default in `TrainingArguments`

Fixes #39392

This change improves loss calculation correctness for multi-GPU training by enabling proper token averaging across devices by default.

## What does this PR do?

Changes the default value of `average_tokens_across_devices` from `False` to `True` in `TrainingArguments`. This ensures more accurate loss calculation in multi-GPU training scenarios by properly averaging tokens across devices.

As noted in the original issue, this feature provides reproducibility and correctness benefits with no downsides, so there's no reason to keep it disabled by default.

## Before submitting
- [x] Was this discussed/approved via a Github issue? Yes - #39392
- [x] Did you make sure to update the documentation with your changes? Yes - updated docstring

## Who can review?
@zach-huggingface @SunMarc @qgallouedec (trainer maintainers)

Changed files:
filename: src/transformers/training_args.py
patch: @@ -800,7 +800,7 @@ class TrainingArguments:
             `_apply_liger_kernel_to_instance` function, which specifies which kernels to apply. Available options vary by model but typically
             include: 'rope', 'swiglu', 'cross_entropy', 'fused_linear_cross_entropy', 'rms_norm', etc. If `None`, use the default kernel configurations.
 
-        average_tokens_across_devices (`bool`, *optional*, defaults to `False`):
+        average_tokens_across_devices (`bool`, *optional*, defaults to `True`):
             Whether or not to average tokens across devices. If enabled, will use all_reduce to synchronize
             num_tokens_in_batch for precise loss calculation. Reference:
             https://github.com/huggingface/transformers/issues/34242
@@ -1553,7 +1553,7 @@ class TrainingArguments:
     )
 
     average_tokens_across_devices: Optional[bool] = field(
-        default=False,
+        default=True,
         metadata={
             "help": "Whether or not to average tokens across devices. If enabled, will use all_reduce to "
             "synchronize num_tokens_in_batch for precise loss calculation. Reference: "