helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: Enable the `--use-temp-file` cli flag

I was having trouble converting `mistral-community/Mixtral-8x22B-v0.1` without this. 

This PR only makes the feature accessible from the cli arguments parser, and passes the flag. 

The part where `GGUFWriter` supports the `tempfile` library was already in place. 

I tested this with the mentioned model only and it worked. I broke into the debugger to inspect the `args` object when calling the script with and without the new flag, and the expected behavior was observed.

Changed files:
filename: convert-hf-to-gguf.py
patch: @@ -43,17 +43,18 @@ class SentencePieceTokenTypes(IntEnum):
 class Model(ABC):
     _model_classes: dict[str, type[Model]] = {}
 
-    def __init__(self, dir_model: Path, ftype: int, fname_out: Path, is_big_endian: bool):
+    def __init__(self, dir_model: Path, ftype: int, fname_out: Path, is_big_endian: bool, use_temp_file: bool):
         self.dir_model = dir_model
         self.ftype = ftype
         self.fname_out = fname_out
         self.is_big_endian = is_big_endian
         self.endianess = gguf.GGUFEndian.BIG if is_big_endian else gguf.GGUFEndian.LITTLE
+        self.use_temp_file = use_temp_file
         self.is_safetensors = self._is_model_safetensors()
         self.num_parts = Model.count_model_parts(self.dir_model, ".safetensors" if self.is_safetensors else ".bin")
         self.part_names = self._get_part_names()
         self.hparams = Model.load_hparams(self.dir_model)
-        self.gguf_writer = gguf.GGUFWriter(fname_out, gguf.MODEL_ARCH_NAMES[self.model_arch], endianess=self.endianess, use_temp_file=False)
+        self.gguf_writer = gguf.GGUFWriter(fname_out, gguf.MODEL_ARCH_NAMES[self.model_arch], endianess=self.endianess, use_temp_file=self.use_temp_file)
         self.block_count = self.find_hparam(["n_layers", "num_hidden_layers", "n_layer"])
 
     @property
@@ -2459,6 +2460,7 @@ def parse_args() -> argparse.Namespace:
         "model", type=Path,
         help="directory containing model file",
     )
+    parser.add_argument("--use-temp-file", action="store_true", help="use the tempfile library while processing (helpful when running out of memory, process killed)")
 
     return parser.parse_args()
 
@@ -2502,7 +2504,7 @@ def main() -> None:
 
     with torch.inference_mode():
         model_class = Model.from_model_architecture(hparams["architectures"][0])
-        model_instance = model_class(dir_model, ftype_map[args.outtype], fname_out, args.bigendian)
+        model_instance = model_class(dir_model, ftype_map[args.outtype], fname_out, args.bigendian, args.use_temp_file)
 
         print("Set model parameters")
         model_instance.set_gguf_parameters()
Repository: facebook/react
Pull request: Remove unnecessary type cast

## Summary
<details>
<summary>Increases type coverage from 82.50% to 82.66% :muscle: ... </summary>

... just because we got rid of one expression.

```bash
$ git checkout master
$ npx flow coverage packages/react-dom/src/client/ReactDOMLegacy.js
Covered: 82.50% (429 of 520 expressions)

$ git checkout eps1lon/chore/root-coverage
$ npx flow coverage packages/react-dom/src/client/ReactDOMLegacy.js 
Covered: 82.66% (429 of 519 expressions)
```
</details>

TODO comment was added in 1b55ad2a4b24b06ce34f77a943396228641d74a1. The flow bug was likely fixed during an update to flow since the type didn't change in the meantime.

## Test Plan

- [x] CI green


Changed files:
filename: packages/react-dom/src/client/ReactDOMLegacy.js
patch: @@ -9,6 +9,7 @@
 
 import type {Container} from './ReactDOMHostConfig';
 import type {RootType} from './ReactDOMRoot';
+import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
 import type {ReactNodeList} from 'shared/ReactTypes';
 
 import {
@@ -184,10 +185,8 @@ function legacyRenderSubtreeIntoContainer(
     warnOnInvalidCallback(callback === undefined ? null : callback, 'render');
   }
 
-  // TODO: Without `any` type, Flow says "Property cannot be accessed on any
-  // member of intersection type." Whyyyyyy.
-  let root: RootType = (container._reactRootContainer: any);
-  let fiberRoot;
+  let root = container._reactRootContainer;
+  let fiberRoot: FiberRoot;
   if (!root) {
     // Initial mount
     root = container._reactRootContainer = legacyCreateRootFromDOMContainer(
Repository: facebook/react
Pull request: Update supported devEngines

## Summary

Change `devEngines` to indicate the required node version to perform __every__ development workflow.

With `node@12.16.0` `yarn build react-server-dom-webpack/node-loader` throws with 
```
$ node ./scripts/rollup/build.js react-server-dom-webpack/node-loader
/home/eps1lon/Development/forks/react/scripts/rollup/build.js:44
  throw err;
  ^

Error: Cannot find module 'react-server-dom-webpack/node-loader'
Require stack:
- /home/eps1lon/Development/forks/react/scripts/rollup/build.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.resolve (internal/modules/cjs/helpers.js:83:19)
    at createBundle (/home/eps1lon/Development/forks/react/scripts/rollup/build.js:556:13)
    at buildEverything (/home/eps1lon/Development/forks/react/scripts/rollup/build.js:776:11) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/eps1lon/Development/forks/react/scripts/rollup/build.js' ]
}
error Command failed with exit code 1.
```

Probably because of the way `exports` field in `packages/react-server-dom-webpack/package.json` is constructed.

<details>

```json
"exports": {
    ".": "./index.js",
    "./plugin": "./plugin.js",
    "./writer": {
      "react-server": {
        "node": "./writer.node.server.js",
        "browser": "./writer.browser.server.js"
      },
      "default": "./writer.js"
    },
    "./writer.node.server": "./writer.node.server.js",
    "./writer.browser.server": "./writer.browser.server.js",
    "./node-loader": "./esm/react-server-dom-webpack-node-loader.js",
    "./node-register": "./node-register.js",
    "./package.json": "./package.json"
  },
```
</details>

With `node@12.17.0` the command passes.


## Test Plan

- [x] CI green
- [x] `yarn build react-server-dom-webpack/node-loader` passes in `node@12.17.0` and `node@16.0.0` 


Changed files:
filename: .codesandbox/ci.json
patch: @@ -1,6 +1,7 @@
 {
   "packages": ["packages/react", "packages/react-dom", "packages/scheduler"],
   "buildCommand": "build --type=NODE react/index,react-dom/index,react-dom/server,react-dom/test-utils,scheduler/index,scheduler/unstable_no_dom,react/jsx-runtime,react/jsx-dev-runtime",
+  "node": "12",
   "publishDirectory": {
     "react": "build/node_modules/react",
     "react-dom": "build/node_modules/react-dom",

filename: package.json
patch: @@ -100,7 +100,7 @@
     "yargs": "^15.3.1"
   },
   "devEngines": {
-    "node": "8.x || 9.x || 10.x || 11.x || 12.x || 13.x || 14.x || 15.x"
+    "node": "^12.17.0 || 13.x || 14.x || 15.x || 16.x"
   },
   "jest": {
     "testRegex": "/scripts/jest/dont-run-jest-directly\\.js$"
Repository: ggml-org/llama.cpp
Pull request: cmake: Fix ggml backend dependencies and installation

This makes the following changes to ggml backends:

1. Fix dependencies between `ggml`, `ggml-base` and backends. Linking a static build of `libllama` using cmake is currently broken because dependencies are listed in the wrong order in linker commands. Backends should only link to `ggml-base`, and `ggml` should link to `ggml-base` and the backends.
2. Fix the installation directory of ggml backends. On Fedora (and probably some other linux distros) `libllama`, `libggml` and `libggml-base`  are installed in the `/lib64` directory, but ggml backends are installed in `/lib`. That is because ggml backends have their installation directory set before `GNUInstallDirs` is included.

Changed files:
filename: ggml/CMakeLists.txt
patch: @@ -212,6 +212,8 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
 
 find_package(Threads REQUIRED)
 
+include(GNUInstallDirs)
+
 #
 # build the library
 #
@@ -235,7 +237,6 @@ endif ()
 # install
 #
 
-include(GNUInstallDirs)
 include(CMakePackageConfigHelpers)
 
 # all public headers

filename: ggml/cmake/ggml-config.cmake.in
patch: @@ -112,7 +112,7 @@ foreach(_ggml_backend ${GGML_AVAILABLE_BACKENDS})
 
     string(REGEX MATCH "^ggml-cpu" is_cpu_variant "${_ggml_backend}")
     if(is_cpu_variant)
-        list(APPEND GGML_CPU_INTERFACE_LINK_LIBRARIES "ggml::ggml" "ggml::ggml-base")
+        list(APPEND GGML_CPU_INTERFACE_LINK_LIBRARIES "ggml::ggml-base")
         set_target_properties(ggml::${_ggml_backend}
            PROPERTIES
                INTERFACE_LINK_LIBRARIES "${GGML_CPU_INTERFACE_LINK_LIBRARIES}")
@@ -124,7 +124,7 @@ foreach(_ggml_backend ${GGML_AVAILABLE_BACKENDS})
         endif()
 
     else()
-        list(APPEND ${_ggml_backend_pfx}_INTERFACE_LINK_LIBRARIES "ggml::ggml" "ggml::ggml-base")
+        list(APPEND ${_ggml_backend_pfx}_INTERFACE_LINK_LIBRARIES "ggml::ggml-base")
         set_target_properties(ggml::${_ggml_backend}
             PROPERTIES
                 INTERFACE_LINK_LIBRARIES "${${_ggml_backend_pfx}_INTERFACE_LINK_LIBRARIES}")
@@ -139,6 +139,11 @@ foreach(_ggml_backend ${GGML_AVAILABLE_BACKENDS})
     list(APPEND _ggml_all_targets ggml::${_ggml_backend})
 endforeach()
 
+list(APPEND GGML_INTERFACE_LINK_LIBRARIES ggml::ggml-base "${_ggml_all_targets}")
+set_target_properties(ggml::ggml
+    PROPERTIES
+        INTERFACE_LINK_LIBRARIES "${GGML_INTERFACE_LINK_LIBRARIES}")
+
 add_library(ggml::all INTERFACE IMPORTED)
 set_target_properties(ggml::all
     PROPERTIES
Repository: facebook/react
Pull request: [Fizz] Switch the isPrimaryRender flag based on the stream config

It's possible for Fizz and Fiber to co-exist for example. If they both end up using the same context field then that can clash.

It's also possible for e.g. DOM and ART to co-exist on the server.

Or Legacy Fizz DOM and Modern Fizz DOM.

Instead of protecting against every possible clash, I just took the most common one. E.g. renderToString clashing with either Fiber or Modern Fizz.

I flip it in the legacy stream config so that renderToString use the secondary Context fields. https://github.com/facebook/react/pull/21276

Changed files:
filename: packages/react-dom/src/server/ReactDOMServerFormatConfig.js
patch: @@ -23,6 +23,7 @@ import {
   writeChunk,
   stringToChunk,
   stringToPrecomputedChunk,
+  isPrimaryStreamConfig,
 } from 'react-server/src/ReactServerStreamConfig';
 
 import {
@@ -50,7 +51,7 @@ import isArray from 'shared/isArray';
 
 // Used to distinguish these contexts from ones used in other renderers.
 // E.g. this can be used to distinguish legacy renderers from this modern one.
-export const isPrimaryRenderer = true;
+export const isPrimaryRenderer = isPrimaryStreamConfig;
 
 // Per response, global state that is not contextual to the rendering subtree.
 export type ResponseState = {

filename: packages/react-server/src/ReactServerStreamConfigBrowser.js
patch: @@ -12,6 +12,8 @@ export type Destination = ReadableStreamController;
 export type PrecomputedChunk = Uint8Array;
 export type Chunk = Uint8Array;
 
+export const isPrimaryStreamConfig = true;
+
 export function scheduleWork(callback: () => void) {
   callback();
 }

filename: packages/react-server/src/ReactServerStreamConfigNode.js
patch: @@ -21,6 +21,8 @@ export type Destination = Writable & MightBeFlushable;
 export type PrecomputedChunk = Uint8Array;
 export type Chunk = string;
 
+export const isPrimaryStreamConfig = true;
+
 export function scheduleWork(callback: () => void) {
   setImmediate(callback);
 }
Repository: huggingface/transformers
Pull request: Fix bamba tests amd

Excepted results where missing for amd gpus

Changed files:
filename: tests/models/bamba/test_modeling_bamba.py
patch: @@ -510,7 +510,7 @@ def test_simple_generate(self):
         EXPECTED_TEXTS = {
             # 7: "",
             8: "
Hey how are you doing on this lovely evening? I hope you are all having a good time.",
-            #  9: """,
+            9: "
Hey how are you doing on this lovely evening? I hope you are doing well. I am here",
         }
 
         self.model.to(torch_device)
@@ -549,7 +549,10 @@ def test_simple_batched_generate_with_padding(self):
                 "
Hey how are you doing on this lovely evening? I hope you are doing well. I am here",
                 "!!!
I am late! I need to get to work! I have to get to the",
             ],
-            9: [],
+            9: [
+                "
Hey how are you doing on this lovely evening? I hope you are doing well. I am here",
+                "!!!
I am late! I need to be at the airport in 20 minutes! I",
+            ],
         }
 
         self.model.to(torch_device)
Repository: ggml-org/llama.cpp
Pull request: llava : add struct for FFI bindgen

Rust bindgen failed to generate bindings: ClangDiagnostic("./llama.cpp/examples/llava/clip.h:78:92: error: must use 'struct' tag to refer to type 'clip_image_u8'\n")


Changed files:
filename: examples/llava/clip.h
patch: @@ -74,8 +74,11 @@ CLIP_API void clip_image_f32_free(struct clip_image_f32 * img);
 CLIP_API void clip_image_u8_batch_free (struct clip_image_u8_batch  * batch);
 CLIP_API void clip_image_f32_batch_free(struct clip_image_f32_batch * batch);
 
-/** build image from pixels decoded by other libraries instead of stb_image.h for better performance. The memory layout is RGBRGBRGB..., input buffer length must be 3*nx*ny bytes */
-CLIP_API void clip_build_img_from_pixels(const unsigned char * rgb_pixels, int nx, int ny, clip_image_u8 * img);
+/**
+ * Build image from pixels decoded by other libraries instead of stb_image.h for better performance.
+ * The memory layout is RGBRGBRGB..., input buffer length must be 3*nx*ny bytes
+ */
+CLIP_API void clip_build_img_from_pixels(const unsigned char * rgb_pixels, int nx, int ny, struct clip_image_u8 * img);
 
 CLIP_API bool clip_image_load_from_file(const char * fname, struct clip_image_u8 * img);
Repository: vercel/next.js
Pull request: [dev-overlay] Fix stacking order of highlighted line



https://github.com/user-attachments/assets/7d72c1bc-c15e-4950-961e-25bece0c0b19



---

Closes NDX-979

Changed files:
filename: packages/next/src/client/components/react-dev-overlay/ui/components/code-frame/code-frame.tsx
patch: @@ -176,6 +176,7 @@ export const CODE_FRAME_STYLES = `
 
   [data-nextjs-codeframe-line][data-nextjs-codeframe-line--errored="true"] {
     position: relative;
+    isolation: isolate;
 
     > span { 
       position: relative;
Repository: huggingface/transformers
Pull request: Remove unused code

The tokenizer `from_pretrained` code has a dead code path (a list that is never appended to), so this PR removes it!

Changed files:
filename: src/transformers/tokenization_utils_base.py
patch: @@ -2012,7 +2012,6 @@ def from_pretrained(
 
         # Get files from url, cache, or disk depending on the case
         resolved_vocab_files = {}
-        unresolved_files = []
         for file_id, file_path in vocab_files.items():
             if file_path is None:
                 resolved_vocab_files[file_id] = None
@@ -2041,12 +2040,6 @@ def from_pretrained(
                 )
                 commit_hash = extract_commit_hash(resolved_vocab_files[file_id], commit_hash)
 
-        if len(unresolved_files) > 0:
-            logger.info(
-                f"Can't load following files from cache: {unresolved_files} and cannot check if these "
-                "files are necessary for the tokenizer to operate."
-            )
-
         # If one passes a GGUF file path to `gguf_file` there is no need for this check as the tokenizer will be
         # loaded directly from the GGUF file.
         if all(full_file_name is None for full_file_name in resolved_vocab_files.values()) and not gguf_file: