helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: Track late-mounted roots in Fast Refresh

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

In doing the micro front-end sub-application encountered the problem of sub-application hot update does not work, I debugged it like this
1. use the online (test environment) main application address
2. proxy the sub-application to be debugged to localhost (localhost domain)

In order to keep the `Shared React Context`, our sub-application is loaded by the main application as a `React component`, because `react-refresh` is loaded only when the sub-application is executed, so the current root is not properly collected in the `mountedRoots`, and eventually the hot update of the application does not work.

## How did you test this change?

When determining `wasMounted`, adjust to
```js
const wasMounted =
            alternate.memoizedState != null &&
            alternate.memoizedState.element != null &&
            mountedRoots.has(root);
```

Logically, there is no breaking change here, and it solves my problem perfectly
![demo](https://sf16-va.tiktokcdn.com/obj/eden-va2/eueh7vhojuh/demo.gif)


Changed files:
filename: packages/react-refresh/src/ReactFreshRuntime.js
patch: @@ -554,7 +554,9 @@ export function injectIntoGlobalHook(globalObject: any): void {
         if (alternate !== null) {
           const wasMounted =
             alternate.memoizedState != null &&
-            alternate.memoizedState.element != null;
+            alternate.memoizedState.element != null &&
+            mountedRoots.has(root);
+
           const isMounted =
             current.memoizedState != null &&
             current.memoizedState.element != null;
Repository: denoland/deno
Pull request: fix(ext/webgpu): don't crash while constructing GPUOutOfMemoryError

Fixes #24806

Changed files:
filename: ext/webgpu/01_webgpu.js
patch: @@ -998,7 +998,7 @@ class InnerGPUDevice {
         );
         break;
       case "out-of-memory":
-        constructedError = new GPUOutOfMemoryError();
+        constructedError = new GPUOutOfMemoryError("not enough memory left");
         break;
       case "internal":
         constructedError = new GPUInternalError();
Repository: ggml-org/llama.cpp
Pull request: Re-enable upscaling of images smaller than the CLIP input size; fix MiniCPM evaluation on small bitmaps

Since commit #13011, MiniCPM models have been unable to process small images. This appears to be caused by disabling the upscaling of images smaller than the CLIP input size. This PR reintroduces that upscaling and restores full functionality for these models.

I'm attaching 2 example of small image for reference 
![10](https://github.com/user-attachments/assets/7589224c-9f88-4108-bc3c-da3ae9caf30d)
![cat0](https://github.com/user-attachments/assets/840bb6bb-7ab5-4b71-9fa6-ad195a26584a)




Changed files:
filename: examples/llava/clip.cpp
patch: @@ -2561,7 +2561,7 @@ struct llava_uhd {
 
         // no pinpoints, dynamically calculate the grid size (e.g. minicpmv)
 
-        auto best_size    = get_best_resize(original_size, slice_size, patch_size, has_slices);
+        auto best_size    = get_best_resize(original_size, slice_size, patch_size, !has_slices);
         res.overview_size = best_size;
 
         if (!has_slices) {
Repository: ggml-org/llama.cpp
Pull request: update GLM4 chat template

following: https://huggingface.co/THUDM/GLM-4-32B-0414/commit/077b5c2f5c43bd3239fd605a0600229e8facbd4a

This commit fixes the chat template for GLM4, aligning it to the official one.


Changed files:
filename: src/llama-chat.cpp
patch: @@ -454,7 +454,7 @@ int32_t llm_chat_apply_template(
             ss << "<|" << role << "|>" << "\n" << message->content;
         }
         if (add_ass) {
-            ss << "
";
+            ss << "
\n";
         }
     } else if (tmpl == LLM_CHAT_TEMPLATE_MINICPM) {
         // MiniCPM-3B-OpenHermes-2.5-v2-GGUF

filename: tests/test-chat-template.cpp
patch: @@ -181,8 +181,8 @@ int main(void) {
         },
         {
             /* .name= */ "ChatGLM4",
-            /* .template_str= */ U8C("[gMASK]<sop>{% for item in messages %}{% if item['tools'] is defined %}
\n你是一个名为 ChatGLM 的人工智能助手。你是基于智谱AI训练的语言模型 GLM-4 模型开发的，你的任务是针对用户的问题和要求提供适当的答复和支持。\n\n# 可用工具{% set tools = item['tools'] %}{% for tool in tools %}{% if tool['type'] == 'function' %}\n\n## {{ tool['function']['name'] }}\n\n{{ tool['function'] | tojson(indent=4) }}\n......{% endif %}{% endfor %}{% endif %}{% if item['content'] %}<|{{ item['role'] }}|>{{ item['metadata'] }}\n{{ item['content'] }}{% endif %}{% endfor %}{% if add_generation_prompt %}
{% endif %}"),
-            /* .expected_output= */ "[gMASK]<sop>
\nYou are a helpful assistant
\nHello
\nHi there
\nWho are you
\n   I am an assistant   
\nAnother question
",
+            /* .template_str= */ U8C("[gMASK]<sop>{% for item in messages %}{% if item['tools'] is defined %}
\n你是一个名为 ChatGLM 的人工智能助手。你是基于智谱AI训练的语言模型 GLM-4 模型开发的，你的任务是针对用户的问题和要求提供适当的答复和支持。\n\n# 可用工具{% set tools = item['tools'] %}{% for tool in tools %}{% if tool['type'] == 'function' %}\n\n## {{ tool['function']['name'] }}\n\n{{ tool['function'] | tojson(indent=4) }}\n......{% endif %}{% endfor %}{% endif %}{% if item['content'] %}<|{{ item['role'] }}|>{{ item['metadata'] }}\n{{ item['content'] }}{% endif %}{% endfor %}{% if add_generation_prompt %}
\n{% endif %}"),
+            /* .expected_output= */ "[gMASK]<sop>
\nYou are a helpful assistant
\nHello
\nHi there
\nWho are you
\n   I am an assistant   
\nAnother question
\n",
             /* .expected_output_jinja= */ "",
             /* .bos_token= */ "",
             /* .eos_token= */ "",
Repository: facebook/react
Pull request: fix: parseExportNamesInto specifiers typo

fix typo :  

specificers  -> specifiers

Changed files:
filename: packages/react-server-dom-webpack/src/ReactFlightWebpackNodeLoader.js
patch: @@ -210,10 +210,10 @@ async function parseExportNamesInto(
             addExportNames(names, node.declaration.id);
           }
         }
-        if (node.specificers) {
-          const specificers = node.specificers;
-          for (let j = 0; j < specificers.length; j++) {
-            addExportNames(names, specificers[j].exported);
+        if (node.specifiers) {
+          const specifiers = node.specifiers;
+          for (let j = 0; j < specifiers.length; j++) {
+            addExportNames(names, specifiers[j].exported);
           }
         }
         continue;
Repository: facebook/react
Pull request: Fix: fixed incorrect Function name 

`clickButtonAndVerifySnapshotSelecetorText` ---> `clickButtonAndVerifySnapshotSelectorText`

Changed files:
filename: packages/react-devtools-inline/__tests__/__e2e__/profiler.test.js
patch: @@ -41,7 +41,7 @@ test.describe('Profiler', () => {
       });
     }
 
-    async function clickButtonAndVerifySnapshotSelecetorText(
+    async function clickButtonAndVerifySnapshotSelectorText(
       buttonTagName,
       expectedText
     ) {
@@ -72,31 +72,31 @@ test.describe('Profiler', () => {
     const text = await getSnapshotSelectorText();
     expect(text).toBe('1 / 3');
 
-    await clickButtonAndVerifySnapshotSelecetorText(
+    await clickButtonAndVerifySnapshotSelectorText(
       'SnapshotSelector-NextButton',
       '2 / 3'
     );
-    await clickButtonAndVerifySnapshotSelecetorText(
+    await clickButtonAndVerifySnapshotSelectorText(
       'SnapshotSelector-NextButton',
       '3 / 3'
     );
-    await clickButtonAndVerifySnapshotSelecetorText(
+    await clickButtonAndVerifySnapshotSelectorText(
       'SnapshotSelector-NextButton',
       '1 / 3'
     );
-    await clickButtonAndVerifySnapshotSelecetorText(
+    await clickButtonAndVerifySnapshotSelectorText(
       'SnapshotSelector-PreviousButton',
       '3 / 3'
     );
-    await clickButtonAndVerifySnapshotSelecetorText(
+    await clickButtonAndVerifySnapshotSelectorText(
       'SnapshotSelector-PreviousButton',
       '2 / 3'
     );
-    await clickButtonAndVerifySnapshotSelecetorText(
+    await clickButtonAndVerifySnapshotSelectorText(
       'SnapshotSelector-PreviousButton',
       '1 / 3'
     );
-    await clickButtonAndVerifySnapshotSelecetorText(
+    await clickButtonAndVerifySnapshotSelectorText(
       'SnapshotSelector-PreviousButton',
       '3 / 3'
     );
Repository: denoland/deno
Pull request: fix(node/timers/promises): add scheduler APIs

This PR adds the experimental `scheduler` APIs in Node's `timers/promises` module. See https://nodejs.org/api/timers.html#timerspromisesschedulerwaitdelay-options

Fixes https://github.com/denoland/deno/issues/24800

Changed files:
filename: ext/node/polyfills/timers/promises.ts
patch: @@ -6,6 +6,13 @@ export const setTimeout = promisify(timers.setTimeout),
   setImmediate = promisify(timers.setImmediate),
   setInterval = promisify(timers.setInterval);
 
+export const scheduler = {
+  async wait(delay: number, options?: { signal?: AbortSignal }): Promise<void> {
+    return await setTimeout(delay, undefined, options);
+  },
+  yield: setImmediate,
+};
+
 export default {
   setTimeout,
   setImmediate,

filename: tests/unit_node/timers_test.ts
patch: @@ -66,6 +66,29 @@ Deno.test("[node/timers/promises setTimeout]", () => {
   return p;
 });
 
+Deno.test("[node/timers/promises scheduler.wait]", async () => {
+  const { scheduler } = timersPromises;
+  let resolved = false;
+  timers.setTimeout(() => (resolved = true), 20);
+  const p = scheduler.wait(20);
+
+  assert(p instanceof Promise);
+  await p;
+  assert(resolved);
+});
+
+Deno.test("[node/timers/promises scheduler.yield]", async () => {
+  const { scheduler } = timersPromises;
+  let resolved = false;
+  timers.setImmediate(() => resolved = true);
+
+  const p = scheduler.yield();
+  assert(p instanceof Promise);
+  await p;
+
+  assert(resolved);
+});
+
 // Regression test for https://github.com/denoland/deno/issues/17981
 Deno.test("[node/timers refresh cancelled timer]", () => {
   const { setTimeout, clearTimeout } = timers;
Repository: huggingface/transformers
Pull request: Add XPU case to is_torch_bf16_gpu_available

torch.xpu also provides `is_bf16_supported` function.

Changed files:
filename: src/transformers/training_args.py
patch: @@ -45,6 +45,7 @@
     is_sagemaker_mp_enabled,
     is_torch_available,
     is_torch_bf16_gpu_available,
+    is_torch_cuda_available,
     is_torch_hpu_available,
     is_torch_mlu_available,
     is_torch_mps_available,
@@ -1683,11 +1684,12 @@ def __post_init__(self):
                     # cpu
                     raise ValueError("Your setup doesn't support bf16/(cpu, tpu, neuroncore). You need torch>=1.10")
                 elif not self.use_cpu:
-                    if torch.cuda.is_available() and not is_torch_bf16_gpu_available():
+                    if not is_torch_bf16_gpu_available():
+                        error_message = "Your setup doesn't support bf16/gpu."
+                        if is_torch_cuda_available():
+                            error_message += " You need Ampere+ GPU with cuda>=11.0"
                         # gpu
-                        raise ValueError(
-                            "Your setup doesn't support bf16/gpu. You need torch>=1.10, using Ampere GPU with cuda>=11.0"
-                        )
+                        raise ValueError(error_message)
 
         if self.fp16 and self.bf16:
             raise ValueError("At most one of fp16 and bf16 can be True, but not both")

filename: src/transformers/utils/import_utils.py
patch: @@ -512,13 +512,17 @@ def is_torch_mps_available(min_version: Optional[str] = None):
     return False
 
 
-def is_torch_bf16_gpu_available():
+def is_torch_bf16_gpu_available() -> bool:
     if not is_torch_available():
         return False
 
     import torch
 
-    return torch.cuda.is_available() and torch.cuda.is_bf16_supported()
+    if torch.cuda.is_available():
+        return torch.cuda.is_bf16_supported()
+    if torch.xpu.is_available():
+        return torch.xpu.is_bf16_supported()
+    return False
 
 
 def is_torch_bf16_cpu_available() -> bool:
Repository: electron/electron
Pull request: build: use proper targets for building

Backport of #43550

See that PR for details.


Notes: none

Changed files:
filename: .github/actions/build-electron/action.yml
patch: @@ -69,7 +69,7 @@ runs:
       shell: bash
       run: |
         cd src
-        e build electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES
+        e build --target electron:electron_dist_zip -j $NUMBER_OF_NINJA_PROCESSES
         if [ "${{ inputs.is-asan }}" != "true" ]; then
           target_os=${{ inputs.target-platform == 'linux' && 'linux' || 'mac'}}
           if [ "${{ inputs.artifact-platform }}" = "mas" ]; then
@@ -81,7 +81,7 @@ runs:
       shell: bash
       run: |
         cd src
-        e build electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
+        e build --target electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
         gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
         # Remove unused args from mksnapshot_args
         SEDOPTION="-i"
@@ -104,7 +104,7 @@ runs:
           fi
         fi
 
-        e build electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
+        e build --target electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
         (cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
     - name: Generate Cross-Arch Snapshot (arm/arm64)  ${{ inputs.step-suffix }}
       shell: bash
@@ -130,24 +130,24 @@ runs:
       shell: bash
       run: |
         cd src
-        e build electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
-        e build electron:electron_chromedriver_zip
+        e build --target electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
+        e build --target electron:electron_chromedriver_zip
     - name: Build Node.js headers ${{ inputs.step-suffix }}
       shell: bash
       run: |
         cd src
-        e build electron:node_headers
+        e build --target electron:node_headers
     - name: Generate & Zip Symbols ${{ inputs.step-suffix }}
       shell: bash
       run: |
         # Generate breakpad symbols on release builds
         if [ "${{ inputs.generate-symbols }}" = "true" ]; then
-          e build electron:electron_symbols
+          e build --target electron:electron_symbols
         fi
         cd src
         export BUILD_PATH="$(pwd)/out/Default"
-        e build electron:licenses
-        e build electron:electron_version_file
+        e build --target electron:licenses
+        e build --target electron:electron_version_file
         if [ "${{ inputs.is-release }}" = "true" ]; then
           DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
         else
Repository: facebook/react
Pull request: Fix:Made the variable name more meaningful

`didErroRef` ---> `didErrorRef`

Changed files:
filename: packages/react-devtools-shared/src/__tests__/treeContext-test.js
patch: @@ -2180,9 +2180,9 @@ describe('TreeListContext', () => {
     it('should update correctly when elements are re-ordered', () => {
       const container = document.createElement('div');
       function ErrorOnce() {
-        const didErroRef = React.useRef(false);
-        if (!didErroRef.current) {
-          didErroRef.current = true;
+        const didErrorRef = React.useRef(false);
+        if (!didErrorRef.current) {
+          didErrorRef.current = true;
           console.error('test-only:one-time-error');
         }
         return null;
Repository: ggml-org/llama.cpp
Pull request: sync : ggml


Changed files:
filename: scripts/sync-ggml.last
patch: @@ -1 +1 @@
-7734363ac74a14d7f2c8033c552d9d655c5dfc00
+f3a375f20bf56860b30e7c511d03593a1e393345
Repository: nodejs/node
Pull request: test: move test-worker-arraybuffer-zerofill to parallel

Move `test/sequential/test-worker-arraybuffer-zerofill.js` back to `test/parallel/test-worker-arraybuffer-zerofill.js` and remove the flaky designation.

The original issue is likely the same as other tests that time out.

Refs: https://github.com/nodejs/node/issues/54918
Refs: https://github.com/nodejs/node/pull/54839
Refs: https://github.com/nodejs/node/pull/54802

<!--
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/parallel.status
patch: @@ -45,8 +45,6 @@ test-sqlite-statement-sync: PASS, FLAKY
 test-runner-run-watch: PASS, FLAKY
 # https://github.com/nodejs/node/issues/37692
 test-fs-utimes: PASS, FLAKY
-# https://github.com/nodejs/node/issues/52274
-test-worker-arraybuffer-zerofill: PASS, FLAKY
 
 [$system==linux || $system==win32]
 # https://github.com/nodejs/node/issues/49605
Repository: huggingface/transformers
Pull request: nit: typing use Llama4TextConfig instead of Llama4Config

# What does this PR do?

nit fix, use text config typing instead.


## 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?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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.

- text models: @ArthurZucker


Changed files:
filename: src/transformers/models/llama4/modeling_llama4.py
patch: @@ -60,7 +60,7 @@
 
 
 class Llama4TextExperts(nn.Module):
-    def __init__(self, config: Llama4Config):
+    def __init__(self, config: Llama4TextConfig):
         super().__init__()
         self.num_experts = config.num_local_experts
         self.intermediate_size = config.intermediate_size
Repository: ggml-org/llama.cpp
Pull request: arg : remove CURLINFO_EFFECTIVE_METHOD

Fix https://github.com/ggml-org/llama.cpp/issues/13213

`CURLINFO_EFFECTIVE_METHOD` is used solely to get the method name for logging, we can replace it with something more simple

Changed files:
filename: common/arg.cpp
patch: @@ -217,13 +217,11 @@ struct curl_slist_ptr {
 #define CURL_MAX_RETRY 3
 #define CURL_RETRY_DELAY_SECONDS 2
 
-static bool curl_perform_with_retry(const std::string & url, CURL * curl, int max_attempts, int retry_delay_seconds) {
+static bool curl_perform_with_retry(const std::string & url, CURL * curl, int max_attempts, int retry_delay_seconds, const char * method_name) {
     int remaining_attempts = max_attempts;
-    char * method = nullptr;
-    curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_METHOD, &method);
 
     while (remaining_attempts > 0) {
-        LOG_INF("%s: %s %s (attempt %d of %d)...\n", __func__ , method, url.c_str(), max_attempts - remaining_attempts + 1, max_attempts);
+        LOG_INF("%s: %s %s (attempt %d of %d)...\n", __func__ , method_name, url.c_str(), max_attempts - remaining_attempts + 1, max_attempts);
 
         CURLcode res = curl_easy_perform(curl);
         if (res == CURLE_OK) {
@@ -343,7 +341,7 @@ static bool common_download_file_single(const std::string & url, const std::stri
 
         // we only allow retrying once for HEAD requests
         // this is for the use case of using running offline (no internet), retrying can be annoying
-        bool was_perform_successful = curl_perform_with_retry(url, curl.get(), 1, 0);
+        bool was_perform_successful = curl_perform_with_retry(url, curl.get(), 1, 0, "HEAD");
         if (!was_perform_successful) {
             head_request_ok = false;
         }
@@ -425,7 +423,7 @@ static bool common_download_file_single(const std::string & url, const std::stri
         // start the download
         LOG_INF("%s: trying to download model from %s to %s (server_etag:%s, server_last_modified:%s)...\n", __func__,
             llama_download_hide_password_in_url(url).c_str(), path.c_str(), headers.etag.c_str(), headers.last_modified.c_str());
-        bool was_perform_successful = curl_perform_with_retry(url, curl.get(), CURL_MAX_RETRY, CURL_RETRY_DELAY_SECONDS);
+        bool was_perform_successful = curl_perform_with_retry(url, curl.get(), CURL_MAX_RETRY, CURL_RETRY_DELAY_SECONDS, "GET");
         if (!was_perform_successful) {
             return false;
         }