helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: Fix log assertion in cancels tasks in Scheduler-test

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn test --debug --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

<img width="611" alt="image" src="https://github.com/facebook/react/assets/18693190/bfb63a64-c0b0-4e03-909a-2d40479ef0ef">

<img width="247" alt="image" src="https://github.com/facebook/react/assets/18693190/41bbeff7-7d77-48e3-b14d-7b637292837a">

In old tests, it was always pass the test even if the task was not cancelled. Because no fireMessageEvent was called and the `onmessage` was not executed.

<!--
 Explain the **motivation** for making this change. What existing problem does the pull request solve?
-->




Changed files:
filename: packages/scheduler/src/__tests__/Scheduler-test.js
patch: @@ -247,7 +247,8 @@ describe('SchedulerBrowser', () => {
     });
     runtime.assertLog(['Post Message']);
     cancelCallback(task);
-    runtime.assertLog([]);
+    runtime.fireMessageEvent();
+    runtime.assertLog(['Message Event']);
   });
 
   it('throws when a task errors then continues in a new event', () => {
Repository: electron/electron
Pull request: perf: prefer `absl::flat_hash_set` over `std::unordered_set`

Backport of #46348

See that PR for details.


Notes: none.

Changed files:
filename: shell/browser/api/message_port.cc
patch: @@ -5,7 +5,6 @@
 #include "shell/browser/api/message_port.h"
 
 #include <string>
-#include <unordered_set>
 #include <utility>
 
 #include "base/containers/to_vector.h"
@@ -20,6 +19,7 @@
 #include "shell/common/gin_helper/event_emitter_caller.h"
 #include "shell/common/node_includes.h"
 #include "shell/common/v8_util.h"
+#include "third_party/abseil-cpp/absl/container/flat_hash_set.h"
 #include "third_party/blink/public/common/messaging/transferable_message.h"
 #include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h"
 #include "third_party/blink/public/mojom/messaging/transferable_message.mojom.h"
@@ -226,7 +226,8 @@ std::vector<blink::MessagePortChannel> MessagePort::DisentanglePorts(
   if (ports.empty())
     return {};
 
-  std::unordered_set<MessagePort*> visited;
+  absl::flat_hash_set<MessagePort*> visited;
+  visited.reserve(ports.size());
 
   // Walk the incoming array - if there are any duplicate ports, or null ports
   // or cloned ports, throw an error (per section 8.3.3 of the HTML5 spec).

filename: shell/renderer/api/electron_api_spell_check_client.cc
patch: @@ -8,7 +8,6 @@
 #include <memory>
 #include <set>
 #include <string_view>
-#include <unordered_set>
 #include <utility>
 #include <vector>
 
@@ -20,6 +19,7 @@
 #include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/gin_helper/function_template.h"
 #include "shell/common/gin_helper/microtasks_scope.h"
+#include "third_party/abseil-cpp/absl/container/flat_hash_set.h"
 #include "third_party/blink/public/web/web_text_checking_completion.h"
 #include "third_party/blink/public/web/web_text_checking_result.h"
 #include "third_party/icu/source/common/unicode/uscript.h"
@@ -182,9 +182,9 @@ void SpellCheckClient::SpellCheckText() {
 
 void SpellCheckClient::OnSpellCheckDone(
     const std::vector<std::u16string>& misspelled_words) {
+  const absl::flat_hash_set<std::u16string> misspelled{misspelled_words.begin(),
+                                                       misspelled_words.end()};
   std::vector<blink::WebTextCheckingResult> results;
-  std::unordered_set<std::u16string> misspelled(misspelled_words.begin(),
-                                                misspelled_words.end());
 
   auto& word_list = pending_request_param_->wordlist();
Repository: facebook/react
Pull request: Revert rollout state of enableCache in React Native to next major only

## Summary

We're working on enabling the use of microtasks in React Native by default when using the new architecture. To enable this we need to synchronize the RN renderers from React, but doing this causes an error because the renderers now rely on an object defined in `React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED` (`ReactCurrentCache`) that's hasn't been released as a stable version yet (cache).

This reverts the change done in #28519 to avoid enabling the cache API in RN until we release a new version of React in npm.

## How did you test this change?

Manually built the RN renderer, copied it to the RN repository and tested e2e in RNTester.

Changed files:
filename: packages/shared/forks/ReactFeatureFlags.native-oss.js
patch: @@ -10,6 +10,13 @@
 import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
 import typeof * as ExportsType from './ReactFeatureFlags.native-oss';
 
+// -----------------------------------------------------------------------------
+// Ready for next major.
+//
+// Alias __NEXT_MAJOR__ to false for easier skimming.
+// -----------------------------------------------------------------------------
+const __NEXT_MAJOR__ = false;
+
 export const debugRenderPhaseSideEffectsForStrictMode = __DEV__;
 export const enableDebugTracing = false;
 export const enableAsyncDebugInfo = false;
@@ -18,7 +25,7 @@ export const enableProfilerTimer = __PROFILE__;
 export const enableProfilerCommitHooks = __PROFILE__;
 export const enableProfilerNestedUpdatePhase = __PROFILE__;
 export const enableUpdaterTracking = __PROFILE__;
-export const enableCache = true;
+export const enableCache = __NEXT_MAJOR__;
 export const enableLegacyCache = false;
 export const enableCacheElement = true;
 export const enableFetchInstrumentation = false;
Repository: ollama/ollama
Pull request: always remove from in progress map on download


Changed files:
filename: server/download.go
patch: @@ -113,6 +113,7 @@ var chunkSize = 1024 * 1024 // 1 MiB in bytes
 
 // doDownload downloads a blob from the registry and stores it in the blobs directory
 func doDownload(ctx context.Context, mp ModelPath, regOpts *RegistryOptions, f *FileDownload, fn func(api.ProgressResponse)) error {
+	defer inProgress.Delete(f.Digest)
 	var size int64
 
 	fi, err := os.Stat(f.FilePath + "-partial")
@@ -208,8 +209,6 @@ outerLoop:
 		inProgress.Store(f.Digest, f)
 	}
 
-	inProgress.Delete(f.Digest)
-
 	log.Printf("success getting %s\n", f.Digest)
 	return nil
 }
Repository: facebook/react
Pull request: Make `enableNewBooleanProps` www dynamic

Feature: https://github.com/facebook/react/pull/24730

Changed files:
filename: packages/shared/forks/ReactFeatureFlags.www-dynamic.js
patch: @@ -30,6 +30,7 @@ export const enableRenderableContext = __VARIANT__;
 export const useModernStrictMode = __VARIANT__;
 export const enableRefAsProp = __VARIANT__;
 export const enableClientRenderFallbackOnTextMismatch = __VARIANT__;
+export const enableNewBooleanProps = __VARIANT__;
 export const enableRetryLaneExpiration = __VARIANT__;
 export const retryLaneExpirationMs = 5000;
 export const syncLaneExpirationMs = 250;

filename: packages/shared/forks/ReactFeatureFlags.www.js
patch: @@ -37,6 +37,7 @@ export const {
   enableRenderableContext,
   useModernStrictMode,
   enableRefAsProp,
+  enableNewBooleanProps,
   enableClientRenderFallbackOnTextMismatch,
 } = dynamicFeatureFlags;
 
@@ -102,8 +103,6 @@ export const allowConcurrentByDefault = true;
 
 export const consoleManagedByDevToolsDuringStrictMode = true;
 
-export const enableNewBooleanProps = false;
-
 export const enableFizzExternalRuntime = true;
 
 export const forceConcurrentByDefaultForTesting = false;
Repository: denoland/deno
Pull request: fix(io): do not autoClose stdin readable stream

Fixes https://github.com/denoland/deno/issues/28867

Changed files:
filename: ext/io/12_io.js
patch: @@ -167,7 +167,7 @@ class Stdin {
 
   get readable() {
     if (this.#readable === undefined) {
-      this.#readable = readableStreamForRid(this.#rid);
+      this.#readable = readableStreamForRid(this.#rid, false);
     }
     return this.#readable;
   }
Repository: ggml-org/llama.cpp
Pull request: delete buffer clear as suggested

As discussed in https://github.com/ggml-org/llama.cpp/pull/13002,  ggml_backend_buffer_clear is deleted.

Changed files:
filename: src/llama-context.cpp
patch: @@ -1536,8 +1536,6 @@ int32_t llama_context::output_reserve(int32_t n_outputs) {
     // set all ids as invalid (negative)
     std::fill(output_ids.begin(), output_ids.end(), -1);
 
-    ggml_backend_buffer_clear(buf_output.get(), 0);
-
     this->n_outputs     = 0;
     this->n_outputs_max = n_outputs_max;
Repository: ollama/ollama
Pull request: close open files


Changed files:
filename: llm/llama_darwin.go
patch: @@ -39,6 +39,7 @@ func initBackend() error {
 		if err != nil {
 			return err
 		}
+		defer actual.Close()
 
 		actualSum := sha256.New()
 		if _, err := io.Copy(actualSum, actual); err != nil {

filename: llm/llm.go
patch: @@ -28,6 +28,7 @@ func New(model string, adapters []string, opts api.Options) (LLM, error) {
 	if err != nil {
 		return nil, err
 	}
+	defer f.Close()
 
 	ggml, err := DecodeGGML(f, ModelFamilyLlama)
 	if err != nil {

filename: server/images.go
patch: @@ -1117,6 +1117,7 @@ func uploadBlobChunked(ctx context.Context, mp ModelPath, url string, layer *Lay
 	if err != nil {
 		return err
 	}
+	defer f.Close()
 
 	totalUploaded := 0
Repository: huggingface/transformers
Pull request: [Continous Batching] set head_dim when config.head_dim is None

# What does this PR do?

Some models have empty `config.head_dim` so we now check if the value is not None instead of setting it to `None`

Changed files:
filename: src/transformers/generation/continuous_batching.py
patch: @@ -185,7 +185,9 @@ def __init__(
             # self.num_key_value_heads //= tp_size
 
         self.head_dim = (
-            config.head_dim if hasattr(config, "head_dim") else config.hidden_size // config.num_attention_heads
+            config.head_dim
+            if hasattr(config, "head_dim") and config.head_dim is not None
+            else config.hidden_size // config.num_attention_heads
         )
         self.num_hidden_layers = config.num_hidden_layers
 
@@ -1259,7 +1261,7 @@ def _run_generation_loop(self):
                 self.model.device,
                 self.model.dtype,
                 num_requests=len(self.input_queue.queue),
-                tp_size=getattr(self.model, "_tp_size", 8),  # TODO quantized converted don't set this
+                tp_size=getattr(self.model, "_tp_size", None),  # Use model's actual TP setting
             )
 
             scheduler = None
Repository: ollama/ollama
Pull request: log embedding eval timing


Changed files:
filename: llm/llama.go
patch: @@ -471,6 +471,8 @@ func (llm *llama) Embedding(input string) ([]float64, error) {
 		return nil, errors.New("llama: eval")
 	}
 
+	C.llama_print_timings(llm.ctx)
+
 	n := C.llama_n_embd(llm.ctx)
 	if n <= 0 {
 		return nil, errors.New("llama: no embeddings generated")
Repository: nodejs/node
Pull request: test: fix missing edge case in test-blob-slice-with-large-size

The test only cares about whether a size outside the range of the 32-bit signed integers works with Blob.prototype.slice(). If it fails due to allocation failure when the system does not have enough memory, the test should just be skipped. The test previously only skipped the test when the allocation failure happens during allocation of the buffer source, but it could also happen during Blob.prototype.slice().

Fixes: https://github.com/nodejs/node/issues/57235

<!--
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: test/pummel/test-blob-slice-with-large-size.js
patch: @@ -1,4 +1,7 @@
 'use strict';
+
+// This tests that Blob.prototype.slice() works correctly when the size of the
+// Blob is outside the range of 32-bit signed integers.
 const common = require('../common');
 
 // Buffer with size > INT32_MAX
@@ -14,8 +17,11 @@ try {
   const slicedBlob = blob.slice(size - 1, size);
   assert.strictEqual(slicedBlob.size, 1);
 } catch (e) {
-  if (e.code !== 'ERR_MEMORY_ALLOCATION_FAILED') {
-    throw e;
+  if (e.code === 'ERR_MEMORY_ALLOCATION_FAILED') {
+    common.skip('insufficient space for Buffer.allocUnsafe');
+  }
+  if (/Array buffer allocation failed/.test(e.message)) {
+    common.skip('insufficient space for Blob.prototype.slice()');
   }
-  common.skip('insufficient space for Buffer.allocUnsafe');
+  throw e;
 }
Repository: huggingface/transformers
Pull request: Fix CI: Use correct import for torchvision InterpolationMode

https://github.com/huggingface/transformers/pull/32317 renamed `from torchvision.transforms.v2 import functional as F_t` leaving `F` for `torch.functional`

but some usages of `F` remained unchanged, breaking CI ([example](https://app.circleci.com/pipelines/github/huggingface/transformers/142032/workflows/d0770631-92de-4f3c-96df-5832a7322bc2/jobs/1879488)):

```
FAILED tests/models/sam/test_image_processing_sam.py::SamImageProcessingTest::test_slow_fast_equivalence
...
E           AttributeError: module 'torch.nn.functional' has no attribute 'InterpolationMode'

/usr/local/lib/python3.9/site-packages/transformers/models/sam/image_processing_sam_fast.py:246: AttributeError
```

Changed files:
filename: src/transformers/models/sam/image_processing_sam_fast.py
patch: @@ -243,9 +243,9 @@ def _preprocess_image_like_inputs(
                 {
                     "do_normalize": False,
                     "do_rescale": False,
-                    "interpolation": F.InterpolationMode.NEAREST_EXACT
+                    "interpolation": F_t.InterpolationMode.NEAREST_EXACT
                     if is_torchvision_v2_available()
-                    else F.InterpolationMode.NEAREST,
+                    else F_t.InterpolationMode.NEAREST,
                     "size": segmentation_maps_kwargs.pop("mask_size"),
                     "pad_size": segmentation_maps_kwargs.pop("mask_pad_size"),
                 }
Repository: facebook/react
Pull request: Add passing exhaustive-deps test for type parameters in TypeScript


## Summary

Adds a test for https://github.com/facebook/react/issues/20395

## Test Plan

- [x] CI green

Changed files:
filename: packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js
patch: @@ -7774,6 +7774,16 @@ const testsTypescript = {
         }
       `,
     },
+    {
+      code: normalizeIndent`
+        function useMyThing<T>(): void {
+          useEffect(() => {
+            let foo: T;
+            console.log(foo);
+          }, []);
+        }
+      `,
+    },
   ],
   invalid: [
     {
Repository: electron/electron
Pull request: perf: improve temporaries in `WebWorkerObserver::WorkerScriptReadyForEvaluation()`

Backport of #46347

See that PR for details.


Notes: none.

Changed files:
filename: shell/renderer/web_worker_observer.cc
patch: @@ -4,9 +4,11 @@
 
 #include "shell/renderer/web_worker_observer.h"
 
+#include <string_view>
 #include <utility>
 
 #include "base/no_destructor.h"
+#include "base/strings/strcat.h"
 #include "base/threading/thread_local.h"
 #include "shell/common/api/electron_bindings.h"
 #include "shell/common/gin_helper/event_emitter_caller.h"
@@ -71,15 +73,14 @@ void WebWorkerObserver::WorkerScriptReadyForEvaluation(
   // is loaded. See corresponding change in node/init.ts.
   v8::Local<v8::Object> global = worker_context->Global();
 
-  std::vector<std::string> keys = {"fetch",   "Response", "FormData",
-                                   "Request", "Headers",  "EventSource"};
-  for (const auto& key : keys) {
+  for (const std::string_view key :
+       {"fetch", "Response", "FormData", "Request", "Headers", "EventSource"}) {
     v8::MaybeLocal<v8::Value> value =
-        global->Get(worker_context, gin::StringToV8(isolate, key.c_str()));
+        global->Get(worker_context, gin::StringToV8(isolate, key));
     if (!value.IsEmpty()) {
-      std::string blink_key = "blink" + key;
+      std::string blink_key = base::StrCat({"blink", key});
       global
-          ->Set(worker_context, gin::StringToV8(isolate, blink_key.c_str()),
+          ->Set(worker_context, gin::StringToV8(isolate, blink_key),
                 value.ToLocalChecked())
           .Check();
     }
Repository: ggml-org/llama.cpp
Pull request: Fix CUDA build failure on AutoDL cloud platforms

## Problem
As reported in issue #13893, the current CUDA build configuration in `ci/run.sh` fails on AutoDL cloud machines:

```bash
if [ ! -z ${GG_BUILD_CUDA} ]; then
    CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=native"
fi
```


## Root Cause
The issue appears to be that CMAKE_CUDA_ARCHITECTURES=native fails on cloud platforms, 
likely due to restricted GPU introspection capabilities.

## Reproduction
This can be reproduced with a minimal test script:

```bash
#!/bin/bash

mkdir cmake_arch_test && cd cmake_arch_test

cat << 'EOF' > CMakeLists.txt
cmake_minimum_required(VERSION 3.18)
project(test_cuda_arch LANGUAGES CUDA)

message(STATUS "CMAKE_CUDA_ARCHITECTURES: ${CMAKE_CUDA_ARCHITECTURES}")
message(STATUS "CMAKE_CUDA_COMPILER_TOOLKIT_ROOT: ${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}")

add_executable(test_cuda test.cu)
EOF

cat << 'EOF' > test.cu
int main() { return 0; }
EOF

rm -rf build && mkdir build && cd build
cmake -DCMAKE_CUDA_ARCHITECTURES=native .. 2>&1 | grep -E "(CMAKE_CUDA_ARCHITECTURES|architecture|fatal|error)"
```

This script produces the `nvcc fatal : Unsupported gpu architecture 'compute_'` error on AutoDL machines, but works fine on physical machines.


Changed files:
filename: ci/run.sh
patch: @@ -46,7 +46,20 @@ if [ ! -z ${GG_BUILD_METAL} ]; then
 fi
 
 if [ ! -z ${GG_BUILD_CUDA} ]; then
-    CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=native"
+    CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_CUDA=ON"
+
+    if command -v nvidia-smi >/dev/null 2>&1; then
+        CUDA_ARCH=$(nvidia-smi --query-gpu=compute_cap --format=csv,noheader,nounits 2>/dev/null | head -1 | tr -d '.')
+        if [[ -n "$CUDA_ARCH" && "$CUDA_ARCH" =~ ^[0-9]+$ ]]; then
+            CMAKE_EXTRA="${CMAKE_EXTRA} -DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCH}"
+        else
+            echo "Warning: Using fallback CUDA architectures"
+            CMAKE_EXTRA="${CMAKE_EXTRA} -DCMAKE_CUDA_ARCHITECTURES=61;70;75;80;86;89"
+        fi
+    else
+        echo "Error: nvidia-smi not found, cannot build with CUDA"
+        exit 1
+    fi
 fi
 
 if [ ! -z ${GG_BUILD_SYCL} ]; then
Repository: ollama/ollama
Pull request: Update langchainpy.md

base_url value for Ollama object creation is corrected.

Changed files:
filename: docs/tutorials/langchainpy.md
patch: @@ -18,7 +18,7 @@ Then we can create a model and ask the question:
 
 ```python
 from langchain.llms import Ollama
-ollama = Ollama(base_url='[http://localhost:11434](http://localhost:11434/)',
+ollama = Ollama(base_url='http://localhost:11434',
 model="llama2")
 print(ollama("why is the sky blue"))
 ```
Repository: denoland/deno
Pull request: fix(compile): ensure `Deno.build.standalone` is set in workers

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

Changed files:
filename: runtime/js/99_main.js
patch: @@ -1025,7 +1025,11 @@ function bootstrapWorkerRuntime(
       6: argv0,
       7: nodeDebug,
       13: otelConfig,
+      15: standalone,
     } = runtimeOptions;
+
+    denoNs.build.standalone = standalone;
+
     closeOnIdle = runtimeOptions[14];
 
     performance.setTimeOrigin();

filename: tests/specs/compile/deno_build_standalone/__test__.jsonc
patch: @@ -3,17 +3,17 @@
   "tests": {
     "compiled": {
       "steps": [{
-        "args": "compile --output main main.ts",
+        "args": "compile --allow-read --output main --include worker.ts main.ts",
         "output": "[WILDCARD]"
       }, {
         "commandName": "./main",
         "args": [],
-        "output": "true\n"
+        "output": "true\ntrue\n"
       }]
     },
     "run": {
-      "args": "run --quiet --check main.ts",
-      "output": "false\n"
+      "args": "run --quiet --check --allow-read main.ts",
+      "output": "false\nfalse\n"
     }
   }
 }

filename: tests/specs/compile/deno_build_standalone/main.ts
patch: @@ -1,2 +1,6 @@
 const value: boolean = Deno.build.standalone;
 console.log(value);
+
+new Worker(import.meta.resolve("./worker.ts"), {
+  "type": "module",
+});

filename: tests/specs/compile/deno_build_standalone/worker.ts
patch: @@ -0,0 +1,4 @@
+// ensure this is properly set in a worker
+const value: boolean = Deno.build.standalone;
+console.log(value);
+self.close();