helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: Update README.md with LangChainRust

LangChain-Rust now supports Ollama (via [Ollama-rs](https://github.com/pepperoni21/ollama-rs)).

Changed files:
filename: README.md
patch: @@ -326,6 +326,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [LangChain](https://python.langchain.com/docs/integrations/llms/ollama) and [LangChain.js](https://js.langchain.com/docs/modules/model_io/models/llms/integrations/ollama) with [example](https://js.langchain.com/docs/use_cases/question_answering/local_retrieval_qa)
 - [LangChainGo](https://github.com/tmc/langchaingo/) with [example](https://github.com/tmc/langchaingo/tree/main/examples/ollama-completion-example)
 - [LangChain4j](https://github.com/langchain4j/langchain4j) with [example](https://github.com/langchain4j/langchain4j-examples/tree/main/ollama-examples/src/main/java)
+- [LangChainRust](https://github.com/Abraxas-365/langchain-rust) with [example](https://github.com/Abraxas-365/langchain-rust/blob/main/examples/llm_ollama.rs)
 - [LlamaIndex](https://gpt-index.readthedocs.io/en/stable/examples/llm/ollama.html)
 - [LiteLLM](https://github.com/BerriAI/litellm)
 - [OllamaSharp for .NET](https://github.com/awaescher/OllamaSharp)
Repository: ggml-org/llama.cpp
Pull request: cuda : fix GGML_CUDA_GRAPHS=OFF

See https://github.com/ggml-org/llama.cpp/pull/15132#issuecomment-3184564270

Changed files:
filename: ggml/src/ggml-cuda/mean.cu
patch: @@ -25,9 +25,12 @@ void ggml_cuda_op_mean(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
 
 // Special case for reducing vectors
 #ifdef GGML_CUDA_USE_CUB
+#ifdef USE_CUDA_GRAPH
     cudaStreamCaptureStatus iscapturing;
     CUDA_CHECK(cudaStreamIsCapturing(stream, &iscapturing));
+#endif // USE_CUDA_GRAPH
     if ((nrows == 1) &&
+#ifdef USE_CUDA_GRAPH
             // CUDA_GRAPHS_DISABLED
             ((ncols > 65536) &&
              ((ctx.cuda_graph->instance == nullptr) && (iscapturing == cudaStreamCaptureStatusNone) ||
@@ -38,6 +41,9 @@ void ggml_cuda_op_mean(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
          !((ctx.cuda_graph->instance == nullptr) && (iscapturing == cudaStreamCaptureStatusNone) ||
            ctx.cuda_graph->disable_due_to_gpu_arch || ctx.cuda_graph->disable_due_to_too_many_updates ||
            ctx.cuda_graph->disable_due_to_failed_graph_capture))) {
+#else
+        (ncols > 65536)) {
+#endif // USE_CUDA_GRAPH
         // Single row - use device-wide reduction
         size_t           tmp_size = 0;
         ggml_cuda_pool & pool     = ctx.pool();
@@ -51,7 +57,7 @@ void ggml_cuda_op_mean(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
         divide_by_count<float><<<1, 1, 0, stream>>>(dst_d, ncols);
         return;
     }
-#endif
+#endif // GGML_CUDA_USE_CUB
 
     const dim3 block_nums(nrows, 1, 1);
Repository: facebook/react
Pull request: fix[react-devtools]: fixed timeline profiler tests

Fixes tests against React 18 after https://github.com/facebook/react/pull/31154:
- Set `supportsTimeline` to true for `Store`.
- Execute `store.profilerStore.startProfiling` after `legacyRender` import, because this is where `react-dom` is imported and renderer is registered. We don't yet propagate `isProfiling` flag to newly registered renderers, when profiling already started see:
https://github.com/facebook/react/blob/d5bba18b5d81f234657586865248c5b6849599cd/packages/react-devtools-shared/src/hook.js#L203-L204

Changed files:
filename: packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js
patch: @@ -1280,13 +1280,13 @@ describe('Timeline profiler', () => {
     });
 
     describe('when profiling', () => {
-      beforeEach(() => {
-        utils.act(() => store.profilerStore.startProfiling());
-      });
-
       describe('with legacy render', () => {
         const {render: legacyRender} = getLegacyRenderImplementation();
 
+        beforeEach(() => {
+          utils.act(() => store.profilerStore.startProfiling());
+        });
+
         // @reactVersion <= 18.2
         // @reactVersion >= 18.0
         it('should mark sync render without suspends or state updates', () => {
@@ -1537,6 +1537,10 @@ describe('Timeline profiler', () => {
 
         const {render: modernRender} = getModernRenderImplementation();
 
+        beforeEach(() => {
+          utils.act(() => store.profilerStore.startProfiling());
+        });
+
         it('should mark concurrent render without suspends or state updates', () => {
           utils.act(() => modernRender(<div />));
 

filename: packages/react-devtools-shared/src/__tests__/setupTests.js
patch: @@ -256,7 +256,9 @@ beforeEach(() => {
     },
   });
 
-  const store = new Store(((bridge: any): FrontendBridge));
+  const store = new Store(((bridge: any): FrontendBridge), {
+    supportsTimeline: true,
+  });
 
   const agent = new Agent(((bridge: any): BackendBridge));
   const hook = global.__REACT_DEVTOOLS_GLOBAL_HOOK__;
Repository: ggml-org/llama.cpp
Pull request: CANN: Make `valid_values` variable `static const`

**Description of the problem**

Variable `valid_values` in function `parse_bool` is an unordered map whose content never changes. But the function is called multiple times, so the variable is unnecessarily created and destroyed at every call.

**Proposed solution**

Make the variable static and constant, so its contents are preserved across different calls of the enclosing function.



Changed files:
filename: ggml/src/ggml-cann/ggml-cann.cpp
patch: @@ -122,7 +122,7 @@ std::optional<std::string> get_env(const std::string & name) {
  * @brief Verify whether the environment variable is a valid value.
  */
 bool parse_bool(const std::string & value) {
-    std::unordered_set<std::string> valid_values = { "on", "1", "yes", "y", "enable", "true" };
+    static const std::unordered_set<std::string> valid_values = { "on", "1", "yes", "y", "enable", "true" };
     return valid_values.find(value) != valid_values.end();
 }
Repository: huggingface/transformers
Pull request: Fix `torchcodec` version in quantization docker file

# What does this PR do?

The `torchcodec` version is not bind automatically to `torch` version during the installation. Currently we get `torch 2.8` (as we pin it) and `torchcodec 0.8.1` (which is for `torch 2.9`).

This PR follows #41892 to allow specifying `torchcodec` version.

Previously, the quantization jobs fails 

https://github.com/huggingface/transformers/actions/runs/18862400780/job/53850645716

Changed files:
filename: docker/transformers-quantization-latest-gpu/Dockerfile
patch: @@ -24,7 +24,7 @@ RUN [ ${#PYTORCH} -gt 0 ] && VERSION='torch=='$PYTORCH'.*' ||  VERSION='torch';
 RUN echo torch=$VERSION
 # `torchvision` and `torchaudio` should be installed along with `torch`, especially for nightly build.
 # Currently, let's just use their latest releases (when `torch` is installed with a release version)
-RUN python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio torchcodec --extra-index-url https://download.pytorch.org/whl/$CUDA
+RUN python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$CUDA
 
 RUN python3 -m pip install --no-cache-dir git+https://github.com/huggingface/accelerate@main#egg=accelerate
Repository: ollama/ollama
Pull request: Add ability to skip oneapi generate

This follows the same pattern for cuda and rocm to allow disabling the build even when we detect the dependent libraries

Related to #4511 

Changed files:
filename: llm/generate/gen_linux.sh
patch: @@ -211,7 +211,7 @@ if [ -z "${ONEAPI_ROOT}" ]; then
     ONEAPI_ROOT=/opt/intel/oneapi
 fi
 
-if [ -d "${ONEAPI_ROOT}" ]; then
+if [ -z "${OLLAMA_SKIP_ONEAPI_GENERATE}" -a -d "${ONEAPI_ROOT}" ]; then
     echo "OneAPI libraries detected - building dynamic OneAPI library"
     init_vars
     source ${ONEAPI_ROOT}/setvars.sh --force # set up environment variables for oneAPI

filename: llm/generate/gen_windows.ps1
patch: @@ -290,7 +290,7 @@ function build_cuda() {
 }
 
 function build_oneapi() {
-  if ((-not "${env:OLLAMA_SKIP_CUDA_GENERATE}") -and ("${env:ONEAPI_ROOT}"))  {
+  if ((-not "${env:OLLAMA_SKIP_ONEAPI_GENERATE}") -and ("${env:ONEAPI_ROOT}"))  {
     # Get oneAPI version
     $script:ONEAPI_VERSION = icpx --version
     $script:ONEAPI_VERSION = [regex]::Match($script:ONEAPI_VERSION, '(?<=oneAPI DPC\+\+/C\+\+ Compiler )(?<version>\d+\.\d+\.\d+)').Value
Repository: electron/electron
Pull request: ci: fixup mac runner hang

Backport of #47982

See that PR for details.


Notes: <!-- 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 -->none


Changed files:
filename: .github/actions/free-space-macos/action.yml
patch: @@ -6,6 +6,8 @@ runs:
     - name: Free Space on MacOS
       shell: bash
       run: |
+        echo "Disk usage before cleanup:"
+        df -h
         sudo mkdir -p $TMPDIR/del-target
 
         tmpify() {
@@ -62,4 +64,5 @@ runs:
 
         # lipo off some huge binaries arm64 versions to save space
         strip_universal_deep $(xcode-select -p)/../SharedFrameworks
-        # strip_arm_deep /System/Volumes/Data/Library/Developer/CommandLineTools/usr
\ No newline at end of file
+        # strip_arm_deep /System/Volumes/Data/Library/Developer/CommandLineTools/usr
+        sudo mdutil -a -i off

filename: .github/workflows/pipeline-segment-electron-test.yml
patch: @@ -103,6 +103,8 @@ jobs:
             "'kTCCServiceCamera','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
             "'kTCCServiceBluetoothAlways','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
             "'kTCCServiceAppleEvents','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
+            "'kTCCServiceCamera','/opt/hca/hosted-compute-agent',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
+            "'kTCCServiceBluetoothAlways','/opt/hca/hosted-compute-agent',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
         )
         for values in "${userValuesArray[@]}"; do
           # Sonoma and higher have a few extra values

filename: spec/chromium-spec.ts
patch: @@ -3089,7 +3089,7 @@ describe('iframe using HTML fullscreen API while window is OS-fullscreened', ()
   });
 });
 
-ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator.serial', () => {
+describe('navigator.serial', () => {
   let w: BrowserWindow;
   before(async () => {
     w = new BrowserWindow({
@@ -3113,6 +3113,7 @@ ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator
   });
 
   it('does not return a port if select-serial-port event is not defined', async () => {
+    // Take screenshot to verify the test is running
     w.loadFile(path.join(fixturesPath, 'pages', 'blank.html'));
     const port = await getPorts();
     expect(port).to.equal(notFoundError);
@@ -3629,7 +3630,7 @@ ifdescribe((process.platform !== 'linux' || app.isUnityRunning()))('navigator.se
   });
 });
 
-ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator.bluetooth', () => {
+describe('navigator.bluetooth', () => {
   let w: BrowserWindow;
   before(async () => {
     w = new BrowserWindow({
Repository: vercel/next.js
Pull request: logger: skip logging full element

Try to avoid stringifying the entire DOM node

Changed files:
filename: packages/next/src/next-devtools/userspace/app/forward-logs.ts
patch: @@ -49,6 +49,10 @@ class ClientFileLogger {
           return String(arg)
         if (arg === null) return 'null'
         if (arg === undefined) return 'undefined'
+        // Handle DOM nodes - only log the tag name to avoid React proxied elements
+        if (arg instanceof Element) {
+          return `<${arg.tagName.toLowerCase()}>`
+        }
         return safeStringifyWithDepth(arg)
       })
       .join(' ')
Repository: nodejs/node
Pull request: lib: optimize priority queue

[Huge credit](https://github.com/lemire/FastPriorityQueue.js) to @lemire, I ported the parts that we can to improve performance without introducing breaking changes

First run:

After:

```sh
util/priority-queue.js

util/priority-queue.js n=100000: 6,372,311.7447058195
```

Before:

```sh
util/priority-queue.js

util/priority-queue.js n=100000: 5,610,982.713123359
```

Second run:

After:

```sh
util/priority-queue.js

util/priority-queue.js n=100000: 6,524,784.786498602
```

Before:

```sh
util/priority-queue.js

util/priority-queue.js n=100000: 4,854,606.242159507
```

Changed files:
filename: lib/internal/priority_queue.js
patch: @@ -47,20 +47,28 @@ module.exports = class PriorityQueue {
     const setPosition = this.#setPosition;
     const heap = this.#heap;
     const size = this.#size;
+    const hsize = size >> 1;
     const item = heap[pos];
 
-    while (pos * 2 <= size) {
-      let childIndex = pos * 2 + 1;
-      if (childIndex > size || compare(heap[pos * 2], heap[childIndex]) < 0)
-        childIndex = pos * 2;
-      const child = heap[childIndex];
-      if (compare(item, child) <= 0)
-        break;
+    while (pos <= hsize) {
+      let child = pos << 1;
+      const nextChild = child + 1;
+      let childItem = heap[child];
+
+      if (nextChild <= size && compare(heap[nextChild], childItem) < 0) {
+        child = nextChild;
+        childItem = heap[nextChild];
+      }
+
+      if (compare(item, childItem) <= 0) break;
+
       if (setPosition !== undefined)
-        setPosition(child, pos);
-      heap[pos] = child;
-      pos = childIndex;
+        setPosition(childItem, pos);
+
+      heap[pos] = childItem;
+      pos = child;
     }
+
     heap[pos] = item;
     if (setPosition !== undefined)
       setPosition(item, pos);
@@ -73,27 +81,30 @@ module.exports = class PriorityQueue {
     const item = heap[pos];
 
     while (pos > 1) {
-      const parent = heap[pos / 2 | 0];
-      if (compare(parent, item) <= 0)
+      const parent = pos >> 1;
+      const parentItem = heap[parent];
+      if (compare(parentItem, item) <= 0)
         break;
-      heap[pos] = parent;
+      heap[pos] = parentItem;
       if (setPosition !== undefined)
-        setPosition(parent, pos);
-      pos = pos / 2 | 0;
+        setPosition(parentItem, pos);
+      pos = parent;
     }
+
     heap[pos] = item;
     if (setPosition !== undefined)
       setPosition(item, pos);
   }
 
   removeAt(pos) {
     const heap = this.#heap;
-    const size = --this.#size;
-    heap[pos] = heap[size + 1];
-    heap[size + 1] = undefined;
+    let size = this.#size;
+    heap[pos] = heap[size];
+    heap[size] = undefined;
+    size = --this.#size;
 
     if (size > 0 && pos <= size) {
-      if (pos > 1 && this.#compare(heap[pos / 2 | 0], heap[pos]) > 0)
+      if (pos > 1 && this.#compare(heap[pos >> 1], heap[pos]) > 0)
         this.percolateUp(pos);
       else
         this.percolateDown(pos);
Repository: facebook/react
Pull request: [ci] Specify limited concurrency for PR jobs



There was a concurrency setting we hadn't enabled on jobs that are primarily triggered for PRs. This meant that every update to the PR would trigger new CI jobs without canceling any ones already in flight, which can greatly slow down CI due to the number of jobs that need to run.

This PR adds concurrency [based on the workflow name and PR number or head ref.](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs)
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31240).
* __->__ #31240
* #31239

Changed files:
filename: .github/workflows/compiler_playground.yml
patch: @@ -8,6 +8,10 @@ on:
       - compiler/**
       - .github/workflows/compiler-playground.yml
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
+  cancel-in-progress: true
+
 env:
   TZ: /usr/share/zoneinfo/America/Los_Angeles
   # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout

filename: .github/workflows/compiler_rust.yml
patch: @@ -15,6 +15,10 @@ on:
       - compiler/Cargo.*
       - compiler/*.toml
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
+  cancel-in-progress: true
+
 env:
   CARGO_TERM_COLOR: always
   RUSTFLAGS: -Dwarnings

filename: .github/workflows/compiler_typescript.yml
patch: @@ -8,6 +8,10 @@ on:
       - compiler/**
       - .github/workflows/compiler_typescript.yml
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
+  cancel-in-progress: true
+
 env:
   TZ: /usr/share/zoneinfo/America/Los_Angeles
   # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout

filename: .github/workflows/runtime_build_and_test.yml
patch: @@ -7,6 +7,10 @@ on:
     paths-ignore:
       - compiler/**
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
+  cancel-in-progress: true
+
 env:
   TZ: /usr/share/zoneinfo/America/Los_Angeles
   # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout

filename: .github/workflows/shared_lint.yml
patch: @@ -5,6 +5,10 @@ on:
     branches: [main]
   pull_request:
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
+  cancel-in-progress: true
+
 env:
   TZ: /usr/share/zoneinfo/America/Los_Angeles
   # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout
Repository: ggml-org/llama.cpp
Pull request: gguf-py: Add requests to dependencies

It's used here:

https://github.com/ggml-org/llama.cpp/blob/e443fbcfa51a8a27b15f949397ab94b5e87b2450/gguf-py/gguf/utility.py#L220-L226

Or maybe an optional dependency would suffice?

Changed files:
filename: gguf-py/pyproject.toml
patch: @@ -22,6 +22,7 @@ python = ">=3.8"
 numpy = ">=1.17"
 tqdm = ">=4.27"
 pyyaml = ">=5.1"
+requests = ">=2.25"
 sentencepiece = { version = ">=0.1.98,<=0.2.0", optional = true }
 PySide6 = { version = "^6.9", python = ">=3.9,<3.14", optional = true }
Repository: ollama/ollama
Pull request: llm: patch to fix qwen 2 temporarily on cublas and rocm


Changed files:
filename: llm/patches/06-qwen2.diff
patch: @@ -0,0 +1,13 @@
+diff --git a/llama.cpp b/llama.cpp
+index 40d2ec2c..f34eb79a 100644
+--- a/llama.cpp
++++ b/llama.cpp
+@@ -6943,7 +6943,7 @@ static struct ggml_tensor * llm_build_kqv(
+         struct ggml_tensor * kq = ggml_mul_mat(ctx, k, q);
+         cb(kq, "kq", il);
+ 
+-        if (model.arch == LLM_ARCH_PHI2 || model.arch == LLM_ARCH_PHI3 || model.arch == LLM_ARCH_GPTNEOX) {
++        if (model.arch == LLM_ARCH_PHI2 || model.arch == LLM_ARCH_PHI3 || model.arch == LLM_ARCH_GPTNEOX || model.arch == LLM_ARCH_QWEN2) {
+             // for this arch, we need to perform the KQ multiplication with F32 precision, otherwise we get NaNs
+             // ref: https://github.com/ggerganov/llama.cpp/pull/4490#issuecomment-1859055847
+             ggml_mul_mat_set_prec(kq, GGML_PREC_F32);
Repository: ollama/ollama
Pull request: API app/browser access

Fixes #4791 
Fixes #3799 
Fixes #4388 

Changed files:
filename: envconfig/config.go
patch: @@ -190,6 +190,12 @@ func LoadConfig() {
 		)
 	}
 
+	AllowOrigins = append(AllowOrigins,
+		"app://*",
+		"file://*",
+		"tauri://*",
+	)
+
 	maxRunners := clean("OLLAMA_MAX_LOADED_MODELS")
 	if maxRunners != "" {
 		m, err := strconv.Atoi(maxRunners)

filename: server/routes.go
patch: @@ -960,6 +960,10 @@ func (s *Server) GenerateRoutes() http.Handler {
 	config.AllowWildcard = true
 	config.AllowBrowserExtensions = true
 	config.AllowHeaders = []string{"Authorization", "Content-Type", "User-Agent", "Accept", "X-Requested-With"}
+	openAIProperties := []string{"lang", "package-version", "os", "arch", "runtime", "runtime-version", "async"}
+	for _, prop := range openAIProperties {
+		config.AllowHeaders = append(config.AllowHeaders, "x-stainless-"+prop)
+	}
 	config.AllowOrigins = envconfig.AllowOrigins
 
 	r := gin.Default()
Repository: facebook/react
Pull request: [compiler] Use consistent version hash for npm



Modifies our release script to use the same version hash (the hashed `compiler` directory) for all compiler packages to keep them consistent.


Changed files:
filename: compiler/scripts/release/publish.js
patch: @@ -119,20 +119,20 @@ async function main() {
     );
     const dateString = await getDateStringForCommit(commit);
     const otp = argv.ci === false ? await promptForOTP() : null;
+    const {hash} = await hashElement(path.resolve(__dirname, '../..'), {
+      encoding: 'hex',
+      folders: {exclude: ['node_modules']},
+      files: {exclude: ['.DS_Store']},
+    });
+    const truncatedHash = hash.slice(0, 7);
+    const newVersion = `0.0.0-experimental-${truncatedHash}-${dateString}`;
 
     for (const pkgName of pkgNames) {
       const pkgDir = path.resolve(__dirname, `../../packages/${pkgName}`);
       const pkgJsonPath = path.resolve(
         __dirname,
         `../../packages/${pkgName}/package.json`
       );
-      const {hash} = await hashElement(pkgDir, {
-        encoding: 'hex',
-        folders: {exclude: ['node_modules']},
-        files: {exclude: ['.DS_Store']},
-      });
-      const truncatedHash = hash.slice(0, 7);
-      const newVersion = `0.0.0-experimental-${truncatedHash}-${dateString}`;
 
       spinner.start(`Writing package.json for ${pkgName}@${newVersion}`);
       await writeJson(