helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: (small) fix conditional for input_ids and input_embeds in marian

# What does this PR do?

This PR fixes a small bug in the conditional in `modeling_marian.py`. In issue #39542, the issue raiser noticed that both `input_ids` and `input_embeds` were none, but that got filtered into the conditional check for both being not None.

Related to but does not fix #39542 

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?

Ran `pytest tests/models/marian/test_modeling_marian.py` to check for regressions.

## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@ArthurZucker @Rocketknight1

Changed files:
filename: src/transformers/models/marian/modeling_marian.py
patch: @@ -979,16 +979,14 @@ def forward(
 
         # retrieve input_ids and inputs_embeds
         if (input_ids is None) ^ (inputs_embeds is not None):
-            raise ValueError("You cannot specify both decoder_input_ids and decoder_inputs_embeds at the same time")
+            raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
         elif input_ids is not None:
             input = input_ids
             input_shape = input.shape
             input_ids = input_ids.view(-1, input_shape[-1])
         elif inputs_embeds is not None:
             input_shape = inputs_embeds.size()[:-1]
             input = inputs_embeds[:, :, -1]
-        else:
-            raise ValueError("You have to specify either decoder_input_ids or decoder_inputs_embeds")
 
         if inputs_embeds is None:
             inputs_embeds = self.embed_tokens(input)
Repository: vercel/next.js
Pull request: Remove unused code

## What?

Removes completely unused code.

Closes PACK-5288

Changed files:
filename: packages/next/src/build/webpack-config.ts
patch: @@ -2128,7 +2128,7 @@ export default async function getBaseWebpackConfig(
             minimized: true,
           },
         }),
-      hasAppDir && isClient && new AppBuildManifestPlugin({ dev }),
+      hasAppDir && isClient && new AppBuildManifestPlugin(),
       hasAppDir &&
         (isClient
           ? new ClientReferenceManifestPlugin({

filename: packages/next/src/build/webpack/plugins/app-build-manifest-plugin.ts
patch: @@ -7,23 +7,13 @@ import {
 import { getEntrypointFiles } from './build-manifest-plugin'
 import getAppRouteFromEntrypoint from '../../../server/get-app-route-from-entrypoint'
 
-type Options = {
-  dev: boolean
-}
-
 export type AppBuildManifest = {
   pages: Record<string, string[]>
 }
 
 const PLUGIN_NAME = 'AppBuildManifestPlugin'
 
 export class AppBuildManifestPlugin {
-  private readonly dev: boolean
-
-  constructor(options: Options) {
-    this.dev = options.dev
-  }
-
   public apply(compiler: any) {
     compiler.hooks.make.tap(PLUGIN_NAME, (compilation: any) => {
       compilation.hooks.processAssets.tap(
Repository: facebook/react
Pull request: Update RTR readme


Changed files:
filename: packages/react-test-renderer/README.md
patch: @@ -1,12 +1,26 @@
-# `react-test-renderer`
+# `react-test-renderer` (DEPRECATED)
+
+## Deprecation notice
+
+`react-test-renderer` is deprecated and no longer maintained. It will be removed in a future version. As of React 19, you will see a console warning when invoking `ReactTestRenderer.create()`.
+
+### React Testing
+
+This library creates a contrived environment and its APIs encourage introspection on React's internals, which may change without notice causing broken tests. It is instead recommended to use browser-based environments such as jsdom and standard DOM APIs for your assertions.
+
+The React team recommends [`@testing-library/react`](https://testing-library.com/docs/react-testing-library/intro) as a modern alternative that uses standard APIs, avoids internals, and [promotes best practices](https://testing-library.com/docs/guiding-principles).
+
+### React Native Testing
+
+The React team recommends @testing-library/react-native as a replacement for `react-test-renderer` for native integration tests. This React Native testing-library variant follows the same API design as described above and promotes better testing patterns.
+
+## Documentation
 
 This package provides an experimental React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM or a native mobile environment.
 
 Essentially, this package makes it easy to grab a snapshot of the "DOM tree" rendered by a React DOM or React Native component without using a browser or jsdom.
 
-Documentation:
-
-[https://reactjs.org/docs/test-renderer.html](https://reactjs.org/docs/test-renderer.html)
+Documentation: [https://reactjs.org/docs/test-renderer.html](https://reactjs.org/docs/test-renderer.html)
 
 Usage:
Repository: facebook/react
Pull request: Hardcode enableLegacyFBSupport flag

Hardcode enableLegacyFBSupport flag


Changed files:
filename: packages/shared/forks/ReactFeatureFlags.www-dynamic.js
patch: @@ -15,7 +15,6 @@
 
 export const disableIEWorkarounds = __VARIANT__;
 export const enableBigIntSupport = __VARIANT__;
-export const enableLegacyFBSupport = __VARIANT__;
 export const enableUseRefAccessWarning = __VARIANT__;
 export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
 export const enableLazyContextPropagation = __VARIANT__;

filename: packages/shared/forks/ReactFeatureFlags.www.js
patch: @@ -18,7 +18,6 @@ export const {
   disableIEWorkarounds,
   enableBigIntSupport,
   enableTrustedTypesIntegration,
-  enableLegacyFBSupport,
   enableDebugTracing,
   enableUseRefAccessWarning,
   enableLazyContextPropagation,
@@ -57,6 +56,7 @@ export const enableUseEffectEventHook = true;
 export const enableFilterEmptyStringAttributesDOM = true;
 export const enableAsyncActions = true;
 export const disableInputAttributeSyncing = false;
+export const enableLegacyFBSupport = true;
 
 // Logs additional User Timing API marks for use with an experimental profiling tool.
 export const enableSchedulingProfiler: boolean =
Repository: ollama/ollama
Pull request: do not download updates multiple times

We've hit a bug in the Electron auto-updater that prevents the toolbar app from restarting after update when `autoUpdater.checkForUpdates()` is called more than once. The root cause of this is not clear, it may be related to [this Electron issue](https://github.com/electron-userland/electron-builder/issues/7800). In any case we shouldnt be downloading the update multiple times, so prevent checking for updates once we know one is available.

Also log Electron app errors to our server.log file so we can actually diagnose these issues in the wild.

resolves #587 

Changed files:
filename: app/src/index.ts
patch: @@ -5,7 +5,7 @@ import winston from 'winston'
 import 'winston-daily-rotate-file'
 import * as path from 'path'
 
-import { analytics, id } from './telemetry'
+import { v4 as uuidv4 } from 'uuid'
 import { installed } from './install'
 
 require('@electron/remote/main').initialize()
@@ -164,11 +164,11 @@ app.on('before-quit', () => {
 
 function init() {
   if (app.isPackaged) {
-    heartbeat()
     autoUpdater.checkForUpdates()
     setInterval(() => {
-      heartbeat()
-      autoUpdater.checkForUpdates()
+      if (!updateAvailable) {
+        autoUpdater.checkForUpdates()
+      }
     }, 60 * 60 * 1000)
   }
 
@@ -234,28 +234,26 @@ app.on('window-all-closed', () => {
   }
 })
 
-// In this file you can include the rest of your app's specific main process
-// code. You can also put them in separate files and import them here.
-let aid = ''
-try {
-  aid = id()
-} catch (e) {}
+function id(): string {
+  const id = store.get('id') as string
 
-autoUpdater.setFeedURL({
-  url: `https://ollama.ai/api/update?os=${process.platform}&arch=${process.arch}&version=${app.getVersion()}&id=${aid}`,
-})
+  if (id) {
+    return id
+  }
 
-async function heartbeat() {
-  analytics.track({
-    anonymousId: aid,
-    event: 'heartbeat',
-    properties: {
-      version: app.getVersion(),
-    },
-  })
+  const uuid = uuidv4()
+  store.set('id', uuid)
+  return uuid
 }
 
+autoUpdater.setFeedURL({
+  url: `https://ollama.ai/api/update?os=${process.platform}&arch=${
+    process.arch
+  }&version=${app.getVersion()}&id=${id()}`,
+})
+
 autoUpdater.on('error', e => {
+  logger.error(`update check failed - ${e.message}`)
   console.error(`update check failed - ${e.message}`)
 })
 

filename: app/src/telemetry.ts
patch: @@ -1,19 +0,0 @@
-import { Analytics } from '@segment/analytics-node'
-import { v4 as uuidv4 } from 'uuid'
-import Store from 'electron-store'
-
-const store = new Store()
-
-export const analytics = new Analytics({ writeKey: process.env.TELEMETRY_WRITE_KEY || '<empty>' })
-
-export function id(): string {
-  const id = store.get('id') as string
-
-  if (id) {
-    return id
-  }
-
-  const uuid = uuidv4()
-  store.set('id', uuid)
-  return uuid
-}
Repository: facebook/react
Pull request: Remove reference to deleted <Cache> in un-linted file

I missed this in #28698 bc the file isn't linted

Changed files:
filename: packages/react-devtools-shell/src/app/ElementTypes/index.js
patch: @@ -60,17 +60,15 @@ export default function ElementTypes(): React.Node {
           <Context.Consumer>{(value: $FlowFixMe) => null}</Context.Consumer>
         </Context.Provider>
         <StrictMode>
-          <Cache>
-            <Suspense fallback={<div>Loading...</div>}>
-              <ClassComponent />
-              <FunctionComponent />
-              <MemoFunctionComponent />
-              <ForwardRefComponent />
-              <ForwardRefComponentWithAnonymousFunction />
-              <ForwardRefComponentWithCustomDisplayName />
-              <LazyComponent />
-            </Suspense>
-          </Cache>
+          <Suspense fallback={<div>Loading...</div>}>
+            <ClassComponent />
+            <FunctionComponent />
+            <MemoFunctionComponent />
+            <ForwardRefComponent />
+            <ForwardRefComponentWithAnonymousFunction />
+            <ForwardRefComponentWithCustomDisplayName />
+            <LazyComponent />
+          </Suspense>
         </StrictMode>
       </Fragment>
     </Profiler>
Repository: ollama/ollama
Pull request: Update modelfile.md to reflect the usage of num_gpu.

The current docs for the parameter num_gpu are inaccurate for linux.
Ref: https://github.com/jmorganca/ollama/issues/618

Changed files:
filename: docs/modelfile.md
patch: @@ -119,7 +119,7 @@ PARAMETER <parameter> <parametervalue>
 | mirostat_tau   | Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. (Default: 5.0)                                                                                                         | float      | mirostat_tau 5.0     |
 | num_ctx        | Sets the size of the context window used to generate the next token. (Default: 2048)                                                                                                                                                                    | int        | num_ctx 4096         |
 | num_gqa        | The number of GQA groups in the transformer layer. Required for some models, for example it is 8 for llama2:70b                                                                                                                                         | int        | num_gqa 1            |
-| num_gpu        | The number of GPUs to use. On macOS it defaults to 1 to enable metal support, 0 to disable.                                                                                                                                                             | int        | num_gpu 1            |
+| num_gpu        | The number of layers to send to the GPU(s). On macOS it defaults to 1 to enable metal support, 0 to disable.                                                                                                                                            | int        | num_gpu 50           |
 | num_thread     | Sets the number of threads to use during computation. By default, Ollama will detect this for optimal performance. It is recommended to set this value to the number of physical CPU cores your system has (as opposed to the logical number of cores). | int        | num_thread 8         |
 | 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   |
Repository: huggingface/transformers
Pull request: Update `test_spm_converter_bytefallback_warning`

# What does this PR do?

not sure why, but now we get

```
{message : DeprecationWarning('builtin type SwigPyObject has no __module__ attribute'), category : 'DeprecationWarning', filename : '<frozen importlib._bootstrap>', lineno : 241, line : None}
```
which is unrelated to the test goal

Changed files:
filename: tests/utils/test_convert_slow_tokenizer.py
patch: @@ -20,12 +20,16 @@ def test_spm_converter_bytefallback_warning(self):
 
         with warnings.catch_warnings(record=True) as w:
             _ = SpmConverter(original_tokenizer_without_bytefallback)
+        # We are looking for if there is any `UserWarning` with
+        # `The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option which is not implemented in the fast tokenizers.`
+        w = [x for x in w if x.category.__name__ != "DeprecationWarning"]
         self.assertEqual(len(w), 0)
 
         original_tokenizer_with_bytefallback = FakeOriginalTokenizer(vocab_file=spm_model_file_with_bytefallback)
 
         with warnings.catch_warnings(record=True) as w:
             _ = SpmConverter(original_tokenizer_with_bytefallback)
+        w = [x for x in w if x.category.__name__ != "DeprecationWarning"]
         self.assertEqual(len(w), 1)
 
         self.assertIn(
Repository: ggml-org/llama.cpp
Pull request: ggml: fix cuda kernel launch configuration for k_compute_batched_ptrs to support large batch

This PR fixes an invalid CUDA kernel launch issue for `k_compute_batched_ptrs` when `ne12` or `ne13` is large.

* The previous launch used `dim3 block(ne13, ne12)`, which can exceed the maximum threads per block (1024) and trigger `cudaErrorInvalidConfiguration`.
* Updated the launch to use a fixed block size (e.g., 32×32 threads) and compute the required number of blocks in each dimension, ensuring the total threads per block do not exceed CUDA limits.
* No changes were made to the kernel logic itself; only the grid/block configuration was adjusted.



Changed files:
filename: ggml/src/ggml-cuda/ggml-cuda.cu
patch: @@ -1957,8 +1957,15 @@ static void ggml_cuda_mul_mat_batched_cublas_impl(ggml_backend_cuda_context & ct
 
         size_t src1_stride_size = sizeof(cuda_t);
 
-        dim3 block_dims(ne13, ne12);
-        k_compute_batched_ptrs<<<1, block_dims, 0, main_stream>>>(
+        const int threads_x = 16;
+        const int threads_y = 16;
+        dim3 block_dims(threads_x, threads_y);
+
+        dim3 grid_dims(
+            (ne13 + threads_x - 1) / threads_x,
+            (ne12 + threads_y - 1) / threads_y
+        );
+        k_compute_batched_ptrs<<<grid_dims, block_dims, 0, main_stream>>>(
                 src0_ptr, src1_ptr, dst_t,
                 ptrs_src.get(), ptrs_dst.get(),
                 ne12, ne13,

filename: tests/test-backend-ops.cpp
patch: @@ -6697,6 +6697,9 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
             test_cases.emplace_back(new test_mul_mat(type_a, type_b, 16,  1, 1024, {3, 2}, {1, 1}));
             test_cases.emplace_back(new test_mul_mat(type_a, type_b, 16,  8, 1024, {3, 2}, {1, 1}));
             test_cases.emplace_back(new test_mul_mat(type_a, type_b, 16, 16, 1024, {3, 2}, {1, 1}));
+
+            // test cases with large batch size
+            test_cases.emplace_back(new test_mul_mat(type_a, type_b, 16, 8, 256, {1536, 1}, {1, 1}));
         }
     }
     for (ggml_type type_a : other_types) {
Repository: ollama/ollama
Pull request: fedora install fixes

- Do not install `kernel-headers` which is not available or needed in Fedora
- Update CUDA version check to pick-up nvidia package
- Remove ollama bin from temporary directory after install, since I was seeing "no space left" errors upon running models.

Changed files:
filename: scripts/install.sh
patch: @@ -216,12 +216,13 @@ fi
 if ! lsmod | grep -q nvidia; then
     KERNEL_RELEASE="$(uname -r)"
     case $OS_NAME in
-        centos|rhel|rocky|fedora|amzn) $SUDO $PACKAGE_MANAGER -y install kernel-devel-$KERNEL_RELEASE kernel-headers-$KERNEL_RELEASE ;;
+        centos|rhel|rocky|amzn) $SUDO $PACKAGE_MANAGER -y install kernel-devel-$KERNEL_RELEASE kernel-headers-$KERNEL_RELEASE ;;
+        fedora) $SUDO $PACKAGE_MANAGER -y install kernel-devel-$KERNEL_RELEASE ;;
         debian|ubuntu) $SUDO apt-get -y install linux-headers-$KERNEL_RELEASE ;;
         *) exit ;;
     esac
 
-    NVIDIA_CUDA_VERSION=$($SUDO dkms status | awk -F: '/added/ { print $1 }')
+    NVIDIA_CUDA_VERSION=$($SUDO dkms status | awk -F: '/nvidia|added/ { print $1 }')
     if [ -n "$NVIDIA_CUDA_VERSION" ]; then
         $SUDO dkms install $NVIDIA_CUDA_VERSION
     fi
Repository: ggml-org/llama.cpp
Pull request: graph : add clamping to ffn_moe_weights_sum to avoid div-by-zero

I initially added norm topk bias only for BailingMoeV2 in #16063 however it turns out this is present in all models that use `norm_topk_prob`, it was probably left out because there was no easy way to add the bias at the time.

Edit: Updated to use clamping as the purpose of this bias is to avoid division by zero.

[DeepSeekV3](https://github.com/huggingface/transformers/blob/12a50f294d50e3d0e124511f2b6f43625f73ffce/src/transformers/models/deepseek_v3/modeling_deepseek_v3.py#L225-L227)
[Dots1](https://github.com/huggingface/transformers/blob/12a50f294d50e3d0e124511f2b6f43625f73ffce/src/transformers/models/dots1/modeling_dots1.py#L379-L381)
[Glm4Moe](https://github.com/huggingface/transformers/blob/12a50f294d50e3d0e124511f2b6f43625f73ffce/src/transformers/models/glm4_moe/modeling_glm4_moe.py#L406-L408)

Edit: Hmmm, ok, [Lfm2Moe](https://github.com/huggingface/transformers/blob/307c5238546ba1675daabc46050c63ffde25f8e6/src/transformers/models/lfm2_moe/modeling_lfm2_moe.py#L203-L204) uses `1e-6`, not sure why, I assume `1e-20` was originally chosen as an insignificantly small number to offset `0.0`. @tdakhran @paulpak58 @mlabonne?

Edit2: It gets more interesting, some models (like [Ernie4_5_Moe](https://github.com/huggingface/transformers/blob/12a50f294d50e3d0e124511f2b6f43625f73ffce/src/transformers/models/ernie4_5_moe/modeling_ernie4_5_moe.py#L368-L370)) uses clamping (to `1e-12`) to achieve the same thing.

Changed files:
filename: src/llama-graph.cpp
patch: @@ -1009,10 +1009,9 @@ ggml_tensor * llm_graph_context::build_moe_ffn(
         ggml_tensor * weights_sum = ggml_sum_rows(ctx0, weights); // [1, n_tokens]
         cb(weights_sum, "ffn_moe_weights_sum", il);
 
-        if (arch == LLM_ARCH_BAILINGMOE2) {
-            weights_sum = ggml_scale_bias(ctx0, weights_sum, 1.0, 1e-20);
-            cb(weights_sum, "ffn_moe_weights_sum_biased", il);
-        }
+        // Avoid division by zero, clamp to smallest number representable by F16
+        weights_sum = ggml_clamp(ctx0, weights_sum, 6.103515625e-5, INFINITY);
+        cb(weights_sum, "ffn_moe_weights_sum_clamped", il);
 
         weights = ggml_div(ctx0, weights, weights_sum); // [n_expert_used, n_tokens]
         cb(weights, "ffn_moe_weights_norm", il);
Repository: facebook/react
Pull request: Cleanup enableNewBooleanProps

Just updating some comments and shaving of some bytes

Changed files:
filename: packages/react-dom-bindings/src/client/ReactDOMComponent.js
patch: @@ -681,7 +681,7 @@ function setProp(
         }
       }
     }
-    // fallthrough for new boolean props without the flag on
+    // Fallthrough for boolean props that don't have a warning for empty strings.
     case 'allowFullScreen':
     case 'async':
     case 'autoPlay':
@@ -2783,7 +2783,6 @@ function diffHydratedGenericElement(
           serverDifferences,
         );
         continue;
-      // fallthrough for new boolean props without the flag on
       default: {
         if (
           // shouldIgnoreAttribute

filename: packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js
patch: @@ -1301,6 +1301,21 @@ function pushAttribute(
       }
       return;
     }
+    case 'inert': {
+      if (__DEV__) {
+        if (value === '' && !didWarnForNewBooleanPropsWithEmptyValue[name]) {
+          didWarnForNewBooleanPropsWithEmptyValue[name] = true;
+          console.error(
+            'Received an empty string for a boolean attribute `%s`. ' +
+              'This will treat the attribute as if it were false. ' +
+              'Either pass `false` to silence this warning, or ' +
+              'pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.',
+            name,
+          );
+        }
+      }
+    }
+    // Fallthrough for boolean props that don't have a warning for empty strings.
     case 'allowFullScreen':
     case 'async':
     case 'autoPlay':
@@ -1421,30 +1436,6 @@ function pushAttribute(
     case 'xmlSpace':
       pushStringAttribute(target, 'xml:space', value);
       return;
-    case 'inert': {
-      if (__DEV__) {
-        if (value === '' && !didWarnForNewBooleanPropsWithEmptyValue[name]) {
-          didWarnForNewBooleanPropsWithEmptyValue[name] = true;
-          console.error(
-            'Received an empty string for a boolean attribute `%s`. ' +
-              'This will treat the attribute as if it were false. ' +
-              'Either pass `false` to silence this warning, or ' +
-              'pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.',
-            name,
-          );
-        }
-      }
-      // Boolean
-      if (value && typeof value !== 'function' && typeof value !== 'symbol') {
-        target.push(
-          attributeSeparator,
-          stringToChunk(name),
-          attributeEmptyString,
-        );
-      }
-      return;
-    }
-    // fallthrough for new boolean props without the flag on
     default:
       if (
         // shouldIgnoreAttribute