sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: The empty 0D or more D tensor with exceeding `dim`(`dim=100` or `dim=-100`) for `cummin()` works
Labels: module: error checking,triaged,actionable,module: edge cases

### 🐛 Describe the bug

The empty 0D or more D tensor with exceeding `dim`(`dim=100` or `dim=-100`) for [cummin()](https://pytorch.org/docs/stable/generated/torch.cummin.html) works as shown below:

```python
import torch

my_tensor = torch.tensor([])

torch.cummin(input=my_tensor, dim=100)
torch.cummin(input=my_tensor, dim=-100)
# torch.return_types.cummin(
# values=tensor([]),
# indices=tensor([], dtype=torch.int64))

my_tensor = torch.tensor([[]])

torch.cummin(input=my_tensor, dim=100)
torch.cummin(input=my_tensor, dim=-100)
# torch.return_types.cummin(
# values=tensor([], size=(1, 0)),
# indices=tensor([], size=(1, 0), dtype=torch.int64))

my_tensor = torch.tensor([[[]]])

torch.cummin(input=my_tensor, dim=100)
torch.cummin(input=my_tensor, dim=-100)
# torch.return_types.cummin(
# values=tensor([], size=(1, 1, 0)),
# indices=tensor([], size=(1, 1, 0), dtype=torch.int64))
```

In addition, the non-empty 0D or more D tensor with exceeding `dim`(`dim=100` or `dim=-100`) for `cummin()` gets the errors as shown below:

```python
import torch

my_tensor = torch.tensor([0, 1, 2])

torch.cummin(input=my_tensor, dim=100) # Error
torch.cummin(input=my_tensor, dim=-100) # Error

my_tensor = torch.tensor([[0, 1, 2]])

torch.cummin(input=my_tensor, dim=100) # Error
torch.cummin(input=my_tensor, dim=-100) # Error

my_tensor = torch.tensor([[[0, 1, 2]]])

torch.cummin(input=my_tensor, dim=100) # Error
torch.cummin(input=my_tensor, dim=-100) # Error
```

> IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 100)
> IndexError: Dimension out of range (expected to be in range of [-1, 0], but got -100)

> IndexError: Dimension out of range (expected to be in range of [-2, 1], but got 100)
> IndexError: Dimension out of range (expected to be in range of [-2, 1], but got -100)

> IndexError: Dimension out of range (expected to be in range of [-3, 2], but got 100)
> IndexError: Dimension out of range (expected to be in range of [-3, 2], but got -100)

### Versions

```python
import torch

torch.__version__ # 2.3.1+cu121
```

cc @malfet
Repository: pytorch
Issue: The empty 0D or more D tensor with exceeding `dim`(`dim=100` or `dim=-100`) for `cummax()` works
Labels: triaged

### 🐛 Describe the bug

The empty 0D or more D tensor with exceeding `dim`(`dim=100` or `dim=-100`) for [cummax()](https://pytorch.org/docs/stable/generated/torch.cummax.html) works as shown below:

```python
import torch

my_tensor = torch.tensor([])

torch.cummax(input=my_tensor, dim=100)
torch.cummax(input=my_tensor, dim=-100)
# torch.return_types.cummax(
# values=tensor([]),
# indices=tensor([], dtype=torch.int64))

my_tensor = torch.tensor([[]])

torch.cummax(input=my_tensor, dim=100)
torch.cummax(input=my_tensor, dim=-100)
# torch.return_types.cummax(
# values=tensor([], size=(1, 0)),
# indices=tensor([], size=(1, 0), dtype=torch.int64))

my_tensor = torch.tensor([[[]]])

torch.cummax(input=my_tensor, dim=100)
torch.cummax(input=my_tensor, dim=-100)
# torch.return_types.cummax(
# values=tensor([], size=(1, 1, 0)),
# indices=tensor([], size=(1, 1, 0), dtype=torch.int64))
```

In addition, the non-empty 0D or more D tensor with exceeding `dim`(`dim=100` or `dim=-100`) for `cummax()` gets the errors as shown below:

```python
import torch

my_tensor = torch.tensor([0, 1, 2])

torch.cummax(input=my_tensor, dim=100) # Error
torch.cummax(input=my_tensor, dim=-100) # Error

my_tensor = torch.tensor([[0, 1, 2]])

torch.cummax(input=my_tensor, dim=100) # Error
torch.cummax(input=my_tensor, dim=-100) # Error

my_tensor = torch.tensor([[[0, 1, 2]]])

torch.cummax(input=my_tensor, dim=100) # Error
torch.cummax(input=my_tensor, dim=-100) # Error
```

> IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 100)
> IndexError: Dimension out of range (expected to be in range of [-1, 0], but got -100)

> IndexError: Dimension out of range (expected to be in range of [-2, 1], but got 100)
> IndexError: Dimension out of range (expected to be in range of [-2, 1], but got -100)

> IndexError: Dimension out of range (expected to be in range of [-3, 2], but got 100)
> IndexError: Dimension out of range (expected to be in range of [-3, 2], but got -100)


### Versions

```python
import torch

torch.__version__ # 2.3.1+cu121
```
Repository: ui
Issue: [bug]: CommandItem is disabled even if data-disabled is set to false.
Labels: bug

### Describe the bug

I was trying to create team selector so I copied the code from your repo [TeamSwitcher.tsx](https://github.com/shadcn-ui/ui/blob/cc70f6ef4389d93b0606027f6271bcc8140b2d9b/apps/www/app/(app)/examples/dashboard/components/team-switcher.tsx#L81)

After doing everything as expected the CommandItem was not working. After inspecting the devtools I found out that it is disabled
```
.data-\[disabled\]\:pointer-events-none[data-disabled] {
    pointer-events: none;
}
```

```
  <CommandGroup>
                <DialogTrigger asChild>
                  <CommandItem
                    onSelect={() => {
                      setOpen(false);
                      setShowNewTeamDialog(true);
                    }}
                  >
                    <CirclePlus className="mr-2 h-5 w-5" />
                    Create Team
                  </CommandItem>
                </DialogTrigger>
              </CommandGroup>
```

### Affected component/components

CommandItem

### How to reproduce

1. Install shadncn/ui and command
2. Copy the code from shadcn/ui repo for the component [TeamSwitcher.tsx](https://github.com/shadcn-ui/ui/blob/cc70f6ef4389d93b0606027f6271bcc8140b2d9b/apps/www/app/(app)/examples/dashboard/components/team-switcher.tsx#L81)
3. After opening the Command the items are not selectable.

### Codesandbox/StackBlitz link

_No response_

### Logs

_No response_

### System Info

```bash
Sec-Ch-Ua-Platform:
"Windows"
User-Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
```


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
Repository: youtube-dl
Issue: Support downloading YouTube videos with multiple audio tracks
Labels: question

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- Look through the README (http://yt-dl.org/readme) and FAQ (http://yt-dl.org/faq) for similar questions
- Search the bugtracker for similar questions: http://yt-dl.org/search-issues
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm asking a question
- [ ] I've looked through the README and FAQ for similar questions
- [ ] I've searched the bugtracker for similar questions including closed ones


## Question
how to downloa dmultiple audio tracks from  youtube


WRITE QUESTION HERE
![image](https://github.com/user-attachments/assets/b593c069-29e2-410f-b710-23603e04a320)
Repository: ollama
Issue: error loading model: unable to allocate backend buffer when model size is > VRAM with multiple GPUs
Labels: bug,memory

### What is the issue?

`ollama run llava:34b write me a poem`

```
Error: llama runner process has terminated: signal: aborted (core dumped) error loading model: unable to allocate backend buffer
llama_load_model_from_file: exception loading model
```

# Hardware

System has 2 discrete GPUs:

- AMD RX 7600 XT (16 GB)
- nvidia 1050 TI (4 GB)

RAM: 48 GB
CPU: AMD 7600X

# struggle

I tried to manipulate `CUDA_VISIBLE_DEVICES` and `HIP_VISIBLE_DEVICES` envvars. Setting either to `-1` makes ollama run with GPU that's left.

Logs: 
[both.txt](https://github.com/user-attachments/files/16319474/both.txt)
[amd_only.txt](https://github.com/user-attachments/files/16319475/amd_only.txt)
[nvidia_only.txt](https://github.com/user-attachments/files/16319476/nvidia_only.txt)

part of both.txt

```
ggml_backend_cuda_buffer_type_alloc_buffer: allocating 15863.15 MiB on device 0: cudaMalloc failed: out of memory
llama_model_load: error loading model: unable to allocate backend buffer
llama_load_model_from_file: exception loading model
terminate called after throwing an instance of 'std::runtime_error'
  what():  unable to allocate backend buffer
time=2024-07-20T10:45:15.144+02:00 level=ERROR source=sched.go:480 msg="error loading llama server" error="llama runner process has terminated: signal: aborted (core dumped) error loading model: unable to allocate backend buffer"
```

This happens on every model that I tried and those size > 16GB when both are available.

### OS

Linux

### GPU

Nvidia, AMD

### CPU

AMD

### Ollama version

ollama version is 0.2.1
Repository: stable-diffusion-webui
Issue: [Feature Request]: Auro Flow (Model Support)
Labels: enhancement

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

Support for Aura Flow model (not to be confused with SDXL):

homepage:
https://huggingface.co/fal/AuraFlow

model:
https://huggingface.co/fal/AuraFlow/tree/main

### Proposed workflow

1. Generate images with

### Additional information

![image](https://github.com/user-attachments/assets/e548e30b-59d0-4a3c-a68d-9819b05a6ab1)
Repository: ui
Issue: [bug]: form.formState.isSubmitting not working in shadcn sonner
Labels: bug

### Describe the bug

`await` is not needed when I try to use `toast.promise()` in shadcn sonner, thats why the state in `form.formState.isSubmitting` is always `false`

### Affected component/components

Sonner

### How to reproduce

1. Create a form uisng `react-hook-form`
2. Create a form action with a `toast.promise()` to handle api response
3. See that the supposedly disabled components like textfield, buttons, etc in the form while loading are still enabled since `toast.promise()` doesn't need to be marked with `await`

Minimal code to reproduce issue:

```
'use client'

import {
  Form,
  FormControl,
  FormDescription,
  FormField,
  FormItem,
  FormLabel,
  FormMessage,
} from '@/components/ui/form'

import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { toast } from 'sonner'
import { useForm } from 'react-hook-form'
import { z } from 'zod'
import { zodResolver } from '@hookform/resolvers/zod'

const formSchema = z.object({
  name: z.string().min(1, { message: 'Name is required' }),
})

export default function Sample() {
  const form = useForm<z.infer<typeof formSchema>>({
    resolver: zodResolver(formSchema),
    defaultValues: {
      name: '',
    },
  })

  async function onSubmit(values: z.infer<typeof formSchema>) {
    toast.promise(
      new Promise<void>((resolve, reject) => {
        setTimeout(() => {
          resolve()
        }, 3000)
      }),
      {
        loading: 'Loading ...',
        success: () => {
          form.reset()
          return `Done! Name is ${values.name}`
        },
        error: (err) => {
          return `${err}`
        },
      },
    )
  }

  return (
    <Form {...form}>
      <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
        <FormField
          control={form.control}
          name="name"
          render={({ field }) => (
            <FormItem>
              <FormLabel>Username</FormLabel>
              <FormControl>
                <Input
                  disabled={form.formState.isSubmitting}
                  placeholder="Enter your name"
                  {...field}
                />
              </FormControl>
              <FormDescription>
                This is your public display name.
              </FormDescription>
              <FormMessage />
            </FormItem>
          )}
        />
        <Button disabled={form.formState.isSubmitting} type="submit">
          Submit
        </Button>
      </form>
    </Form>
  )
}
```



### Codesandbox/StackBlitz link

_No response_

### Logs

_No response_

### System Info

```bash
Processor	Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz   2.50 GHz
Installed RAM	24.0 GB (23.8 GB usable)
System type	64-bit operating system, x64-based processor
Pen and touch	No pen or touch input is available for this display

Browser: Brave, MS Edge
```


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
Repository: pytorch
Issue: The shape of weights in lstm seems to be wrong.
Labels: module: docs,module: rnn,triaged,actionable

### 📚 The doc issue

If the input to the lstm layer is `(batch_size, seq_length, input_size)`, then `x_t` would be `(batch_size, input_size)`.

And as the documentation say so, the shape of `W_ii` is `(hidden_size*4, input_size)`.

In this case, we can't calculate i_t since its equation is i_t = sigma(W_ii@x_t + b_ii + W_hi@h_t-1 + b_hi).
Here we can't do matrix multiplication of W_ii and x_t. 


### Suggest a potential alternative/fix

_No response_

cc @svekars @brycebortree @mikaylagawarecki @gujinghui @EikanWang @fengyuan14 @guangyey
Repository: PowerToys
Issue: Make Ctrl+C copy path location to applications on PowerToys Run
Labels: Idea-Enhancement,Product-PowerToys Run,Needs-Triage,Run-Results (Programs)

### Description of the new feature / enhancement

Pressing Ctrl+C on PowerToys Run only works on folders and files. It'd be great if we had the ability to press Ctrl+C to copy path location to applications on PowerToys Run. It's like holding Shift, right clicking an application's icon, and clicking **Copy as path**.

### Scenario when this would be used?

Press the hotkey for PowerToys Run, type the name of an application, select an application by pressing the Up or Down arrow, and then press Ctrl+C. This will copy the path location to an application. For example, if we type **paint** in PowerToys Run and select **Paint**, pressing Ctrl+C copies the path location to it, and it'll be **c:\windows\system32\mspaint.exe**.

### Supporting information

Pressing Ctrl+C on PowerToys Run after typing the name of an application and selecting it will copy the path location, so it can be pasted anywhere like Command Prompt or the Run dialog box.
Repository: transformers
Issue: _prepare_4d_causal_attention_mask mask inversion should work boolean masks
Labels: Feature request

### Feature request

https://github.com/huggingface/transformers/blob/0fdea8607d7e01eb0e38a1ebeb7feee30a22f0cf/src/transformers/modeling_attn_mask_utils.py#L332

Here we can just assume the user provides a tensor of 0s and 1s right? In that case, the inversion can be done like `inverted_mask = ~(attention_mask.to(torch.bool))`

### Motivation

There are two advantages I found with doing the conversion assuming the input is bool
* Its slightly faster 
* When using a cached huggingface dataset to generate the mask, it is way more space-efficient to store the masks as bool type. 

### Your contribution

`inverted_mask = ~(attention_mask.to(torch.bool))`
Repository: pytorch
Issue: `input` argument of `nan_to_num()` works with `complex` type but `nan`, `posinf` and `neginf` argument don't work with `complex` type
Labels: triaged,module: complex,actionable

### 🐛 Describe the bug

`input` argument of [nan_to_num()](https://pytorch.org/docs/stable/generated/torch.nan_to_num.html) works with `complex` type but `nan`, `posinf` and `neginf` argument don't work with `complex` type as shown below:

```python
import torch

my_tensor = torch.tensor([complex('nan'), complex('inf-infj'), complex('-inf+infj'), 4.+0.j])
                                    # ↓       # ↓       # ↓
torch.nan_to_num(input=my_tensor, nan=1, posinf=2, neginf=3)
# tensor([1.+0.j, 2.+3.j, 3.+2.j, 4.+0.j])

                                    # ↓↓       # ↓↓       # ↓↓
torch.nan_to_num(input=my_tensor, nan=1., posinf=2., neginf=3.)
# tensor([1.+0.j, 2.+3.j, 3.+2.j, 4.+0.j])

                                    # ↓↓↓↓       # ↓↓↓↓↓       # ↓↓↓↓
torch.nan_to_num(input=my_tensor, nan=True, posinf=False, neginf=True)
# tensor([1.+0.j, 0.+1.j, 1.+0.j, 4.+0.j])

                                    # ↓↓↓↓↓↓       # ↓↓↓↓↓↓       # ↓↓↓↓↓↓
torch.nan_to_num(input=my_tensor, nan=1.+0.j, posinf=2.+0.j, neginf=3.+0.j) # Error
```

> TypeError: nan_to_num(): argument 'nan' must be float, not complex

> TypeError: nan_to_num(): argument 'posinf' must be float, not complex

> TypeError: nan_to_num(): argument 'neginf' must be float, not complex

In addition, `input` argument of `nan_to_num()` works with `int`, `float` and `bool` type as shown below:

```python
import torch

my_tensor = torch.tensor([1, 2, 3, 4])

torch.nan_to_num(input=my_tensor)
# tensor([1, 2, 3, 4])

my_tensor = torch.tensor([1., 2., 3., 4.])

torch.nan_to_num(input=my_tensor)
# tensor([1., 2., 3., 4.])

my_tensor = torch.tensor([True, False, True, False])

torch.nan_to_num(input=my_tensor)
# tensor([True, False, True, False])
```

### Versions

```python
import torch

torch.__version__ # 2.3.1+cu121
```

cc @ezyang @anjali411 @dylanbespalko @mruberry @Lezcano @nikitaved @amjames
Repository: go
Issue: proposal: slices: add AllMatch
Labels: Proposal

This proposal suggests adding three new methods, `AllMatch`, to the `slices` package. The method will provide developers with powerful and concise ways to perform common operations on slices, enhancing code readability and reducing the likelihood of errors.   

```
package slices

// AllMatch checks if all elements in the slice satisfy the predicate.
func AllMatch[T any](s []T, predicate func(T) bool) bool {
    for _, v := range s {
        if !predicate(v) {
            return false
        }
    }
    return true
}
```

I look forward to feedback from the maintainers and the community on this proposal and I'm ready to implement it if you don't mind.
Repository: ui
Issue: [bug]: npx shadcn-ui init INSTALLS in wrong folder (React Vite)... bug (and its cause)
Labels: bug

### Describe the bug

the index.css file is created in the root folder instead of the src folder. Reason... when prompted to specify  location of globals.css, your installer does not trim the input, so it stores an incorrect path (an empty space at the beginning or end... .e.g.:

in components.json:

```
  "tailwind": {
    "config": "tailwind.config.js",
    "css": "   src/index.css   ",           // delete this (contains spaces at start or end
    "css": "src/index.css ",               // add this
    "baseColor": "slate",
    "cssVariables": true,
    "prefix": ""
  },
``` 

This is for Shadcn installed in Vite React app

### Affected component/components

globals.css file (installed in incorrect path)

### How to reproduce

run `npx shadcn-ui@latest init`

You are asked to enter the location of globals.css
If you accidently leave an extra space before or after `src/indexx.css` the path is stored incorrectly in components.json and consequently, index.css is stored in incorrect path or with wrong extension

Solution trim the input when user enters `src/index.css`

### Codesandbox/StackBlitz link

https://run-npx shadcn-ui@latest-init.com 

### Logs

_No response_

### System Info

```bash
Shadcn installed over React Vite app
```


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
Repository: svelte
Issue: Svelte 5: client-side `render` function
Labels: feature request

### Describe the problem

Per https://github.com/sveltejs/svelte/pull/12512#issue-2420943734: it's common in a [programmatic snippet](https://svelte-5-preview.vercel.app/docs/imports#svelte-createrawsnippet) to do `render(SomeComponent, props).body`, but this doesn't work in the browser because `SomeComponent` is compiled in a way that doesn't work with `render`.

### Describe the proposed solution

Either or both of:

- a browser version of `render` that behaves differently in some way (at minimum a more helpful error, but maybe it could return a `body` string that tells the component that subsequently mounts how to do so)
- a `svelte/environment` module akin to [`$app/environment`](https://kit.svelte.dev/docs/modules#$app-environment), providing access to `browser` and `dev`

Of course, in an ideal world it would Just Work, but that would require shipping the server-side templating logic to the client, unless there's some clever tree-shaking trickery we can employ.

### Importance

nice to have
Repository: vscode
Issue: Feature Request: Add kebabcase Formatter Support for Snippets in VSCode
Labels: feature-request,snippets

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->

#### Issue Description

As a developer who frequently uses Visual Studio Code for projects involving web development and other programming tasks that often require the use of `kebab-case` naming conventions (particularly in CSS, HTML, and certain JavaScript frameworks), I've noticed that the current snippet transformation capabilities in VSCode, while robust, do not include support for transforming string cases into `kebab-case`.

Currently, VSCode supports the following [formatters](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_grammar) in snippets:

- `/upcase` - Transform to uppercase
- `/downcase` - Transform to lowercase
- `/capitalize` - Capitalize the first letter
- `/camelcase` - Transform to camelCase
- `/pascalcase` - Transform to PascalCase

#### Proposed Feature

I propose adding a new transformation option called `/kebabcase` that would transform a string to `kebab-case`. This transformation would be incredibly useful for developers working in environments where `kebab-case` is a standard, such as in many CSS frameworks. 

#### Rationale

Many projects, particularly those involving web technologies, utilize `kebab-case` for class names, IDs, and other attributes. Built-in support in VSCode would aid in maintaining consistency across codebases.

#### Example Implementation

The transformation could be implemented similarly to the existing transformations, where a user can include something like `$TM_SELECTED_TEXT/kebabcase` in their snippet definition to automatically convert the selected text into `kebab-case`.
Repository: ollama
Issue: Gemma 2 runs too slow
Labels: bug,nvidia,memory

### What is the issue?

After ollama's upgrade to 0.27 from 0.20, it runs gemma 2 9b at very low speed. I don't think the OS is out of vram, since gemma 2 only costs 6.8G (q_4_0) vram while my laptop has 8G vram. However, other 9b models with q4_0 run like glm4 run very smoothly. Is that a bug of ollama or gemma 2 itself?


### OS

Windows

### GPU

Nvidia

### CPU

Intel

### Ollama version

0.27