Closed lijianxing123 closed 1 year ago
vllm vicuna-7b-v1.1 script:
from vllm import LLM, SamplingParams
prompts = [
"Hello, my name is",
"The president of the United States is",
"The capital of France is",
"The future of AI is",
]
sampling_params = SamplingParams(max_tokens=256)
# Create an LLM.
llm = LLM(model="lmsys/vicuna-7b-v1.1")
outputs = llm.generate(prompts, sampling_params)
# Print the outputs.
for output in outputs:
prompt = output.prompt
generated_text = output.outputs[0].text
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
the results is:
Prompt: 'The future of AI is', Generated text: 'here, and it’s called “Generative AI”. In this podcast, we introduce you to the key players in the industry and what makes Generative AI so special:</s>'
Prompt: 'The president of the United States is', Generated text: 'the leader of the free world, responsible for guiding the nation and its policies. In the past, no other occupation of an American president has been confirmed from flying a plane to being the mayor of a small town. However, being president of the United States is an important job requirement. It requires an individual who is willing to take on the challenges of office and lead the country through both good times and bad.</s>'
Prompt: 'Hello, my name is', Generated text: "D'Arcy, and I' Yeah, I know, it's a bit of a mouthful. My parents had high hopes for me, and then they met my sister. Anyway, I've been doing this stand-up comedy thing for a couple of years now, and I've been lucky enough to perform all over Scotland. My comedy is a bit observational, and I like to poke fun at myself and the world around us. I hope you enjoy it!</s>"
Prompt: 'The capital of France is', Generated text: 'Paris, which is actually split into two main districts. The first is the City of Paris, which is the most central part of the city, and it is home to iconic landmarks such as the Eiffel Tower, the Louvre Museum, Notre Dame Cathedral, and the Pompidou Center. The second is La banlieue, which refers to the outer suburbs of Paris. This mainly residential area covers around 1,500 square kilometers, and it is home to around four million people. Many of La banlieue residents are immigrants or children of immigrants, who have moved to Paris looking for work or a better life. While the suburbs are considered somewhat isolated from the rest of France, they have a rich culture of their own, with many unique neighborhoods and a diverse mix of people.\n\nImportant landmarks in La banlieue include various sports stadiums, such as the Stade de France, the largest stadium in France, which is located in Saint-Denis, and the Parc des Princes stadium, which is home to the Paris Saint-Germain football club. There are also several theme parks in La banlieue, such'
The default sampling parameters for vllm and the default generation parameters for huggingface seem to differ. For one, huggingface uses greedy decoding by default while vllm uses sampling. Does vllm still differ when set to greedy decoding?
Close this issue since it seems like to be the incorrect setting of sampling parameters. Feel free to reopen the issue if you meet any further problems!
transformers vicuna-7b-v1.1 script:
the results is: