helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: Read constructor name more carefully

## Summary

Sometimes `constructor` happens to be the name of an unrelated property, or we may be dealing with a `Proxy` that intercepts every read. Verify the constructor is a function before using its name, and reset the name anyway if it turns out not to be serializable.

Fixes some cases of the devtools crashing and becoming inoperable upon attempting to inspect components whose props are Hookstate `State`s.

## How did you test this change?

Installed a patched version of the extension and confirmed that it solves the problem.

Changed files:
filename: packages/react-devtools-shared/src/hydration.js
patch: @@ -84,7 +84,9 @@ function createDehydrated(
     preview_long: formatDataForPreview(data, true),
     preview_short: formatDataForPreview(data, false),
     name:
-      !data.constructor || data.constructor.name === 'Object'
+      typeof data.constructor !== 'function' ||
+      typeof data.constructor.name !== 'string' ||
+      data.constructor.name === 'Object'
         ? ''
         : data.constructor.name,
   };
@@ -240,7 +242,9 @@ export function dehydrate(
           preview_short: formatDataForPreview(data, false),
           preview_long: formatDataForPreview(data, true),
           name:
-            !data.constructor || data.constructor.name === 'Object'
+            typeof data.constructor !== 'function' ||
+            typeof data.constructor.name !== 'string' ||
+            data.constructor.name === 'Object'
               ? ''
               : data.constructor.name,
         };
