helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: Resume chunk download on UnexpectedEOF errors

If the chunk download is interrupted, resume from where we left off

Changed files:
filename: server/download.go
patch: @@ -161,6 +161,9 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *Regis
 					log.Printf("%s part %d attempt %d failed: %v, retrying", b.Digest[7:19], i, try, err)
 					continue
 				default:
+					if try > 0 {
+						log.Printf("%s part %d completed after %d retries", b.Digest[7:19], i, try)
+					}
 					return nil
 				}
 			}
@@ -202,7 +205,7 @@ func (b *blobDownload) downloadChunk(ctx context.Context, requestURL *url.URL, w
 	defer resp.Body.Close()
 
 	n, err := io.Copy(w, io.TeeReader(resp.Body, b))
-	if err != nil && !errors.Is(err, context.Canceled) {
+	if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(err, io.ErrUnexpectedEOF) {
 		// rollback progress
 		b.Completed.Add(-n)
 		return err
@@ -213,7 +216,7 @@ func (b *blobDownload) downloadChunk(ctx context.Context, requestURL *url.URL, w
 		return err
 	}
 
-	// return nil or context.Canceled
+	// return nil or context.Canceled or UnexpectedEOF (resumable)
 	return err
 }
Repository: vercel/next.js
Pull request: [devtools] Immediately set meta key in shortcut recorder

NDT is only client-side rendered and the platform never changes, so we can immediately set the meta key in the shortcut recorder during render.

Changed files:
filename: packages/next/src/next-devtools/dev-overlay/components/errors/dev-tools-indicator/dev-tools-info/shortcut-recorder.tsx
patch: @@ -1,5 +1,5 @@
 import type { JSX } from 'react'
-import { useState, useRef, useEffect } from 'react'
+import { useState, useRef } from 'react'
 import { css } from '../../../../utils/css'
 
 const SUCCESS_SHOW_DELAY_MS = 180
@@ -308,25 +308,13 @@ function parseKeyCode(code: string | JSX.Element) {
 }
 
 function MetaKey() {
-  // u00A0 = &nbsp;
-  const [label, setLabel] = useState('\u00A0')
-
-  const apple = isApple()
-
-  useEffect(() => {
-    // Meta is Command on Apple devices, otherwise Control
-    if (apple === true) {
-      // eslint-disable-next-line react-hooks/set-state-in-effect -- TODO
-      setLabel('⌘')
-    }
-
-    // Explicitly say "Ctrl" instead of the symbol "⌃"
-    // because most Windows/Linux laptops do not print the symbol
-    // Other keyboard-intensive apps like Linear do this
-    if (apple === false) {
-      setLabel('Ctrl')
-    }
-  }, [apple])
+  const label = isApple()
+    ? // Meta is Command on Apple devices, otherwise Control
+      '⌘'
+    : // Explicitly say "Ctrl" instead of the symbol "⌃"
+      // because most Windows/Linux laptops do not print the symbol
+      // Other keyboard-intensive apps like Linear do this
+      'Ctrl'
 
   return (
     <span style={{ minWidth: '1em', display: 'inline-block' }}>{label}</span>
@@ -499,8 +487,7 @@ export const SHORTCUT_RECORDER_STYLES = css`
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 function testPlatform(re: RegExp): boolean | undefined {
-  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Checking on an unusual environment.
-  return typeof window !== 'undefined' && window.navigator != null
+  return window.navigator != null
     ? re.test(window.navigator.platform)
     : undefined
 }
Repository: huggingface/transformers
Pull request: Flaky CI is annoying

# What does this PR do?

Mark TVP image processor test flaky, It fails a lot under PRs currently. cc @yonigozlan to investigate when you have time

Changed files:
filename: tests/models/tvp/test_image_processing_tvp.py
patch: @@ -19,7 +19,7 @@
 import numpy as np
 
 from transformers.image_transforms import PaddingMode
-from transformers.testing_utils import require_torch, require_vision
+from transformers.testing_utils import is_flaky, require_torch, require_vision
 from transformers.utils import is_torch_available, is_torchvision_available, is_vision_available
 
 from ...test_image_processing_common import ImageProcessingTestMixin, prepare_video_inputs
@@ -349,6 +349,17 @@ def test_call_pytorch(self):
 
     @require_vision
     @require_torch
+    @is_flaky(
+        description="FIXME: @yoni probably because of an extra 'time' dimension and since image processors don't handle it well?"
+    )
+    def test_slow_fast_equivalence(self):
+        super().test_slow_fast_equivalence()
+
+    @require_vision
+    @require_torch
+    @is_flaky(
+        description="FIXME: @yoni probably because of an extra 'time' dimension and since image processors don't handle it well?"
+    )
     def test_slow_fast_equivalence_batched(self):
         if not self.test_slow_image_processor or not self.test_fast_image_processor:
             self.skipTest(reason="Skipping slow/fast equivalence test")
Repository: facebook/react
Pull request: Write Diff Train import branch to this repo

For fbsource we've historically used a separate repo for imports due to internal limitations in Diff Train. Those have been lifted so we can now commit this branch here and then we can import from this repo (and get rid of the other repo)

Changed files:
filename: .github/workflows/commit_artifacts.yml
patch: @@ -210,7 +210,7 @@ jobs:
           commit_user_email: ${{ github.actor }}@users.noreply.github.com
           create_branch: true
 
-  commit_fbsource_artifacts:
+  commit_fbsource_artifacts_external_repo:
     needs: download_artifacts
     runs-on: ubuntu-latest
     if: ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0') || github.ref == 'refs/heads/meta-fbsource' }}
@@ -245,3 +245,39 @@ jobs:
             DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.sha }}.
           commit_user_name: ${{ github.actor }}
           commit_user_email: ${{ github.actor }}@users.noreply.github.com
+
+  commit_fbsource_artifacts:
+    needs: download_artifacts
+    if: ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0') || github.ref == 'refs/heads/meta-fbsource' }}
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          ref: builds/facebook-fbsource
+      - name: Ensure clean directory
+        run: rm -rf compiled
+      - uses: actions/download-artifact@v3
+        with:
+          name: compiled-rn
+          path: compiled-rn/
+      - run: git status -u
+      - name: Check if only the REVISION file has changed
+        id: check_should_commit
+        run: |
+          if git status --porcelain | grep -qv '/REVISION$'; then
+            echo "should_commit=true" >> "$GITHUB_OUTPUT"
+          else
+            echo "should_commit=false" >> "$GITHUB_OUTPUT"
+          fi
+      - name: Commit changes to branch
+        if: steps.check_should_commit.outputs.should_commit == 'true'
+        uses: stefanzweifel/git-auto-commit-action@v4
+        with:
+          commit_message: |
+            ${{ github.event.head_commit.message }}
+
+            DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.sha }}.
+          branch: builds/facebook-fbsource
+          commit_user_name: ${{ github.actor }}
+          commit_user_email: ${{ github.actor }}@users.noreply.github.com
+          create_branch: true
Repository: electron/electron
Pull request: fix: window border on Gnome Wayland

Backport of #46624

See that PR for details.


Notes: Fixed an inverted conditional in the above PR that caused broken window borders in some circumstances on Wayland.


Changed files:
filename: shell/browser/ui/electron_desktop_window_tree_host_linux.cc
patch: @@ -195,7 +195,7 @@ void ElectronDesktopWindowTreeHostLinux::UpdateFrameHints() {
     if (ui::OzonePlatform::GetInstance()->IsWindowCompositingSupported()) {
       // Set the opaque region.
       std::vector<gfx::Rect> opaque_region;
-      if (!IsShowingFrame()) {
+      if (IsShowingFrame()) {
         // The opaque region is a list of rectangles that contain only fully
         // opaque pixels of the window.  We need to convert the clipping
         // rounded-rect into this format.
Repository: denoland/deno
Pull request: fix(ext/node): make `kReinitializeHandle` work for TLS wrap


Changed files:
filename: ext/node/polyfills/net.ts
patch: @@ -1809,6 +1809,9 @@ Object.defineProperty(Socket.prototype, "_handle", {
 Socket.prototype[kReinitializeHandle] = function (handle) {
   this._handle?.close();
 
+  // Make sure TLS wrap works after reinitialize.
+  handle.afterConnectTls = this._handle.afterConnectTls;
+
   this._handle = handle;
   this._handle[ownerSymbol] = this;
Repository: ollama/ollama
Pull request: document specifying multiple stop params

resolves #572 

Changed files:
filename: docs/modelfile.md
patch: @@ -112,8 +112,8 @@ PARAMETER <parameter> <parametervalue>
 | repeat_last_n  | Sets how far back for the model to look back to prevent repetition. (Default: 64, 0 = disabled, -1 = num_ctx)                                                                                                                                           | int        | repeat_last_n 64     |
 | repeat_penalty | Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient. (Default: 1.1)                                                                     | float      | repeat_penalty 1.1   |
 | temperature    | The temperature of the model. Increasing the temperature will make the model answer more creatively. (Default: 0.8)                                                                                                                                     | float      | temperature 0.7      |
-| seed | Sets the random number seed to use for generation. Setting this to a specific number will make the model generate the same text for the same prompt. (Default: 0) | int | seed 42 |
-| stop           | Sets the stop sequences to use.                                                                                                                                                                                                                         | string     | stop "AI assistant:" |
+| seed           | Sets the random number seed to use for generation. Setting this to a specific number will make the model generate the same text for the same prompt. (Default: 0)                                                                                       | int        | seed 42              |
+| stop           | Sets the stop sequences to use. When this pattern is encountered the LLM will stop generating text and return. Multiple stop patterns may be set by specifying multiple separate `stop` parameters in a modelfile.                                      | string     | stop "AI assistant:" |
 | tfs_z          | Tail free sampling is used to reduce the impact of less probable tokens from the output. A higher value (e.g., 2.0) will reduce the impact more, while a value of 1.0 disables this setting. (default: 1)                                               | float      | tfs_z 1              |
 | num_predict    | Maximum number of tokens to predict when generating text. (Default: 128, -1 = infinite generation, -2 = fill context)                                                                                                                                   | int        | num_predict 42       |
 | top_k          | Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative. (Default: 40)                                                                        | int        | top_k 40             |
Repository: vercel/next.js
Pull request: [test] update the metadata deployment cache header tests

Update metadata deployment tests assertion due to https://github.com/vercel/vercel/pull/13816 is rolled out, they're served as static file on vercel with `must-revalidate` header.

This is for unblocking the deployment tests failure. Will follow up to align and simplify the general cache approach in #83215

Changed files:
filename: test/e2e/app-dir/metadata/metadata.test.ts
patch: @@ -691,14 +691,18 @@ describe('app dir - metadata', () => {
       expect(resAppleIcon.headers.get('cache-control')).toBe(
         isNextDev
           ? 'no-cache, no-store'
-          : 'public, immutable, no-transform, max-age=31536000'
+          : isNextDeploy
+            ? 'public, max-age=0, must-revalidate'
+            : 'public, immutable, no-transform, max-age=31536000'
       )
       expect(resIcon.status).toBe(200)
       expect(resIcon.headers.get('content-type')).toBe('image/png')
       expect(resIcon.headers.get('cache-control')).toBe(
         isNextDev
           ? 'no-cache, no-store'
-          : 'public, immutable, no-transform, max-age=31536000'
+          : isNextDeploy
+            ? 'public, max-age=0, must-revalidate'
+            : 'public, immutable, no-transform, max-age=31536000'
       )
     })
Repository: nodejs/node
Pull request: Revert "deps: make V8 compilable with older glibc"

This reverts commit 84d455e08e4129f7d1b3c68d62cbb129458619ec.

Refs: https://github.com/nodejs/node/issues/45118


Changed files:
filename: common.gypi
patch: @@ -36,7 +36,7 @@
 
     # Reset this number to 0 on major V8 upgrades.
     # Increment by one for each non-official patch applied to deps/v8.
-    'v8_embedder_string': '-node.17',
+    'v8_embedder_string': '-node.18',
 
     ##### V8 defaults for Node.js #####
 

filename: deps/v8/src/base/platform/platform-posix.cc
patch: @@ -618,7 +618,26 @@ void OS::FreeAddressSpaceReservation(AddressSpaceReservation reservation) {
 // Need to disable CFI_ICALL due to the indirect call to memfd_create.
 DISABLE_CFI_ICALL
 PlatformSharedMemoryHandle OS::CreateSharedMemoryHandleForTesting(size_t size) {
+#if V8_OS_LINUX && !V8_OS_ANDROID
+  // Use memfd_create if available, otherwise mkstemp.
+  using memfd_create_t = int (*)(const char*, unsigned int);
+  memfd_create_t memfd_create =
+      reinterpret_cast<memfd_create_t>(dlsym(RTLD_DEFAULT, "memfd_create"));
+  int fd = -1;
+  if (memfd_create) {
+    fd = memfd_create("V8MemFDForTesting", 0);
+  }
+  if (fd == -1) {
+    char filename[] = "/tmp/v8_tmp_file_for_testing_XXXXXX";
+    fd = mkstemp(filename);
+    if (fd != -1) CHECK_EQ(0, unlink(filename));
+  }
+  if (fd == -1) return kInvalidSharedMemoryHandle;
+  CHECK_EQ(0, ftruncate(fd, size));
+  return SharedMemoryHandleFromFileDescriptor(fd);
+#else
   return kInvalidSharedMemoryHandle;
+#endif
 }
 
 // static
Repository: facebook/react
Pull request: Support writing to this.refs from userspace

Previously, the `refs` property of a class component instance was read-only by user code — only React could write to it, and until/unless a string ref was used, it pointed to a shared empty object that was frozen in dev to prevent userspace mutations.

Because string refs are deprecated, we want users to be able to codemod all their string refs to callback refs. The safest way to do this is to output a callback ref that assigns to `this.refs`.

So to support this, we need to make `this.refs` writable by userspace.

Changed files:
filename: packages/react-reconciler/src/ReactFiberClassComponent.js
patch: @@ -819,7 +819,6 @@ function mountClassInstance(
   const instance = workInProgress.stateNode;
   instance.props = newProps;
   instance.state = workInProgress.memoizedState;
-  instance.refs = {};
 
   initializeUpdateQueue(workInProgress);
 

filename: packages/react-reconciler/src/__tests__/ReactFiberRefs-test.js
patch: @@ -138,4 +138,28 @@ describe('ReactFiberRefs', () => {
     );
     expect(refProp).toBe('child');
   });
+
+  test('strings refs can be codemodded to callback refs', async () => {
+    let app;
+    class App extends React.Component {
+      render() {
+        app = this;
+        return (
+          <div
+            prop="Hello!"
+            ref={el => {
+              // `refs` used to be a shared frozen object unless/until a string
+              // ref attached by the reconciler, but it's not anymore so that we
+              // can codemod string refs to userspace callback refs.
+              this.refs.div = el;
+            }}
+          />
+        );
+      }
+    }
+
+    const root = ReactNoop.createRoot();
+    await act(() => root.render(<App />));
+    expect(app.refs.div.prop).toBe('Hello!');
+  });
 });

filename: packages/react/src/ReactBaseClasses.js
patch: @@ -8,19 +8,13 @@
 import ReactNoopUpdateQueue from './ReactNoopUpdateQueue';
 import assign from 'shared/assign';
 
-const emptyObject = {};
-if (__DEV__) {
-  Object.freeze(emptyObject);
-}
-
 /**
  * Base class helpers for the updating state of a component.
  */
 function Component(props, context, updater) {
   this.props = props;
   this.context = context;
-  // If a component has string refs, we will assign a different object later.
-  this.refs = emptyObject;
+  this.refs = {};
   // We initialize the default updater but the real one gets injected by the
   // renderer.
   this.updater = updater || ReactNoopUpdateQueue;
@@ -133,7 +127,7 @@ function PureComponent(props, context, updater) {
   this.props = props;
   this.context = context;
   // If a component has string refs, we will assign a different object later.
-  this.refs = emptyObject;
+  this.refs = {};
   this.updater = updater || ReactNoopUpdateQueue;
 }
Repository: huggingface/transformers
Pull request: Fix gpt-oss rope warning 

# What does this PR do?

When initializing gpt-oss model, we would receive the following warning when it shouldn't be the case. 

`config.rope_scaling['original_max_position_embeddings'], the pre-yarn context length, is unset. We will **assume** config.max_position_embeddings holds the pre-yarn context length. Some use cases may expect config.max_position_embeddings to hold the post-yarn context length (pre-yarn context length * factor) -- we recommend updating both fields for optimal downstream model usage.`

This happens because the config class was not correctly initialized compared to the one from the checkpoint. The warning was triggered when the default config class was initialized (e.g when calling `self.__class__()` for example)

cc @gante I'm not sure if this happens to other models or not 

Changed files:
filename: src/transformers/models/gpt_oss/configuration_gpt_oss.py
patch: @@ -62,7 +62,14 @@ def __init__(
         initializer_range: float = 0.02,
         max_position_embeddings=131072,
         rms_norm_eps: float = 1e-5,
-        rope_scaling={"rope_type": "yarn", "factor": 32.0, "beta_fast": 32.0, "beta_slow": 1.0, "truncate": False},
+        rope_scaling={
+            "rope_type": "yarn",
+            "factor": 32.0,
+            "beta_fast": 32.0,
+            "beta_slow": 1.0,
+            "truncate": False,
+            "original_max_position_embeddings": 4096,
+        },
         attention_dropout: float = 0.0,
         num_experts_per_tok=4,
         router_aux_loss_coef: float = 0.9,
Repository: denoland/deno
Pull request: fix(check): fall back to copying tsgo binary if rename fails

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

Changed files:
filename: cli/tsc/go/setup.rs
patch: @@ -31,8 +31,8 @@ pub enum DownloadError {
   InvalidDownloadUrl(String, #[source] deno_core::url::ParseError),
   #[error("failed to unpack typescript-go: {0}")]
   UnpackFailed(#[source] AnyError),
-  #[error("failed to rename typescript-go: {0}")]
-  RenameFailed(#[source] std::io::Error),
+  #[error("failed to rename or copy typescript-go from {0} to {1}: {2}")]
+  RenameOrCopyFailed(String, String, #[source] std::io::Error),
   #[error("failed to write zip file to {0}: {1}")]
   WriteZipFailed(String, #[source] std::io::Error),
   #[error("failed to download typescript-go: {0}")]
@@ -162,8 +162,15 @@ pub async fn ensure_tsgo(
       dest_path: temp.path(),
     })
     .map_err(DownloadError::UnpackFailed)?;
-  std::fs::rename(unpacked_path, &bin_path)
-    .map_err(DownloadError::RenameFailed)?;
+  std::fs::rename(&unpacked_path, &bin_path)
+    .or_else(|_| std::fs::copy(&unpacked_path, &bin_path).map(|_| ()))
+    .map_err(|e| {
+      DownloadError::RenameOrCopyFailed(
+        unpacked_path.to_string_lossy().into_owned(),
+        bin_path.to_string_lossy().into_owned(),
+        e,
+      )
+    })?;
 
   Ok(TSGO_PATH.get_or_init(|| bin_path))
 }
Repository: vercel/next.js
Pull request: Revert "Turbopack: Persisting happens in foreground tasks"

Reverts vercel/next.js#83020

Closes PACK-5364

Changed files:
filename: turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
patch: @@ -1215,7 +1215,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
 
         if self.should_persist() {
             // Schedule the snapshot job
-            turbo_tasks.schedule_backend_foreground_job(TurboTasksBackendJob::InitialSnapshot);
+            turbo_tasks.schedule_backend_background_job(TurboTasksBackendJob::InitialSnapshot);
         }
     }
 
@@ -2215,7 +2215,7 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
                                 Ordering::Relaxed,
                             );
 
-                            turbo_tasks.schedule_backend_foreground_job(
+                            turbo_tasks.schedule_backend_background_job(
                                 TurboTasksBackendJob::FollowUpSnapshot,
                             );
                             return;
Repository: ollama/ollama
Pull request: skip gpu if less than 2GB VRAM are available

This check for available VRAM that triggered a fallback to CPU if less than 2GB of VRAM was available wasn't handled correctly in the current ollama version. This resulted in a very low amount of layers being offloaded to GPU in the case that a GPU was available with a low amount of available VRAM, and this results in worse performance than just falling back to CPU.

Changed files:
filename: llm/llama.go
patch: @@ -196,7 +196,10 @@ type llama struct {
 	Running
 }
 
-var errNoGPU = errors.New("nvidia-smi command failed")
+var (
+	errNvidiaSMI     = errors.New("nvidia-smi command failed")
+	errAvailableVRAM = errors.New("not enough VRAM available, falling back to CPU only")
+)
 
 // CheckVRAM returns the free VRAM in bytes on Linux machines with NVIDIA GPUs
 func CheckVRAM() (int64, error) {
@@ -205,7 +208,7 @@ func CheckVRAM() (int64, error) {
 	cmd.Stdout = &stdout
 	err := cmd.Run()
 	if err != nil {
-		return 0, errNoGPU
+		return 0, errNvidiaSMI
 	}
 
 	var freeMiB int64
@@ -226,8 +229,8 @@ func CheckVRAM() (int64, error) {
 
 	freeBytes := freeMiB * 1024 * 1024
 	if freeBytes < 2*format.GigaByte {
-		log.Printf("less than 2 GB VRAM available, falling back to CPU only")
-		freeMiB = 0
+		log.Printf("less than 2 GB VRAM available")
+		return 0, errAvailableVRAM
 	}
 
 	return freeBytes, nil
@@ -240,7 +243,7 @@ func NumGPU(numLayer, fileSizeBytes int64, opts api.Options) int {
 	if runtime.GOOS == "linux" {
 		freeBytes, err := CheckVRAM()
 		if err != nil {
-			if err.Error() != "nvidia-smi command failed" {
+			if !errors.Is(err, errNvidiaSMI) {
 				log.Print(err.Error())
 			}
 			// nvidia driver not installed or no nvidia GPU found
Repository: ollama/ollama
Pull request: Added gptel to list of integrations


Changed files:
filename: README.md
patch: @@ -231,6 +231,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [Ellama Emacs client](https://github.com/s-kostyaev/ellama)
 - [Emacs client](https://github.com/zweifisch/ollama)
 - [gen.nvim](https://github.com/David-Kunz/gen.nvim)
+- [gptel](https://github.com/karthink/gptel) Emacs client
 
 ### Libraries