helloadhavan/github_issues huggingface dataset:
Repository: ollama/ollama
Pull request: [fix] /bye and /exit are now treated as prefixes

instead of being treated as entire lines which doesn't align with the way the rest of the commands are treated
it was a little annoying typing "/bye " and not having it work as expected

Changed files:
filename: cmd/interactive.go
patch: @@ -470,7 +470,7 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
 			} else {
 				usage()
 			}
-		case line == "/exit", line == "/bye":
+		case strings.HasPrefix(line, "/exit"), strings.HasPrefix(line, "/bye"):
 			return nil
 		case strings.HasPrefix(line, "/"):
 			args := strings.Fields(line)
Repository: facebook/react
Pull request: [fix] replace polyfill.io with cloudflare equivalent

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn test --debug --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

This PR will replace the reference to `polyfill.io` with a Cloudflare equivalent. This is needed because `polyfill.io` was bought by a Chinese company and started serving malware embedded in the polyfill JS files.

Source: [https://sansec.io/research/polyfill-supply-chain-attack](https://sansec.io/research/polyfill-supply-chain-attack)

<!--
 Explain the **motivation** for making this change. What existing problem does the pull request solve?
-->

## How did you test this change?

I ran the command `yarn dev` in `fixtures/dom` directory. I opened `http://localhost:3000/hydration?version=15.0.0-rc.2` on my browser. I checked if the page works like before. And if the `polyfill.min.js` was loaded using the developer tools. Attached the screenshot for the same.

![image](https://github.com/facebook/react/assets/29162020/e07c9653-5036-490a-a349-c9d732e2acf2)


<!--
  Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface.
  How exactly did you verify that your PR solves the issue you wanted to solve?
  If you leave this empty, your PR will very likely be closed.
-->


Changed files:
filename: fixtures/dom/public/renderer.html
patch: @@ -80,7 +80,7 @@
 
     <div id="output"></div>
 
-    <script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
+    <script src="https://cdnjs.cloudflare.com/polyfill/v2/polyfill.min.js"></script>
     <script src="renderer.js"></script>
   </body>
 </html>
Repository: nodejs/node
Pull request: deps: V8: cherry-pick 56816d76c121

Original commit message:
```    
[loong64] Supplement a LoongArch support in include/v8config.h
    
Change-Id: I658c1b781163bcd3ca39bfceb74aef9d255247b8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3894795
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Liu Yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#83374}
```
Refs: https://github.com/v8/v8/commit/56816d76c121c8dd5b406dc6019350eee05f4abd

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.18',
+    'v8_embedder_string': '-node.19',
 
     ##### V8 defaults for Node.js #####
 

filename: deps/v8/include/v8config.h
patch: @@ -703,6 +703,8 @@ V8 shared library set USING_V8_SHARED.
 #define V8_TARGET_ARCH_ARM 1
 #elif defined(__mips64)
 #define V8_TARGET_ARCH_MIPS64 1
+#elif defined(__loongarch64)
+#define V8_TARGET_ARCH_LOONG64 1
 #elif defined(_ARCH_PPC64)
 #define V8_TARGET_ARCH_PPC64 1
 #elif defined(_ARCH_PPC)
Repository: denoland/deno
Pull request: fix(ext/node): use primordials in `_fs_ftruncate.ts`

Towards #24236

<!--
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.
-->


Changed files:
filename: ext/node/polyfills/_fs/_fs_ftruncate.ts
patch: @@ -1,10 +1,15 @@
 // Copyright 2018-2026 the Deno authors. MIT license.
 
-// TODO(petamoriken): enable prefer-primordials for node polyfills
-// deno-lint-ignore-file prefer-primordials
-
-import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { primordials } from "ext:core/mod.js";
+import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
 import { FsFile } from "ext:deno_fs/30_fs.js";
+import { promisify } from "ext:deno_node/internal/util.mjs";
+
+const {
+  Error,
+  PromisePrototypeThen,
+  SymbolFor,
+} = primordials;
 
 export function ftruncate(
   fd: number,
@@ -20,20 +25,18 @@ export function ftruncate(
 
   if (!callback) throw new Error("No callback function supplied");
 
-  new FsFile(fd, Symbol.for("Deno.internal.FsFile"))
-    .truncate(len)
-    .then(() => callback(null), callback);
+  PromisePrototypeThen(
+    new FsFile(fd, SymbolFor("Deno.internal.FsFile")).truncate(len),
+    () => callback(null),
+    callback,
+  );
 }
 
 export function ftruncateSync(fd: number, len?: number) {
-  new FsFile(fd, Symbol.for("Deno.internal.FsFile")).truncateSync(len);
+  new FsFile(fd, SymbolFor("Deno.internal.FsFile")).truncateSync(len);
 }
 
-export function ftruncatePromise(fd: number, len?: number): Promise<void> {
-  return new Promise((resolve, reject) => {
-    ftruncate(fd, len, (err) => {
-      if (err) reject(err);
-      else resolve();
-    });
-  });
-}
+export const ftruncatePromise = promisify(ftruncate) as (
+  fd: number,
+  len?: number,
+) => Promise<void>;
Repository: ollama/ollama
Pull request: add faqs for memory pre-loading and the keep_alive setting


Changed files:
filename: docs/faq.md
patch: @@ -131,3 +131,37 @@ This can impact both installing Ollama, as well as downloading models.
 Open `Control Panel > Networking and Internet > View network status and tasks` and click on `Change adapter settings` on the left panel. Find the `vEthernel (WSL)` adapter, right click and select `Properties`.
 Click on `Configure` and open the `Advanced` tab. Search through each of the properties until you find `Large Send Offload Version 2 (IPv4)` and `Large Send Offload Version 2 (IPv6)`. *Disable* both of these
 properties.
+
+## How can I pre-load a model to get faster response times?
+
+If you are using the API you can preload a model by sending the Ollama server an empty request. This works with both the `/api/generate` and `/api/chat` API endpoints.
+
+To preload the mistral model using the generate endpoint, use:
+```shell
+curl http://localhost:11434/api/generate -d '{"model": "mistral"}'
+```
+
+To use the chat completions endpoint, use:
+```shell
+curl http://localhost:11434/api/chat -d '{"model": "mistral"}'
+```
+
+## How do I keep a model loaded in memory or make it unload immediately?
+
+By default models are kept in memory for 5 minutes before being unloaded. This allows for quicker response times if you are making numerous requests to the LLM. You may, however, want to free up the memory before the 5 minutes have elapsed or keep the model loaded indefinitely. Use the `keep_alive` parameter with either the `/api/generate` and `/api/chat` API endpoints to control how long the model is left in memory.
+
+The `keep_alive` parameter can be set to:
+* a duration string (such as "10m" or "24h")
+* a number in seconds (such as 3600)
+* any negative number which will keep the model loaded in memory (e.g. -1 or "-1m")
+* '0' which will unload the model immediately after generating a response
+
+For example, to preload a model and leave it in memory use:
+```shell
+curl http://localhost:11434/api/generate -d '{"model": "llama2", "keep_alive": -1}'
+```
+
+To unload the model and free up memory use:
+```shell
+curl http://localhost:11434/api/generate -d '{"model": "llama2", "keep_alive": 0}'
+```
\ No newline at end of file
Repository: ggml-org/llama.cpp
Pull request: ggml : use svcntb() for SVE vector length detection

This allows SVE on FreeBSD and others

Changed files:
filename: ggml/src/ggml-cpu/ggml-cpu.c
patch: @@ -683,22 +683,14 @@ bool ggml_is_numa(void) {
 }
 
 #if defined(__ARM_ARCH)
-
-#if defined(__linux__) && defined(__aarch64__)
-#include <sys/auxv.h>
-#endif
-
-static void ggml_init_arm_arch_features(void) {
 #if defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
-#if defined(__linux__)
-    ggml_arm_arch_features.sve_cnt = PR_SVE_VL_LEN_MASK & prctl(PR_SVE_GET_VL);
+#include <arm_sve.h>
+static void ggml_init_arm_arch_features(void) {
+    ggml_arm_arch_features.sve_cnt = svcntb();
+}
 #else
-    // TODO: add support of SVE for non-linux systems
-#error "TODO: SVE is not supported on this platform. To use SVE, sve_cnt needs to be initialized here."
-#endif
+static void ggml_init_arm_arch_features(void) {}
 #endif
-}
-
 #endif // __ARM_ARCH
 
 struct ggml_tensor * ggml_new_i32(struct ggml_context * ctx, int32_t value) {
Repository: vercel/next.js
Pull request: Turbopack: trace all state changes

### What?

add a tracing span when state changes to make this visible in the tracing.

follow up from #83977

Closes PACK-5517

Changed files:
filename: turbopack/crates/turbo-tasks/src/state.rs
patch: @@ -35,6 +35,7 @@ impl<T> StateInner<T> {
 
     pub fn set_unconditionally(&mut self, value: T) {
         self.value = value;
+        let _span = trace_span!("state value changed", value_type = type_name::<T>()).entered();
         for invalidator in take(&mut self.invalidators) {
             invalidator.invalidate();
         }
@@ -44,6 +45,7 @@ impl<T> StateInner<T> {
         if !update(&mut self.value) {
             return false;
         }
+        let _span = trace_span!("state value changed", value_type = type_name::<T>()).entered();
         for invalidator in take(&mut self.invalidators) {
             invalidator.invalidate();
         }
@@ -89,6 +91,7 @@ impl<T> DerefMut for StateRef<'_, T> {
 impl<T> Drop for StateRef<'_, T> {
     fn drop(&mut self) {
         if self.mutated {
+            let _span = trace_span!("state value changed", value_type = type_name::<T>()).entered();
             for invalidator in take(&mut self.inner.invalidators) {
                 invalidator.invalidate();
             }
Repository: ollama/ollama
Pull request: Document setting server vars for windows

Fixes #2546

Changed files:
filename: docs/faq.md
patch: @@ -46,6 +46,21 @@ If Ollama is run as a systemd service, environment variables should be set using
    systemctl restart ollama
    ```
 
+### Setting environment variables on Windows
+
+On windows, Ollama inherits your user and system environment variables.
+
+1. First Quit Ollama by clicking on it in the task bar
+
+2. Edit system environment variables from the control panel
+
+3. Edit or create New variable(s) for your user account for `OLLAMA_HOST`, `OLLAMA_MODELS`, etc.
+
+4. Click OK/Apply to save 
+
+5. Run `ollama` from a new terminal window 
+
+
 ## How can I expose Ollama on my network?
 
 Ollama binds 127.0.0.1 port 11434 by default. Change the bind address with the `OLLAMA_HOST` environment variable.
Repository: facebook/react
Pull request: Remove isPrimaryRenderer from Flight Server Config

This was used for Context but since ReactFlightNewContext is gone now this is no longer used.



Changed files:
filename: packages/react-dom-bindings/src/server/ReactFlightServerConfigDOM.js
patch: @@ -20,10 +20,6 @@ import type {
 // but it does not have any exports
 import './ReactDOMFlightServerHostDispatcher';
 
-// 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;
-
 // We use zero to represent the absence of an explicit precedence because it is
 // small, smaller than how we encode undefined, and is unambiguous. We could use
 // a different tuple structure to encode this instead but this makes the runtime

filename: packages/react-server/src/forks/ReactFlightServerConfig.custom.js
patch: @@ -19,8 +19,6 @@ export type HintCode = any;
 // eslint-disable-next-line no-unused-vars
 export type HintModel<T: any> = any;
 
-export const isPrimaryRenderer = false;
-
 export const supportsRequestStorage = false;
 export const requestStorage: AsyncLocalStorage<Request | void> = (null: any);
Repository: ggml-org/llama.cpp
Pull request: convert: add error message for mistral3 quantized weight

Adding this message to avoid user flooding us with issues

Changed files:
filename: convert_hf_to_gguf.py
patch: @@ -2842,6 +2842,10 @@ def set_gguf_parameters(self):
             self.gguf_writer.add_attn_temperature_scale(rope_params["llama_4_scaling_beta"])
 
     def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None):
+        # TODO: probably not worth supporting quantized weight, as official BF16 is also available
+        if name.endswith("weight_scale_inv"):
+            raise ValueError("This is a quantized weight, please use BF16 weight instead")
+
         name = name.replace("language_model.", "")
         if "multi_modal_projector" in name or "vision_tower" in name:
             return []
Repository: electron/electron
Pull request: build: update_depot_tools on initial install

Release builds have been seeing the error:
```
python3_bin_reldir.txt not found. need to initialize depot_tools by
running gclient, update_depot_tools or ensure_bootstrap.
``` 
(eg https://github.com/electron/electron/actions/runs/15114398562/job/42508751795#step:23:44284)

This PR ensures that python is setup for proper use from depot_tools which should eliminate this issue.

#### Description of Change

<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [x] [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: <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->none


Changed files:
filename: .github/actions/install-build-tools/action.yml
patch: @@ -15,6 +15,7 @@ runs:
       fi
       export BUILD_TOOLS_SHA=6e8526315ea3b4828882497e532b8340e64e053c
       npm i -g @electron/build-tools
+      e d update_depot_tools
       e auto-update disable
       e d auto-update disable
       if [ "$(expr substr $(uname -s) 1 10)" == "MSYS_NT-10" ]; then
Repository: ollama/ollama
Pull request: Explicitly disable AVX2 on GPU builds

Even though we weren't setting it to on, somewhere in the cmake config it was getting toggled on.  By explicitly setting it to off, we get `/arch:AVX` as intended.

fixes #2527 

Changed files:
filename: llm/generate/gen_windows.ps1
patch: @@ -189,7 +189,7 @@ if ($null -ne $script:CUDA_LIB_DIR) {
     }
     init_vars
     $script:buildDir="${script:llamacppDir}/build/windows/${script:ARCH}/cuda$script:CUDA_VARIANT"
-    $script:cmakeDefs += @("-DLLAMA_CUBLAS=ON", "-DLLAMA_AVX=on", "-DCUDAToolkit_INCLUDE_DIR=$script:CUDA_INCLUDE_DIR", "-DCMAKE_CUDA_ARCHITECTURES=${script:CMAKE_CUDA_ARCHITECTURES}")
+    $script:cmakeDefs += @("-DLLAMA_CUBLAS=ON", "-DLLAMA_AVX=on", "-DLLAMA_AVX2=off", "-DCUDAToolkit_INCLUDE_DIR=$script:CUDA_INCLUDE_DIR", "-DCMAKE_CUDA_ARCHITECTURES=${script:CMAKE_CUDA_ARCHITECTURES}")
     build
     install
     sign
Repository: nodejs/node
Pull request: test: set common.bits to 64 for loong64


Changed files:
filename: test/common/index.js
patch: @@ -33,7 +33,7 @@ const { inspect } = require('util');
 const { isMainThread } = require('worker_threads');
 
 const tmpdir = require('./tmpdir');
-const bits = ['arm64', 'mips', 'mipsel', 'ppc64', 'riscv64', 's390x', 'x64']
+const bits = ['arm64', 'loong64', 'mips', 'mipsel', 'ppc64', 'riscv64', 's390x', 'x64']
   .includes(process.arch) ? 64 : 32;
 const hasIntl = !!process.config.variables.v8_enable_i18n_support;
Repository: vercel/next.js
Pull request: Fix TypeScript type error in example code

Without the `| null`, the following error appears during compilation:
```
TS2322: Type RefObject<HTMLDivElement | null> is not assignable to type RefObject<HTMLDivElement>
Type HTMLDivElement | null is not assignable to type HTMLDivElement
Type null is not assignable to type HTMLDivElement
```

Changed files:
filename: docs/01-app/03-api-reference/03-file-conventions/error.mdx
patch: @@ -219,7 +219,7 @@ export class GracefullyDegradingErrorBoundary extends Component<
   ErrorBoundaryProps,
   ErrorBoundaryState
 > {
-  private contentRef: React.RefObject<HTMLDivElement>
+  private contentRef: React.RefObject<HTMLDivElement | null>
 
   constructor(props: ErrorBoundaryProps) {
     super(props)
Repository: ggml-org/llama.cpp
Pull request: CANN: The Ger operator of OUT_PROD is not supported on the 310p device

310p device don't support aclnnGer, so we disabled it on the 310p device.

Changed files:
filename: ggml/src/ggml-cann/ggml-cann.cpp
patch: @@ -2564,6 +2564,10 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev, const ggml_ten
             return true;
         case GGML_OP_OUT_PROD:
             {
+#ifdef ASCEND_310P
+                // Ger is not supported on 310p device
+                return false;
+#endif
                 switch (op->src[0]->type) {
                     case GGML_TYPE_F16:
                     case GGML_TYPE_F32:
Repository: huggingface/transformers
Pull request: Fix Glm4v test

# What does this PR do?



Changed files:
filename: tests/models/glm4v_moe/test_modeling_glm4v_moe.py
patch: @@ -297,6 +297,7 @@ def test_inputs_embeds_matches_input_ids(self):
 
 
 @require_torch
+@slow
 class Glm4vMoeIntegrationTest(unittest.TestCase):
     model = None
 
@@ -310,7 +311,8 @@ def get_model(cls):
 
     @classmethod
     def tearDownClass(cls):
-        del cls.model
+        if hasattr(cls, "model"):
+            del cls.model
         cleanup(torch_device, gc_collect=True)
 
     def setUp(self):
@@ -364,7 +366,6 @@ def setUp(self):
     def tearDown(self):
         cleanup(torch_device, gc_collect=True)
 
-    @slow
     def test_small_model_integration_test(self):
         inputs = self.processor.apply_chat_template(
             self.message, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt"
@@ -386,7 +387,6 @@ def test_small_model_integration_test(self):
         )
         torch.testing.assert_close(expected_pixel_slice, inputs.pixel_values[:6, :3], atol=1e-4, rtol=1e-4)
 
-    @slow
     def test_small_model_integration_test_batch(self):
         model = self.get_model()
         batch_messages = [self.message, self.message2, self.message_wo_image]
@@ -414,7 +414,6 @@ def test_small_model_integration_test_batch(self):
             EXPECTED_DECODED_TEXT,
         )
 
-    @slow
     def test_small_model_integration_test_with_video(self):
         processor = AutoProcessor.from_pretrained("zai-org/GLM-4.5V", max_image_size={"longest_edge": 50176})
         model = self.get_model()
@@ -437,7 +436,6 @@ def test_small_model_integration_test_with_video(self):
         )
 
     @run_first
-    @slow
     @require_flash_attn
     @require_torch_gpu
     def test_small_model_integration_test_batch_flashatt2(self):
Repository: facebook/react
Pull request: [compiler] Always error on async reassignments

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #30111
* #30110

Summary: Addresses the issue in #30109: any mutation of a local in an async function may occur after rendering has finished.

Changed files:
filename: compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateLocalsNotReassignedAfterRender.ts
patch: @@ -19,7 +19,12 @@ import {
  */
 export function validateLocalsNotReassignedAfterRender(fn: HIRFunction): void {
   const contextVariables = new Set<IdentifierId>();
-  const reassignment = getContextReassignment(fn, contextVariables, false, false);
+  const reassignment = getContextReassignment(
+    fn,
+    contextVariables,
+    false,
+    false
+  );
   if (reassignment !== null) {
     CompilerError.throwInvalidReact({
       reason:
@@ -38,7 +43,7 @@ function getContextReassignment(
   fn: HIRFunction,
   contextVariables: Set<IdentifierId>,
   isFunctionExpression: boolean,
-  isAsync: boolean,
+  isAsync: boolean
 ): Place | null {
   const reassigningFunctions = new Map<IdentifierId, Place>();
   for (const [, block] of fn.body.blocks) {
@@ -51,7 +56,7 @@ function getContextReassignment(
             value.loweredFunc.func,
             contextVariables,
             true,
-            isAsync || value.loweredFunc.func.async,
+            isAsync || value.loweredFunc.func.async
           );
           if (reassignment === null) {
             // If the function itself doesn't reassign, does one of its dependencies?

filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo.invalid-nested-function-reassign-local-variable-in-effect.expect.md
patch: @@ -11,7 +11,7 @@ function Component() {
       local = newValue;
     };
     return reassignLocal;
-  }
+  };
   const reassignLocal = mk_reassignlocal();
   const onMount = (newValue) => {
     reassignLocal("hello");

filename: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo.invalid-nested-function-reassign-local-variable-in-effect.js
patch: @@ -7,7 +7,7 @@ function Component() {
       local = newValue;
     };
     return reassignLocal;
-  }
+  };
   const reassignLocal = mk_reassignlocal();
   const onMount = (newValue) => {
     reassignLocal("hello");