helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Turbopack: Remove matchers.reload() call on each request

## What?

It's likely that because of the bug in #83628 this logic existed in order to make the tests pass but it adds significant overhead depending on the size of your `app` directory. Since #83628 matches the watcher no longer wait for 200ms it should no longer be needed. Let's see how the tests do with the change.

Closes PACK-5448

Changed files:
filename: packages/next/src/server/base-server.ts
patch: @@ -606,6 +606,10 @@ export default abstract class Server<
     this.responseCache = this.getResponseCache({ dev })
   }
 
+  protected reloadMatchers() {
+    return this.matchers.reload()
+  }
+
   private handleRSCRequest: RouteHandler<ServerRequest, ServerResponse> = (
     req,
     _res,

filename: packages/next/src/server/route-matcher-managers/dev-route-matcher-manager.ts
patch: @@ -65,10 +65,6 @@ export class DevRouteMatcherManager extends DefaultRouteMatcherManager {
     pathname: string,
     options: MatchOptions
   ): AsyncGenerator<RouteMatch<RouteDefinition<RouteKind>>, null, undefined> {
-    // Compile the development routes.
-    // TODO: we may want to only run this during testing, users won't be fast enough to require this many dir scans
-    await super.reload()
-
     // Iterate over the development matches to see if one of them match the
     // request path.
     for await (const developmentMatch of super.matchAll(pathname, options)) {
Repository: ollama/ollama
Pull request: add `gcc -lstdc++` flag for linux cpu


Changed files:
filename: llm/generate/gen_common.sh
patch: @@ -52,13 +52,13 @@ install() {
 }
 
 link_server_lib() {
-    g++ -fPIC -g -shared -o ${BUILD_DIR}/lib/libext_server.so \
+    gcc -fPIC -g -shared -o ${BUILD_DIR}/lib/libext_server.so \
         -Wl,--whole-archive \
         ${BUILD_DIR}/lib/libext_server.a \
         -Wl,--no-whole-archive \
         ${BUILD_DIR}/lib/libcommon.a \
-        ${BUILD_DIR}/lib/libllama.a
-
+        ${BUILD_DIR}/lib/libllama.a \
+        -lstdc++
 }
 
 # Keep the local tree clean after we're done with the build
Repository: denoland/deno
Pull request: fix(x): correct alias deno command location for Windows

I'm not familiar with Rust or Windows CMD syntax. But I tried both the current option and just plain `deno.exe` locally by changing `dx.cmd`, which solved the issue for me.

Closes #31572 

Changed files:
filename: cli/tools/x.rs
patch: @@ -251,7 +251,7 @@ exec "$SCRIPT_DIR/deno" x --default-allow-all "$@"
     std::fs::write(
       out_path,
       r##"@echo off
-./deno.exe x %*
+"%~dp0deno.exe" x %*
 exit /b %ERRORLEVEL%
 "##,
     )?;

filename: tests/specs/x/alias/__test__.jsonc
patch: @@ -0,0 +1,13 @@
+{
+  "tempDir": true,
+  "steps": [
+    {
+      "args": "x --install-alias",
+      "output": ""
+    },
+    {
+      "args": "task --eval \"dx\"",
+      "output": "alias.out"
+    }
+  ]
+}

filename: tests/specs/x/alias/alias.out
patch: @@ -0,0 +1,2 @@
+Task  dx
+No local commands found
Repository: ollama/ollama
Pull request: remove double newlines in /set parameter

also change `fmt.Print("\(.*\)\n")` to `fmt.Println("\1")`

Before
```
>>> /set parameter temperature 0
Set parameter 'temperature' to '0'

>>> Send a message (/? for help)
```

Now
```
>>> /set parameter temperature 0
Set parameter 'temperature' to '0'
>>>
```


Changed files:
filename: cmd/interactive.go
patch: @@ -241,10 +241,10 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
 					params := args[3:]
 					fp, err := api.FormatParams(map[string][]string{args[2]: params})
 					if err != nil {
-						fmt.Printf("Couldn't set parameter: %q\n\n", err)
+						fmt.Printf("Couldn't set parameter: %q\n", err)
 						continue
 					}
-					fmt.Printf("Set parameter '%s' to '%s'\n\n", args[2], strings.Join(params, ", "))
+					fmt.Printf("Set parameter '%s' to '%s'\n", args[2], strings.Join(params, ", "))
 					opts.Options[args[2]] = fp[args[2]]
 				case "system", "template":
 					if len(args) < 3 {
@@ -325,15 +325,15 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
 					fmt.Println("")
 				case "license":
 					if resp.License == "" {
-						fmt.Print("No license was specified for this model.\n\n")
+						fmt.Println("No license was specified for this model.")
 					} else {
 						fmt.Println(resp.License)
 					}
 				case "modelfile":
 					fmt.Println(resp.Modelfile)
 				case "parameters":
 					if resp.Parameters == "" {
-						fmt.Print("No parameters were specified for this model.\n\n")
+						fmt.Println("No parameters were specified for this model.")
 					} else {
 						if len(opts.Options) > 0 {
 							fmt.Println("User defined parameters:")
@@ -352,7 +352,7 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
 					case resp.System != "":
 						fmt.Println(resp.System + "\n")
 					default:
-						fmt.Print("No system message was specified for this model.\n\n")
+						fmt.Println("No system message was specified for this model.")
 					}
 				case "template":
 					switch {
@@ -361,7 +361,7 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
 					case resp.Template != "":
 						fmt.Println(resp.Template)
 					default:
-						fmt.Print("No prompt template was specified for this model.\n\n")
+						fmt.Println("No prompt template was specified for this model.")
 					}
 				default:
 					fmt.Printf("Unknown command '/show %s'. Type /? for help\n", args[1])
Repository: ollama/ollama
Pull request: add max context length check

setting a context length greater than what the model is trained for has adverse effects. to prevent this, if the user requests a larger context length, log and set it to the model's max

Changed files:
filename: llm/ggml.go
patch: @@ -83,6 +83,7 @@ type model interface {
 	NumEmbed() uint32
 	NumHead() uint32
 	NumHeadKv() uint32
+	NumCtx() uint32
 }
 
 type container interface {

filename: llm/gguf.go
patch: @@ -308,6 +308,15 @@ func (llm *ggufModel) NumHeadKv() uint32 {
 	return value.(uint32)
 }
 
+func (llm *ggufModel) NumCtx() uint32 {
+	value, exists := llm.kv[fmt.Sprintf("%s.context_length", llm.ModelFamily())]
+	if !exists {
+		return 0
+	}
+
+	return value.(uint32)
+}
+
 func (llm *ggufModel) NumGQA() uint32 {
 	numHeadKv := llm.NumHeadKv()
 	if numHeadKv == 0 {

filename: llm/llm.go
patch: @@ -35,6 +35,11 @@ func New(workDir, model string, adapters, projectors []string, opts api.Options)
 		return nil, err
 	}
 
+	if opts.NumCtx > int(ggml.NumCtx()) {
+		log.Printf("WARNING: requested context length is greater than model's max context length (%d > %d), using %d instead", opts.NumCtx, ggml.NumCtx(), ggml.NumCtx())
+		opts.NumCtx = int(ggml.NumCtx())
+	}
+
 	if opts.NumCtx < 4 {
 		opts.NumCtx = 4
 	}
Repository: electron/electron
Pull request: fix: crash on macOS dialog after `window-all-closed`

Backport of #46927

See that PR for details.


Notes: Fixed a crash that could occur when opening some dialogs as windows are closing on macOS.

Changed files:
filename: shell/browser/ui/cocoa/electron_ns_window.mm
patch: @@ -221,7 +221,7 @@ - (void)rotateWithEvent:(NSEvent*)event {
 }
 
 - (NSRect)contentRectForFrameRect:(NSRect)frameRect {
-  if (shell_->has_frame())
+  if (shell_ && shell_->has_frame())
     return [super contentRectForFrameRect:frameRect];
   else
     return frameRect;
Repository: nodejs/node
Pull request: src: call unmask after install signal handler

Call `unmask` after installing signal handler to ensure the signal is caught.


- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes
- [x] tests and/or benchmarks are included
- [x] documentation is changed or added
- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)


Changed files:
filename: src/inspector_agent.cc
patch: @@ -123,12 +123,11 @@ static int StartDebugSignalHandler() {
   CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &savemask));
   sigmask = savemask;
   pthread_t thread;
-  const int err = pthread_create(&thread, &attr,
-                                 StartIoThreadMain, nullptr);
-  // Restore original mask
-  CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr));
+  const int err = pthread_create(&thread, &attr, StartIoThreadMain, nullptr);
   CHECK_EQ(0, pthread_attr_destroy(&attr));
   if (err != 0) {
+    // Restore original mask
+    CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr));
     fprintf(stderr, "node[%u]: pthread_create: %s\n",
             uv_os_getpid(), strerror(err));
     fflush(stderr);
@@ -137,6 +136,8 @@ static int StartDebugSignalHandler() {
     return -err;
   }
   RegisterSignalHandler(SIGUSR1, StartIoThreadWakeup);
+  // Restore original mask
+  CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr));
   // Unblock SIGUSR1.  A pending SIGUSR1 signal will now be delivered.
   sigemptyset(&sigmask);
   sigaddset(&sigmask, SIGUSR1);

filename: src/node_watchdog.cc
patch: @@ -308,7 +308,10 @@ int SigintWatchdogHelper::Start() {
   CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &savemask));
   sigmask = savemask;
   int ret = pthread_create(&thread_, nullptr, RunSigintWatchdog, nullptr);
-  CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr));
+
+  auto cleanup = OnScopeLeave(
+      [&]() { CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr)); });
+
   if (ret != 0) {
     return ret;
   }
Repository: denoland/deno
Pull request: fix: adjust deno_cache version

Small mishap because of https://github.com/denoland/deno/pull/31183 and https://github.com/denoland/deno/pull/31205.

Changed files:
filename: Cargo.lock
patch: @@ -1791,7 +1791,7 @@ dependencies = [
 
 [[package]]
 name = "deno_cache"
-version = "0.154.0"
+version = "0.155.0"
 dependencies = [
  "async-stream",
  "async-trait",

filename: Cargo.toml
patch: @@ -89,7 +89,7 @@ denokv_sqlite = { default-features = false, version = "0.13.0" }
 
 # exts
 deno_bundle_runtime = { version = "0.9.0", path = "./ext/bundle" }
-deno_cache = { version = "0.154.0", path = "./ext/cache" }
+deno_cache = { version = "0.155.0", path = "./ext/cache" }
 deno_canvas = { version = "0.91.0", path = "./ext/canvas" }
 deno_cron = { version = "0.102.0", path = "./ext/cron" }
 deno_crypto = { version = "0.236.0", path = "./ext/crypto" }

filename: ext/cache/Cargo.toml
patch: @@ -2,7 +2,7 @@
 
 [package]
 name = "deno_cache"
-version = "0.154.0"
+version = "0.155.0"
 authors.workspace = true
 edition.workspace = true
 license.workspace = true
Repository: ggml-org/llama.cpp
Pull request: opencl: refine condition for using kqv mm kernel

Fixes #17351

The kernel introduced in #17181 is specialized for f16f32 mm in attention, in particular for KQ and KQV. Ordinary f16f32 mm would go to this kernel under the original condition causing incorrect results like in #17351. This PR refines the condition (similarly to what vulkan backend does) so that this kernel will only be used for attention.

Changed files:
filename: ggml/src/ggml-opencl/ggml-opencl.cpp
patch: @@ -6895,9 +6895,23 @@ static void ggml_cl_mul_mat(ggml_backend_t backend, const ggml_tensor * src0, co
     cl_context context = backend_ctx->context;
 
     if(src0t == GGML_TYPE_F16 && src1t == GGML_TYPE_F32){
-        if (ne01 >= 64 && ne1 >= 32 && ne00 >= 16 && (ne12 % ne02) == 0){
-            ggml_cl_mul_mat_kq_kqv_adreno(backend, src0, src1, dst);
-            return;
+        if (ne01 >= 64 && ne1 >= 32 && ne00 >= 16 && (ne12 % ne02) == 0) {
+            // For KQ
+            if (ggml_is_permuted(src0) && ggml_is_permuted(src1) &&
+                nb00 <= nb02 &&
+                nb02 <= nb01 &&
+                nb01 <= nb03 &&
+                nb10 <= nb12 &&
+                nb12 <= nb11 &&
+                nb11 <= nb13) {
+                ggml_cl_mul_mat_kq_kqv_adreno(backend, src0, src1, dst);
+                return;
+            }
+            // For KQV
+            if (!ggml_is_contiguous(src0) && ggml_is_contiguous(src1)) {
+                ggml_cl_mul_mat_kq_kqv_adreno(backend, src0, src1, dst);
+                return;
+            }
         }
     }
Repository: huggingface/transformers
Pull request: [generate] Always use decoder config to init cache

# What does this PR do?

(see title)

Fixes #40644 

Changed files:
filename: src/transformers/cache_utils.py
patch: @@ -1010,7 +1010,7 @@ def __init__(
         layers = []
         # If a config is passed, use it to infer the layer types and initialize accordingly
         if config is not None:
-            config = config.get_text_config()
+            config = config.get_text_config(decoder=True)
             sliding_window = getattr(config, "sliding_window", None) or getattr(config, "attention_chunk_size", None)
             layer_types = getattr(config, "layer_types", None)
             if layer_types is None:
@@ -1122,7 +1122,7 @@ def __init__(
         offload_only_non_sliding: bool = True,
         **kwargs,
     ):
-        config = config.get_text_config()
+        config = config.get_text_config(decoder=True)
         layer_types = getattr(config, "layer_types", None)
         # If `layer_types` is not explicitly provided, infer if the model is fully sliding
         if layer_types is None:

filename: src/transformers/generation/utils.py
patch: @@ -1867,7 +1867,7 @@ def _get_cache(self, cache_implementation: str, batch_size: int, max_cache_len:
             self._cache = StaticCache(**self_attention_cache_kwargs)
             if requires_cross_attention_cache:
                 cross_attention_cache_kwargs = {
-                    "config": self.config.get_text_config(encoder=True),
+                    "config": self.config.get_text_config(decoder=True),
                     "max_cache_len": model_kwargs["encoder_outputs"][0].shape[1],
                     "offloading": offload_cache,
                 }
@@ -1972,7 +1972,7 @@ def _prepare_cache_for_generation(
         ):
             dynamic_cache_kwargs = {}
         else:
-            dynamic_cache_kwargs = {"config": self.config}
+            dynamic_cache_kwargs = {"config": self.config.get_text_config(decoder=True)}
         if generation_config.cache_implementation is not None:
             if generation_config.cache_implementation in ALL_STATIC_CACHE_IMPLEMENTATIONS:
                 if generation_config.cache_implementation in DEPRECATED_STATIC_CACHE_IMPLEMENTATIONS:
Repository: vercel/next.js
Pull request: Revert "Remove clientParamParsing requirement from RDC for Navigations"

Reverts vercel/next.js#83661

This appears to be causing performance regressions and failing deployment tests. 

[Failures](https://github.com/vercel/next.js/actions/runs/17660037496/job/50193288746)

Changed files:
filename: packages/next/src/build/index.ts
patch: @@ -1574,7 +1574,12 @@ export default async function build(
                 // Once we've made RDC for Navigations the default for PPR, we
                 // can remove the check for `config.experimental.rdcForNavigations`.
                 isAppPPREnabled &&
-                config.experimental.rdcForNavigations === true,
+                config.experimental.rdcForNavigations === true &&
+                // Temporarily we require that clientParamParsing is enabled for
+                // RDC for Navigations. This is due to a builder configuration
+                // bug that manifests as invalid query params being passed to
+                // the resume lambdas.
+                config.experimental.clientParamParsing === true,
             },
             rewriteHeaders: {
               pathHeader: NEXT_REWRITTEN_PATH_HEADER,
@@ -2194,8 +2199,7 @@ export default async function build(
 
                       if (pageType === 'app' && originalAppPath) {
                         appNormalizedPaths.set(originalAppPath, page)
-
-                        // Edge runtime doesn't support static generation.
+                        // TODO-APP: handle prerendering with edge
                         if (isEdgeRuntime(pageRuntime)) {
                           isStatic = false
                           isSSG = false

filename: packages/next/src/build/templates/app-page.ts
patch: @@ -294,7 +294,13 @@ export async function handler(
   // When a page supports PPR, we can support RSC for Navigations so long as the
   // feature is not disabled.
   const supportsRSCForNavigations =
-    isRoutePPREnabled && nextConfig.experimental.rdcForNavigations === true
+    isRoutePPREnabled &&
+    nextConfig.experimental.rdcForNavigations === true &&
+    // Temporarily we require that clientParamParsing is enabled for
+    // RDC for Navigations. This is due to a builder configuration
+    // bug that manifests as invalid query params being passed to
+    // the resume lambdas.
+    nextConfig.experimental.clientParamParsing === true
 
   // In development, we always want to generate dynamic HTML.
   const supportsDynamicResponse: boolean =
Repository: ollama/ollama
Pull request: Add group delete to uninstall instructions

After executing the `userdel ollama` command, I saw this message:

```sh
$ sudo userdel ollama
userdel: group ollama not removed because it has other members.
```

Which reminded me that I had to remove the dangling group too. For completeness, the uninstall instructions should do this too.

Thanks!

Changed files:
filename: docs/linux.md
patch: @@ -109,8 +109,9 @@ Remove the ollama binary from your bin directory (either `/usr/local/bin`, `/usr
 sudo rm $(which ollama)
 ```
 
-Remove the downloaded models and Ollama service user:
+Remove the downloaded models and Ollama service user and group:
 ```bash
 sudo rm -r /usr/share/ollama
 sudo userdel ollama
+sudo groupdel ollama
 ```
Repository: ggml-org/llama.cpp
Pull request: Detect GigaChat3-10-A1.8B as deepseek lite

Hardcodes checking number of layers to detect if a model is the lite version of deepseek.

Tested with bf16 and q8_0 version of GigaChat3-10B-A1.8B and discussed realizing it was a `lite` version similar to DeepSeek-V2-Lite. That model had 27 layers, but GigaChat3 has 26 and that is used to detect the `lite` variant as discussed here: https://huggingface.co/ai-sage/GigaChat3-10B-A1.8B/discussions/1#691fb161ac024c8eb626ab36

I'd like if anyone else could test. I'll update after testing perplexity to make sure the value looks sane. I haven't uploaded a gguf yet as the template has a parse error and wanted to get it updated before baking it in. That is discussed here: https://huggingface.co/ai-sage/GigaChat3-702B-A36B-preview-bf16/discussions/1

Changed files:
filename: src/llama-model.cpp
patch: @@ -1593,7 +1593,8 @@ void llama_model::load_hparams(llama_model_loader & ml) {
             } break;
         case LLM_ARCH_DEEPSEEK2:
             {
-                bool is_lite = (hparams.n_layer == 27);
+                // lite variants include DeepSeek-V2-Lite, GigaChat3-10B-A1.8B
+                bool is_lite = (hparams.n_layer == 27 || hparams.n_layer == 26);
                 ml.get_key(LLM_KV_ATTENTION_LAYERNORM_RMS_EPS, hparams.f_norm_rms_eps);
                 ml.get_key(LLM_KV_LEADING_DENSE_BLOCK_COUNT,   hparams.n_layer_dense_lead);
                 if (!is_lite) {
@@ -4581,7 +4582,8 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
                 } break;
             case LLM_ARCH_DEEPSEEK2:
                 {
-                    const bool is_lite = (hparams.n_layer == 27);
+                    // lite variants include DeepSeek-V2-Lite, GigaChat3-10B-A1.8B
+                    const bool is_lite = (hparams.n_layer == 27 || hparams.n_layer == 26);
 
                     const bool is_mla = (hparams.n_embd_head_k_mla != 0 && hparams.n_embd_head_v_mla != 0);
 

filename: src/models/deepseek2.cpp
patch: @@ -4,7 +4,8 @@
 
 llm_build_deepseek2::llm_build_deepseek2(const llama_model & model, const llm_graph_params & params) :
     llm_graph_context(params) {
-    bool is_lite = (hparams.n_layer == 27);
+    // lite variants include DeepSeek-V2-Lite, GigaChat3-10B-A1.8B
+    bool is_lite = (hparams.n_layer == 27 || hparams.n_layer == 26);
 
     const bool is_mla = (hparams.n_embd_head_k_mla != 0 && hparams.n_embd_head_v_mla != 0);
Repository: ollama/ollama
Pull request: fix build and lint

x/exp/slices is compatible with 1.20 while slices is not

also fix llm/llm.go where fmt is used but not imported

Changed files:
filename: llm/llm.go
patch: @@ -2,6 +2,7 @@ package llm
 
 import (
 	"context"
+	"fmt"
 	"log"
 	"os"
 	"runtime"

filename: llm/payload_common.go
patch: @@ -3,13 +3,13 @@ package llm
 import (
 	"errors"
 	"fmt"
+	"golang.org/x/exp/slices"
 	"io"
 	"io/fs"
 	"log"
 	"os"
 	"path/filepath"
 	"runtime"
-	"slices"
 	"strings"
 
 	"github.com/jmorganca/ollama/gpu"
@@ -76,7 +76,7 @@ func getDynLibs(gpuInfo gpu.GpuInfo) []string {
 		}
 	}
 
-	// Finaly, if we didn't find any matches, LCD CPU FTW
+	// Finally, if we didn't find any matches, LCD CPU FTW
 	if len(dynLibs) == 0 {
 		dynLibs = []string{availableDynLibs["cpu"]}
 	}
Repository: denoland/deno
Pull request: fix(bundle): support android

support android os in esbuild

linked with https://github.com/denoland/esbuild_client/pull/16

Changed files:
filename: cli/tools/bundle/esbuild.rs
patch: @@ -28,6 +28,8 @@ fn esbuild_platform() -> &'static str {
     ("aarch64", "macos" | "apple") => "darwin-arm64",
     ("x86_64", "windows") => "win32-x64",
     ("aarch64", "windows") => "win32-arm64",
+    ("x86_64", "android") => "android-x64",
+    ("aarch64", "android") => "android-arm64",
     _ => panic!(
       "Unsupported platform: {} {}",
       std::env::consts::ARCH,