helloadhavan/github_issues huggingface dataset:
Repository: denoland/deno
Pull request: Revert "fix(otel): flush data when terminating signal is received (#2…

…9515)"

This reverts commit 248d038ef65cca43e2728246fbca15db8c3dc9a9.

Reverting for now as it causes programs to not exit properly, see
https://github.com/denoland/deno/issues/29590.

While we are working on a proper fix it's better to revert it
and not flush OTEL data in some situations.

Changed files:
filename: ext/telemetry/lib.rs
patch: @@ -770,87 +770,9 @@ pub fn init(
     })
     .map_err(|_| deno_core::anyhow::anyhow!("failed to set otel globals"))?;
 
-  setup_signal_handlers();
   Ok(())
 }
 
-#[cfg(unix)]
-fn setup_signal_handlers() {
-  use tokio::signal::unix::SignalKind;
-
-  let signals_to_handle = [
-    SignalKind::hangup(),
-    SignalKind::interrupt(),
-    SignalKind::terminate(),
-  ];
-
-  for signal_kind in signals_to_handle {
-    tokio::spawn(async move {
-      let Ok(mut signal_fut) = tokio::signal::unix::signal(signal_kind) else {
-        return;
-      };
-
-      loop {
-        signal_fut.recv().await;
-        flush();
-      }
-    });
-  }
-}
-
-#[cfg(windows)]
-fn setup_signal_handlers() {
-  tokio::spawn(async {
-    let Ok(mut signal_fut) = tokio::signal::windows::ctrl_break() else {
-      return;
-    };
-    loop {
-      signal_fut.recv().await;
-      flush();
-    }
-  });
-
-  tokio::spawn(async {
-    let Ok(mut signal_fut) = tokio::signal::windows::ctrl_c() else {
-      return;
-    };
-    loop {
-      signal_fut.recv().await;
-      flush();
-    }
-  });
-
-  tokio::spawn(async {
-    let Ok(mut signal_fut) = tokio::signal::windows::ctrl_close() else {
-      return;
-    };
-    loop {
-      signal_fut.recv().await;
-      flush();
-    }
-  });
-
-  tokio::spawn(async {
-    let Ok(mut signal_fut) = tokio::signal::windows::ctrl_logoff() else {
-      return;
-    };
-    loop {
-      signal_fut.recv().await;
-      flush();
-    }
-  });
-
-  tokio::spawn(async {
-    let Ok(mut signal_fut) = tokio::signal::windows::ctrl_shutdown() else {
-      return;
-    };
-    loop {
-      signal_fut.recv().await;
-      flush();
-    }
-  });
-}
-
 /// This function is called by the runtime whenever it is about to call
 /// `process::exit()`, to ensure that all OpenTelemetry logs are properly
 /// flushed before the process terminates.
Repository: electron/electron
Pull request: build: roll build-images SHAs

Backport of #46291

See that PR for details.


Notes: none


Changed files:
filename: .devcontainer/docker-compose.yml
patch: @@ -2,7 +2,7 @@ version: '3'
 
 services:
   buildtools:
-    image: ghcr.io/electron/devcontainer:77262e58c37631ab082482f42c33cdf68c6c394b
+    image: ghcr.io/electron/devcontainer:9f11982e806f439d0a0a8ebbbf566cd5e0d9e952
 
     volumes:
       - ..:/workspaces/gclient/src/electron:cached

filename: .github/workflows/build.yml
patch: @@ -6,7 +6,7 @@ on:
       build-image-sha:
         type: string
         description: 'SHA for electron/build image'
-        default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
+        default: '9f11982e806f439d0a0a8ebbbf566cd5e0d9e952'
         required: true
       skip-macos:
         type: boolean
@@ -64,7 +64,7 @@ jobs:
       id: set-output
       run: |
         if [ -z "${{ inputs.build-image-sha }}" ]; then
-          echo "build-image-sha=bc2f48b2415a670de18d13605b1cf0eb5fdbaae1" >> "$GITHUB_OUTPUT"
+          echo "build-image-sha=9f11982e806f439d0a0a8ebbbf566cd5e0d9e952" >> "$GITHUB_OUTPUT"
         else
           echo "build-image-sha=${{ inputs.build-image-sha }}" >> "$GITHUB_OUTPUT"
         fi