@@ -332,7 +336,11 @@ export function dehydrate(
         readonly: true,
         preview_short: formatDataForPreview(data, false),
         preview_long: formatDataForPreview(data, true),
-        name: data.constructor.name,
+        name:
+          typeof data.constructor !== 'function' ||
+          typeof data.constructor.name !== 'string'
+            ? ''
+            : data.constructor.name,
       };
 
       getAllEnumerableKeys(data).forEach(key => {
Repository: electron/electron
Pull request: fix: prevent gc monitor 2nd pass crash

#### Description of Change

Closes #46920

#### Release Notes

Notes: no-notes

Changed files:
filename: shell/common/gin_converters/osr_converter.cc
patch: @@ -143,19 +143,21 @@ v8::Local<v8::Value> Converter<electron::OffscreenSharedTextureValue>::ToV8(
           // texture, output it in second pass callback.
           data.SetSecondPassCallback([](const v8::WeakCallbackInfo<
                                          OffscreenReleaseHolderMonitor>& data) {
-            auto* iso = data.GetIsolate();
             // Emit warning only once
             static std::once_flag flag;
             std::call_once(flag, [=] {
-              electron::util::EmitWarning(
-                  iso,
-                  "[OSR TEXTURE LEAKED] When using OSR with "
-                  "`useSharedTexture`, `texture.release()` "
-                  "must be called explicitly as soon as the texture is "
-                  "copied to your rendering system. "
-                  "Otherwise, it will soon drain the underlying "
-                  "framebuffer and prevent future frames from being generated.",
-                  "SharedTextureOSRNotReleased");
+              base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
+                  FROM_HERE, base::BindOnce([] {
+                    electron::util::EmitWarning(
+                        "Offscreen rendering shared texture was garbage "
+                        "collected before calling `release()`. When using OSR "
+                        "with `useSharedTexture: true`, `texture.release()` "
+                        "must be called explicitly as soon as the texture is "
+                        "copied to your rendering system. Otherwise, it will "
+                        "soon drain the underlying frame pool and prevent "
+                        "future frames from being sent.",
+                        "OSRSharedTextureNotReleased");
+                  }));
             });
           });
         }
Repository: huggingface/transformers
Pull request: Use torch.autocast

# What does this PR do?

The new API is available since PT 2.2

Changed files:
filename: src/transformers/models/esm/modeling_esmfold.py
patch: @@ -293,7 +293,7 @@ def __init__(self, c_in, eps=1e-5):
     def forward(self, x):
         d = x.dtype
         if d is torch.bfloat16 and not is_deepspeed_initialized():
-            with torch.cuda.amp.autocast(enabled=False):
+            with torch.autocast(device_type="cuda", enabled=False):
                 out = nn.functional.layer_norm(x, self.c_in, self.weight.to(dtype=d), self.bias.to(dtype=d), self.eps)
         else:
             out = nn.functional.layer_norm(x, self.c_in, self.weight, self.bias, self.eps)
@@ -308,7 +308,7 @@ def softmax_no_cast(t: torch.Tensor, dim: int = -1) -> torch.Tensor:
     """
     d = t.dtype
     if d is torch.bfloat16 and not is_deepspeed_initialized():
-        with torch.cuda.amp.autocast(enabled=False):
+        with torch.autocast(device_type="cuda", enabled=False):
             s = torch.nn.functional.softmax(t, dim=dim)
     else:
         s = torch.nn.functional.softmax(t, dim=dim)

filename: src/transformers/models/oneformer/modeling_oneformer.py
patch: @@ -23,7 +23,6 @@
 import numpy as np
 import torch
 from torch import Tensor, nn
-from torch.cuda.amp import autocast
 
 from ...activations import ACT2FN
 from ...modeling_layers import GradientCheckpointingLayer
@@ -322,7 +321,7 @@ def forward(self, masks_queries_logits, class_queries_logits, mask_labels, class
                 align_corners=False,
             ).squeeze(1)
 
-            with autocast(enabled=False):
+            with torch.autocast(device_type="cuda", enabled=False):
                 pred_mask = pred_mask.float()
                 target_mask = target_mask.float()
 

filename: src/transformers/trainer.py
patch: @@ -3971,10 +3971,7 @@ def autocast_smart_context_manager(self, cache_enabled: Optional[bool] = True):
         arguments, depending on the situation.
         """
         if self.use_cpu_amp:
-            # TODO Matt: This syntax is deprecated and the preferred version is
-            #      torch.amp.autocast("cpu", cache_enabled=cache_enabled, dtype=self.amp_dtype)
-            #      but this is unavailable on Torch 2.1 or earlier. We can change this when we stop supporting 2.1.
-            ctx_manager = torch.cpu.amp.autocast(cache_enabled=cache_enabled, dtype=self.amp_dtype)
+            ctx_manager = torch.autocast(device_type="cpu", cache_enabled=cache_enabled, dtype=self.amp_dtype)
         else:
             ctx_manager = contextlib.nullcontext()
Repository: nodejs/node
Pull request: build: only mention Apple when on Apple

<!--
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: configure.py
patch: @@ -1301,7 +1301,7 @@ def check_compiler(o):
   if not ok:
     warn(f'failed to autodetect C++ compiler version (CXX={CXX})')
   elif (is_apple and clang_version < (17, 0, 0) or not is_apple and clang_version < (19, 1, 0)) if is_clang else gcc_version < (12, 2, 0):
-    warn(f'C++ compiler (CXX={CXX}, {version_str}) too old, need g++ 12.2.0, clang++ 19.1.0, or Apple clang++ 17.0.0')
+    warn(f"C++ compiler (CXX={CXX}, {version_str}) too old, need g++ 12.2.0 or clang++ 19.1.0{' or Apple clang++ 17.0.0' if is_apple else ''}")
 
   ok, is_clang, clang_version, gcc_version, is_apple = try_check_compiler(CC, 'c')
   version_str = ".".join(map(str, clang_version if is_clang else gcc_version))
Repository: ggml-org/llama.cpp
Pull request: model: fix llama arch implementation


Changed files:
filename: src/llama-model.cpp
patch: @@ -626,6 +626,8 @@ void llama_model::load_hparams(llama_model_loader & ml) {
     switch (arch) {
         case LLM_ARCH_LLAMA:
             {
+                ml.get_key(LLM_KV_ATTENTION_LAYERNORM_RMS_EPS, hparams.f_norm_rms_eps);
+
                 if (hparams.n_expert == 8) {
                     switch (hparams.n_layer) {
                         case 32: type = LLM_TYPE_8x7B; break;
Repository: ollama/ollama
Pull request: Fix negative keep_alive

Using a negative `keep_alive` did not work as expected, models would unload instantly. Some logging of the duration which was unmarshalled showed that the `math.MaxFloat64` was resulting in a very large negative duration rather than the desired very large positive duration.

I just changed these codepaths to use `math.MaxInt64`, which is what I understand `time.Duration` to expect.

Changed files:
filename: api/types.go
patch: @@ -415,8 +415,7 @@ func (d *Duration) UnmarshalJSON(b []byte) (err error) {
 	switch t := v.(type) {
 	case float64:
 		if t < 0 {
-			t = math.MaxFloat64
-			d.Duration = time.Duration(t)
+			d.Duration = time.Duration(math.MaxInt64)
 		} else {
 			d.Duration = time.Duration(t * float64(time.Second))
 		}
@@ -426,8 +425,7 @@ func (d *Duration) UnmarshalJSON(b []byte) (err error) {
 			return err
 		}
 		if d.Duration < 0 {
-			mf := math.MaxFloat64
-			d.Duration = time.Duration(mf)
+			d.Duration = time.Duration(math.MaxInt64)
 		}
 	}
Repository: facebook/react
Pull request: [ez] Remove outdated files

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #30092

These are no longer in use

Changed files:
filename: compiler/packages/snap/src/SproutTodoFilter.ts
patch: @@ -444,7 +444,6 @@ const skipFilter = new Set([
   "loop-unused-let",
   "reanimated-no-memo-arg",
 
-  // Tested e2e in forget-feedback repo
   "userspace-use-memo-cache",
   "transitive-freeze-function-expressions",
 

filename: compiler/scripts/build-packages-forget-feedback.sh
patch: @@ -1,39 +0,0 @@
-#!/bin/sh
-# Copyright (c) Meta Platforms, Inc. and affiliates.
-#
-# This source code is licensed under the MIT license found in the
-# LICENSE file in the root directory of this source tree.
-
-# Script to build packages for Forget Feedback (eg when you need to add a new package to the
-# testapp)
-
-set -eo pipefail
-
-cwd=`basename $(pwd)`
-
-if [ $cwd != "react-forget" ]; then
-  echo "Error: This script must be run from the top level react-forget directory. Exiting"
-  exit 1
-fi
-
-# ----------------------- Build packages
-yarn install --silent
-rm -rf forget-feedback/dist
-mkdir forget-feedback/dist
-
-packages=("babel-plugin-react-compiler" "eslint-plugin-react-compiler" "react-forget-runtime")
-for package in ${packages[@]}; do
-  echo "Building" $package
-  yarn workspace $package run build
-done
-
-echo "Copying artifacts to local forget-feedback directory..."
-for package in ${packages[@]}; do
-  for dir in packages/$package/; do
-    if [ -d $dir/dist ]; then
-      package_name=$(basename $dir)
-      cp -R $dir/dist/. ./forget-feedback/dist/$package_name
-      cp $dir/package.json ./forget-feedback/dist/$package_name
-    fi
-  done
-done

filename: compiler/scripts/copyright.js
patch: @@ -22,9 +22,6 @@ const files = glob.sync("**/*.{js,ts,tsx,jsx,rs}", {
   ignore: [
     "**/dist/**",
     "**/node_modules/**",
-    "react/**",
-    "forget-feedback/**",
-    "packages/js-fuzzer/**",
     "**/tests/fixtures/**",
     "**/__tests__/fixtures/**",
   ],
Repository: ggml-org/llama.cpp
Pull request: cmake: fix macOS build with `-DGGML_BACKEND_DL=ON`

#17091 introduced an issue where when building with `-DGGML_BACKEND_DL=ON` on macOS you get this error:
```
c++: error: invalid argument '-current_version 0.9.4' only allowed with '-dynamiclib'
make[2]: *** [bin/libggml-blas.so] Error 1
make[1]: *** [ggml/src/ggml-blas/CMakeFiles/ggml-blas.dir/all] Error 2
```

It appears that building a module library with a version is not supported on macOS ([CMake ticket](https://gitlab.kitware.com/cmake/cmake/-/issues/20782)), so this PR makes the build skip setting a version for backend module libraries on macOS.

Changed files:
filename: ggml/src/CMakeLists.txt
patch: @@ -274,10 +274,13 @@ function(ggml_add_backend_library backend)
     endif()
 
     # Set versioning properties for all backend libraries
-    set_target_properties(${backend} PROPERTIES
-        VERSION ${GGML_VERSION}
-        SOVERSION ${GGML_VERSION_MAJOR}
-    )
+    # Building a MODULE library with a version is not supported on macOS (https://gitlab.kitware.com/cmake/cmake/-/issues/20782)
+    if (NOT (APPLE AND GGML_BACKEND_DL))
+        set_target_properties(${backend} PROPERTIES
+            VERSION ${GGML_VERSION}
+            SOVERSION ${GGML_VERSION_MAJOR}
+        )
+    endif()
 
     if(NOT GGML_AVAILABLE_BACKENDS)
         set(GGML_AVAILABLE_BACKENDS "${backend}"
Repository: ollama/ollama
Pull request: Update README.md to include link to Ollama-ex Elixir library


Changed files:
filename: README.md
patch: @@ -310,6 +310,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [Semantic Kernel - Python](https://github.com/microsoft/semantic-kernel/tree/main/python/semantic_kernel/connectors/ai/ollama)
 - [Haystack](https://github.com/deepset-ai/haystack-integrations/blob/main/integrations/ollama.md)
 - [Ollama for R - rollama](https://github.com/JBGruber/rollama)
+- [Ollama-ex for Elixir](https://github.com/lebrunel/ollama-ex)
 
 ### Mobile
Repository: huggingface/transformers
Pull request: Fix outdated torch version check

# What does this PR do?

Fix outdated torch version check.

Changed files:
filename: src/transformers/utils/import_utils.py
patch: @@ -236,9 +236,9 @@ def _is_package_available(pkg_name: str, return_version: bool = False) -> Union[
 
 _torch_available, _torch_version = _is_package_available("torch", return_version=True)
 if _torch_available:
-    _torch_available = version.parse(_torch_version) >= version.parse("2.1.0")
+    _torch_available = version.parse(_torch_version) >= version.parse("2.2.0")
     if not _torch_available:
-        logger.warning(f"Disabling PyTorch because PyTorch >= 2.1 is required but found {_torch_version}")
+        logger.warning(f"Disabling PyTorch because PyTorch >= 2.2 is required but found {_torch_version}")
 
 
 _essentia_available = importlib.util.find_spec("essentia") is not None

filename: tests/models/qwen2_5_vl/test_modeling_qwen2_5_vl.py
patch: @@ -55,8 +55,6 @@
 if is_torch_available():
     import torch
 
-else:
-    is_torch_greater_or_equal_than_2_0 = False
 
 if is_vision_available():
     from PIL import Image
Repository: facebook/react
Pull request: [compiler] Enable sourceMaps in tsconfig

With this, we can set a `debugger` breakpoint and we'll break into the source code when running tests with snap. Without this, we'd break into the transpiled js code.

Changed files:
filename: compiler/packages/snap/src/runner-watch.ts
patch: @@ -27,7 +27,7 @@ export function watchSrc(
   const host = ts.createWatchCompilerHost(
     configPath,
     ts.convertCompilerOptionsFromJson(
-      { module: "commonjs", outDir: "dist" },
+      { module: "commonjs", outDir: "dist", sourceMap: true },
       "."
     ).options,
     ts.sys,
Repository: electron/electron
Pull request: fix: prevent gc monitor 2nd pass crash

Backport of #46987

See that PR for details.


Notes: no-notes

Changed files:
filename: shell/common/gin_converters/osr_converter.cc
patch: @@ -145,19 +145,21 @@ v8::Local<v8::Value> Converter<electron::OffscreenSharedTextureValue>::ToV8(
           // texture, output it in second pass callback.
           data.SetSecondPassCallback([](const v8::WeakCallbackInfo<
                                          OffscreenReleaseHolderMonitor>& data) {
-            auto* iso = data.GetIsolate();
             // Emit warning only once
             static std::once_flag flag;
             std::call_once(flag, [=] {
-              electron::util::EmitWarning(
-                  iso,
-                  "[OSR TEXTURE LEAKED] When using OSR with "
-                  "`useSharedTexture`, `texture.release()` "
-                  "must be called explicitly as soon as the texture is "
-                  "copied to your rendering system. "
-                  "Otherwise, it will soon drain the underlying "
-                  "framebuffer and prevent future frames from being generated.",
-                  "SharedTextureOSRNotReleased");
+              base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
+                  FROM_HERE, base::BindOnce([] {
+                    electron::util::EmitWarning(
+                        "Offscreen rendering shared texture was garbage "
+                        "collected before calling `release()`. When using OSR "
+                        "with `useSharedTexture: true`, `texture.release()` "
+                        "must be called explicitly as soon as the texture is "
+                        "copied to your rendering system. Otherwise, it will "
+                        "soon drain the underlying frame pool and prevent "
+                        "future frames from being sent.",
+                        "OSRSharedTextureNotReleased");
+                  }));
             });
           });
         }
Repository: ggml-org/llama.cpp
Pull request: contributing: update guidelines for AI-generated code

Requires disclosing usage of AI for:
- PRs (contributors /collaborators) - this excludes usage of AI for trivial tab auto-completions
- Security reports


Changed files:
filename: CONTRIBUTING.md
patch: @@ -19,6 +19,7 @@ The project differentiates between 3 levels of contributors:
 - If your PR becomes stale, don't hesitate to ping the maintainers in the comments
 - Maintainers will rely on your insights and approval when making a final decision to approve and merge a PR
 - Consider adding yourself to [CODEOWNERS](CODEOWNERS) to indicate your availability for reviewing related PRs
+- Using AI to generate PRs is permitted. However, you must (1) explicitly disclose how AI was used and (2) conduct a thorough manual review before publishing the PR. Note that trivial tab autocompletions do not require disclosure.
 
 # Pull requests (for maintainers)
 

filename: SECURITY.md
patch: @@ -65,4 +65,6 @@ However, If you have discovered a security vulnerability in this project, please
 
 Please disclose it as a private [security advisory](https://github.com/ggml-org/llama.cpp/security/advisories/new).
 
+Please note that using AI to identify vulnerabilities and generate reports is permitted. However, you must (1) explicitly disclose how AI was used and (2) conduct a thorough manual review before submitting the report.
+
 A team of volunteers on a reasonable-effort basis maintains this project. As such, please give us at least 90 days to work on a fix before public exposure.
Repository: facebook/react
Pull request: Set renameElementSymbol to dynamic value

Prepare to roll this out with dynamic flag

`yarn flags --diff www canary`

<img width="514" alt="Screenshot 2024-06-24 at 11 33 55 AM" src="https://github.com/facebook/react/assets/8965173/31508fdc-4cb1-4ce0-8e22-c02a034377b0">


Changed files:
filename: packages/react-dom/src/__tests__/ReactDOMOption-test.js
patch: @@ -134,7 +134,7 @@ describe('ReactDOMOption', () => {
     }).rejects.toThrow('Objects are not valid as a React child');
   });
 
-  // @gate www
+  // @gate www && !renameElementSymbol
   it('should support element-ish child', async () => {
     // This is similar to <fbt>.
     // We don't toString it because you must instead provide a value prop.

filename: packages/shared/forks/ReactFeatureFlags.www-dynamic.js
patch: @@ -32,6 +32,7 @@ export const syncLaneExpirationMs = 250;
 export const transitionLaneExpirationMs = 5000;
 export const enableAddPropertiesFastPath = __VARIANT__;
 export const disableLegacyMode = __VARIANT__;
+export const renameElementSymbol = __VARIANT__;
 
 // Enable this flag to help with concurrent mode debugging.
 // It logs information to the console about React scheduling, rendering, and commit phases.

filename: packages/shared/forks/ReactFeatureFlags.www.js
patch: @@ -35,6 +35,7 @@ export const {
   enableNoCloningMemoCache,
   enableAddPropertiesFastPath,
   enableFastJSX,
+  renameElementSymbol,
 } = dynamicFeatureFlags;
 
 // On WWW, __EXPERIMENTAL__ is used for a new modern build.
@@ -65,8 +66,6 @@ export const enableSchedulingProfiler: boolean =
 export const disableLegacyContext = __EXPERIMENTAL__;
 export const enableGetInspectorDataForInstanceInProduction = false;
 
-export const renameElementSymbol = false;
-
 export const enableCache = true;
 export const enableLegacyCache = true;
Repository: denoland/deno
Pull request: feat(task): `globstar`, `failglob`, `nullglob`, and `pipefail` support

Defaults: `failglob`, `globstar`

* `shopt -u failglob && ...` - Disable failglob.
* `shopt -u failglob && shopt -s nullglob && ...` - Disable failglob and enable nullglob.
* `shopt -u globstar && ...` - Disable globstar.
* `set -o pipefail` - Enable pipefail.

Note that these shell options do not propagate down into `deno task ...` subprocesses.

Changed files:
filename: Cargo.lock
patch: @@ -2940,11 +2940,12 @@ dependencies = [
 
 [[package]]
 name = "deno_task_shell"
-version = "0.26.2"
+version = "0.28.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6c8906a44dee412f17bf3ec79da41548612c5da3741fd0023c718408d6fe685"
+checksum = "078f9f536187d5bdf536104c139aeb49d23a3bbc2b6f23626fa04487bd819615"
 dependencies = [
  "anyhow",
+ "bitflags 2.9.3",
  "deno_path_util",
  "futures",
  "glob",

filename: Cargo.toml
patch: @@ -78,7 +78,7 @@ deno_native_certs = "0.3.0"
 deno_npm = "=0.42.3"
 deno_path_util = "=0.6.4"
 deno_semver = "=0.9.1"
-deno_task_shell = "=0.26.2"
+deno_task_shell = "=0.28.0"
 deno_terminal = "=0.2.3"
 deno_unsync = { version = "0.4.4", default-features = false }
 deno_whoami = "0.1.0"