helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: `JetMoe` Fix jetmoe after #40132

# What does this PR do?

A typo got in in #40132

Changed files:
filename: src/transformers/models/jetmoe/modeling_jetmoe.py
patch: @@ -490,10 +490,10 @@ class JetMoeDecoderLayer(GradientCheckpointingLayer):
     def __init__(self, config: JetMoeConfig, layer_idx: Optional[int] = None):
         super().__init__()
         self.hidden_size = config.hidden_size
-        self.self_attn = JetMoeAttention(config, layer_idx)
         self.mlp = JetMoeMoE(config)
         self.input_layernorm = JetMoeRMSNorm(config.hidden_size)
         self.post_attention_layernorm = JetMoeRMSNorm(config.hidden_size)
+        self.self_attention = JetMoeAttention(config, layer_idx)
 
     @deprecate_kwarg("past_key_value", new_name="past_key_values", version="4.58")
     def forward(
@@ -510,7 +510,7 @@ def forward(
         residual = hidden_states
         hidden_states = self.input_layernorm(hidden_states)
         # Self Attention
-        hidden_states, _, _ = self.self_attn(
+        hidden_states, _, _ = self.self_attention(
             hidden_states=hidden_states,
             attention_mask=attention_mask,
             position_ids=position_ids,

filename: src/transformers/models/jetmoe/modular_jetmoe.py
patch: @@ -374,9 +374,10 @@ class JetMoeDecoderLayer(LlamaDecoderLayer):
     def __init__(self, config: JetMoeConfig, layer_idx: Optional[int] = None):
         super().__init__(config, layer_idx)
         self.input_layernorm = JetMoeRMSNorm(config.hidden_size)
-        self.self_attn = JetMoeAttention(config, layer_idx)
+        self.self_attention = JetMoeAttention(config, layer_idx)
         self.post_attention_layernorm = JetMoeRMSNorm(config.hidden_size)
         self.mlp = JetMoeMoE(config)
+        del self.self_attn
 
     def forward(
         self,
@@ -392,7 +393,7 @@ def forward(
         residual = hidden_states
         hidden_states = self.input_layernorm(hidden_states)
         # Self Attention
-        hidden_states, _, _ = self.self_attn(
+        hidden_states, _, _ = self.self_attention(
             hidden_states=hidden_states,
             attention_mask=attention_mask,
             position_ids=position_ids,
Repository: ollama/ollama
Pull request: only generate cuda/rocm when changes to llm detected


Changed files:
filename: .github/workflows/test.yaml
patch: @@ -9,6 +9,24 @@ on:
       - '!README.md'
 
 jobs:
+  changes:
+    runs-on: ubuntu-latest
+    outputs:
+      GENERATE_CUDA: ${{ steps.changes.outputs.GENERATE_CUDA }}
+      GENERATE_ROCM: ${{ steps.changes.outputs.GENERATE_ROCM }}
+    steps:
+      - id: changes
+        run: |
+          changed() {
+            git diff-tree -r --no-commit-id --name-only $GITHUB_BASE_REF $GITHUB_HEAD_REF \
+              | xargs python3 -c "import sys; print(any([x.startswith('$1') for x in sys.argv[1:]]))"
+          }
+
+          {
+            echo GENERATE_CUDA=$(changed llm)
+            echo GENERATE_ROCM=$(changed llm)
+          } >>$GITHUB_OUTPUT
+
   generate:
     strategy:
       matrix:
@@ -46,6 +64,8 @@ jobs:
           name: ${{ matrix.os }}-${{ matrix.arch }}-libraries
           path: llm/llama.cpp/build/**/lib/*
   generate-cuda:
+    needs: [changes]
+    if: ${{ needs.changes.outputs.GENERATE_CUDA == 'True' }}
     strategy:
       matrix:
         cuda-version:
@@ -75,6 +95,8 @@ jobs:
           name: cuda-${{ matrix.cuda-version }}-libraries
           path: llm/llama.cpp/build/**/lib/*
   generate-rocm:
+    needs: [changes]
+    if: ${{ needs.changes.outputs.GENERATE_ROCM == 'True' }}
     strategy:
       matrix:
         rocm-version:
Repository: vercel/next.js
Pull request: [test] Stop downloading unused test browsers when generating PR stats

These browsers are used by Playwright which isn't used for PR stats.

Changed files:
filename: .github/actions/next-stats-action/src/index.js
patch: @@ -111,7 +111,8 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
                   // changes from merging latest changes
                   ` && pnpm install --no-frozen-lockfile`
                 : ' && yarn install --network-timeout 1000000'
-            }`
+            }`,
+            { env: { PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' } }
           )
 
           await exec.spawnPromise(

filename: .github/actions/next-stats-action/src/util/exec.js
patch: @@ -36,7 +36,7 @@ exec.spawn = function spawn(command = '', opts = {}) {
 
 exec.spawnPromise = function spawnPromise(command = '', opts = {}) {
   return new Promise((resolve, reject) => {
-    const child = exec.spawn(command)
+    const child = exec.spawn(command, opts)
     child.on('exit', (code, signal) => {
       if (code || signal) {
         return reject(
Repository: denoland/deno
Pull request: fix(node): preserve AsyncLocalStorage context in unhandledRejection handlers

## Summary

- Fixes `AsyncLocalStorage.getStore()` returning `undefined` inside `unhandledRejection` / `unhandledrejection` event handlers
- Now matches Node.js behavior where the async context active at the time of rejection is preserved

## Problem

```js
import { AsyncLocalStorage } from 'node:async_hooks';
import process from 'node:process';

const store = new AsyncLocalStorage();

process.on('unhandledRejection', () => {
    console.log(store.getStore()); // Node: "data", Deno (before): undefined
});

await store.run("data", async () => {
    new Promise((_, reject) => setTimeout(() => reject(new Error('test')), 50));
});
```

Fixes #30135
Actually fixed in https://github.com/denoland/deno/pull/32293, this just adds a test.

Changed files:
filename: tests/specs/node/async_local_storage_unhandled_rejection/__test__.jsonc
patch: @@ -0,0 +1,8 @@
+{
+  "tests": {
+    "async_local_storage_unhandled_rejection": {
+      "args": "run main.mjs",
+      "output": "rejectionValue => data\n"
+    }
+  }
+}

filename: tests/specs/node/async_local_storage_unhandled_rejection/main.mjs
patch: @@ -0,0 +1,17 @@
+import { AsyncLocalStorage } from "node:async_hooks";
+import { setTimeout } from "node:timers";
+import process from "node:process";
+
+const store = new AsyncLocalStorage();
+
+process.on("unhandledRejection", (reason, promise) => {
+  console.log("rejectionValue =>", store.getStore());
+});
+
+await store.run("data", async () => {
+  new Promise((_, reject) => {
+    setTimeout(() => {
+      reject(new Error("Test rejection after 50ms"));
+    }, 50);
+  });
+});
Repository: ggml-org/llama.cpp
Pull request: ggml : allow fill node alloc inplace

Allows `ggml_fill` to effectively be made in place if possible.

Changed files:
filename: ggml/src/ggml-alloc.c
patch: @@ -25,6 +25,7 @@ static bool ggml_is_view(const struct ggml_tensor * t) {
 // ops that return true for this function must not use restrict pointers for their backend implementations
 bool ggml_op_can_inplace(enum ggml_op op) {
     switch (op) {
+        case GGML_OP_FILL:
         case GGML_OP_SCALE:
         case GGML_OP_DIAG_MASK_ZERO:
         case GGML_OP_DIAG_MASK_INF:

filename: ggml/src/ggml-cuda/fill.cu
patch: @@ -4,7 +4,7 @@
 #define CUDA_FILL_BLOCK_SIZE 256
 
 template <typename T>
-static __global__ void fill_kernel(T * __restrict__ dst, const int64_t k, const T value) {
+static __global__ void fill_kernel(T * dst, const int64_t k, const T value) {
     const int64_t i = (int64_t)blockDim.x * blockIdx.x + threadIdx.x;
     if (i >= k) {
         return;
Repository: nodejs/node
Pull request: typings: add missing URLBinding methods

<!--
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.
-->

add getOrigin() and pathToFileURL() to URLBinding interface. 

Changed files:
filename: typings/internalBinding/url.d.ts
patch: @@ -10,4 +10,6 @@ export interface URLBinding {
   format(input: string, fragment?: boolean, unicode?: boolean, search?: boolean, auth?: boolean): string;
   parse(input: string, base?: string): string | false;
   update(input: string, actionType: typeof urlUpdateActions, value: string): string | false;
+  getOrigin(input: string): string;
+  pathToFileURL(input: string, isWindows: boolean, hostname?: string): string;
 }
Repository: ggml-org/llama.cpp
Pull request: cmake: fix Mach-O current version number

PR #17091 set the `VERSION` of various libraries to 0.0.<var>abcd</var>, where <var>abcd</var> is the `LLAMA_BUILD_NUMBER`. That build number is too large to fit in the Mach-O 'current version' field's 'micro' part, which only goes up to 255. This just sets the Mach-O current version to 0 to get it building properly again.

Fixes #17258.

I tried running the CPU-only CI command (`bash ./ci/run.sh ./tmp/results ./tmp/mnt`). It built successfully, but test 32 of 38 (`test-backend-ops`) sat there for a long time and eventually timed out. Everything else ran fine. For what it's worth, I've been using [a slightly fancier version](https://github.com/ggml-org/llama.cpp/issues/17258#issuecomment-3572819851) of this same patch via Nix, and it seems to be working properly.

If it would be better to keep the full build number in there, I can push an alternate patch that sets the Mach-O version to 0.<var>ab</var>.<var>cd</var> instead. Wasn't sure if that would conflict with any other version numbers you were planning though, so for now I went with just setting it to 0 as suggested in <https://github.com/ggml-org/llama.cpp/issues/17258#issuecomment-3572834220>.

Changed files:
filename: src/CMakeLists.txt
patch: @@ -139,6 +139,7 @@ add_library(llama
 set_target_properties(llama PROPERTIES
     VERSION ${LLAMA_INSTALL_VERSION}
     SOVERSION 0
+    MACHO_CURRENT_VERSION 0 # keep macOS linker from seeing oversized version number
 )
 
 target_include_directories(llama PRIVATE .)

filename: tools/mtmd/CMakeLists.txt
patch: @@ -16,6 +16,7 @@ add_library(mtmd
 set_target_properties(mtmd PROPERTIES
     VERSION ${LLAMA_INSTALL_VERSION}
     SOVERSION 0
+    MACHO_CURRENT_VERSION 0 # keep macOS linker from seeing oversized version number
 )
 
 target_link_libraries     (mtmd PUBLIC ggml llama)
Repository: facebook/react
Pull request: [Fiber] use srcset to trigger load even on img mount

In https://github.com/facebook/react/pull/23316 we fixed a bug where onload events were missed if they happened too early. This update adds support for srcset to retrigger the load event. Firefox unfortunately does not trigger a load even when you assign srcset so this won't work in every browser when you use srcset without src however it does close a gap in chrome at least

Changed files:
filename: packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
patch: @@ -692,8 +692,19 @@ export function commitMount(
       }
       return;
     case 'img': {
+      // The technique here is to assign the src or srcSet property to cause the browser
+      // to issue a new load event. If it hasn't loaded yet it'll fire whenever the load actually completes.
+      // If it has already loaded we missed it so the second load will still be the first one that executes
+      // any associated onLoad props.
+      // Even if we have srcSet we prefer to reassign src. The reason is that Firefox does not trigger a new
+      // load event when only srcSet is assigned. Chrome will trigger a load event if either is assigned so we
+      // only need to assign one. And Safari just never triggers a new load event which means this technique
+      // is already a noop regardless of which properties are assigned. We should revisit if browsers update
+      // this heuristic in the future.
       if ((newProps: any).src) {
         ((domElement: any): HTMLImageElement).src = (newProps: any).src;
+      } else if ((newProps: any).srcSet) {
+        ((domElement: any): HTMLImageElement).srcset = (newProps: any).srcSet;
       }
       return;
     }
Repository: electron/electron
Pull request: fix: printing PDF via `webContents.print()`

#### Description of Change

Refs https://github.com/electron/electron/issues/47272

Partially fixes an issue with printing a PDF via `webContents.print()` where the callback would not be called and the print dialog sometimes not show. This was happening because we were not correctly using the `PrintViewManager` created for the PDF View Plugin's `webContents`.

#### 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] [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: Partially fixes an issue with printing a PDF via `webContents.print()` where the callback would not be called.


Changed files:
filename: shell/browser/api/electron_api_web_contents.cc
patch: @@ -2951,12 +2951,15 @@ void OnGetDeviceNameToUse(base::WeakPtr<content::WebContents> web_contents,
     print_settings.Set(printing::kSettingDpiVertical, dpi.height());
   }
 
-  auto* print_view_manager =
-      PrintViewManagerElectron::FromWebContents(web_contents.get());
+  content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents.get());
+  if (!rfh)
+    return;
+
+  auto* print_view_manager = PrintViewManagerElectron::FromWebContents(
+      content::WebContents::FromRenderFrameHost(rfh));
   if (!print_view_manager)
     return;
 
-  content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents.get());
   print_view_manager->PrintNow(rfh, std::move(print_settings),
                                std::move(print_callback));
 }
@@ -3002,12 +3005,15 @@ void WebContents::Print(gin::Arguments* args) {
   }
 
   if (options.IsEmptyObject()) {
-    auto* print_view_manager =
-        PrintViewManagerElectron::FromWebContents(web_contents());
+    content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents());
+    if (!rfh)
+      return;
+
+    auto* print_view_manager = PrintViewManagerElectron::FromWebContents(
+        content::WebContents::FromRenderFrameHost(rfh));
     if (!print_view_manager)
       return;
 
-    content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents());
     print_view_manager->PrintNow(rfh, std::move(settings), std::move(callback));
     return;
   }
Repository: ggml-org/llama.cpp
Pull request: llama : nit, DeepSeek V1 MoE is 16B and GigaChat is 20B

~Unsure why it was identified as 20B, probably a mistake.~

DeepSeek V1 MoE is 16B while GigaChat is 20B.

Changed files:
filename: src/llama-model.cpp
patch: @@ -1606,8 +1606,9 @@ void llama_model::load_hparams(llama_model_loader & ml) {
                 ml.get_key(LLM_KV_EXPERT_SHARED_COUNT,         hparams.n_expert_shared);
                 ml.get_key(LLM_KV_EXPERT_WEIGHTS_SCALE,        hparams.expert_weights_scale);
 
-                switch (hparams.n_layer) {
-                    case 28: type = LLM_TYPE_20B; break;
+                switch (hparams.n_ff_exp) {
+                    case 1408: type = LLM_TYPE_16B; break;
+                    case 1792: type = LLM_TYPE_20B; break;
                     default: type = LLM_TYPE_UNKNOWN;
                 }
             } break;
Repository: ollama/ollama
Pull request: Detect arrow keys on windows

Also simplifies to use the `golang.org/x/sys/windows` package. Note: this could be simplified more using the `x/term` package as well on the unix side of things, but I kept this small to fix windows first

Fixes https://github.com/ollama/ollama/issues/2639

Changed files:
filename: readline/term_windows.go
patch: @@ -1,29 +1,7 @@
 package readline
 
 import (
-	"syscall"
-	"unsafe"
-)
-
-const (
-	enableLineInput       = 2
-	enableWindowInput     = 8
-	enableMouseInput      = 16
-	enableInsertMode      = 32
-	enableQuickEditMode   = 64
-	enableExtendedFlags   = 128
-	enableProcessedOutput = 1
-	enableWrapAtEolOutput = 2
-	enableAutoPosition    = 256 // Cursor position is not affected by writing data to the console.
-	enableEchoInput       = 4   // Characters are written to the console as they're read.
-	enableProcessedInput  = 1   // Enables input processing (like recognizing Ctrl+C).
-)
-
-var kernel32 = syscall.NewLazyDLL("kernel32.dll")
-
-var (
-	procGetConsoleMode = kernel32.NewProc("GetConsoleMode")
-	procSetConsoleMode = kernel32.NewProc("SetConsoleMode")
+	"golang.org/x/sys/windows"
 )
 
 type State struct {
@@ -33,31 +11,28 @@ type State struct {
 // IsTerminal checks if the given file descriptor is associated with a terminal
 func IsTerminal(fd int) bool {
 	var st uint32
-	r, _, e := syscall.SyscallN(procGetConsoleMode.Addr(), uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)
-	// if the call succeeds and doesn't produce an error, it's a terminal
-	return r != 0 && e == 0
+	err := windows.GetConsoleMode(windows.Handle(fd), &st)
+	return err == nil
 }
 
 func SetRawMode(fd int) (*State, error) {
 	var st uint32
-	// retrieve the current mode of the terminal
-	_, _, e := syscall.SyscallN(procGetConsoleMode.Addr(), uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)
-	if e != 0 {
-		return nil, error(e)
+	if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil {
+		return nil, err
 	}
-	// modify the mode to set it to raw
-	raw := st &^ (enableEchoInput | enableProcessedInput | enableLineInput | enableProcessedOutput)
-	// apply the new mode to the terminal
-	_, _, e = syscall.SyscallN(procSetConsoleMode.Addr(), uintptr(fd), uintptr(raw), 0)
-	if e != 0 {
-		return nil, error(e)
+
+	// this enables raw mode by turning off various flags in the console mode: https://pkg.go.dev/golang.org/x/sys/windows#pkg-constants
+	raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT)
+
+	// turn on ENABLE_VIRTUAL_TERMINAL_INPUT to enable escape sequences
+	raw |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT
+	if err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil {
+		return nil, err
 	}
-	// return the original state so that it can be restored later
 	return &State{st}, nil
 }
 
 func UnsetRawMode(fd int, state any) error {
 	s := state.(*State)
-	_, _, err := syscall.SyscallN(procSetConsoleMode.Addr(), uintptr(fd), uintptr(s.mode), 0)
-	return err
+	return windows.SetConsoleMode(windows.Handle(fd), s.mode)
 }
Repository: huggingface/transformers
Pull request: Security/fuyu

# What does this PR do?

Remove a reference to a compromised github repo. 

For reference, all conversion scripts are excluded from releases. https://github.com/huggingface/transformers/blob/217ff1e4ef6b006d601d0fa834c2bd68c79b66cd/utils/release.py#L135-L143 

Changed files:
filename: src/transformers/models/fuyu/convert_fuyu_model_weights_to_hf.py
patch: @@ -34,21 +34,13 @@
     tokenizer_class = LlamaTokenizer
 
 """
-Sample usage: # TODO fix clone links from persimmon to fuyu
-```
-git clone https://github.com/adept-ai-labs/adept-inference
-wget https://axtkn4xl5cip.objectstorage.us-phoenix-1.oci.customer-oci.com/n/axtkn4xl5cip/b/adept-public-data/o/8b_base_model_release.tar
-wget https://axtkn4xl5cip.objectstorage.us-phoenix-1.oci.customer-oci.com/n/axtkn4xl5cip/b/adept-public-data/o/8b_chat_model_release.tar
-python src/transformers/models/fuyu/convert_fuyu_weights_to_hf.py  --input_dir /path/to/downloaded/fuyu/weights/ --output_dir /output/path
-```
-
-Thereafter, models can be loaded via:
 
+If you have the original models, they can be loaded with:
 ```py
 from transformers import FuyuForCausalLM, FuyuTokenizer
 
-model = FuyuForCausalLM.from_pretrained("/output/path")
-tokenizer = FuyuTokenizer.from_pretrained("/output/path")
+model = FuyuForCausalLM.from_pretrained("/path/to/models/")
+tokenizer = FuyuTokenizer.from_pretrained("/path/to/models")
 ```
 
 Important note: you need to be able to host the whole model in RAM to execute this script (even if the biggest versions
Repository: electron/electron
Pull request: fix: printing PDF via `webContents.print()`

Backport of #47377

See that PR for details.


Notes: Partially fixes an issue with printing a PDF via `webContents.print()` where the callback would not be called.


Changed files:
filename: shell/browser/api/electron_api_web_contents.cc
patch: @@ -2955,12 +2955,15 @@ void OnGetDeviceNameToUse(base::WeakPtr<content::WebContents> web_contents,
     print_settings.Set(printing::kSettingDpiVertical, dpi.height());
   }
 
-  auto* print_view_manager =
-      PrintViewManagerElectron::FromWebContents(web_contents.get());
+  content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents.get());
+  if (!rfh)
+    return;
+
+  auto* print_view_manager = PrintViewManagerElectron::FromWebContents(
+      content::WebContents::FromRenderFrameHost(rfh));
   if (!print_view_manager)
     return;
 
-  content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents.get());
   print_view_manager->PrintNow(rfh, std::move(print_settings),
                                std::move(print_callback));
 }
@@ -3006,12 +3009,15 @@ void WebContents::Print(gin::Arguments* args) {
   }
 
   if (options.IsEmptyObject()) {
-    auto* print_view_manager =
-        PrintViewManagerElectron::FromWebContents(web_contents());
+    content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents());
+    if (!rfh)
+      return;
+
+    auto* print_view_manager = PrintViewManagerElectron::FromWebContents(
+        content::WebContents::FromRenderFrameHost(rfh));
     if (!print_view_manager)
       return;
 
-    content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents());
     print_view_manager->PrintNow(rfh, std::move(settings), std::move(callback));
     return;
   }