sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: pytorch
Issue: Add `int` type to `device` parameter of torch.set_default_device() on the doc
Labels: module: docs,triaged,actionable,module: python frontend

### 📚 The doc issue

[The doc](https://pytorch.org/docs/stable/generated/torch.set_default_device.html) of `torch.set_default_device()` explains `device` parameter but it doesn't have `int` type as shown below:

> device ([device](https://pytorch.org/docs/stable/tensor_attributes.html#torch.device) or string) – the device to set as default

Actually, `device` parameter with `int` type works as shown below:

```python
import torch

torch.set_default_device(device=0) # Here

torch.tensor([0, 1, 2]).device
# device(type='cuda', index=0)
```

### Suggest a potential alternative/fix

[The doc](https://pytorch.org/docs/stable/generated/torch.set_default_device.html) should also say `int` type as shown below:

> device ([device](https://pytorch.org/docs/stable/tensor_attributes.html#torch.device), string or `int`) – the device to set as default

cc @svekars @brycebortree @albanD
Repository: PowerToys
Issue: "File Locksmith" is not appearing in the shift+right-click menu.
Labels: Issue-Bug,Needs-Triage

### Microsoft PowerToys version

0.80.1

### Installation method

GitHub

### Running as admin

Yes

### Area(s) with issue?

File Locksmith

### Steps to reproduce

![explorer_x2PPGa439y](https://github.com/MicrosoftDocs/windows-dev-docs/assets/43485379/a366bdc6-2731-48c9-a00e-3985447c8cf4)

"File Locksmith" is not appearing in the shift+right-click menu.

Can you please modify it to "File Locksmith appears when right-clicking like in previous versions"?

### ✔️ Expected Behavior

I hope appearing `File Locksmith` and `PowerRename` in the shift+right-click menu.

### ❌ Actual Behavior

It not appearing...

### Other Software

OS: Windows10 Enterprise 21H2
Explorer: [qttabbar](https://github.com/indiff/qttabbar)

![image](https://github.com/microsoft/PowerToys/assets/43485379/c564c849-9877-4c6c-8acb-758e4bef5216)
Repository: next.js
Issue: Next.js Compatibility Issues on Chrome 80: Style, useEffect, and Query Problems
Labels: bug

### Link to the code that reproduces this issue

https://github.com/dStormTrooper/my-test-app

### To Reproduce

## Bug Report 

**Title**
next.js Compatibility Issues with Chrome 80: useEffect Hook and Query Not Working

**Description**
When running my next.js project on Chrome 80, I noticed compatibility issues with styles. Additionally, the useEffect hook and query functionalities are not working as expected.

## Steps to Reproduce
1. Open next.js project in Chrome 80.
2. Observe the styling errors and abnormal behavior of useEffect.
3. Attempt to use the query functionality, which also fails to operate properly.
**Expected Behavior**
The page should display styles correctly, and both useEffect hook and query functionalities should work seamlessly.


### Current vs. Expected behavior

## Current Behavior

I am encountering several issues in my Next.js application when using Chrome version 80. Firstly, the application's styling is not loading as expected, resulting in a disorganized layout. Secondly, when I attempt to use the `useEffect` hook for data fetching, it seems that it is not being invoked since I see no data or state updates. Lastly, despite having appropriate query parameters in the routing, they seem inaccessible within page components via the `useRouter` hook.

I have tried refreshing the page and clearing the cache, but these issues persist. In other versions of Chrome and different browsers, these problems are not occurring.

## Expected Behavior

My expectation is that in all supported browser versions, including Chrome 80, the Next.js application should load and render styles correctly, the `useEffect` hook should be invoked upon component mounting to perform data fetching operations. Additionally, the `useRouter` hook should be able to access route query parameters, allowing me to use them within page components.

In previous versions, these functionalities were working as expected, which leads me to believe there is either a compatibility issue or a bug with the latest version of Next.js.


### Provide environment information

```bash
Operating System:
  Platform: linux
  Arch: x64
  Version: #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr  4 14:39:20 UTC 2
  Available memory (MB): 59968
  Available CPU cores: 16
Binaries:
  Node: 18.20.2
  npm: 10.5.0
  Yarn: N/A
  pnpm: 8.15.5
Relevant Packages:
  next: 14.2.1 // There is a newer version (14.2.3) available, upgrade recommended! 
  eslint-config-next: 14.2.1
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.5
Next.js Config:
  output: standalone
```


### Which area(s) are affected? (Select all that apply)

Not sure

### Which stage(s) are affected? (Select all that apply)

next dev (local)

### Additional context

_No response_
Repository: stable-diffusion-webui
Issue: [Feature Request]: Option to save original mask image when inpainting
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 ?

To be able to reproduce results, there should be an option to save the original mask image, which can later be used in the `inpaint upload` tab.
Currently there is already an option `save_mask` (For inpainting, save a copy of the greyscale mask). However, this option only saves the processed mask.

Originally, this wasn't much of an issue because the only processing applied to the mask was the mask blur. To reproduce a result, you could simply use the already-blurred mask in `inpaint upload` and then simply set mask blur 0 to to prevent the mask from being blurred twice.
However, with the introduction of soft inpainting, this approach no longer works, because for every seed/result there will be a different mask image.

Optionally, this original mask image could be saved only once prior to generating results, similar to init images.

### Proposed workflow

Add an option in settings > saving images/grids, the description could be something like `For inpainting, save a copy of the original mask`.

### Additional information

_No response_
Repository: tauri
Issue: [bug] `tauri-bundler` fails to compile on Termux/Android
Labels: type: bug,status: needs triage

### Describe the bug

I'm running a Linux environment on my Android phone (Galaxy Fold 4) using [Termux](https://github.com/termux), and I'm trying to build one of my Dioxus projects. Dioxus CLI makes use of tauri-bundler, which fails to compile on Termux because function `create_tar_from_src()` in `src/bundle/updater_bundle.rs` is only defined for macOS and Linux targets.

`cargo build` output:
```
   Compiling tauri-bundler v1.5.4
error[E0425]: cannot find function `create_tar_from_src` in this scope
   --> /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-bundler-1.5.4/src/bundle/updater_bundle.rs:242:22
    |
242 |   let gzip_encoder = create_tar_from_src(src_dir, gzip_encoder)?;
    |                      ^^^^^^^^^^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `tauri-bundler` (lib) due to 1 previous error
``` 

Termux makes use of Android's libc and as such Rust by default builds everything for the `aarch64-linux-android` target.

A possible fix would be add Android to the Linux version of the function, so  `#[cfg(target_os = "linux")]` becomes `#[cfg(any(target_os = "android", target_os = "linux"))]`, however this might have some consequences I might not be aware of. 

Maybe we can switch the attributes around so the Mac version build as-is, but if the target OS is not Mac then we use the Linux version directly? (`#[cfg(target_os = "linux")]` would become `#[cfg(not(target_os = "macos"))]`).

This would avoid explicitly mentioning Android in the code in case that might cause issues or confusion.

I was planning on forking Tauri instead of submitting an issue, but I thought it's worth bringing up at least. Let me know what you think - I'm also willing to submit a PR if you agree to this change.

I understand if the Tauri team does not consider this worth dealing with, my setup is pretty obscure and I'm fine with just forking and making the changes for my own purposes.

### Reproduction

Install Termux on an Android phone. Install Rust with `pkg install rust`, create a test project with Cargo and add `tauri-bundler` to it. Then run `cargo build`.

### Expected behavior

`tauri-bundler` builds without error.

### Full `tauri info` output
N/A

### Stack trace
N/A
Repository: go
Issue: crypto/tls: add ConnectionState.CurveID
Labels: Proposal,Proposal-Accepted,Proposal-Crypto

### Proposal Details

With #67061, the selected "CurveID" is the difference between a post-quantum connection and not. We should expose it in ConnectionState. I actually assumed we were already exposing this.

It's unfortunate to use the CurveID misnomer, but ConnectionState doesn't feel like the place to start introducing a new name, it will only cause confusion.

/cc @golang/security
Repository: ollama
Issue: llava-llama3 Continuously generate output
Labels: bug

### What is the issue?

ollama run llava-llama3
after input a text and image path, it continuously generate messages, and repeated it.
same input works fine when ollama run llava, only s short paragraph of answer generated.

### OS

Linux

### GPU

Nvidia

### CPU

Intel

### Ollama version

0.1.38
Repository: rust
Issue: pre-commit hook for `./x.py fmt` appears to not always know which files were changed.
Labels: C-bug,S-needs-repro

I tried this PR: https://github.com/rust-lang/rust/pull/125283 (original push was just the first two commits, which have invalid formatting)

I expected to see this happen: `git push` pre-commit-hook should have noticed that the formatting for `library/alloc/src/sync.rs` was invalid in the pre-commit hook.

Instead, this happened: The push completed successfully.

I haven't been able to reproduce the issue (intentionally trying to push code with invalid formatting is caught by the pre-commit-hook in the times I've tried since).
Repository: ollama
Issue: Default Stop Sequence is not working when user provides additional stop sequences
Labels: bug

### What is the issue?

I want to stop generation at stop sequence "\nObservation". 

My expectation here is generation will stop at either "\nObservation" or models default stop sequence "
" (in llama3 case).

But it does not happen and model keep on generating answer.

Request:
![image](https://github.com/ollama/ollama/assets/115451020/294228a0-5364-4ea1-9910-b2d71bd70b60)


Response:
![image](https://github.com/ollama/ollama/assets/115451020/e4ed4524-84d6-4d05-8700-7f467df5e84f)


> I think we should add stop sequences to default stop sequence instead of replacing them


### OS

Windows

### GPU

_No response_

### CPU

Intel

### Ollama version

0.1.27
Repository: rust
Issue: Emit errors or warning to user about recursion of display
Labels: A-lints,A-diagnostics,A-trait-system,T-compiler,L-unconditional_recursion

### Code
code cause recursion stack overflow

```Rust

struct Hello;

impl std::fmt::Debug for Hello {
  fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    write!(f, "{}", self)
  }
}

impl std::fmt::Display for Hello {
  fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    write!(f, "{:}", self)
  }
}

fn main() {
    let h = Hello;
    println!("{}", h);
}
```


### Current output
Runtime error instead of compile time error at present 

```Shell
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
```


### Desired output

In a large code base, such small mistake is hard to locate because it does not point out which recursion call cause stack overflow.


### Rationale and extra context

1. It is calling Display in a implementation for Display, this seems to be abvious recursion can be detected by compiler. I guess there may be general effort to detect recursion call, but if such obvious recursion can be prevented by compiler earlier 
2. there is no use case for using `:` as standalone formatter, and it is better the compiler to emit error to use `:` as standalone formatter because it is likely user want to use `:?` but drop `?` by mistake, 

### Other cases

_No response_

### Rust Version

```Shell
rustc v1.78.0
```


### Anything else?

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=15e6928ea61ea7e8ac7072fa82875e97
Repository: godot
Issue: OpenBSD build is broken due to compilation errors
Labels: bug,platform:linuxbsd,topic:buildsystem

### Tested versions

Reproducible with the `4.3 beta` (commit [daa81bb]) and with the `4.3 dev 6` (commit [64520fe])

### System information

OpenBSD 7.5 GENERIC amd64 (running on QEMU)

### Issue description

OpenBSD build is broken. 

I've tried to build it on freshly installed OpenBSD 7.5 in QEMU, and the build is broken due to compilation errors. I've found the following problems:

1. With the default `scons` build command it fails because the definition of `quick_exit` standard function cannot be found when compiling the file `platform/linuxbsd/x11/detect_prime_x11.cpp`, although the header `<stdlib.h>` is included.
2. If I build with OpenGL disabled with `scons opengl3=no` (that way the source file above won't be included in the build), it sill fails with another error: it can't find the header file `#include <linux/input-event-codes.h>` (which is included in `platform/linuxbsd/wayland/wayland_thread.cpp`). Note: it's linux-specific header, although it's available in FreeBSD, but not in OpenBSD.
3. Problem with `Variant` class: calls to `vformat` with `long` and `unsigned long` parameters make compiler fail to resolve `Variant` class constructor, because there is no constructor with either `long` or `unsigned long` and in this environment neither of `intX_t`/`uintX_t` is typedefed with `long`/`unsigled long`.
4. Definition of the function `secure_getenv(name)` can't be found in `thirdparty/openxr/scr/common/platform_utils.hpp` (line 98).
5. Error: unknown type name `cpu_set_t` in `thirtparty/embree/common/sys/sysinfo.cpp`, line 672.

And most likely there are other errors.


### Steps to reproduce

1. Checkout Godot source code, master branch
2. Install build dependencies: `pkg_add python scons llvm`
6. Run `scons` or `scons opengl3=no`


### Minimal reproduction project (MRP)

N/A
Repository: neovim
Issue: SIGSEGV when adding a `%` to user-commands with `preview` and `complete = "file"` options.
Labels: has:backtrace,bug-crash,cmdline-mode

### Problem



When the character `%` is added to the Ex command-line, and the command in the prompt is defined with the options `preview` and `complete = "file"` (via `nvim_create_user_command`), Neovim crashes with a memory error.

The crash happens only if the current buffer has a file. If `expand("%")` is empty it seems to work.

Sometimes it crashes with a `SIGSEGV` (with no error messages), and some other times it prints `E41: Out of memory!` and dies.

I found the issue with `complete = "file"`, but it also fails with `"dir"`. Other completions (like, `"help"`, `"syntax"`, or `"file_in_path"`) have no problems.

I tested multiple Neovim versions (Linux x86_64, from Nix and from the prebuilt packages in <https://github.com/neovim/neovim/releases>), and it seems that it is broken since 0.8 (when `preview` was added).






### Steps to reproduce

1. Create a user-command with `complete = "file"` and `preview`. The function for `preview` can be empty.

    ```lua
    local function callback()
    end

    local function preview()
        return 0
    end

    vim.api.nvim_create_user_command("TestCommand", callback, {
        nargs = "?",        -- or "*"
        complete = "file",  -- or "dir"
        preview = preview,
    })
    ```

1. Ensure that the current buffer has a file (so `expand("%")` is not empty).

    ```vim
    :e /tmp/testfile
    ```

1. Open the command-line and type the command with any argument without a `%`.

    The completion will work as expected.

    ```vim
    :TestCommand /tmp/<Tab>
    ```

1. Now, write a `%` in the command-line. Neovim crashes immediately.

    ```vim
    :TestCommand /tmp/%
    ```


The steps can be automated:

1. A Lua script to create the user-command, open a file, and simulate the `:TestCommand %` input:

    ```lua
    local function callback()
    end

    local function preview()
        return 0
    end

    vim.api.nvim_create_user_command("TestCommand", callback, {
        nargs = "?",        -- or "*"
        complete = "file",  -- or "dir"
        preview = preview,
    })



    vim.defer_fn(
        function()
            -- Open any file.
            vim.cmd.edit("/tmp/test" .. os.time())

            -- Type the command with a `%`.
            vim.api.nvim_feedkeys(":TestCommand %", "n", false)
        end,
        200
    )
    ```

2. Then, open Neovim with it:

    ```console
    $ nvim --clean -c 'so test-sigsegv.lua'
    ```




### Expected behavior

No crashes.

### Neovim version (nvim -v)

0.10.0

### Vim (not Nvim) behaves the same?

This is exclusive to Neovim

### Operating system/version

Debian 12

### Terminal name/version

Alacritty

### $TERM environment variable

alacritty

### Installation

Prebuilt packages and nixpkgs
Repository: ollama
Issue: Add a Hide/Show switch function
Labels: feature request,ollama.com

sometimes I wish my uploaded model can be hidden from public. is that possible add a hide/show switch button there?
Repository: PowerToys
Issue: Mouse  without borders generated a 180 GB log file
Labels: Issue-Bug,Needs-Triage,Product-Mouse Without Borders

### Microsoft PowerToys version

0.80.1

### Installation method

GitHub

### Running as admin

Yes

### Area(s) with issue?

Mouse Without Borders

### Steps to reproduce

I have Mouse Without Borders always running but since I had to send my screen for repairs I am using my laptop as a screen with a program called Spacedesk Driver and Spacedesk Viewer, my idea is that there is a problem with Mouse Without Borders where it detects there's a problem and creates a log, this log is always growing in size, I have deleted the file since I have no way to send it and I need some space.
![Screenshot 2024-05-19 221036](https://github.com/microsoft/PowerToys/assets/166626359/ca959e2e-0ade-4267-8d54-6d111ab568ea)


### ✔️ Expected Behavior

Not generating a 180 GB log file

### ❌ Actual Behavior

Generated a 180 GB log file

### Other Software

spacedesk DRIVER v2.1.16
spacedesk VIEWER 0.0.33.0
Repository: TypeScript
Issue: Optional parameters instantiated from generic params add `| undefined` to displayed type
Labels: Help Wanted,Possible Improvement

### 🔎 Search Terms

generic function optional undefined ? modifier return infer inferrence

### 🕗 Version & Regression Information

- This is the behavior in every version I tried


### ⏯ Playground Link

https://tsplay.dev/w199kw

### 💻 Code

```ts
// Since 4.7, TS doesn't innately add `|undefined` to optional params the way it does for props with EOPT off

type Expected = (arg?: number) => void
//   ^? (arg?: number) => void


// But it adds it when instantiating a type from a generic param

type OptionalUnary<t> = (arg?: t) => void

type Fail = OptionalUnary<number>
//    ^? (arg?: number | undefined) => void

declare const foo: <t>(arg?: t) => void  

const instantiated = foo<number>
//    ^? (arg?: number | undefined) => void

declare const bar: <t>(arg: t) => (arg?: t) => void;

const returned = bar(42);
//    ^? (arg?: number | undefined) => void
```


### 🙁 Actual behavior

(see example)

### 🙂 Expected behavior

(see example)

### Additional information about the issue

I don't think this is likely to cause type-safety issues. It's primarily just visual clutter and inconsistency with the standard behavior.
Repository: excalidraw
Issue: zoom function not super predictable
Labels: UX/UI

When navigating the canvas with two fingers - zooming in, zooming out - the expected view gets lost over time. The link to the video shows how objects move upward, although the fingers return to their original position https://github.com/excalidraw/excalidraw/issues/6913#issuecomment-2119277427

It will be super cool if the navigation is in Excalidraw will be identical Google Keep. 

Thank you for your attention!
Repository: pytorch
Issue: `kthvalue()` cannot be used with `complex` or `bool` type of a 1D or more D tensor but `kthvalue()`  can be used with `complex` or `bool` type of a 0D tensor
Labels: triaged,module: edge cases

### 🐛 Describe the bug

It seems like [kthvalue()](https://pytorch.org/docs/stable/generated/torch.kthvalue.html) cannot be used with `complex` type of a 1D or more D tensor according to the errors as shown below:

`complex` type of a 1D tensor:

```python
import torch

my_tensor = torch.tensor([0.+0.j, 1.+0.j, 2.+0.j], device='cpu')

torch.kthvalue(input=my_tensor, k=2) # RuntimeError: "kthvalue_cpu" not implemented for 'ComplexFloat'

my_tensor = torch.tensor([0.+0.j, 1.+0.j, 2.+0.j], device='cuda:0')

torch.kthvalue(input=my_tensor, k=2) # RuntimeError: "kthvalue_cuda" not implemented for 'ComplexFloat'
```

`bool` type of a 1D tensor:

```python
import torch

my_tensor = torch.tensor([True, False, True], device='cpu')

torch.kthvalue(input=my_tensor, k=2) # RuntimeError: "kthvalue_cpu" not implemented for 'Bool'

my_tensor = torch.tensor([True, False, True], device='cuda:0')

torch.kthvalue(input=my_tensor, k=2) # RuntimeError: "kthvalue_cuda" not implemented for 'Bool'
```

`complex` type of a 2D tensor:

```python
import torch

my_tensor = torch.tensor([[0.+0.j, 1.+0.j], [2.+0.j, 3.+0.j]], device='cpu')

torch.kthvalue(input=my_tensor, k=2) # RuntimeError: "kthvalue_cpu" not implemented for 'ComplexFloat'

my_tensor = torch.tensor([[0.+0.j, 1.+0.j], [2.+0.j, 3.+0.j]], device='cuda:0')

torch.kthvalue(input=my_tensor, k=2) # RuntimeError: "kthvalue_cuda" not implemented for 'ComplexFloat'
```

`bool` type of a 2D tensor:

```python
import torch

my_tensor = torch.tensor([[True, False], [False, True]], device='cpu')

torch.kthvalue(input=my_tensor, k=2)  # RuntimeError: "kthvalue_cpu" not implemented for 'Bool'

my_tensor = torch.tensor([[True, False], [False, True]], device='cuda:0')

torch.kthvalue(input=my_tensor, k=2) # RuntimeError: "kthvalue_cuda" not implemented for 'Bool'
```

But [kthvalue()](https://pytorch.org/docs/stable/generated/torch.kthvalue.html) can be used with `complex` or `bool` type of a 0D tensor as shown below:

`complex` type of a 0D tensor:

```python
import torch

my_tensor = torch.tensor(0.+0.j, device='cpu')

torch.kthvalue(input=my_tensor, k=1)
# torch.return_types.kthvalue(
# values=tensor(0.+0.j),
# indices=tensor(0))

my_tensor = torch.tensor(0.+0.j, device='cuda:0')

torch.kthvalue(input=my_tensor, k=1)
# torch.return_types.kthvalue(
# values=tensor(0.+0.j, device='cuda:0'),
# indices=tensor(0, device='cuda:0'))
```

`bool` type of a 0D tensor:

```python
import torch

my_tensor = torch.tensor(True, device='cpu')

torch.kthvalue(input=my_tensor, k=1)
# torch.return_types.kthvalue(
# values=tensor(True),
# indices=tensor(0))

my_tensor = torch.tensor(True, device='cuda:0')

torch.kthvalue(input=my_tensor, k=1)
# torch.return_types.kthvalue(
# values=tensor(True),
# indices=tensor(0))
```

### Versions

```python
import torch

torch.__version__ # 2.2.1+cu121
```