helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: convert : fix block_ff_dim retrieval for lfm2

## Overview

Ensure correct retrieval of `block_ff_dim` value for LFM2.

## Additional information

Recent `transformers` changes pops `block_ff_dim` into `intermediate_size`, see
https://github.com/huggingface/transformers/blob/39f751a538ca67932cab53e6eb5763243674ae2c/src/transformers/models/lfm2/configuration_lfm2.py#L91

# Requirements

<!-- IMPORTANT: Please do NOT delete this section, otherwise your PR may be rejected -->

- I have read and agree with the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md)
- AI usage disclosure: ei

Changed files:
filename: convert_hf_to_gguf.py
patch: @@ -11818,10 +11818,8 @@ class LFM2Model(TextModel):
     model_arch = gguf.MODEL_ARCH.LFM2
 
     def _add_feed_forward_length(self):
-        ff_dim = self.hparams["block_ff_dim"]
-
+        ff_dim = self.find_hparam(["block_ff_dim", "intermediate_size"])
         auto_adjust_ff_dim = self.hparams["block_auto_adjust_ff_dim"]
-        ff_dim = self.hparams["block_ff_dim"]
         ffn_dim_multiplier = self.hparams["block_ffn_dim_multiplier"]
         multiple_of = self.hparams["block_multiple_of"]
Repository: facebook/react
Pull request: [DevTools] Always include the root in the timeline and select it by default

Rebased on #34454.

Always include the root in the timeline even if it has no unique suspenders, since even if it won't suspend, we have to be able to see that and step to one step before the next boundary to see the first boundary that does suspend in its fallback state.

Also, if there's no current selection on initial mount, select the last entry in the timeline. We usually do this with `selectedSuspenseID` but that doesn't happen on initial load. So this does it on initial load if nothing else is selected by then. That way when you reload you get the initial root selected.

There's a problem here because we should really use one source of truth and `selectedSuspenseID` doesn't really do anything now. Either it should be its separate source of truth and you can't show components in the side-panel or it should be derived from the other state.

If it's derived, once there's a selection, e.g. in the root, then even if new timelines load it will never change but that's probably a good thing.

Changed files:
filename: packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTab.js
patch: @@ -34,6 +34,10 @@ import {
   SuspenseTreeStateContext,
 } from './SuspenseTreeContext';
 import {StoreContext, OptionsContext} from '../context';
+import {
+  TreeDispatcherContext,
+  TreeStateContext,
+} from '../Components/TreeContext';
 import Button from '../Button';
 import Toggle from '../Toggle';
 import typeof {SyntheticPointerEvent} from 'react-dom-bindings/src/events/SyntheticEvent';
@@ -181,6 +185,18 @@ function SuspenseTab(_: {}) {
     treeListHorizontalFraction,
   } = state;
 