filename: .github/workflows/linux-publish.yml
patch: @@ -6,7 +6,7 @@ on:
       build-image-sha:
         type: string
         description: 'SHA for electron/build image'
-        default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
+        default: '9f11982e806f439d0a0a8ebbbf566cd5e0d9e952'
       upload-to-storage:
         description: 'Uploads to Azure storage'
         required: false

filename: .github/workflows/macos-publish.yml
patch: @@ -6,7 +6,7 @@ on:
       build-image-sha:
         type: string
         description: 'SHA for electron/build image'
-        default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
+        default: '9f11982e806f439d0a0a8ebbbf566cd5e0d9e952'
         required: true
       upload-to-storage:
         description: 'Uploads to Azure storage'

filename: .github/workflows/windows-publish.yml
patch: @@ -6,7 +6,7 @@ on:
       build-image-sha:
         type: string
         description: 'SHA for electron/build image'
-        default: 'bc2f48b2415a670de18d13605b1cf0eb5fdbaae1'
+        default: '9f11982e806f439d0a0a8ebbbf566cd5e0d9e952'
         required: true
       upload-to-storage:
         description: 'Uploads to Azure storage'
Repository: ollama/ollama
Pull request: Update modelfile.md

fix markdown.

Changed files:
filename: docs/modelfile.md
patch: @@ -38,7 +38,7 @@ SYSTEM You are Mario from super mario bros, acting as an assistant.
 
 To use this:
 
-1. Save it as a file (eg. `Modelfile``)
+1. Save it as a file (eg. `Modelfile`)
 2. `ollama create NAME -f <location of the file eg. ./Modelfile>'`
 3. `ollama run NAME`
 4. Start using the model!
Repository: denoland/deno
Pull request: Revert "fix(ext/napi): ensure the finalizer callback will be called (…

…#29710)"

This reverts commit 3c3af1011a582398e4e9cadf705f06b4e9cfa69b.

Going to revert this one, because there are multiple issues reported
that cause panics. We are working on a proper fix, but for the time
being it's better to revert.

Closes https://github.com/denoland/deno/issues/29832
Closes https://github.com/denoland/deno/issues/29874
Closes https://github.com/denoland/deno/issues/29911
Closes https://github.com/denoland/deno/issues/29866
Closes https://github.com/denoland/deno/issues/29973
Closes https://github.com/denoland/deno/issues/29978

Changed files:
filename: ext/napi/js_native_api.rs
patch: @@ -111,11 +111,12 @@ impl Reference {
   fn set_weak(&mut self) {
     let reference = self as *mut Reference;
     if let ReferenceState::Strong(g) = &self.state {
-      let cb = Box::new(move || Reference::weak_callback(reference));
+      let cb = Box::new(move |_: &mut v8::Isolate| {
+        Reference::weak_callback(reference)
+      });
       let isolate = unsafe { (*self.env).isolate() };
-      self.state = ReferenceState::Weak(v8::Weak::with_guaranteed_finalizer(
-        isolate, g, cb,
-      ));
+      self.state =
+        ReferenceState::Weak(v8::Weak::with_finalizer(isolate, g, cb));
     }
   }
Repository: ggml-org/llama.cpp
Pull request: server : add support for external server for tests

This commit adds support for using an externally started llama-server instance for the server tests. This can be enabled by setting the DEBUG_EXTERNAL environment variable.

The motivation for this is to allow debugging of the server itself when investigating a test failure. Instructions for how to do this are added to the README.md file in the tests directory.


Changed files:
filename: tools/server/tests/README.md
patch: @@ -64,3 +64,33 @@ cmake --build build -j --target llama-server && ./tools/server/tests/tests.sh
 ```
 
 To see all available arguments, please refer to [pytest documentation](https://docs.pytest.org/en/stable/how-to/usage.html)
+
+### Debugging external llama-server
+It can sometimes be useful to run the server in a debugger when invesigating test
+failures. To do this, the environment variable `DEBUG_EXTERNAL=1` can be set
+which will cause the test to skip starting a llama-server itself. Instead, the
+server can be started in a debugger.
+
+Example using `gdb`:
+```console
+$ gdb --args ../../../build/bin/llama-server \
+    --host 127.0.0.1 --port 8080 \
+    --temp 0.8 --seed 42 \
+    --hf-repo ggml-org/models --hf-file tinyllamas/stories260K.gguf \
+    --batch-size 32 --no-slots --alias tinyllama-2 --ctx-size 512 \
+    --parallel 2 --n-predict 64
+```
+And a break point can be set in before running:
+```console
+(gdb) br server.cpp:4604
+(gdb) r
+main: server is listening on http://127.0.0.1:8080 - starting the main loop
+srv  update_slots: all slots are idle
+```
+
+And then the test in question can be run in another terminal:
+```console
+(venv) $ env DEBUG_EXTERNAL=1 ./tests.sh unit/test_chat_completion.py -v -x
+```
+And this should trigger the breakpoint and allow inspection of the server state
+in the debugger terminal.

filename: tools/server/tests/utils.py
patch: @@ -99,8 +99,12 @@ def __init__(self):
             self.debug = True
         if "PORT" in os.environ:
             self.server_port = int(os.environ["PORT"])
+        self.external_server = "DEBUG_EXTERNAL" in os.environ
 
     def start(self, timeout_seconds: int | None = DEFAULT_HTTP_TIMEOUT) -> None:
+        if self.external_server:
+            print(f"[external_server]: Assuming external server running on {self.server_host}:{self.server_port}")
+            return
         if self.server_path is not None:
             server_path = self.server_path
         elif "LLAMA_SERVER_BIN_PATH" in os.environ:
@@ -244,6 +248,9 @@ def start(self, timeout_seconds: int | None = DEFAULT_HTTP_TIMEOUT) -> None:
         raise TimeoutError(f"Server did not start within {timeout_seconds} seconds")
 
     def stop(self) -> None:
+        if self.external_server:
+            print("[external_server]: Not stopping external server")
+            return
         if self in server_instances:
             server_instances.remove(self)
         if self.process:
Repository: ollama/ollama
Pull request: fix vars.First


Changed files:
filename: server/images.go
patch: @@ -51,7 +51,7 @@ func (m *Model) Prompt(request api.GenerateRequest) (string, error) {
 		Context []int
 	}
 
-	vars.First = len(vars.Context) == 0
+	vars.First = len(request.Context) == 0
 	vars.System = m.System
 	vars.Prompt = request.Prompt
 	vars.Context = request.Context
Repository: ollama/ollama
Pull request: fix extended tag names


Changed files:
filename: server/modelpath.go
patch: @@ -45,7 +45,7 @@ func ParseModelPath(name string) ModelPath {
 		return ModelPath{}
 	}
 
-	colonParts := strings.Split(name, ":")
+	colonParts := strings.Split(slashParts[len(slashParts)-1], ":")
 	if len(colonParts) == 2 {
 		tag = colonParts[1]
 	} else {
Repository: vercel/next.js
Pull request: Turbopack: implement shutdown for backing storage correct

### What?

This ensures next.js correctly waits for the turbopack shutdown to complete


Closes PACK-5155

Changed files:
filename: turbopack/crates/turbo-tasks-backend/src/backing_storage.rs
patch: @@ -211,6 +211,10 @@ where
             }
         }
     }
+
+    fn shutdown(&self) -> Result<()> {
+        either::for_both!(self, this => this.shutdown())
+    }
 }
 
 // similar to `Either::unwrap_left`, but does not require `R: Debug`.
Repository: ollama/ollama
Pull request: get the proper path for blobs to delete


Changed files:
filename: server/images.go
patch: @@ -548,9 +548,13 @@ func DeleteModel(name string, fn func(api.ProgressResponse)) error {
 	// only delete the files which are still in the deleteMap
 	for k, v := range deleteMap {
 		if v {
-			err := os.Remove(k)
+			fp, err := GetBlobsPath(k)
 			if err != nil {
-				log.Printf("couldn't remove file '%s': %v", k, err)
+				log.Printf("couldn't get file path for '%s': %v", k, err)
+				continue
+			}
+			if err := os.Remove(fp); err != nil {
+				log.Printf("couldn't remove file '%s': %v", fp, err)
 				continue
 			}
 		}
Repository: huggingface/transformers
Pull request: [`GPT Big Code`] Fix attention scaling

Reported internally cc @hmellor @zucchini-nlp 

Changed files:
filename: src/transformers/models/gpt_bigcode/modeling_gpt_bigcode.py
patch: @@ -144,7 +144,7 @@ def __init__(self, config, is_cross_attention=False, layer_idx=None):
             )
 
         self.scale_attn_weights = config.scale_attn_weights
-        self.scaling = self.head_dim**0.5 if config.scale_attn_weights else 1.0
+        self.scaling = self.head_dim**-0.5 if config.scale_attn_weights else 1.0
         self.is_cross_attention = is_cross_attention
 
         self.layer_idx = layer_idx

filename: tests/models/gpt_bigcode/test_modeling_gpt_bigcode.py
patch: @@ -29,6 +29,7 @@
     import torch
 
     from transformers import (
+        AutoTokenizer,
         GPT2TokenizerFast,
         GPTBigCodeForCausalLM,
         GPTBigCodeForSequenceClassification,
@@ -510,7 +511,7 @@ def test_generate_simple(self):
         output_sequence = model.generate(input_ids)
         output_sentence = tokenizer.decode(output_sequence[0], skip_special_tokens=True)
 
-        expected_output = """def print_hello_world():\n    print("Hello World!")\n\n\ndef print_hello_"""
+        expected_output = 'def print_hello_world():\n    print("Hello World!")\n\n\ndef print_hello_world_with_args(name'  # fmt: skip
         self.assertEqual(output_sentence, expected_output)
 
     def test_generate_batched(self):
@@ -527,11 +528,27 @@ def test_generate_batched(self):
         outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)
 
         expected_output = [
-            'def print_hello_world():\n    print("Hello World!")\n\n\ndef print_hello_',
-            'def say_hello():\n    print("Hello, World!")\n\n\nsay_hello()',
+            'def print_hello_world():\n    print("Hello World!")\n\n\ndef print_hello_world_with_args(name',
+            'def say_hello():\n    print("Hello, World!")\n\n\nsay_hello()\n',
         ]
         self.assertListEqual(outputs, expected_output)
 
+    def test_newline_regression(self):
+        """Added to prevent regressions regarding attention (scaling) indicated by excessive newlines"""
+        tokenizer = AutoTokenizer.from_pretrained("bigcode/tiny_starcoder_py")
+        model = GPTBigCodeForCausalLM.from_pretrained("bigcode/tiny_starcoder_py").to(torch_device)
+
+        input_ids = tokenizer(
+            "Analyze the impact of the COVID-19 pandemic on global economic structures and future business models.\n",
+            return_tensors="pt",
+        ).input_ids.to(torch_device)
+
+        output_sequence = model.generate(input_ids, max_new_tokens=20, do_sample=False)
+        output_sentence = tokenizer.decode(output_sequence[0], skip_special_tokens=True)
+
+        expected_output = 'Analyze the impact of the COVID-19 pandemic on global economic structures and future business models.\n\nThe impact of the COVID-19 pandemic on global economic structures and future business'  # fmt: skip
+        self.assertEqual(output_sentence, expected_output)
+
 
 @require_torch
 class GPTBigCodeMQATest(unittest.TestCase):
Repository: facebook/react
Pull request: fix[devtools]: fixed Tree indentation logic after updating react-windows

Forward-fixing the indentation after landing https://github.com/facebook/react/pull/28408. Could potentially be related to `ref` changes in `react`, but haven't validated yet.

Haven't occured while testing the previous PR, but reproduced while testing the https://github.com/facebook/react/pull/28418, for which I've rebuilt all dependencies, including `react`.

This change basically removes the props passing from original parent, `rest` should include only `ref`: https://github.com/bvaughn/react-window/blob/efad3d8909753fd74aad7c47dc902b26f0919651/src/createListComponent.js#L382

Changed files:
filename: packages/react-devtools-shared/src/devtools/views/Components/Tree.js
patch: @@ -538,7 +538,7 @@ function updateIndentationSizeVar(
 }
 
 // $FlowFixMe[missing-local-annot]
-function InnerElementType({children, style, ...rest}) {
+function InnerElementType({children, style}) {
   const {ownerID} = useContext(TreeStateContext);
 
   const cachedChildWidths = useMemo<WeakMap<HTMLElement, number>>(
@@ -586,11 +586,7 @@ function InnerElementType({children, style, ...rest}) {
   // A lot of options were considered; this seemed the one that requires the least code.
   // See https://github.com/bvaughn/react-devtools-experimental/issues/9
   return (
-    <div
-      className={styles.InnerElementType}
-      ref={divRef}
-      style={style}
-      {...rest}>
+    <div className={styles.InnerElementType} ref={divRef} style={style}>
       <SelectedTreeHighlight />
       {children}
     </div>
Repository: ggml-org/llama.cpp
Pull request: ggml-cpu : fix leftover handling in ggml_vec_scale_f32 for SVE

This commit updates the leftover handling in ggml_vec_scale_f32.

The motivation for this is that the code currently incorrectly assumes there would be fewer than ggml_f32_epr leftover elements. However, since the main loop processes 2\*ggml_f32_epr elements per iteration , there can be up to (2*ggml_f32_epr - 1) leftover elements.

The original single-pass leftover code could only process ggml_f32_epr elements, leaving some elements unscaled.

Example scenario with 256-bit SVE:
```
ggml_f32_epr  = 8 (elements per register)
ggml_f32_step = 16 (two registers per iteration)
n             = 25
np            = 16
leftovers     = 9 elements (16-24)

Original    : processes only elements 16-23, misses element 24
This commit : loop processes elements 16-23, then element 24
```

Refs: https://github.com/ggml-org/llama.cpp/actions/runs/18070620247/job/51419855630


Changed files:
filename: ggml/src/ggml-cpu/vec.h
patch: @@ -654,11 +654,11 @@ inline static void ggml_vec_scale_f32(const int n, float * y, const float   v) {
         }
         // leftovers
         // maximum number of leftover elements will be less that ggml_f32_epr. Apply predicated svmad on available elements only
-        if (np < n) {
-            svbool_t pg = svwhilelt_b32(np, n);
-            ay1 = svld1_f32(pg, y + np);
+        for (int i = np; i < n; i += ggml_f32_epr) {
+            svbool_t pg = svwhilelt_b32(i, n);
+            ay1 = svld1_f32(pg, y + i);
             ay1 = svmul_f32_m(pg, ay1, vx);
-            svst1_f32(pg, y + np, ay1);
+            svst1_f32(pg, y + i, ay1);
         }
     #elif defined(__riscv_v_intrinsic)
         for (int i = 0, avl; i < n; i += avl) {
Repository: denoland/deno
Pull request: fix(serve): actually wire up resolving main module with import map for deno serve

Closes https://github.com/denoland/deno/issues/29897

Changed files:
filename: cli/tools/serve.rs
patch: @@ -17,6 +17,7 @@ use crate::args::parallelism_count;
 use crate::args::Flags;
 use crate::args::ServeFlags;
 use crate::args::WatchFlagsWithPaths;
+use crate::args::WorkspaceMainModuleResolver;
 use crate::factory::CliFactory;
 use crate::util::file_watcher::WatcherRestartMode;
 use crate::worker::CliMainWorkerFactory;
@@ -51,7 +52,12 @@ pub async fn serve(
     deno_dir.upgrade_check_file_path(),
   );
 
-  let main_module = cli_options.resolve_main_module()?;
+  let workspace_resolver = factory.workspace_resolver().await?.clone();
+  let node_resolver = factory.node_resolver().await?.clone();
+
+  let main_module = cli_options.resolve_main_module_with_resolver(Some(
+    &WorkspaceMainModuleResolver::new(workspace_resolver, node_resolver),
+  ))?;
 
   maybe_npm_install(&factory).await?;
 

filename: tests/specs/serve/import_map_bare_specifier/__test__.jsonc
patch: @@ -0,0 +1,9 @@
+{
+  "tempDir": true,
+  "steps": [
+    {
+      "args": "serve my-server",
+      "output": "Listening\n"
+    }
+  ]
+}

filename: tests/specs/serve/import_map_bare_specifier/deno.jsonc
patch: @@ -0,0 +1,5 @@
+{
+  "imports": {
+    "my-server": "./server.ts"
+  }
+}

filename: tests/specs/serve/import_map_bare_specifier/server.ts
patch: @@ -0,0 +1,9 @@
+export default {
+  fetch() {
+    return new Response("Hello, world!");
+  },
+  onListen() {
+    console.log("Listening");
+    Deno.exit(0);
+  },
+} satisfies Deno.ServeDefaultExport;
Repository: nodejs/node
Pull request: http: expose websocket in nodehttp

This PR exposes Websocket in node:http as requested in #53684 
Once we discuss, if it satisfies the requirement, we can backport to Node.js 20 and 22

CC: @mcollina @nodejs/http @manekinekko 

Changed files:
filename: doc/api/http.md
patch: @@ -4228,6 +4228,15 @@ added:
 
 Set the maximum number of idle HTTP parsers.
 
+## `WebSocket`
+
+<!-- YAML
+added:
+  - REPLACEME
+-->
+
+A browser-compatible implementation of [`WebSocket`][].
+
 [RFC 8187]: https://www.rfc-editor.org/rfc/rfc8187.txt
 [`'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`]: errors.md#err_http_content_length_mismatch
 [`'checkContinue'`]: #event-checkcontinue
@@ -4244,6 +4253,7 @@ Set the maximum number of idle HTTP parsers.
 [`Headers`]: globals.md#class-headers
 [`TypeError`]: errors.md#class-typeerror
 [`URL`]: url.md#the-whatwg-url-api
+[`WebSocket`]: #websocket
 [`agent.createConnection()`]: #agentcreateconnectionoptions-callback
 [`agent.getName()`]: #agentgetnameoptions
 [`destroy()`]: #agentdestroy

filename: lib/http.js
patch: @@ -42,6 +42,7 @@ const {
   ServerResponse,
 } = require('_http_server');
 let maxHeaderSize;
+let undici;
 
 /**
  * Returns a new instance of `http.Server`.
@@ -114,6 +115,14 @@ function get(url, options, cb) {
   return req;
 }
 
+/**
+ * Lazy loads WebSocket, CloseEvent and MessageEvent classes from undici
+ * @returns {object} An object containing WebSocket, CloseEvent, and MessageEvent classes.
+ */
+function lazyUndici() {
+  return undici ??= require('internal/deps/undici/undici');
+}
+
 module.exports = {
   _connectionListener,
   METHODS: methods.toSorted(),
@@ -160,3 +169,30 @@ ObjectDefineProperty(module.exports, 'globalAgent', {
     httpAgent.globalAgent = value;
   },
 });
+
+ObjectDefineProperty(module.exports, 'WebSocket', {
+  __proto__: null,
+  configurable: true,
+  enumerable: true,
+  get() {
+    return lazyUndici().WebSocket;
+  },
+});
+
+ObjectDefineProperty(module.exports, 'CloseEvent', {
+  __proto__: null,
+  configurable: true,
+  enumerable: true,
+  get() {
+    return lazyUndici().CloseEvent;
+  },
+});
+
+ObjectDefineProperty(module.exports, 'MessageEvent', {
+  __proto__: null,
+  configurable: true,
+  enumerable: true,
+  get() {
+    return lazyUndici().MessageEvent;
+  },
+});

filename: test/parallel/test-http-import-websocket.js
patch: @@ -0,0 +1,14 @@
+'use strict';
+
+require('../common');
+const assert = require('assert');
+const {
+  WebSocket: NodeHttpWebSocket,
+  CloseEvent: NodeHttpCloseEvent,
+  MessageEvent: NodeHttpMessageEvent
+} = require('node:http');
+
+// Compare with global objects
+assert.strictEqual(NodeHttpWebSocket, WebSocket);
+assert.strictEqual(NodeHttpCloseEvent, CloseEvent);
+assert.strictEqual(NodeHttpMessageEvent, MessageEvent);
Repository: ollama/ollama
Pull request: add ls alias


Changed files:
filename: cmd/cmd.go
patch: @@ -424,6 +424,7 @@ func NewCLI() *cobra.Command {
 
 	listCmd := &cobra.Command{
 		Use:   "list",
+		Aliases: []string{"ls"},
 		Short: "List models",
 		RunE:  list,
 	}