helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Fix typo on 03-layouts-and-pages.mdx

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
- Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to understand the PR)
- When linking to a Slack thread, you might want to share details of the conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Changed files:
filename: docs/01-app/01-getting-started/03-layouts-and-pages.mdx
patch: @@ -269,7 +269,7 @@ export default async function Page({ searchParams }) {
 }
 ```
 
-Using `searchParams` opts your page into [**dynamic rendering**](/docs/app/guides/caching#dynamic-rendering) because it requires a incoming request to read the search parameters from.
+Using `searchParams` opts your page into [**dynamic rendering**](/docs/app/guides/caching#dynamic-rendering) because it requires an incoming request to read the search parameters from.
 
 Client Components can read search params using the [`useSearchParams`](/docs/app/api-reference/functions/use-search-params) hook.
Repository: vuejs/vue
Pull request: Add support attribute module

To be able to use css-module

Changed files:
filename: flow/compiler.js
patch: @@ -151,4 +151,5 @@ declare type SFCBlock = {
   lang?: string;
   src?: string;
   scoped?: boolean;
+  module?: string | boolean;
 }

filename: src/sfc/parser.js
patch: @@ -61,6 +61,9 @@ export function parseComponent (
       if (attr.name === 'scoped') {
         block.scoped = true
       }
+      if (attr.name === 'module') {
+        block.module = attr.value || true
+      }
       if (attr.name === 'src') {
         block.src = attr.value
       }
Repository: ollama/ollama
Pull request: Use llama3.1 in tools example

Running this example with `mistral` produces the error "mistral does not support tools". What wasn't obvious to me until I made this PR was that my copy of mistral needed upgrading for tools (`ollama pull mistral`). Making the example be `llama3.1` will lead to more success for other long time ollama users.

Changed files:
filename: docs/api.md
patch: @@ -669,7 +669,7 @@ curl http://localhost:11434/api/chat -d '{
 
 ```
 curl http://localhost:11434/api/chat -d '{
-  "model": "mistral",
+  "model": "llama3.1",
   "messages": [
     {
       "role": "user",
@@ -708,7 +708,7 @@ curl http://localhost:11434/api/chat -d '{
 
 ```json
 {
-  "model": "mistral:7b-instruct-v0.3-q4_K_M",
+  "model": "llama3.1",
   "created_at": "2024-07-22T20:33:28.123648Z",
   "message": {
     "role": "assistant",
Repository: nodejs/node
Pull request: repl: fix cpu overhead pasting big strings to the REPL

Pasting input should not trigger any completions and other calculations. This is now handled by just writing the string to the terminal in case the user is pasting. As soon as pasting is done, the completions will be re-enabled.

Fixes: https://github.com/nodejs/node/issues/40626
Fixes: https://github.com/nodejs/node/issues/43343

The improvement is not linear (former data was always reparsed), so providing a concrete number is not sufficient. On my machine it is 50x faster for `'a'.repeat(5e4)`.

The test case I added has a big time buffer to not be flaky. On some CPUs, it might however still be flaky and I could not think of a better test case that does not cause it to be flaky or have a long runtime.

Changed files:
filename: lib/internal/readline/interface.js
patch: @@ -658,6 +658,12 @@ class Interface extends InterfaceConstructor {
 
   [kInsertString](c) {
     this[kBeforeEdit](this.line, this.cursor);
+    if (!this.isCompletionEnabled) {
+      this.line += c;
+      this.cursor += c.length;
+      this[kWriteToOutput](c);
+      return;
+    }
     if (this.cursor < this.line.length) {
       const beg = StringPrototypeSlice(this.line, 0, this.cursor);
       const end = StringPrototypeSlice(

filename: test/parallel/test-repl-paste-big-data.js
patch: @@ -0,0 +1,36 @@
+'use strict';
+
+const common = require('../common');
+const repl = require('repl');
+const stream = require('stream');
+const assert = require('assert');
+
+// Pasting big input should not cause the process to have a huge CPU usage.
+
+const cpuUsage = process.cpuUsage();
+
+const r = initRepl();
+r.input.emit('data', 'a'.repeat(2e4) + '\n');
+r.input.emit('data', '.exit\n');
+
+r.once('exit', common.mustCall(() => {
+  const diff = process.cpuUsage(cpuUsage);
+  assert.ok(diff.user < 1e6);
+}));
+
+function initRepl() {
+  const input = new stream();
+  input.write = input.pause = input.resume = () => {};
+  input.readable = true;
+
+  const output = new stream();
+  output.write = () => {};
+  output.writable = true;
+
+  return repl.start({
+    input,
+    output,
+    terminal: true,
+    prompt: ''
+  });
+}
Repository: facebook/react
Pull request: [DevTools]  feat[Tree]: set initial scroll offset when inspected element index is set

Stacked on https://github.com/facebook/react/pull/31956. See [commit on top](https://github.com/facebook/react/pull/31968/commits/ecb8df4175342cde7669cd4a6b008b3782eb5b61).

Use `initialScrollOffset` prop for `FixedSizeList` from `react-window`. This happens when user selects an element in built-in Elements panel in DevTools, and then opens Components panel from React DevTools - elements will be synced and corresponding React Element will be pre-selected, we just have to scroll to its position now. 

Changed files:
filename: packages/react-devtools-shared/src/devtools/views/Components/Tree.js
patch: @@ -47,6 +47,22 @@ export type ItemData = {
   treeFocused: boolean,
 };
 
+function calculateInitialScrollOffset(
+  inspectedElementIndex: number | null,
+  elementHeight: number,
+): number | void {
+  if (inspectedElementIndex === null) {
+    return undefined;
+  }
+
+  if (inspectedElementIndex < 3) {
+    return undefined;
+  }
+
+  // Make 3 elements on top of the inspected one visible
+  return (inspectedElementIndex - 3) * elementHeight;
+}
+
 export default function Tree(): React.Node {
   const dispatch = useContext(TreeDispatcherContext);
   const {
@@ -401,6 +417,10 @@ export default function Tree(): React.Node {
                 <FixedSizeList
                   className={styles.List}
                   height={height}
+                  initialScrollOffset={calculateInitialScrollOffset(
+                    inspectedElementIndex,
+                    lineHeight,
+                  )}
                   innerElementType={InnerElementType}
                   itemCount={numElements}
                   itemData={itemData}
Repository: vuejs/vue
Pull request: Check and warn for falsy class name (fixes #4050)

This commit adds a check for falsy names (null or empty string) before attempting to add or remove them, to prevent a DOM exception. A warning will also be triggered if in development env.


Changed files:
filename: src/platforms/web/runtime/class-util.js
patch: @@ -1,10 +1,17 @@
 /* @flow */
 
+import { warn } from 'core/util/index'
+
 /**
  * Add class with compatibility for SVG since classList is not supported on
  * SVG elements in IE
  */
-export function addClass (el: Element, cls: string) {
+export function addClass (el: Element, cls: ?string) {
+  if (!cls || cls.trim() === '') {
+    process.env.NODE_ENV !== 'production' && warn('Ignoring empty class name.')
+    return
+  }
+
   /* istanbul ignore else */
   if (el.classList) {
     if (cls.indexOf(' ') > -1) {
@@ -24,7 +31,12 @@ export function addClass (el: Element, cls: string) {
  * Remove class with compatibility for SVG since classList is not supported on
  * SVG elements in IE
  */
-export function removeClass (el: Element, cls: string) {
+export function removeClass (el: Element, cls: ?string) {
+  if (!cls || cls.trim() === '') {
+    process.env.NODE_ENV !== 'production' && warn('Ignoring empty class name.')
+    return
+  }
+
   /* istanbul ignore else */
   if (el.classList) {
     if (cls.indexOf(' ') > -1) {
Repository: ggml-org/llama.cpp
Pull request: arg : add -kvu to llama-batched-bench


Changed files:
filename: common/arg.cpp
patch: @@ -1301,7 +1301,7 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
         [](common_params & params, bool value) {
             params.kv_unified = value;
         }
-    ).set_env("LLAMA_ARG_KV_UNIFIED").set_examples({LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_BATCHED}));
+    ).set_env("LLAMA_ARG_KV_UNIFIED").set_examples({LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_PERPLEXITY, LLAMA_EXAMPLE_BATCHED, LLAMA_EXAMPLE_BENCH}));
     add_opt(common_arg(
         {"--context-shift"},
         {"--no-context-shift"},
Repository: ollama/ollama
Pull request: llm: reserve required number of slots for embeddings

Fixes https://github.com/ollama/ollama/issues/6217

Changed files:
filename: llm/server.go
patch: @@ -44,11 +44,12 @@ type LlamaServer interface {
 
 // llmServer is an instance of the llama.cpp server
 type llmServer struct {
-	port    int
-	cmd     *exec.Cmd
-	done    chan error // Channel to signal when the process exits
-	status  *StatusWriter
-	options api.Options
+	port        int
+	cmd         *exec.Cmd
+	done        chan error // Channel to signal when the process exits
+	status      *StatusWriter
+	options     api.Options
+	numParallel int
 
 	estimate    MemoryEstimate
 	totalLayers uint64
@@ -343,6 +344,7 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
 			status:      NewStatusWriter(os.Stderr),
 			options:     opts,
 			estimate:    estimate,
+			numParallel: numParallel,
 			sem:         semaphore.NewWeighted(int64(numParallel)),
 			totalLayers: ggml.KV().BlockCount() + 1,
 			gpus:        gpus,
@@ -890,11 +892,14 @@ type EmbedResponse struct {
 }
 
 func (s *llmServer) Embed(ctx context.Context, input []string) (*EmbedResponse, error) {
-	if err := s.sem.Acquire(ctx, 1); err != nil {
+	// each input will use a slot, so we need to acquire the semaphore for
+	// the number of inputs up to numParallel
+	slots := int64(min(len(input), s.numParallel))
+	if err := s.sem.Acquire(ctx, slots); err != nil {
 		slog.Error("Failed to acquire semaphore", "error", err)
 		return nil, err
 	}
-	defer s.sem.Release(1)
+	defer s.sem.Release(slots)
 
 	// Make sure the server is ready
 	status, err := s.getServerStatusRetry(ctx)
Repository: vuejs/vue
Pull request: fix problematic use of 'deprecated' in warnings

Fixes #4042.


Changed files:
filename: src/compiler/parser/index.js
patch: @@ -399,7 +399,7 @@ function processAttrs (el) {
         if (expression) {
           warn(
             `${name}="${value}": ` +
-            'Interpolation inside attributes has been deprecated. ' +
+            'Interpolation inside attributes has been removed. ' +
             'Use v-bind or the colon shorthand instead. For example, ' +
             'instead of <div id="{{ val }}">, use <div :id="val">.'
           )

filename: src/platforms/web/compiler/modules/class.js
patch: @@ -15,8 +15,9 @@ function transformNode (el: ASTElement, options: CompilerOptions) {
     if (expression) {
       warn(
         `class="${staticClass}": ` +
-        'Interpolation inside attributes has been deprecated. ' +
-        'Use v-bind or the colon shorthand instead.'
+        'Interpolation inside attributes has been removed. ' +
+        'Use v-bind or the colon shorthand instead. For example, ' +
+        'instead of <div class="{{ val }}">, use <div :class="val">.'
       )
     }
   }

filename: test/unit/modules/compiler/parser.spec.js
patch: @@ -256,7 +256,7 @@ describe('parser', () => {
     expect(ast2.classBinding).toBe('class1')
     // interpolation warning
     parse('<p class="{{error}}">hello world</p>', baseOptions)
-    expect('Interpolation inside attributes has been deprecated').toHaveBeenWarned()
+    expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
   })
 
   it('style binding', () => {
@@ -318,7 +318,7 @@ describe('parser', () => {
     expect(ast1.attrs[2].value).toBe('"hello world"')
     // interpolation warning
     parse('<input type="text" name="field1" value="{{msg}}">', baseOptions)
-    expect('Interpolation inside attributes has been deprecated').toHaveBeenWarned()
+    expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
   })
 
   if (!isIE) {
Repository: vercel/next.js
Pull request: [test] Use `next-data-api-endpoint` for Middleware HTTP method tests

We use `https://next-data-api-endpoint.vercel.app` for most of our e2e test API calls. The `middleware-fetches-with-any-http-method` test suite was using `https://http-echo-kou029w.vercel.app`, which was soft-deleted recently, and that caused the tests to fail. Now we're using the `next-data-api-endpoint` for this test suite as well.

Changed files:
filename: test/e2e/middleware-fetches-with-any-http-method/index.test.ts
patch: @@ -19,7 +19,7 @@ describe('Middleware fetches with any HTTP method', () => {
         'middleware.js': `
           import { NextResponse } from 'next/server';
 
-          const HTTP_ECHO_URL = 'https://http-echo-kou029w.vercel.app/';
+          const HTTP_ECHO_URL = 'https://next-data-api-endpoint.vercel.app/api/echo-headers';
 
           export default async (req) => {
             const kind = req.nextUrl.searchParams.get('kind')
Repository: facebook/react
Pull request: [playground] Partially revert #32009


I had forgotten that our default error reporting threshold was `none` due to the fact that build pipelines should not throw errors. This resets it back to throwing on all errors which mostly is the same as the eslint plugin.

Closes #32014.


Changed files:
filename: compiler/apps/playground/components/Editor/EditorImpl.tsx
patch: @@ -78,6 +78,7 @@ function invokeCompiler(
       logEvent: () => {},
     },
     environment,
+    panicThreshold: 'all_errors',
   });
   const ast = parseInput(source, language);
   let result = transformFromAstSync(ast, source, {
Repository: ollama/ollama
Pull request: Fix Invalid Option Name Warning Bug

Fixed invalid option provided not displaying the invalid option name problem.

Changed files:
filename: api/types.go
patch: @@ -504,7 +504,7 @@ func (opts *Options) FromMap(m map[string]interface{}) error {
 	for key, val := range m {
 		opt, ok := jsonOpts[key]
 		if !ok {
-			slog.Warn("invalid option provided", "option", opt.Name)
+			slog.Warn("invalid option provided", "option", key)
 			continue
 		}
Repository: vuejs/vue
Pull request: Inline export for consistency

Minor :)


Changed files:
filename: src/platforms/web/util/attrs.js
patch: @@ -33,14 +33,13 @@ const isAttr = makeMap(
 )
 
 /* istanbul ignore next */
-const isRenderableAttr = (name: string): boolean => {
+export const isRenderableAttr = (name: string): boolean => {
   return (
     isAttr(name) ||
     name.indexOf('data-') === 0 ||
     name.indexOf('aria-') === 0
   )
 }
-export { isRenderableAttr }
 
 export const propsToAttrMap = {
   acceptCharset: 'accept-charset',
Repository: vercel/next.js
Pull request: fix broken extend implementation on DynamicStorage

### What?

This implementation was broken. It did call `add` instead of `insert` and that doesn't override existing values as it should.

It could also be a bit more efficient by using `extend`.

Changed files:
filename: turbopack/crates/turbo-tasks-backend/src/backend/dynamic_storage.rs
patch: @@ -61,14 +61,9 @@ impl DynamicStorage {
     pub fn extend(
         &mut self,
         ty: CachedDataItemType,
-        item: impl Iterator<Item = CachedDataItem>,
+        iterator: impl Iterator<Item = CachedDataItem>,
     ) -> bool {
-        let map = self.get_or_create_map_mut(ty);
-        let mut added = true;
-        for item in item {
-            added = map.add(item) && added;
-        }
-        added
+        self.get_or_create_map_mut(ty).extend(iterator)
     }
 
     pub fn insert(&mut self, item: CachedDataItem) -> Option<CachedDataItemValue> {

filename: turbopack/crates/turbo-tasks-macros/src/derive/key_value_pair_macro.rs
patch: @@ -360,6 +360,20 @@ pub fn derive_key_value_pair(input: TokenStream) -> TokenStream {
                 }
             }
 
+            pub fn extend(&mut self, iterator: impl Iterator<Item = #ident>) -> bool {
+                match self {
+                    #(
+                        #storage_name::#variant_names { storage } => {
+                            storage.extend(iterator.map(|item| match item {
+                                #storage_pattern => (#storage_key, value),
+                                _ => unreachable!(),
+                            }))
+                        }
+                    )*
+                    _ => unreachable!(),
+                }
+            }
+
             pub fn remove(&mut self, key: &#key_name) -> Option<#value_name> {
                 match (self, *key) {
                     #(
Repository: huggingface/transformers
Pull request: fix(benchmarks): correct sdpa_backend inconsistency and attn_implementation for continuous batching

## Summary

This PR fixes two bugs in `BenchmarkConfig` reported in issue #42211:

1. **sdpa_backend inconsistency (line 105)**: The warning message states "sdpa_backend must be None" but the code was setting it to "math". Changed to None to match the warning message.

2. **Invalid attn_implementation (line 243)**: Changed from "paged|sdpa" to "sdpa". Using "paged|sdpa" directly bypassed the validation logic since it only checks for exactly "sdpa". The "paged|" prefix is automatically added by `init_continuous_batching()`.

## Technical Details

**Bug 1 - sdpa_backend inconsistency:**
- Location: `benchmark_v2/framework/benchmark_config.py:105`
- Issue: Warning says "setting it to None" but code sets to "math"
- Fix: Changed `self.sdpa_backend = "math"` to `self.sdpa_backend = None`
- Reasoning: Setting to None allows PyTorch to auto-select the appropriate SDPA backend for continuous batching scenarios with custom attention masks

**Bug 2 - attn_implementation bypass:**
- Location: `benchmark_v2/framework/benchmark_config.py:243`
- Issue: Using "paged|sdpa" bypasses validation at lines 91-105
- Fix: Changed from `attn_implementation="paged|sdpa"` to `attn_implementation="sdpa"`
- Reasoning: The "paged|" prefix is automatically added by `init_continuous_batching()` in `continuous_api.py` (lines 744-756), so configs should use plain implementation names

Both bugs were introduced in commit 069684ef87 (PR #41916).

Fixes #42211

Changed files:
filename: benchmark_v2/framework/benchmark_config.py
patch: @@ -102,7 +102,7 @@ def check_validity(self, skip_validity_check: bool = False) -> None:
                 logger.warning(
                     "when continuous batching is enabled, sdpa_backend must be None because of the attention mask, setting it to None"
                 )
-                self.sdpa_backend = "math"
+                self.sdpa_backend = None
 
     @property
     def hash(self) -> str:
@@ -240,5 +240,5 @@ def get_config_by_level(level: int) -> list[BenchmarkConfig]:
         configs.append(BenchmarkConfig(attn_implementation="sdpa", compile_mode="default"))
         configs.append(BenchmarkConfig(attn_implementation="flex_attention", compile_mode="default", kernelize=True))
         configs.append(BenchmarkConfig(attn_implementation="flash_attention_2", kernelize=True))
-        configs.append(BenchmarkConfig(attn_implementation="paged|sdpa", continuous_batching=True))
+        configs.append(BenchmarkConfig(attn_implementation="sdpa", continuous_batching=True))
     return configs
Repository: ollama/ollama
Pull request: Ensure sparse files on windows during download

The file.Truncate call on windows will write the whole file unless you set the sparse flag, leading to heavy I/O at the beginning of download.  This should improve our I/O behavior on windows and put less stress on the users disk.

Fixes #5852

Changed files:
filename: server/download.go
patch: @@ -216,6 +216,9 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *regis
 		return err
 	}
 	defer file.Close()
+	if err := setSparse(file); err != nil {
+		return err
+	}
 
 	_ = file.Truncate(b.Total)
 

filename: server/sparse_common.go
patch: @@ -0,0 +1,9 @@
+//go:build !windows
+
+package server
+
+import "os"
+
+func setSparse(file *os.File) error {
+	return nil
+}

filename: server/sparse_windows.go
patch: @@ -0,0 +1,16 @@
+package server
+
+import (
+	"os"
+
+	"golang.org/x/sys/windows"
+)
+
+func setSparse(file *os.File) error {
+	return windows.DeviceIoControl(
+		windows.Handle(file.Fd()), windows.FSCTL_SET_SPARSE,
+		nil, 0,
+		nil, 0,
+		nil, nil,
+	)
+}