+  const {inspectedElementID} = useContext(TreeStateContext);
+  const {timeline} = useContext(SuspenseTreeStateContext);
+  const treeDispatch = useContext(TreeDispatcherContext);
+  useLayoutEffect(() => {
+    // If the inspected element is still null and we've loaded a timeline, we can set the initial selection.
+    // TODO: This tab should use its own source of truth instead so we only show suspense boundaries.
+    if (inspectedElementID === null && timeline.length > 0) {
+      const milestone = timeline[timeline.length - 1];
+      treeDispatch({type: 'SELECT_ELEMENT_BY_ID', payload: milestone});
+    }
+  }, [timeline, inspectedElementID]);
+
   useLayoutEffect(() => {
     const wrapperElement = wrapperTreeRef.current;
Repository: ollama/ollama
Pull request: types: send index for tool calls

we start tool calling index at 0 but that is omitted in go

Changed files:
filename: api/types.go
patch: @@ -204,7 +204,7 @@ type ToolCall struct {
 }
 
 type ToolCallFunction struct {
-	Index     int                       `json:"index,omitempty"`
+	Index     int                       `json:"index"`
 	Name      string                    `json:"name"`
 	Arguments ToolCallFunctionArguments `json:"arguments"`
 }

filename: api/types_test.go
patch: @@ -298,6 +298,30 @@ func TestToolFunction_UnmarshalJSON(t *testing.T) {
 	}
 }
 
+func TestToolCallFunction_IndexAlwaysMarshals(t *testing.T) {
+	fn := ToolCallFunction{
+		Name:      "echo",
+		Arguments: ToolCallFunctionArguments{"message": "hi"},
+	}
+
+	data, err := json.Marshal(fn)
+	require.NoError(t, err)
+
+	raw := map[string]any{}
+	require.NoError(t, json.Unmarshal(data, &raw))
+	require.Contains(t, raw, "index")
+	assert.Equal(t, float64(0), raw["index"])
+
+	fn.Index = 3
+	data, err = json.Marshal(fn)
+	require.NoError(t, err)
+
+	raw = map[string]any{}
+	require.NoError(t, json.Unmarshal(data, &raw))
+	require.Contains(t, raw, "index")
+	assert.Equal(t, float64(3), raw["index"])
+}
+
 func TestPropertyType_UnmarshalJSON(t *testing.T) {
 	tests := []struct {
 		name     string
Repository: ollama/ollama
Pull request: llm: Perform eviction when num_gpu is set with new estimates

Currently, if you set num_gpu then this forces the model to load with that number of layers in the current configuration. This is done regardless of any other information, which means that no eviction is performed even if another model is loaded.

This behavior is different from the old estimates (and still happens for models that runs on the llama engine). In those cases, models would be evicted if needed to load at the requested number of layers. That behavior is more useful and less surprising, so this changes the new estimates to match.

Fixes #12580

Changed files:
filename: llm/server.go
patch: @@ -928,7 +928,7 @@ func (s *ollamaServer) createLayout(systemInfo discover.SystemInfo, systemGPUs d
 			}
 		}
 
-		libraryGpuLayers := assignLayers(layers, gl, s.options.NumGPU, lastUsedGPU)
+		libraryGpuLayers := assignLayers(layers, gl, requireFull, s.options.NumGPU, lastUsedGPU)
 		if libraryGpuLayers.Sum() > gpuLayers.Sum() {
 			gpuLayers = libraryGpuLayers
 		}
@@ -994,7 +994,7 @@ nextLayer:
 }
 
 // assignLayers packs the maximum number of layers onto the smallest set of GPUs and comes up with a layer assignment
-func assignLayers(layers []uint64, gpus discover.GpuInfoList, requestedLayers int, lastUsedGPU int) (gpuLayers ml.GPULayersList) {
+func assignLayers(layers []uint64, gpus discover.GpuInfoList, requireFull bool, requestedLayers int, lastUsedGPU int) (gpuLayers ml.GPULayersList) {
 	// If we can't fit everything then prefer offloading layers other than the output layer
 	for range 2 {
 		// requestedLayers may be -1 if nothing was requested
@@ -1003,14 +1003,14 @@ func assignLayers(layers []uint64, gpus discover.GpuInfoList, requestedLayers in
 		if !envconfig.SchedSpread() {
 			for i := lastUsedGPU; i < len(gpus); i++ {
 				// Try to pack things into as few GPUs as possible
-				forceRequest := i == len(gpus)-1
+				forceRequest := i == len(gpus)-1 && !requireFull
 				gpuLayers = findBestFit(layers, gpus[:i+1], requestedLayers, forceRequest)
 				if gpuLayers.Sum() == len(layers) || gpuLayers.Sum() == requestedLayers {
 					break
 				}
 			}
 		} else {
-			gpuLayers = findBestFit(layers, gpus, requestedLayers, true)
+			gpuLayers = findBestFit(layers, gpus, requestedLayers, !requireFull)
 		}
 
 		// We only stop if we've gotten all of the layers - even if we got requestedLayers, we still

filename: llm/server_test.go
patch: @@ -127,6 +127,14 @@ func TestLLMServerFitGPU(t *testing.T) {
 			requireFull: true,
 			expectedErr: ErrLoadRequiredFull,
 		},
+		{
+			name:        "requireFull numGPU",
+			gpus:        []gpu{{id: ml.DeviceID{ID: "gpu0"}, free: 256 * format.MebiByte}},
+			layers:      []int{100 * format.MebiByte, 100 * format.MebiByte, 100 * format.MebiByte, 100 * format.MebiByte},
+			numGPU:      4,
+			requireFull: true,
+			expectedErr: ErrLoadRequiredFull,
+		},
 	}
 
 	for _, tt := range tests {
Repository: rust-lang/rust
Pull request: implement `BinaryHeap::as_mut_slice`

<!-- homu-ignore:start -->
<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r? <reviewer name>
-->
<!-- homu-ignore:end -->

Tracking issue: https://github.com/rust-lang/rust/issues/154009

Changed files:
filename: library/alloc/src/collections/binary_heap/mod.rs
patch: @@ -1364,6 +1364,37 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
         self.data.as_slice()
     }
 
+    /// Returns a mutable slice of all values in the underlying vector.
+    ///
+    /// # Safety
+    ///
+    /// The caller must ensure that the slice remains a max-heap, i.e. for all indices
+    /// `0 < i < slice.len()`, `slice[(i - 1) / 2] >= slice[i]`, before the borrow ends
+    /// and the binary heap is used.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```
+    /// #![feature(binary_heap_as_mut_slice)]
+    ///
+    /// use std::collections::BinaryHeap;
+    ///
+    /// let mut heap = BinaryHeap::<u32>::from([1, 2, 3, 4, 5, 6, 7]);
+    ///
+    /// unsafe {
+    ///     for value in heap.as_mut_slice() {
+    ///         *value = (*value).saturating_mul(2);
+    ///     }
+    /// }
+    /// ```
+    #[must_use]
+    #[unstable(feature = "binary_heap_as_mut_slice", issue = "154009")]
+    pub unsafe fn as_mut_slice(&mut self) -> &mut [T] {
+        self.data.as_mut_slice()
+    }
+
     /// Consumes the `BinaryHeap` and returns the underlying vector
     /// in arbitrary order.
     ///
Repository: ollama/ollama
Pull request: qwen3-coder: support anyOf when parsing tool calls


Changed files:
filename: model/parsers/qwen3coder.go
patch: @@ -276,7 +276,14 @@ func parseToolCall(raw qwenEventRawToolCall, tools []api.Tool) (api.ToolCall, er
 		var paramType api.PropertyType
 		if matchedTool != nil && matchedTool.Function.Parameters.Properties != nil {
 			if prop, ok := matchedTool.Function.Parameters.Properties[parameter.Name]; ok {
-				paramType = prop.Type
+				// Handle anyOf by collecting all types from the union
+				if len(prop.AnyOf) > 0 {
+					for _, anyOfProp := range prop.AnyOf {
+						paramType = append(paramType, anyOfProp.Type...)
+					}
+				} else {
+					paramType = prop.Type
+				}
 			}
 		}
 

filename: model/parsers/qwen3coder_test.go
patch: @@ -977,6 +977,21 @@ func TestQwenToolCallValueParsing(t *testing.T) {
 			raw:       "123",
 			want:      123, // Integer has higher precedence than string
 		},
+		{
+			desc:      "anyOf array or string - with array of objects",
+			paramType: api.PropertyType{"array", "string"},
+			raw:       `[{"content": "task 1", "status": "pending", "priority": "high", "id": "1"}, {"content": "task 2", "status": "completed", "priority": "low", "id": "2"}]`,
+			want: []any{
+				map[string]any{"content": "task 1", "status": "pending", "priority": "high", "id": "1"},
+				map[string]any{"content": "task 2", "status": "completed", "priority": "low", "id": "2"},
+			},
+		},
+		{
+			desc:      "anyOf array or string - with plain string",
+			paramType: api.PropertyType{"array", "string"},
+			raw:       "Error: could not load data",
+			want:      "Error: could not load data",
+		},
 	}
 
 	for _, tc := range cases {
Repository: vercel/next.js
Pull request: [ci] Crash if next-swc could not be loaded when `NEXT_TEST_NATIVE_DIR` is specified

It's never valid to fall back to downloading next-swc if `NEXT_TEST_NATIVE_DIR` is specified. If we built locally, we want to use that version.

E.g. https://github.com/vercel/next.js/actions/runs/22315397194/job/64568286425 fails silently and then falls back to downloading 15.x which is completely wrong.

There's probably a better fallback but CI should always use the binary built (or restored from cache) for a specific workflow.

Changed files:
filename: apps/bundle-analyzer/package.json
patch: @@ -3,10 +3,10 @@
   "version": "16.0.2-canary.16",
   "private": true,
   "scripts": {
-    "build": "cross-env NEXT_TEST_NATIVE_DIR=no next build --no-mangling",
-    "dev": "cross-env NEXT_TEST_NATIVE_DIR=no next dev",
+    "build": "cross-env NEXT_TEST_NATIVE_IGNORE_LOCAL_INSTALL=true NEXT_TEST_NATIVE_DIR=no next build --no-mangling",
+    "dev": "cross-env NEXT_TEST_NATIVE_IGNORE_LOCAL_INSTALL=true NEXT_TEST_NATIVE_DIR=no next dev",
     "lint": "eslint .",
-    "start": "cross-env NEXT_TEST_NATIVE_DIR=no next start"
+    "start": "cross-env NEXT_TEST_NATIVE_IGNORE_LOCAL_INSTALL=true NEXT_TEST_NATIVE_DIR=no next start"
   },
   "dependencies": {
     "@radix-ui/react-dialog": "1.1.4",

filename: packages/next/src/build/swc/index.ts
patch: @@ -1463,7 +1463,8 @@ function loadNative(importPath?: string) {
     ? require(__INTERNAL_CUSTOM_TURBOPACK_BINDINGS)
     : null
   let bindings: RawBindings = customBindings
-  let attempts: any[] = []
+  // callers expect that if loadNative throws, it's an array of strings.
+  let attempts: string[] = []
 
   const NEXT_TEST_NATIVE_DIR = process.env.NEXT_TEST_NATIVE_DIR
   for (const triple of triples) {
@@ -1477,8 +1478,12 @@ function loadNative(importPath?: string) {
           'next-swc build: local built @next/swc from NEXT_TEST_NATIVE_DIR'
         )
         break
-      } catch (e) {}
-    } else {
+      } catch (e: any) {
+        attempts.push(
+          `Failed to load triple ${triple.platformArchABI}: ${e.message ?? e}`
+        )
+      }
+    } else if (process.env.NEXT_TEST_NATIVE_IGNORE_LOCAL_INSTALL !== 'true') {
       try {
         bindings = require(
           `@next/swc/native/next-swc.${triple.platformArchABI}.node`
@@ -1490,6 +1495,10 @@ function loadNative(importPath?: string) {
   }
 
   if (!bindings) {
+    if (NEXT_TEST_NATIVE_DIR) {
+      throw attempts
+    }
+
     for (const triple of triples) {
       let pkg = importPath
         ? path.join(
Repository: rust-lang/rust
Pull request: Fix environ on FreeBSD with cdylib targets that use -Wl,--no-undefined .

Instead of relying on the linker to find the 'environ' symbol, use dlsym.  This fixes using `environ` from cdylibs that link with `-Wl,--no-undefined` .

Fixes rust-lang/rust#153451
Sponsored by:	ConnectWise


Changed files:
filename: library/std/src/sys/env/unix.rs
patch: @@ -38,8 +38,25 @@ pub unsafe fn environ() -> *mut *const *const c_char {
     unsafe { libc::_NSGetEnviron() as *mut *const *const c_char }
 }
 
+// On FreeBSD, environ comes from CRT rather than libc
+#[cfg(target_os = "freebsd")]
+pub unsafe fn environ() -> *mut *const *const c_char {
+    use crate::sync::LazyLock;
+
+    struct Environ(*mut *const *const c_char);
+    unsafe impl Send for Environ {}
+    unsafe impl Sync for Environ {}
+
+    static ENVIRON: LazyLock<Environ> = LazyLock::new(|| {
+        Environ(unsafe {
+            libc::dlsym(libc::RTLD_DEFAULT, c"environ".as_ptr()) as *mut *const *const c_char
+        })
+    });
+    ENVIRON.0
+}
+
 // Use the `environ` static which is part of POSIX.
-#[cfg(not(target_vendor = "apple"))]
+#[cfg(not(any(target_os = "freebsd", target_vendor = "apple")))]
 pub unsafe fn environ() -> *mut *const *const c_char {
     unsafe extern "C" {
         static mut environ: *const *const c_char;
Repository: ggml-org/llama.cpp
Pull request: server : handle unsuccessful sink.write in chunked stream provider

Handle the return value of `sink.write()` in the chunked content provider and return `false` when the write fails, matching `cpp-httplib`'s own streaming contract.

### Changes
- Check the return value of `sink.write()` in `process_handler_response()`
- Return `false` from the content provider when the write is rejected
- Only log a chunk as sent when the write actually succeeds

### Result
The server now properly aborts streaming when the sink rejects a write (e.g. client disconnect), instead of continuing to attempt sends and logging them as successful.

Changed files:
filename: tools/server/server-http.cpp
patch: @@ -397,8 +397,9 @@ static void process_handler_response(server_http_req_ptr && request, server_http
             std::string chunk;
             bool has_next = response->next(chunk);
             if (!chunk.empty()) {
-                // TODO: maybe handle sink.write unsuccessful? for now, we rely on is_connection_closed()
-                sink.write(chunk.data(), chunk.size());
+                if (!sink.write(chunk.data(), chunk.size())) {
+                    return false;
+                }
                 SRV_DBG("http: streamed chunk: %s\n", chunk.c_str());
             }
             if (!has_next) {
Repository: huggingface/transformers
Pull request: Fix image processors `from_dict` backward compatibility with old remote code

# What does this PR do?

Fix backward compatibility with remote code for old processors not defining valid_kwargs (e.g. phi4)

Cc @zucchini-nlp 

Fix `test_processor_override` for phi3v and phi4 in vllm @hmellor 

Changed files:
filename: src/transformers/image_processing_base.py
patch: @@ -369,10 +369,18 @@ def from_dict(cls, image_processor_dict: dict[str, Any], **kwargs):
         image_processor_dict.update({k: v for k, v in kwargs.items() if k in cls.valid_kwargs.__annotations__})
         image_processor = cls(**image_processor_dict)
 
-        # Remove kwargs that are used to initialize the image processor attributes
-        for key in list(kwargs):
-            if hasattr(image_processor, key):
-                kwargs.pop(key)
+        # Apply extra kwargs to instance (BC for remote code, e.g. phi4_multimodal)
+        extra_keys = []
+        for key in reversed(list(kwargs.keys())):
+            if hasattr(image_processor, key) and key not in cls.valid_kwargs.__annotations__:
+                setattr(image_processor, key, kwargs.pop(key, None))
+                extra_keys.append(key)
+        if extra_keys:
+            logger.warning_once(
+                f"Image processor {cls.__name__}: kwargs {extra_keys} were applied for backward compatibility. "
+                f"To avoid this warning, add them to valid_kwargs: create a custom TypedDict extending "
+                f"ImagesKwargs with these keys and set it as the `valid_kwargs` class attribute."
+            )
 
         logger.info(f"Image processor {image_processor}")
         if return_unused_kwargs:
Repository: electron/electron
Pull request: fix: validate response header names and values before AddHeader

Backport of #50123

See that PR for details.


Notes: Fixed an issue where invalid characters in custom protocol or webRequest response header values were not rejected.

Changed files:
filename: shell/browser/net/electron_url_loader_factory.cc
patch: @@ -24,6 +24,7 @@
 #include "net/base/filename_util.h"
 #include "net/http/http_request_headers.h"
 #include "net/http/http_status_code.h"
+#include "net/http/http_util.h"
 #include "net/url_request/redirect_util.h"
 #include "services/network/public/cpp/resource_request.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
@@ -138,13 +139,17 @@ network::mojom::URLResponseHeadPtr ToResponseHead(
   base::DictValue headers;
   if (dict.Get("headers", &headers)) {
     for (const auto iter : headers) {
+      if (!net::HttpUtil::IsValidHeaderName(iter.first))
+        continue;
       if (iter.second.is_string()) {
         // key, value
-        head->headers->AddHeader(iter.first, iter.second.GetString());
+        if (net::HttpUtil::IsValidHeaderValue(iter.second.GetString()))
+          head->headers->AddHeader(iter.first, iter.second.GetString());
       } else if (iter.second.is_list()) {
         // key: [values...]
         for (const auto& item : iter.second.GetList()) {
-          if (item.is_string())
+          if (item.is_string() &&
+              net::HttpUtil::IsValidHeaderValue(item.GetString()))
             head->headers->AddHeader(iter.first, item.GetString());
         }
       } else {

filename: shell/common/gin_converters/net_converter.cc
patch: @@ -19,6 +19,7 @@
 #include "net/cert/x509_certificate.h"
 #include "net/cert/x509_util.h"
 #include "net/http/http_response_headers.h"
+#include "net/http/http_util.h"
 #include "net/http/http_version.h"
 #include "net/url_request/redirect_info.h"
 #include "services/network/public/cpp/data_element.h"
@@ -197,6 +198,10 @@ bool Converter<net::HttpResponseHeaders*>::FromV8(
     }
     std::string value;
     gin::ConvertFromV8(isolate, localStrVal, &value);
+    if (!net::HttpUtil::IsValidHeaderName(key) ||
+        !net::HttpUtil::IsValidHeaderValue(value)) {
+      return false;
+    }
     out->AddHeader(key, value);
     return true;
   };
Repository: ollama/ollama
Pull request: runner: fix shifting on llama runner

This parameter wasn't plumbed through correctly.

Changed files:
filename: runner/llamarunner/runner.go
patch: @@ -162,6 +162,7 @@ func (s *Server) NewSequence(prompt string, images []llm.ImageData, params NewSe
 		embeddingOnly:    params.embedding,
 		stop:             params.stop,
 		numKeep:          params.numKeep,
+		shift:            params.shift,
 	}, nil
 }
Repository: ollama/ollama
Pull request: fix(qwen3): deepseek distill

deepseek's qwen3 distill uses a different rope scheme so support both

Changed files:
filename: fs/ggml/ggml.go
patch: @@ -243,6 +243,7 @@ func (kv KV) OllamaEngineRequired() bool {
 		"gemma3",
 		"gemma3n",
 		"mistral3",
+		"qwen3",
 		"qwen3moe",
 		"llama4",
 		"mllama",
Repository: nodejs/node
Pull request: [v22.x] src: use std::sort in node_metadata for libc++13 compatibility

### Summary
This replaces `std::ranges::sort()` with `std::sort(begin, end, ...)` in `src/node_metadata.cc`.

### Motivation
On armhf + clang-13/libc++13, `std::ranges::sort` is unavailable, causing Node v22 build failure.

### Testing
- Built on armhf (Raspberry Pi 3, 32-bit userspace)
- Command: `make -j2`

### Notes
- No behavior change intended; sorting semantics are unchanged.

Changed files:
filename: src/node_metadata.cc
patch: @@ -1,4 +1,5 @@
 #include "node_metadata.h"
+#include <algorithm>
 #include "acorn_version.h"
 #include "ada.h"
 #include "amaro_version.h"
@@ -177,8 +178,9 @@ Metadata::Versions::pairs() const {
   NODE_VERSIONS_KEYS(V)
 #undef V
 
-  std::ranges::sort(versions_array,
-                    [](auto& a, auto& b) { return a.first < b.first; });
+  std::sort(versions_array.begin(),
+            versions_array.end(),
+            [](auto& a, auto& b) { return a.first < b.first; });
 
   return versions_array;
 }
Repository: huggingface/transformers
Pull request: Fix local dataset loading priority in run_image_classification_no_tra…

## What does this PR do?

This PR fixes an issue in `run_image_classification_no_trainer.py`
where the script always loaded `dataset_name` (e.g., CIFAR10)
even when `--train_dir` or `--validation_dir` was provided.

Now, when local dataset directories are specified,
the script prioritizes loading the local `imagefolder`
dataset instead of falling back to `dataset_name`.

## Reproduction

Before fix:
Running with --train_dir still loaded CIFAR10 (10 classes).

After fix:
Running with a local beans dataset correctly loads 3 classes:
- angular_leaf_spot
- bean_rust
- healthy

Example:

accelerate launch run_image_classification_no_trainer.py \
  --train_dir ./beans/train \
  --validation_dir ./beans/validation
  
Fixes #44190

Changed files:
filename: examples/pytorch/image-classification/run_image_classification_no_trainer.py
patch: @@ -291,8 +291,9 @@ def main():
 
     # In distributed training, the load_dataset function guarantees that only one local process can concurrently
     # download the dataset.
-    if args.dataset_name is not None:
-        # Downloading and loading a dataset from the hub.
+    if (
+        args.dataset_name is not None and args.train_dir is None and args.validation_dir is None
+    ):  # Downloading and loading a dataset from the hub.
         dataset = load_dataset(args.dataset_name, trust_remote_code=args.trust_remote_code)
     else:
         data_files = {}