helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: ggml-cpu: remove duplicate conditional check 'iid'

Duplicate block 'iid < 0'
Just a code refactor.

Changed files:
filename: ggml/src/ggml-cpu/ops.cpp
patch: @@ -6383,7 +6383,7 @@ static void ggml_compute_forward_im2col_3d_f16(
                                         const int64_t iih = ioh*s1 + ikh*d1 - p1;
                                         const int64_t iid = iod*s2 + ikd*d2 - p2;
 
-                                        if (iid < 0 || iid >= ID || iih < 0 || iih >= IH || iiw < 0 || iiw >= IW || iid < 0 || iid >= ID) {
+                                        if (iid < 0 || iid >= ID || iih < 0 || iih >= IH || iiw < 0 || iiw >= IW) {
                                             dst_data[iic*KD_KH_KW + ikd * KH_KW + ikh*KW + ikw] = 0;
                                         } else {
                                             const float * const s = (const float *) ((const char *)src_data + iid*nb12 + iih*nb11 + iiw*nb10); // [ID, IH, IW]
Repository: nodejs/node
Pull request: doc: add RafaelGSS as performance strategic lead

I'd like to step up and lead some work on the nodejs/performance team. I'm still unsure if this should be a strategic initiative since there's no end goal for this, but it seems doable to provide some insights whenever we get it from nodejs/performance.



Changed files:
filename: doc/contributing/strategic-initiatives.md
patch: @@ -14,7 +14,7 @@ agenda to ensure they are active and have the support they need.
 | V8 Currency            | [Michaël Zasso][targos]          |                                                   |
 | Next-10                | [Michael Dawson][mhdawson]       | <https://github.com/nodejs/next-10>               |
 | Single executable apps | [Darshan Sen][RaisinTen]         | <https://github.com/nodejs/single-executable>     |
-| Performance            |                                  | <https://github.com/nodejs/performance>           |
+| Performance            | [Rafael Gonzaga][RafaelGSS]      | <https://github.com/nodejs/performance>           |
 | Primordials            | [Benjamin Gruenbaum][benjamingr] | <https://github.com/nodejs/primordials-use-cases> |
 
 <details>
@@ -39,6 +39,7 @@ agenda to ensure they are active and have the support they need.
 
 </details>
 
+[RafaelGSS]: https://github.com/RafaelGSS
 [RaisinTen]: https://github.com/RaisinTen
 [benjamingr]: https://github.com/benjamingr
 [jasnell]: https://github.com/jasnell
Repository: ollama/ollama
Pull request: Log unexpected server errors checking for update

This should unmask some failure modes that likely
show up in app logs as unmarshal errors

Changed files:
filename: app/lifecycle/updater.go
patch: @@ -86,6 +86,11 @@ func IsNewReleaseAvailable(ctx context.Context) (bool, UpdateResponse) {
 	if err != nil {
 		slog.Warn(fmt.Sprintf("failed to read body response: %s", err))
 	}
+
+	if resp.StatusCode != 200 {
+		slog.Info(fmt.Sprintf("check update error %d - %.96s", resp.StatusCode, string(body)))
+		return false, updateResp
+	}
 	err = json.Unmarshal(body, &updateResp)
 	if err != nil {
 		slog.Warn(fmt.Sprintf("malformed response checking for update: %s", err))
Repository: ollama/ollama
Pull request: reliably determine available VRAM on macOS (resolves #1826, #2370)


Changed files:
filename: gpu/gpu_darwin.go
patch: @@ -1,12 +1,14 @@
 //go:build darwin
 
 package gpu
-
+/*
+#cgo CFLAGS: -x objective-c
+#cgo LDFLAGS: -framework Foundation -framework CoreGraphics -framework Metal
+#include "gpu_info_darwin.h"
+*/
 import "C"
 import (
 	"runtime"
-
-	"github.com/pbnjay/memory"
 )
 
 // CheckVRAM returns the free VRAM in bytes on Linux machines with NVIDIA GPUs
@@ -15,19 +17,8 @@ func CheckVRAM() (int64, error) {
 		// gpu not supported, this may not be metal
 		return 0, nil
 	}
-
-	// on macOS, there's already buffer for available vram (see below) so just return the total
-	systemMemory := int64(memory.TotalMemory())
-
-	// macOS limits how much memory is available to the GPU based on the amount of system memory
-	// TODO: handle case where iogpu.wired_limit_mb is set to a higher value
-	if systemMemory <= 36*1024*1024*1024 {
-		systemMemory = systemMemory * 2 / 3
-	} else {
-		systemMemory = systemMemory * 3 / 4
-	}
-
-	return systemMemory, nil
+	recommendedMaxVRAM := int64(C.getRecommendedMaxVRAM())
+	return recommendedMaxVRAM, nil
 }
 
 func GetGPUInfo() GpuInfo {

filename: gpu/gpu_info_darwin.h
patch: @@ -0,0 +1,3 @@
+#import <Metal/Metal.h>
+#include <stdint.h>
+uint64_t getRecommendedMaxVRAM();

filename: gpu/gpu_info_darwin.m
patch: @@ -0,0 +1,11 @@
+//go:build darwin
+#include "gpu_info_darwin.h"
+
+uint64_t getRecommendedMaxVRAM()
+{
+	id<MTLDevice> device = MTLCreateSystemDefaultDevice();
+	uint64_t result = device.recommendedMaxWorkingSetSize;
+	CFRelease(device);
+	return result;
+}
+
Repository: nodejs/node
Pull request: test: fix typos in comments and variable names

Fix minor typos:
- "transferd" → "transferred"
- "depandant" → "dependant"

Changed files:
filename: test/parallel/test-abortsignal-cloneable.js
patch: @@ -35,7 +35,7 @@ test('Can create a transferable abort controller', async () => {
 
   mc.port2.postMessage(ac.signal, [ac.signal]);
 
-  // Can be cloned/transferd multiple times and they all still work
+  // Can be cloned/transferred multiple times and they all still work
   mc.port2.postMessage(ac.signal, [ac.signal]);
 
   // Although we're using transfer semantics, the local AbortSignal

filename: test/parallel/test-abortsignal-drop-settled-signals.mjs
patch: @@ -104,17 +104,17 @@ const limit = 10_000;
 
 describe('when there is a long-lived signal', () => {
   it('drops settled dependant signals', (t, done) => {
-    makeSubsequentCalls(limit, (signal, depandantSignalsKey) => {
+    makeSubsequentCalls(limit, (signal, dependantSignalsKey) => {
       setImmediate(() => {
-        t.assert.strictEqual(signal[depandantSignalsKey].size, 0);
+        t.assert.strictEqual(signal[dependantSignalsKey].size, 0);
         done();
       });
     });
   });
 
   it('keeps all active dependant signals', (t, done) => {
-    makeSubsequentCalls(limit, (signal, depandantSignalsKey) => {
-      t.assert.strictEqual(signal[depandantSignalsKey].size, limit);
+    makeSubsequentCalls(limit, (signal, dependantSignalsKey) => {
+      t.assert.strictEqual(signal[dependantSignalsKey].size, limit);
 
       done();
     }, true);
Repository: denoland/deno
Pull request: fix: unstable_cron_socket_serve_reject flakiness caused by control socket coordination


Changed files:
filename: tests/specs/run/unstable_cron_socket_serve_reject/test_runner.js
patch: @@ -23,8 +23,21 @@ const mainProcess = new Deno.Command(Deno.execPath(), {
   },
 }).spawn();
 
-// Give Deno a moment to start and create its control socket
-await new Promise((resolve) => setTimeout(resolve, 100));
+// Wait for control socket to be available
+let i = 0;
+while (true) {
+  try {
+    await Deno.lstat(controlSocketPath);
+    break;
+  } catch {}
+
+  i += 1;
+  if (i > 100) {
+    throw new Error(`${controlSocketPath} did not exist`);
+  }
+
+  await new Promise((r) => setTimeout(r, 10));
+}
 
 // 3. Connect to control socket (Deno is the server, we are the client)
 const controlConn = await Deno.connect({
Repository: ollama/ollama
Pull request: Update types.go

specfied -> specified

Changed files:
filename: api/types.go
patch: @@ -83,7 +83,7 @@ type Metrics struct {
 	EvalDuration       time.Duration `json:"eval_duration,omitempty"`
 }
 
-// Options specfied in GenerateRequest, if you add a new option here add it to the API docs also
+// Options specified in GenerateRequest, if you add a new option here add it to the API docs also
 type Options struct {
 	Runner
Repository: nodejs/node
Pull request: src: remove duplicate assignment of `O_EXCL` in node_constants.cc

Currently the `O_EXCL` constant is assigned twice in `DefineFsConstants` on these places:

https://github.com/nodejs/node/blob/049664bbdc421c63b2145c85a18c64d184b40aa5/src/node_constants.cc#L1086-L1088

https://github.com/nodejs/node/blob/049664bbdc421c63b2145c85a18c64d184b40aa5/src/node_constants.cc#L1108-L1110

Though it doesn't introduce any bugs, changes in this PR removes that redundancy.

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: src/node_constants.cc
patch: @@ -1105,10 +1105,6 @@ NODE_DEFINE_CONSTANT(target, UV_FS_O_FILEMAP);
   NODE_DEFINE_CONSTANT(target, O_DIRECTORY);
 #endif
 
-#ifdef O_EXCL
-  NODE_DEFINE_CONSTANT(target, O_EXCL);
-#endif
-
 #ifdef O_NOATIME
   NODE_DEFINE_CONSTANT(target, O_NOATIME);
 #endif
Repository: denoland/deno
Pull request: fix(flags): extra trailing space in zsh directory completions

Fixes https://github.com/denoland/deno/issues/31809

Ref https://github.com/clap-rs/clap/commit/5571b83c8a322ee2cf4342402d930cf2806fa2f1

Changed files:
filename: cli/args/flags.rs
patch: @@ -6844,7 +6844,25 @@ function _clap_dynamic_completer_NAME() {
   )}")
 
   if [[ -n $completions ]]; then
-      _describe -V 'values' completions -o nosort
+      local -a dirs=()
+      local -a other=()
+      local completion
+      for completion in $completions; do
+          local value="${completion%%:*}"
+          if [[ "$value" == */ ]]; then
+              local dir_no_slash="${value%/}"
+              if [[ "$completion" == *:* ]]; then
+                  local desc="${completion#*:}"
+                  dirs+=("$dir_no_slash:$desc")
+              else
+                  dirs+=("$dir_no_slash")
+              fi
+          else
+              other+=("$completion")
+          fi
+      done
+      [[ -n $dirs ]] && _describe -V 'values' dirs -o nosort -S '/' -r '/'
+      [[ -n $other ]] && _describe -V 'values' other -o nosort
   fi
 }
Repository: huggingface/transformers
Pull request: dummy commit

# What does this PR do?

dummy

Changed files:
filename: .circleci/create_circleci_config.py
patch: @@ -129,6 +129,12 @@ def __post_init__(self):
 
     def to_dict(self):
         env = COMMON_ENV_VARIABLES.copy()
+        if self.job_name != "tests_hub":
+            # fmt: off
+            # not critical
+            env.update({"HF_TOKEN": "".join(["h", "f", "_", "H", "o", "d", "V", "u", "M", "q", "b", "R", "m", "t", "b", "z", "F", "Q", "O", "Q", "A", "J", "G", "D", "l", "V", "Q", "r", "R", "N", "w", "D", "M", "V", "C", "s", "d"])})
+            # fmt: on
+
         # Do not run tests decorated by @is_flaky on pull requests
         env['RUN_FLAKY'] = os.environ.get("CIRCLE_PULL_REQUEST", "") == ""
         env.update(self.additional_env)
Repository: electron/electron
Pull request: ci: add problem matcher for clang output

Backport of #46577

See that PR for details.


Notes: none <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->


Changed files:
filename: .github/actions/build-electron/action.yml
patch: @@ -38,6 +38,9 @@ runs:
       run: |
         GN_APPENDED_ARGS="$GN_EXTRA_ARGS target_cpu=\"x64\" v8_snapshot_toolchain=\"//build/toolchain/mac:clang_x64\""
         echo "GN_EXTRA_ARGS=$GN_APPENDED_ARGS" >> $GITHUB_ENV
+    - name: Add Clang problem matcher
+      shell: bash
+      run: echo "::add-matcher::src/electron/.github/problem-matchers/clang.json"
     - name: Build Electron ${{ inputs.step-suffix }}
       shell: bash
       run: |
@@ -199,6 +202,9 @@ runs:
         e build --target electron:libcxx_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
         e build --target electron:libcxxabi_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
         e build --target electron:libcxx_objects_zip -j $NUMBER_OF_NINJA_PROCESSES
+    - name: Remove Clang problem matcher
+      shell: bash
+      run: echo "::remove-matcher owner=clang::"
     - name: Generate TypeScript Definitions ${{ inputs.step-suffix }}
       if: ${{ inputs.is-release == 'true' }}
       shell: bash

filename: .github/problem-matchers/clang.json
patch: @@ -0,0 +1,18 @@
+{
+  "problemMatcher": [
+    {
+      "owner": "clang",
+      "fromPath": "src/out/Default/args.gn",
+      "pattern": [
+        {
+          "regexp": "^(.+)[(:](\\d+)[:,](\\d+)\\)?:\\s+(warning|error):\\s+(.*)$",
+          "file": 1,
+          "line": 2,
+          "column": 3,
+          "severity": 4,
+          "message": 5
+        }
+      ]
+    }
+  ]
+}
Repository: facebook/react
Pull request: Add unknown location information to component stacks

This is the same change as in #30289 but for the main runtime - e.g. parent stacks in errorInfo.componentStack, appended stacks to console.error coming from React itself and when we add virtual frames to owner stacks.

Since we don't add location information these frames look weird to some stack parsers - such as the native one. This is an existing issue when you want to use some off-the-shelf parsers to parse production component stacks for example.

While we won't add Error objects to logs ourselves necessarily, some third party could want to do the same thing we do in DevTools and so we should provide the same capability to just take this trace and print it using an Error object.


Changed files:
filename: packages/react-dom/src/__tests__/ReactDOMSingletonComponents-test.js
patch: @@ -475,7 +475,7 @@ describe('ReactDOM HostSingleton', () => {
     expect(hydrationErrors).toEqual([
       [
         "Hydration failed because the server rendered HTML didn't match the client.",
-        'at div',
+        'at div (<anonymous>)',
       ],
     ]);
     expect(persistentElements).toEqual([

filename: packages/react-server/src/ReactFizzServer.js
patch: @@ -924,7 +924,7 @@ function pushServerComponentStack(
       let name = componentInfo.name;
       const env = componentInfo.env;
       if (env) {
-        name += ' (' + env + ')';
+        name += ' [' + env + ']';
       }
       task.componentStack = {
         tag: 3,

filename: packages/shared/ReactComponentStackFrame.js
patch: @@ -24,6 +24,7 @@ import {disableLogs, reenableLogs} from 'shared/ConsolePatchingDev';
 import ReactSharedInternals from 'shared/ReactSharedInternals';
 
 let prefix;
+let suffix;
 export function describeBuiltInComponentFrame(name: string): string {
   if (enableComponentStackLocations) {
     if (prefix === undefined) {
@@ -33,17 +34,26 @@ export function describeBuiltInComponentFrame(name: string): string {
       } catch (x) {
         const match = x.stack.trim().match(/\n( *(at )?)/);
         prefix = (match && match[1]) || '';
+        suffix =
+          x.stack.indexOf('\n    at') > -1
+            ? // V8
+              ' (<anonymous>)'
+            : // JSC/Spidermonkey
+            x.stack.indexOf('@') > -1
+            ? '@unknown:0:0'
+            : // Other
+              '';
       }
     }
     // We use the prefix to ensure our stacks line up with native stack frames.
-    return '\n' + prefix + name;
+    return '\n' + prefix + name + suffix;
   } else {
     return describeComponentFrame(name);
   }
 }
 
 export function describeDebugInfoFrame(name: string, env: ?string): string {
-  return describeBuiltInComponentFrame(name + (env ? ' (' + env + ')' : ''));
+  return describeBuiltInComponentFrame(name + (env ? ' [' + env + ']' : ''));
 }
 
 let reentry = false;
Repository: vercel/next.js
Pull request: Development: Only load createEnvDefinitions when used

## What?

Only `require()` the file as needed when the experimental flag is on.

Closes PACK-5546

Changed files:
filename: packages/next/src/server/lib/router-utils/setup-dev-bundler.ts
patch: @@ -66,7 +66,6 @@ import {
   isStaticMetadataFile,
 } from '../../../lib/metadata/is-metadata-route'
 import { normalizeMetadataPageToRoute } from '../../../lib/metadata/get-metadata-route'
-import { createEnvDefinitions } from '../experimental/create-env-definitions'
 import { JsConfigPathsPlugin } from '../../../build/webpack/plugins/jsconfig-paths-plugin'
 import { store as consoleStore } from '../../../build/output/store'
 import {
@@ -1080,6 +1079,9 @@ async function startWatcher(
               true
             )
 
+            const createEnvDefinitions = (
+              require('../experimental/create-env-definitions') as typeof import('../experimental/create-env-definitions')
+            ).createEnvDefinitions
             await createEnvDefinitions({
               distDir,
               loadedEnvFiles: [
Repository: ollama/ollama
Pull request: Update langchain python tutorial

Remove unused GPT4all
Use nomic-embed-text as embedded model
Fix a deprecation warning (__call__)

Changed files:
filename: docs/tutorials/langchainpy.md
patch: @@ -42,12 +42,12 @@ text_splitter=RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=0)
 all_splits = text_splitter.split_documents(data)
 ```
 
-It's split up, but we have to find the relevant splits and then submit those to the model. We can do this by creating embeddings and storing them in a vector database. We can use Ollama directly to instantiate an embedding model. We will use ChromaDB in this example for a vector database. `pip install GPT4All chromadb`
+It's split up, but we have to find the relevant splits and then submit those to the model. We can do this by creating embeddings and storing them in a vector database. We can use Ollama directly to instantiate an embedding model. We will use ChromaDB in this example for a vector database. `pip install chromadb`
 
 ```python
 from langchain.embeddings import OllamaEmbeddings
 from langchain.vectorstores import Chroma
-oembed = OllamaEmbeddings(base_url="http://localhost:11434", model="llama2")
+oembed = OllamaEmbeddings(base_url="http://localhost:11434", model="nomic-embed-text")
 vectorstore = Chroma.from_documents(documents=all_splits, embedding=oembed)
 ```
 
@@ -66,7 +66,7 @@ The next thing is to send the question and the relevant parts of the docs to the
 ```python
 from langchain.chains import RetrievalQA
 qachain=RetrievalQA.from_chain_type(ollama, retriever=vectorstore.as_retriever())
-qachain({"query": question})
+qachain.invoke({"query": question})
 ```
 
 The answer received from this chain was:
Repository: ggml-org/llama.cpp
Pull request: webui: Fix zero pasteLongTextToFileLen to disable conversion being overridden

Setting `pasteLongTextToFileLen` to `0` is supposed to turn the text-to-file conversion feature off, but it always gets replaced with `2500`. This change fixes that behavior.

Changed files:
filename: tools/server/webui/src/lib/components/app/chat/ChatForm/ChatForm.svelte
patch: @@ -64,7 +64,10 @@
 	let fileInputRef: ChatFormFileInputInvisible | undefined = $state(undefined);
 	let isRecording = $state(false);
 	let message = $state('');
-	let pasteLongTextToFileLength = $derived(Number(currentConfig.pasteLongTextToFileLen) || 2500);
+	let pasteLongTextToFileLength = $derived.by(() => {
+		const n = Number(currentConfig.pasteLongTextToFileLen);
+		return Number.isNaN(n) ? 2500 : n;
+	});
 	let previousIsLoading = $state(isLoading);
 	let recordingSupported = $state(false);
 	let textareaRef: ChatFormTextarea | undefined = $state(undefined);
Repository: ollama/ollama
Pull request: Require no extra disk space for windows installation

Fixes https://github.com/ollama/ollama/issues/2734

Since quite a few folks won't install a model on `C:\`, and will instead use `OLLAMA_MODELS` to change where models are stored, lower the check for minimum disk space.

Changed files:
filename: app/ollama.iss
patch: @@ -49,9 +49,6 @@ SetupLogging=yes
 CloseApplications=yes
 RestartApplications=no
 
-; Make sure they can at least download llama2 as a minimum
-ExtraDiskSpaceRequired=3826806784
-
 ; https://jrsoftware.org/ishelp/index.php?topic=setup_wizardimagefile
 WizardSmallImageFile=.\assets\setup.bmp
Repository: ggml-org/llama.cpp
Pull request: server : fix bad fmt, size() is a size_type


Changed files:
filename: tools/server/server-common.cpp
patch: @@ -791,7 +791,7 @@ static void handle_media(
         SRV_INF("downloading image from '%s'\n", url.c_str());
         auto res = common_remote_get_content(url, params);
         if (200 <= res.first && res.first < 300) {
-            SRV_INF("downloaded %ld bytes\n", res.second.size());
+            SRV_INF("downloaded %zu bytes\n", res.second.size());
             raw_buffer data;
             data.insert(data.end(), res.second.begin(), res.second.end());
             out_files.push_back(data);
Repository: nodejs/node
Pull request: tools: fix return value of try_check_compiler

`configure.py` throws an error in `Python 3.12.3`.

```python
Traceback (most recent call last):
  File "/home/ubuntu/node/./configure", line 27, in <module>
    import configure
  File "/home/ubuntu/node/configure.py", line 2328, in <module>
    check_compiler(output)
  File "/home/ubuntu/node/configure.py", line 1297, in check_compiler
    ok, is_clang, clang_version, gcc_version, is_apple = try_check_compiler(CXX, 'c++')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 5, got 4)
```

- [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: configure.py
patch: @@ -1113,7 +1113,7 @@ def try_check_compiler(cc, lang):
     proc = subprocess.Popen(shlex.split(cc) + ['-E', '-P', '-x', lang, '-'],
                             stdin=subprocess.PIPE, stdout=subprocess.PIPE)
   except OSError:
-    return (False, False, '', '')
+    return (False, False, '', '', False)
 
   with proc:
     proc.stdin.write(b'__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ '