helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: clip : rename lerp function to avoid conflict

This commit renames the lerp (linear interpolation) function in clip.cpp to avoid a conflict with the lerp function in the <cmath> standard C++ library when using c++20.

The motivation for this change is to enable projects that use c++20 to be able to compile clip.cpp without having to resort to patching it. The lerp function was added to cmath in version C++20 (202002L) and is why this is not causing any issue at the moment as C++11/C++17 is currently used by llama.cpp.

I realize that llama.cpp uses either C++11 (or C++17 in the case for SYCL) but wanted to ask if this would be an acceptable change just the same.

Refs: https://en.cppreference.com/w/cpp/numeric/lerp

Changed files:
filename: examples/llava/clip.cpp
patch: @@ -1325,7 +1325,7 @@ bool clip_image_load_from_bytes(const unsigned char * bytes, size_t bytes_length
 }
 
 // Linear interpolation between two points
-inline float lerp(float s, float e, float t) {
+inline float clip_lerp(float s, float e, float t) {
     return s + (e - s) * t;
 }
 // Bilinear resize function
@@ -1347,17 +1347,17 @@ static void bilinear_resize(const clip_image_u8& src, clip_image_u8& dst, int ta
             float y_lerp = py - y_floor;
 
             for (int c = 0; c < 3; c++) {
-                float top = lerp(
+                float top = clip_lerp(
                     static_cast<float>(src.buf[3 * (y_floor * src.nx + x_floor) + c]),
                     static_cast<float>(src.buf[3 * (y_floor * src.nx + (x_floor + 1)) + c]),
                     x_lerp
                 );
-                float bottom = lerp(
+                float bottom = clip_lerp(
                     static_cast<float>(src.buf[3 * ((y_floor + 1) * src.nx + x_floor) + c]),
                     static_cast<float>(src.buf[3 * ((y_floor + 1) * src.nx + (x_floor + 1)) + c]),
                     x_lerp
                 );
-                dst.buf[3 * (y * target_width + x) + c] = static_cast<uint8_t>(lerp(top, bottom, y_lerp));
+                dst.buf[3 * (y * target_width + x) + c] = static_cast<uint8_t>(clip_lerp(top, bottom, y_lerp));
             }
         }
     }
Repository: denoland/deno
Pull request: fix(workspace): diagnostic for imports in member with importMap at root

* https://github.com/denoland/deno_config/pull/157

Closes https://github.com/denoland/deno/issues/28110

Changed files:
filename: Cargo.lock
patch: @@ -1599,9 +1599,9 @@ dependencies = [
 
 [[package]]
 name = "deno_config"
-version = "0.46.0"
+version = "0.48.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08fe512a72c4300bd997c6849450a1f050da0c909a2a4fbdc44891647392bacf"
+checksum = "7f8dbb5b5f3ca2f57e9db3ecb67cbd7eba9a3fd619e98516ee1d0d3732e84361"
 dependencies = [
  "boxed_error",
  "capacity_builder 0.5.0",

filename: Cargo.toml
patch: @@ -54,7 +54,7 @@ deno_ast = { version = "=0.44.0", features = ["transpiling"] }
 deno_core = { version = "0.336.0" }
 
 deno_bench_util = { version = "0.184.0", path = "./bench_util" }
-deno_config = { version = "=0.46.0", features = ["workspace"] }
+deno_config = { version = "=0.48.1", features = ["workspace"] }
 deno_lockfile = "=0.24.0"
 deno_media_type = { version = "=0.2.5", features = ["module_specifier"] }
 deno_npm = "=0.27.2"
Repository: huggingface/transformers
Pull request: Add zero dim tensor check when using flash_attention

 The cuda or triton kernel can not support this case: dimensions of size is 0, but traditional SDPA is implemented using PyTorch's tensor operations, which have robust support for tensors with dimensions of size 0. We need to add this check and error tips for developers when using flash_attention. Related issue is in https://github.com/deepspeedai/DeepSpeed/issues/7275

Changed files:
filename: src/transformers/integrations/flash_attention.py
patch: @@ -32,6 +32,13 @@ def flash_attention_forward(
     # This is before the transpose
     seq_len = query.shape[2]
 
+    if any(dim == 0 for dim in query.shape):
+        raise ValueError(
+            "Tensor query has shape  with a zero dimension.\n"
+            "FlashAttention does not support inputs with dim=0.\n"
+            "Please check your input shapes or use SDPA instead."
+        )
+
     # FA2 uses non-transposed inputs
     query = query.transpose(1, 2)
     key = key.transpose(1, 2)
Repository: denoland/deno
Pull request: fix(lint): react-rules-of-hooks works with destructuring


Changed files:
filename: Cargo.lock
patch: @@ -2031,9 +2031,9 @@ dependencies = [
 
 [[package]]
 name = "deno_lint"
-version = "0.72.0"
+version = "0.72.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff1057c63ef31a7b3a8426bac62c3d3b31049383e044928432238b79aba2b1c4"
+checksum = "ef5020c50214ba5b42d84b623b58573095e800a81c6060e9589e7e4ea1206f8d"
 dependencies = [
  "anyhow",
  "deno_ast",

filename: cli/Cargo.toml
patch: @@ -74,7 +74,7 @@ deno_doc = { version = "=0.164.0", features = ["rust", "comrak"] }
 deno_error.workspace = true
 deno_graph = { version = "=0.87.3" }
 deno_lib.workspace = true
-deno_lint = { version = "0.72.0" }
+deno_lint = { version = "0.72.1" }
 deno_lockfile.workspace = true
 deno_media_type = { workspace = true, features = ["data_url", "decoding", "module_specifier"] }
 deno_npm.workspace = true
Repository: electron/electron
Pull request: fix: add patch to fix desktopCapturer.getSources not returning electron windows on Windows

#### Description of Change


This patch is to fix issue https://github.com/electron/electron/issues/36037, where `desktopCapturer.getSources` does not return the electron window on Windows.

The first parameter added sets `add_current_process_windows` to true, allowing the desktopCapturer to enumerate electron windows. The second parameter is tentatively set at false to retain default behaviour. 

Additional info about the second param, `auto_show_delegated_source_list` seems to be related to ongoing chromium [work](https://source.chromium.org/chromium/chromium/src/+/24deb479af8b4904f7effc2bf630702b23dec415) in the [delegated source capturer](https://source.chromium.org/chromium/chromium/src/+/24deb479af8b4904f7effc2bf630702b23dec415:chrome/browser/media/webrtc/delegated_source_list_capturer.h)

Tested by confirming the fiddle spawned app appears in this list of sources:
https://github.com/electron/electron/pull/45000

#### Release Notes

Notes: fix desktopCapturer.getSources not returning electron windows on Windows

Changed files:
filename: shell/browser/api/electron_api_desktop_capturer.cc
patch: @@ -286,7 +286,7 @@ void DesktopCapturer::StartHandling(bool capture_window,
       capture_screen_ = false;
       capture_window_ = capture_window;
       window_capturer_ = std::make_unique<NativeDesktopMediaList>(
-          DesktopMediaList::Type::kWindow, std::move(capturer));
+          DesktopMediaList::Type::kWindow, std::move(capturer), true, true);
       window_capturer_->SetThumbnailSize(thumbnail_size);
 
       OnceCallback update_callback = base::BindOnce(
@@ -322,7 +322,7 @@ void DesktopCapturer::StartHandling(bool capture_window,
       auto capturer = MakeWindowCapturer();
       if (capturer) {
         window_capturer_ = std::make_unique<NativeDesktopMediaList>(
-            DesktopMediaList::Type::kWindow, std::move(capturer));
+            DesktopMediaList::Type::kWindow, std::move(capturer), true, true);
         window_capturer_->SetThumbnailSize(thumbnail_size);
 #if BUILDFLAG(IS_MAC)
         window_capturer_->skip_next_refresh_ =
Repository: denoland/deno
Pull request: fix(completions): remove problematic character for powershell

Untested because I am not on a windows machine atm. 

Closes #28092

Changed files:
filename: cli/args/flags.rs
patch: @@ -1772,7 +1772,7 @@ If you specify a directory instead of a file, the path is expanded to all contai
 }
 
 fn bundle_subcommand() -> Command {
-  command("bundle",  "⚠️ `deno bundle` was removed in Deno 2.
+  command("bundle",  "`deno bundle` was removed in Deno 2.
 
 See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations", UnstableArgsConfig::ResolutionOnly)
     .hide(true)
@@ -3321,7 +3321,7 @@ different location, use the <c>--output</> flag:
 
 fn vendor_subcommand() -> Command {
   command("vendor",
-      "⚠️ `deno vendor` was removed in Deno 2.
+      "`deno vendor` was removed in Deno 2.
 
 See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations",
       UnstableArgsConfig::ResolutionOnly

filename: tests/specs/bundle/removed/bundle_help.out
patch: @@ -1,4 +1,4 @@
-⚠️ `deno bundle` was removed in Deno 2.
+`deno bundle` was removed in Deno 2.
 
 See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations
 

filename: tests/specs/vendor/removed/vendor_help.out
patch: @@ -1,4 +1,4 @@
-⚠️ `deno vendor` was removed in Deno 2.
+`deno vendor` was removed in Deno 2.
 
 See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations
Repository: vercel/next.js
Pull request: Add htmlrewriter to default server externals

This package needs to be externalized to have it's wasm dependencies traced properly for node runtime so this adds it to our default list. 

x-ref: [slack thread](https://vercel.slack.com/archives/C07LQPFERGF/p1750713377659779?thread_ts=1750693981.162239&cid=C07LQPFERGF)

Changed files:
filename: docs/01-app/03-api-reference/05-config/01-next-config-js/serverExternalPackages.mdx
patch: @@ -50,6 +50,7 @@ Next.js includes a [short list of popular packages](https://github.com/vercel/ne
 - `eslint`
 - `express`
 - `firebase-admin`
+- `htmlrewriter`
 - `import-in-the-middle`
 - `isolated-vm`
 - `jest`

filename: docs/02-pages/04-api-reference/04-config/01-next-config-js/serverExternalPackages.mdx
patch: @@ -50,6 +50,7 @@ Next.js includes a [short list of popular packages](https://github.com/vercel/ne
 - `eslint`
 - `express`
 - `firebase-admin`
+- `htmlrewriter`
 - `import-in-the-middle`
 - `isolated-vm`
 - `jest`

filename: packages/next/src/lib/server-external-packages.json
patch: @@ -31,6 +31,7 @@
   "eslint",
   "express",
   "firebase-admin",
+  "htmlrewriter",
   "import-in-the-middle",
   "isolated-vm",
   "jest",
Repository: facebook/react
Pull request: [react-native] Always set RN$stopSurface

## Summary
To support incremental adoption of bridgeless logic we want to default to using these globals whenever they're available.

## How did you test this change?
https://github.com/facebook/react-native/pull/37410

Changed files:
filename: scripts/rollup/shims/react-native/ReactFabric.js
patch: @@ -22,9 +22,9 @@ if (__DEV__) {
   ReactFabric = require('../implementations/ReactFabric-prod');
 }
 
-if (global.RN$Bridgeless) {
-  global.RN$stopSurface = ReactFabric.stopSurface;
-} else {
+global.RN$stopSurface = ReactFabric.stopSurface;
+
+if (global.RN$Bridgeless !== true) {
   BatchedBridge.registerCallableModule('ReactFabric', ReactFabric);
 }
Repository: facebook/react
Pull request: fix[devtools]: fixed duplicated backend activation with multiple renderers

## Summary
Initially reported in https://github.com/facebook/react/issues/26797. Was not able to reproduce the exact same problem, but found this case:

1. Open corresponding codepen from the issue in debug mode
2. Open components tab of the extension
3. Refresh the page

Received multiple errors:
- Warning in the Console tab: Invalid renderer id "2".
- Error in the Components tab: Uncaught Error: Cannot add node "3" because a node with that id is already in the Store.

This problem has occurred after landing a fix in https://github.com/facebook/react/pull/26779. Looks like Chrome is keeping the injected scripts (the backend in this case) and we start backend twice.




Changed files:
filename: packages/react-devtools-extensions/src/backend.js
patch: @@ -29,5 +29,6 @@ function setup(hook: ?DevToolsHook) {
     initBackend,
     setupNativeStyleEditor,
   });
+
   hook.emit('devtools-backend-installed', COMPACT_VERSION_NAME);
 }

filename: packages/react-devtools-extensions/src/backendManager.js
patch: @@ -58,7 +58,7 @@ function setup(hook: ?DevToolsHook) {
 
   // register renderers that have already injected themselves.
   hook.renderers.forEach(renderer => {
-    registerRenderer(renderer);
+    registerRenderer(renderer, hook);
   });
 
   // Activate and remove from required all present backends, registered within the hook
@@ -71,7 +71,7 @@ function setup(hook: ?DevToolsHook) {
 
   // register renderers that inject themselves later.
   hook.sub('renderer', ({renderer}) => {
-    registerRenderer(renderer);
+    registerRenderer(renderer, hook);
     updateRequiredBackends();
   });
 
@@ -84,19 +84,24 @@ function setup(hook: ?DevToolsHook) {
 
 const requiredBackends = new Set<string>();
 
-function registerRenderer(renderer: ReactRenderer) {
+function registerRenderer(renderer: ReactRenderer, hook: DevToolsHook) {
   let version = renderer.reconcilerVersion || renderer.version;
   if (!hasAssignedBackend(version)) {
     version = COMPACT_VERSION_NAME;
   }
-  requiredBackends.add(version);
+
+  // Check if required backend is already activated, no need to require again
+  if (!hook.backends.has(version)) {
+    requiredBackends.add(version);
+  }
 }
 
 function activateBackend(version: string, hook: DevToolsHook) {
   const backend = hook.backends.get(version);
   if (!backend) {
     throw new Error(`Could not find backend for version "${version}"`);
   }
+
   const {Agent, Bridge, initBackend, setupNativeStyleEditor} = backend;
   const bridge = new Bridge({
     listen(fn) {
@@ -157,6 +162,10 @@ function activateBackend(version: string, hook: DevToolsHook) {
 
 // tell the service worker which versions of backends are needed for the current page
 function updateRequiredBackends() {
+  if (requiredBackends.size === 0) {
+    return;
+  }
+
   window.postMessage(
     {
       source: 'react-devtools-backend-manager',
Repository: electron/electron
Pull request: fix: better prompt not supported message in window-setup.ts

Backport of #45017

See that PR for details.


Notes: none


Changed files:
filename: lib/renderer/window-setup.ts
patch: @@ -15,7 +15,7 @@ export const windowSetup = (isWebView: boolean, isHiddenPage: boolean) => {
 
   // But we do not support prompt().
   window.prompt = function () {
-    throw new Error('prompt() is and will not be supported.');
+    throw new Error('prompt() is not supported.');
   };
   if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['prompt'], window.prompt);
Repository: ggml-org/llama.cpp
Pull request: common: remove duplicate check for curl

This commit removes one of the two identical checks for curl being NULL in `llama_load_model_from_url`.

Changed files:
filename: common/common.cpp
patch: @@ -1928,11 +1928,6 @@ struct llama_model * llama_load_model_from_url(
         return NULL;
     }
 
-    if (!curl) {
-        fprintf(stderr, "%s: error initializing libcurl\n", __func__);
-        return NULL;
-    }
-
     if (!llama_download_file(curl, model_url, path_model)) {
         return NULL;
     }
Repository: facebook/react
Pull request: [www] reduce dynamic SchedulerFeatureFlags

For these values we're not using dynamic values. We can statically compile in the values we're running.

Changed files:
filename: packages/scheduler/src/__tests__/Scheduler-test.js
patch: @@ -344,7 +344,7 @@ describe('SchedulerBrowser', () => {
       // about, like a network event.
       gate(flags =>
         flags.enableIsInputPending
-          ? 'Yield at 300ms'
+          ? 'Yield at 10ms'
           : // When isInputPending is disabled, we always yield quickly
             'Yield at 5ms',
       ),
@@ -398,7 +398,7 @@ describe('SchedulerBrowser', () => {
         // about, like a network event.
         gate(flags =>
           flags.enableIsInputPending
-            ? 'Yield at 300ms'
+            ? 'Yield at 10ms'
             : // When isInputPending is disabled, we always yield quickly
               'Yield at 5ms',
         ),
@@ -423,7 +423,7 @@ describe('SchedulerBrowser', () => {
         // as quickly as for a discrete event.
         gate(flags =>
           flags.enableIsInputPending
-            ? 'Yield at 50ms'
+            ? 'Yield at 10ms'
             : // When isInputPending is disabled, we always yield quickly
               'Yield at 5ms',
         ),
@@ -453,7 +453,7 @@ describe('SchedulerBrowser', () => {
       'Task with no paint',
       gate(flags =>
         flags.enableIsInputPending
-          ? 'Yield at 300ms'
+          ? 'Yield at 10ms'
           : // When isInputPending is disabled, we always yield quickly
             'Yield at 5ms',
       ),

filename: packages/scheduler/src/forks/SchedulerFeatureFlags.www-dynamic.js
patch: @@ -11,10 +11,4 @@
 // Use __VARIANT__ to simulate a GK. The tests will be run twice: once
 // with the __VARIANT__ set to `true`, and once set to `false`.
 
-export const enableIsInputPending = __VARIANT__;
-export const enableSchedulerDebugging = __VARIANT__;
 export const enableProfiling = __VARIANT__;
-export const enableIsInputPendingContinuous = __VARIANT__;
-export const frameYieldMs = 5;
-export const continuousYieldMs = 50;
-export const maxYieldMs = 300;

filename: packages/scheduler/src/forks/SchedulerFeatureFlags.www.js
patch: @@ -7,19 +7,15 @@
  * @flow
  */
 
-// $FlowFixMe[cannot-resolve-module]
-const dynamicFeatureFlags = require('SchedulerFeatureFlags');
-
-// Re-export dynamic flags from the www version.
-export const {
-  enableIsInputPending,
-  enableSchedulerDebugging,
-  enableProfiling: enableProfilingFeatureFlag,
-  enableIsInputPendingContinuous,
-  frameYieldMs,
-  continuousYieldMs,
-  maxYieldMs,
-} = dynamicFeatureFlags;
+const {enableProfiling: enableProfilingFeatureFlag} =
+  // $FlowFixMe[cannot-resolve-module]
+  require('SchedulerFeatureFlags');
 
+export const enableSchedulerDebugging = true;
 export const enableProfiling: boolean =
   __PROFILE__ && enableProfilingFeatureFlag;
+export const enableIsInputPending = true;
+export const enableIsInputPendingContinuous = true;
+export const frameYieldMs = 5;
+export const continuousYieldMs = 10;
+export const maxYieldMs = 10;
Repository: ggml-org/llama.cpp
Pull request: llama : add completion for --chat-template-file

This commit adds completion for `--chat-template-file`, enabling only `.jinja` files to be displayed as completions.

Example usage:
```console
$ ./build/bin/llama-cli --chat-template-file models/templates/<TAB>
models/templates/CohereForAI-c4ai-command-r7b-12-2024-tool_use.jinja
models/templates/CohereForAI-c4ai-command-r-plus-tool_use.jinja
models/templates/deepseek-ai-DeepSeek-R1-Distill-Llama-8B.jinja
models/templates/deepseek-ai-DeepSeek-R1-Distill-Qwen-32B.jinja
models/templates/fireworks-ai-llama-3-firefunction-v2.jinja
models/templates/google-gemma-2-2b-it.jinja
models/templates/llama-cpp-deepseek-r1.jinja
models/templates/meetkai-functionary-medium-v3.1.jinja
models/templates/meetkai-functionary-medium-v3.2.jinja
models/templates/meta-llama-Llama-3.1-8B-Instruct.jinja
models/templates/meta-llama-Llama-3.2-3B-Instruct.jinja
models/templates/meta-llama-Llama-3.3-70B-Instruct.jinja
models/templates/microsoft-Phi-3.5-mini-instruct.jinja
models/templates/mistralai-Mistral-Nemo-Instruct-2407.jinja
models/templates/NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use.jinja
models/templates/NousResearch-Hermes-3-Llama-3.1-8B-tool_use.jinja
models/templates/Qwen-Qwen2.5-7B-Instruct.jinja
```
This is not limited to the models/templates directory, it can be used anywhere in the filesystem, the above is just an example.


Changed files:
filename: common/arg.cpp
patch: @@ -409,6 +409,10 @@ static void common_params_print_completion(common_params_context & ctx_arg) {
     printf("            COMPREPLY=( $(compgen -f -X '!*.gbnf' -- \"$cur\") $(compgen -d -- \"$cur\") )\n");
     printf("            return 0\n");
     printf("            ;;\n");
+    printf("        --chat-template-file)\n");
+    printf("            COMPREPLY=( $(compgen -f -X '!*.jinja' -- \"$cur\") $(compgen -d -- \"$cur\") )\n");
+    printf("            return 0\n");
+    printf("            ;;\n");
     printf("        *)\n");
     printf("            COMPREPLY=( $(compgen -W \"${opts}\" -- \"$cur\") )\n");
     printf("            return 0\n");
Repository: nodejs/node
Pull request: buffer: define global v8::CFunction objects as const

 objects I defined them as const so that they cannot be changed.

Changed files:
filename: src/node_buffer.cc
patch: @@ -1525,11 +1525,11 @@ uint32_t FastWriteString(Local<Value> receiver,
       std::min<uint32_t>(dst.length() - offset, max_length));
 }
 
-static v8::CFunction fast_write_string_ascii(
+static const v8::CFunction fast_write_string_ascii(
     v8::CFunction::Make(FastWriteString<ASCII>));
-static v8::CFunction fast_write_string_latin1(
+static const v8::CFunction fast_write_string_latin1(
     v8::CFunction::Make(FastWriteString<LATIN1>));
-static v8::CFunction fast_write_string_utf8(
+static const v8::CFunction fast_write_string_utf8(
     v8::CFunction::Make(FastWriteString<UTF8>));
 
 void Initialize(Local<Object> target,
Repository: electron/electron
Pull request: fix: better prompt not supported message in window-setup.ts

The message should simply read "is not supported" or, alternatively, "is not, and will not, be supported", but not "is and will not be supported".

#### Description of Change

<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [x] relevant documentation, tutorials, templates and examples are changed or added
- [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: lib/renderer/window-setup.ts
patch: @@ -15,7 +15,7 @@ export const windowSetup = (isWebView: boolean, isHiddenPage: boolean) => {
 
   // But we do not support prompt().
   window.prompt = function () {
-    throw new Error('prompt() is and will not be supported.');
+    throw new Error('prompt() is not supported.');
   };
   if (contextIsolationEnabled) internalContextBridge.overrideGlobalValueFromIsolatedWorld(['prompt'], window.prompt);
Repository: facebook/react
Pull request: Fix nightly job to publish to "canary" channel

When I was renaming the next channel to canary, I updated the `publish_preleases` workflow correctly, but I skipped over `publish_preleases_nightly`. Oops.

Changed files:
filename: .circleci/config.yml
patch: @@ -646,7 +646,7 @@ workflows:
           name: Publish to Canary channel
           commit_sha: << pipeline.git.revision >>
           release_channel: stable
-          dist_tag: "next"
+          dist_tag: "canary,next"
       - publish_prerelease:
           name: Publish to Experimental channel
           requires: