Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

num_return_sequences not working #1007

Open
3 of 5 tasks
songkeys opened this issue Nov 1, 2024 · 0 comments
Open
3 of 5 tasks

num_return_sequences not working #1007

songkeys opened this issue Nov 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@songkeys
Copy link

songkeys commented Nov 1, 2024

System Info

Node.js / browser

Environment/Platform

  • Website/web-app
  • Browser extension
  • Server-side (e.g., Node.js, Deno, Bun)
  • Desktop app (e.g., Electron)
  • Other (e.g., VSCode extension)

Description

According to this doc:

SCR-20241102-cwcw

num_return_sequences should return multiple sequences.

But in real run, it only outputs one.

Reproduction

A test script:

import { pipeline } from "@huggingface/transformers";

const generator = await pipeline(
	"text-generation",
	"onnx-community/Llama-3.2-1B-Instruct"
);
const text = "Once upon a time, there was";
const output = await generator(text, {
	temperature: 2,
	max_new_tokens: 10,
	repetition_penalty: 1.5,
	no_repeat_ngram_size: 2,
	num_beams: 2,
	num_return_sequences: 2,
});

console.log(output);

Output:

[
  {
    generated_text: 'Once upon a time, there was no such thing as social media. You were limited'
  }
]
@songkeys songkeys added the bug Something isn't working label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant