helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: [generate] document non-canonical beam search default behavior

# What does this PR do?

Related to #38778: this PR adds more context behind some legacy decisions that shouldn't be broken for BC purposes.

Changed files:
filename: src/transformers/generation/utils.py
patch: @@ -3773,16 +3773,28 @@ def _beam_search_has_unfinished_sequences(
         Beam Search stopping condition -- halts the generation loop if any of these conditions becomes False
         """
         # a. Can the open beams improve the top completed scores?
-        # early_stopping == False -> apply heuristic = always get the best score from
-        #   `cur_len - decoder_prompt_len`. See the discussion below for more details.
-        #   https://github.com/huggingface/transformers/pull/20901#issuecomment-1369845565
+        # early_stopping == False -> apply heuristic = always get the best score from `cur_len - decoder_prompt_len`.
         # early_stopping == "never" -> compute the best score from `max_length` or `cur_len`, depending on the
         #   sign of `length_penalty`. Positive `length_penalty` favors longer sequences, thus we use
         #   `max_length` there.
+        # !!
+        # Be sure to check the docstring for `early_stopping` and `length_penalty`. The default parameterization
+        # does NOT correspond to a canonical beam search implementation, and tends to favor shorter output sequences
+        # compared to it (the heuristic active by default underestimates the maximum achievable score, and thus cut
+        # generation short). Also, be mindful that length penalty > 0.0 actually favors longer sequences, despite
+        # its name. These modifications were empirically found in the past (prior to 2022) to produce better quality
+        # generations, and changing them is BC breaking.
+        # For a canonical beam search implementation, set `early_stopping="never"` and `length_penalty=0.0`.
+        # See the discussion below for more details.
+        # https://github.com/huggingface/transformers/pull/20901#issuecomment-1369845565
+        # !!
         if early_stopping == "never" and length_penalty > 0.0:
             best_hypothetical_length = max_length - decoder_prompt_len
         else:
             best_hypothetical_length = cur_len - decoder_prompt_len
+
+        # best-case scenario: the next tokens have logprobs=0 (probability=1), and the score stays the same before
+        # applying length penalty
         best_possible_running_score = running_beam_scores[:, :1] / (best_hypothetical_length**length_penalty)
         worst_finished_score = torch.where(is_sent_finished, torch.min(beam_scores, dim=1, keepdim=True)[0], -1.0e9)
         improvement_possible = torch.any(best_possible_running_score > worst_finished_score)
Repository: denoland/deno
Pull request: fix(ext/webgpu): release current texture of surface after present

Fixes #28207.


Changed files:
filename: ext/webgpu/surface.rs
patch: @@ -166,6 +166,9 @@ impl GPUCanvasContext {
 
     config.device.instance.surface_present(self.surface_id)?;
 
+    // next `get_current_texture` call would get a new texture
+    *self.texture.borrow_mut() = None;
+
     Ok(())
   }
 }
Repository: facebook/react
Pull request: Add CodeSandbox CI Config

This will enable [CodeSandbox CI](https://ci.codesandbox.io) on the React repo. To have a better idea of what CodeSandbox CI does you can read more about it here: https://u2edh.csb.app/. I recommend merging this PR first before installing the GitHub App, to ensure that all future PRs will work from the get-go.

The gist of it is:

The goal of this app is to make it easier for you to test your library without publishing to npm yet. Since CodeSandbox is already used for bug reports we wanted to make it possible to also test the PR version of your library with the existing bug reports.

In an ideal flow, it would work like this:

1. Someone opens an issue for a bug with a sandbox reproducible
2. Someone opens a fix PR mentioning the issue
3. We build the library from the PR, fork the sandbox repro and install the new library in that sandbox
This way you will only have to open the generated sandbox to confirm that the fix works. No need to clone, install or test locally.

Changed files:
filename: .codesandbox/ci.json
patch: @@ -0,0 +1,10 @@
+{
+  "packages": ["packages/react", "packages/react-dom", "packages/scheduler"],
+  "buildCommand": "build --type=NODE react/index,react-dom/index,scheduler/index,scheduler/tracing",
+  "publishDirectory": {
+    "react": "build/node_modules/react",
+    "react-dom": "build/node_modules/react-dom",
+    "scheduler": "build/node_modules/scheduler"
+  },
+  "sandboxes": ["new"]
+}
Repository: electron/electron
Pull request: build: add win toolchain for release builds

#### Description of Change

This PR handles the building and uploading of the Windows toolchain for release builds

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [ ] PR description included and stakeholders cc'd
- [ ] `npm test` passes
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [ ] relevant documentation, tutorials, templates and examples are changed or added
- [ ] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes

Notes: none


Changed files:
filename: .github/actions/build-electron/action.yml
patch: @@ -143,6 +143,25 @@ runs:
       run: |
         cd src
         e build --target electron:node_headers
+    - name: Create installed_software.json ${{ inputs.step-suffix }}
+      shell: powershell
+      if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
+      run: |
+        cd src
+        Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json
+    - name: Profile Windows Toolchain ${{ inputs.step-suffix }}
+      shell: bash
+      if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
+      run: |
+        cd src
+        python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
+    - name: Add msdia140.dll to Path ${{ inputs.step-suffix }}
+      shell: bash
+      if: ${{ inputs.is-release == 'true' && inputs.target-platform == 'win' }}
+      run: |
+        # Needed for msdia140.dll on 64-bit windows
+        cd src
+        export PATH="$PATH:$(pwd)/third_party/llvm-build/Release+Asserts/bin"
     - name: Generate & Zip Symbols ${{ inputs.step-suffix }}
       shell: bash
       run: |

filename: script/lib/config.py
patch: @@ -10,6 +10,7 @@
   'linux': 'linux',
   'linux2': 'linux',
   'win32': 'win32',
+  'win': 'win32',
 }[sys.platform]
 
 verbose_mode = False
@@ -26,6 +27,8 @@ def get_target_arch():
   arch = os.environ.get('TARGET_ARCH')
   if arch is None:
     return 'x64'
+  if arch == 'x86':
+    return 'ia32'
   return arch
 
 def set_verbose_mode(mode):
Repository: huggingface/transformers
Pull request: Reduce Glm4v model test size significantly

# What does this PR do?

As per the title. The model test was about 180M params, making the CI quite slow. cc @ydshieh 

Changed files:
filename: tests/models/glm4v/test_modeling_glm4v.py
patch: @@ -69,16 +69,15 @@ def __init__(
         is_training=True,
         text_config={
             "vocab_size": 99,
-            "hidden_size": 32,
-            "intermediate_size": 37,
-            "num_hidden_layers": 4,
-            "num_attention_heads": 4,
-            "num_key_value_heads": 2,
+            "hidden_size": 16,
+            "intermediate_size": 22,
+            "num_hidden_layers": 2,
+            "num_attention_heads": 2,
+            "num_key_value_heads": 1,
             "output_channels": 64,
             "hidden_act": "silu",
             "max_position_embeddings": 512,
             "rope_scaling": {"type": "default", "mrope_section": [2, 1, 1]},
-            "max_window_layers": 3,
             "rope_theta": 10000,
             "tie_word_embeddings": True,
             "bos_token_id": 0,
@@ -87,11 +86,10 @@ def __init__(
         },
         vision_config={
             "depth": 2,
-            "embed_dim": 32,
             "hidden_act": "silu",
-            "hidden_size": 32,
-            "mlp_ratio": 4,
-            "num_heads": 4,
+            "hidden_size": 48,
+            "out_hidden_size": 16,
+            "intermediate_size": 22,
             "patch_size": 14,
             "spatial_merge_size": 1,
             "temporal_patch_size": 2,
@@ -239,10 +237,6 @@ def test_sdpa_can_dispatch_on_flash(self):
     def test_multi_gpu_data_parallel_forward(self):
         pass
 
-    @unittest.skip(reason="We cannot configure to output a smaller model.")
-    def test_model_is_small(self):
-        pass
-
     @unittest.skip("Error with compilation")
     def test_generate_from_inputs_embeds_with_static_cache(self):
         pass
Repository: facebook/react
Pull request: [Flight] Dedupe suspense boundaries when it has already been found earlier

If we track a postponed SuspenseBoundary parent that we have to replay through before it has postponed and it postpones itself later, we need to upgrade it to a postponed replay boundary instead of adding two.


Changed files:
filename: packages/react-dom/src/__tests__/ReactDOMFizzStaticBrowser-test.js
patch: @@ -840,4 +840,51 @@ describe('ReactDOMFizzStaticBrowser', () => {
       </div>,
     ]);
   });
+
+  // @gate enablePostpone
+  it('can postpone a boundary after it has already been added', async () => {
+    let prerendering = true;
+    function Postpone() {
+      if (prerendering) {
+        React.unstable_postpone();
+      }
+      return 'Hello';
+    }
+
+    function App() {
+      return (
+        <div>
+          <Suspense fallback="Loading...">
+            <Suspense fallback="Loading...">
+              <Postpone />
+            </Suspense>
+            <Postpone />
+            <Postpone />
+          </Suspense>
+        </div>
+      );
+    }
+
+    const prerendered = await ReactDOMFizzStatic.prerender(<App />);
+    expect(prerendered.postponed).not.toBe(null);
+
+    prerendering = false;
+
+    console.log(JSON.stringify(prerendered.postponed, null, 2));
+
+    const resumed = await ReactDOMFizzServer.resume(
+      <App />,
+      JSON.parse(JSON.stringify(prerendered.postponed)),
+    );
+
+    await readIntoContainer(prerendered.prelude);
+
+    expect(getVisibleChildren(container)).toEqual(<div>Loading...</div>);
+
+    await readIntoContainer(resumed);
+
+    expect(getVisibleChildren(container)).toEqual(
+      <div>{['Hello', 'Hello', 'Hello']}</div>,
+    );
+  });
 });

filename: packages/react-server/src/ReactFizzServer.js
patch: @@ -2490,15 +2490,23 @@ function trackPostpone(
       addToReplayParent(boundaryNode, boundaryKeyPath[0], trackedPostpones);
       return;
     } else {
-      const boundaryNode: ReplaySuspenseBoundary = [
-        boundaryKeyPath[1],
-        boundaryKeyPath[2],
-        children,
-        null,
-        boundary.rootSegmentID,
-      ];
-      trackedPostpones.workingMap.set(boundaryKeyPath, boundaryNode);
-      addToReplayParent(boundaryNode, boundaryKeyPath[0], trackedPostpones);
+      let boundaryNode: void | ReplayNode =
+        trackedPostpones.workingMap.get(boundaryKeyPath);
+      if (boundaryNode === undefined) {
+        boundaryNode = [
+          boundaryKeyPath[1],
+          boundaryKeyPath[2],
+          children,
+          null,
+          boundary.rootSegmentID,
+        ];
+        trackedPostpones.workingMap.set(boundaryKeyPath, boundaryNode);
+        addToReplayParent(boundaryNode, boundaryKeyPath[0], trackedPostpones);
+      } else {
+        // Upgrade to ReplaySuspenseBoundary.
+        ((boundaryNode: any): ReplaySuspenseBoundary)[4] =
+          boundary.rootSegmentID;
+      }
       // Fall through to add the child node.
     }
   }
Repository: electron/electron
Pull request: build: remove outdated Node.js serdes patch

Backport of #45401.

See that PR for details.

Notes: none

Changed files:
filename: patches/node/.patches
patch: @@ -11,7 +11,6 @@ fix_crypto_tests_to_run_with_bssl.patch
 fix_account_for_debugger_agent_race_condition.patch
 fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch
 fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch
-fix_serdes_test.patch
 feat_add_uv_loop_interrupt_on_io_change_option_to_uv_loop_configure.patch
 support_v8_sandboxed_pointers.patch
 build_ensure_native_module_compilation_fails_if_not_using_a_new.patch

filename: patches/node/fix_serdes_test.patch
patch: @@ -1,34 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jeremy Rose <nornagon@nornagon.net>
-Date: Fri, 28 Jan 2022 13:50:21 -0800
-Subject: fix serdes test
-
-The V8 wire format version changed.
-
-diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js
-index 296e076a9f760d94293fe4310d6f3a081e3e59f4..be6deaf463977cc65e9f135008c3ce2b2919e22f 100644
---- a/test/parallel/test-v8-serdes.js
-+++ b/test/parallel/test-v8-serdes.js
-@@ -163,11 +163,11 @@ const hostObject = new (internalBinding('js_stream').JSStream)();
- 
- {
-   // Test that an old serialized value can still be deserialized.
--  const buf = Buffer.from('ff0d6f2203666f6f5e007b01', 'hex');
-+  const buf = Buffer.from('ff0f6f2203666f6f5e007b01', 'hex');
- 
-   const des = new v8.DefaultDeserializer(buf);
-   des.readHeader();
--  assert.strictEqual(des.getWireFormatVersion(), 0x0d);
-+  assert.strictEqual(des.getWireFormatVersion(), 0x0f);
- 
-   const value = des.readValue();
-   assert.strictEqual(value, value.foo);
-@@ -202,7 +202,7 @@ const hostObject = new (internalBinding('js_stream').JSStream)();
- {
-   // Unaligned Uint16Array read, with padding in the underlying array buffer.
-   let buf = Buffer.alloc(32 + 9);
--  buf.write('ff0d5c0404addeefbe', 32, 'hex');
-+  buf.write('ff0e5c0404addeefbe', 32, 'hex');
-   buf = buf.slice(32);
- 
-   const expectedResult = os.endianness() === 'LE' ?
Repository: vercel/next.js
Pull request: [devtools]: width/height adjustments

Before:


https://github.com/user-attachments/assets/f4fdda52-452c-4990-818d-0a0db331a02b





After:


https://github.com/user-attachments/assets/ee58f986-96b3-4cf0-920e-aaee3370eea5





Fixes NEXT-4575



Changed files:
filename: packages/next/src/next-devtools/dev-overlay/components/devtools-panel/devtools-panel.tsx
patch: @@ -277,11 +277,7 @@ export const DEVTOOLS_PANEL_STYLES = css`
     }
 
     @media (min-width: 992px) {
-      max-width: 960px;
-    }
-
-    @media (min-width: 1200px) {
-      max-width: 1140px;
+      max-width: 920px;
     }
   }
 
@@ -311,8 +307,11 @@ export const DEVTOOLS_PANEL_STYLES = css`
     box-shadow: var(--shadow-lg);
     position: relative;
     width: 100%;
-    max-height: 75vh;
-    min-height: 450px;
+    height: 350px;
+
+    @media (min-width: 768px) {
+      height: 450px;
+    }
   }
 
   [data-nextjs-devtools-panel-header] {
Repository: vercel/next.js
Pull request: [test] fix browser chunk test failure

Fix the browser chunk test failure introduced on #80948

x-ref: https://github.com/vercel/next.js/actions/runs/15976345262/job/45061901639

```
p test-start test/production/app-dir/browser-chunks/browser-chunks.test.ts
```

Changed files:
filename: packages/next/src/client/react-client-callbacks/error-boundary-callbacks.ts
patch: @@ -13,7 +13,6 @@ import { reportGlobalError } from './report-global-error'
 import { originConsoleError } from '../../next-devtools/userspace/app/errors/intercept-console-error'
 import { ErrorBoundaryHandler } from '../components/error-boundary'
 import DefaultErrorBoundary from '../components/builtin/global-error'
-import { SEGMENT_EXPLORER_SIMULATED_ERROR_MESSAGE } from '../../next-devtools/userspace/app/segment-explorer-node'
 
 export function onCaughtError(
   thrownValue: unknown,
@@ -38,12 +37,15 @@ export function onCaughtError(
         .props.errorComponent === DefaultErrorBoundary)
 
   // Skip the segment explorer triggered error
-  if (
-    process.env.NODE_ENV !== 'production' &&
-    thrownValue instanceof Error &&
-    thrownValue.message === SEGMENT_EXPLORER_SIMULATED_ERROR_MESSAGE
-  ) {
-    return
+  if (process.env.NODE_ENV !== 'production') {
+    const { SEGMENT_EXPLORER_SIMULATED_ERROR_MESSAGE } =
+      require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')
+    if (
+      thrownValue instanceof Error &&
+      thrownValue.message === SEGMENT_EXPLORER_SIMULATED_ERROR_MESSAGE
+    ) {
+      return
+    }
   }
 
   if (isImplicitErrorBoundary) {
Repository: facebook/react
Pull request: fix[devtools/extension]: added a workaround for proxy content script injection in firefox

Changes:
1. [Firefox-only] For some reason, Firefox might try to inject dynamically registered content script in pages like `about:blank`. I couldn't find a way to change this behaviour, `about:` is not a valid scheme, so we can't exclude it and `match_about_blank` flag is not supported in `chrome.scripting.registerContentScripts`. 
2. While navigating the history in Firefox, some content scripts might not be re-injected and still be alive. To handle this, we are now patching `window` with `__REACT_DEVTOOLS_PROXY_INJECTED__` flag, to make sure that proxy is injected and only once. This flag is cleared on `pagehide` event.

Changed files:
filename: packages/react-devtools-extensions/src/background/index.js
patch: @@ -60,6 +60,12 @@ function isNumeric(str: string): boolean {
 
 chrome.runtime.onConnect.addListener(port => {
   if (port.name === 'proxy') {
+    // Might not be present for restricted pages in Firefox
+    if (port.sender?.tab?.id == null) {
+      // Not disconnecting it, so it would not reconnect
+      return;
+    }
+
     // Proxy content script is executed in tab, so it should have it specified.
     const tabId = port.sender.tab.id;
 

filename: packages/react-devtools-extensions/src/contentScripts/proxy.js
patch: @@ -2,22 +2,38 @@
 
 'use strict';
 
-let port = null;
-let backendInitialized: boolean = false;
-
-connectPort();
-sayHelloToBackendManager();
+window.addEventListener('pageshow', function ({target}) {
+  // Firefox's behaviour for injecting this content script can be unpredictable
+  // While navigating the history, some content scripts might not be re-injected and still be alive
+  if (!window.__REACT_DEVTOOLS_PROXY_INJECTED__) {
+    window.__REACT_DEVTOOLS_PROXY_INJECTED__ = true;
 
-// The backend waits to install the global hook until notified by the content script.
-// In the event of a page reload, the content script might be loaded before the backend manager is injected.
-// Because of this we need to poll the backend manager until it has been initialized.
-const intervalID = setInterval(() => {
-  if (backendInitialized) {
-    clearInterval(intervalID);
-  } else {
+    connectPort();
     sayHelloToBackendManager();
+
+    // The backend waits to install the global hook until notified by the content script.
+    // In the event of a page reload, the content script might be loaded before the backend manager is injected.
+    // Because of this we need to poll the backend manager until it has been initialized.
+    const intervalID = setInterval(() => {
+      if (backendInitialized) {
+        clearInterval(intervalID);
+      } else {
+        sayHelloToBackendManager();
+      }
+    }, 500);
+  }
+});
+
+window.addEventListener('pagehide', function ({target}) {
+  if (target !== window.document) {
+    return;
   }
-}, 500);
+
+  delete window.__REACT_DEVTOOLS_PROXY_INJECTED__;
+});
+
+let port = null;
+let backendInitialized: boolean = false;
 
 function sayHelloToBackendManager() {
   window.postMessage(
Repository: denoland/deno
Pull request: fix(types): add `Error.isError` type

<!--
Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label.
-->

fix #28670


Changed files:
filename: cli/tsc/dts/lib.deno.unstable.d.ts
patch: @@ -6352,3 +6352,14 @@ interface DataView<TArrayBuffer extends ArrayBufferLike> {
    */
   setFloat16(byteOffset: number, value: number, littleEndian?: boolean): void;
 }
+
+/**
+ * @category Platform
+ * @experimental
+ */
+interface ErrorConstructor {
+  /**
+   * Indicates whether the argument provided is a built-in Error instance or not.
+   */
+  isError(error: unknown): error is Error;
+}
Repository: ggml-org/llama.cpp
Pull request: Fix webui

*Make sure to read the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) before submitting a PR*

Fixes https://github.com/ggml-org/llama.cpp/issues/15461

Changed files:
filename: tools/server/webui/src/utils/app.context.tsx
patch: @@ -255,7 +255,7 @@ export const AppContextProvider = ({
         if (chunk.error) {
           throw new Error(chunk.error?.message || 'Unknown error');
         }
-        const addedContent = chunk.choices[0].delta.content;
+        const addedContent = chunk.choices[0]?.delta.content;
         const lastContent = pendingMsg.content || '';
         if (addedContent) {
           pendingMsg = {