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

Fix internlm after https://github.com/vllm-project/vllm/pull/2860 #2861

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

pcmoritz
Copy link
Collaborator

Sorry, I was shooting a little too fast with #2860 and it got merged before I could try it out end-to-end. This PR fixes the model, to verify the fix I ran the following:

In [1]: from vllm import LLM, SamplingParams

In [2]: 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(temperature=0.8, top_p=0.95)

In [3]: llm = LLM(model="internlm/internlm-7b", trust_remote_code=True)

In [5]: outputs = llm.generate(prompts, sampling_params)

In [6]: # 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}")
   ...: 
Prompt: 'Hello, my name is', Generated text: ' Lorena. I am a native Spanish speaker who loves to travel, read,'
Prompt: 'The president of the United States is', Generated text: " in Europe this week, but he's only making one stop in the former Soviet"
Prompt: 'The capital of France is', Generated text: ' Paris. The city is also called “City of Light” and “City of'
Prompt: 'The future of AI is', Generated text: ' bright, but there are a few things to be aware of\n\nThe future of'

The error was that https://huggingface.co/internlm/internlm-7b/blob/main/config.json doesn't have num_key_value_heads.

@pcmoritz pcmoritz changed the title Fix internlm Fix internlm after https://github.com/vllm-project/vllm/pull/2860 Feb 14, 2024
Copy link
Collaborator

@WoosukKwon WoosukKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the PR. Sorry, I merged the previous one too quickly 😓 Let me know if the PR looks good to go.

@pcmoritz
Copy link
Collaborator Author

No worries, I should have written that I hadn't tested it yet 😓

I tested it now with internlm/internlm-chat-20b, internlm/internlm-7b and internlm/internlm-chat-7b so should be ready :)

@WoosukKwon WoosukKwon merged commit 0c48b37 into vllm-project:main Feb 14, 2024
16 of 19 checks passed
jvmncs pushed a commit to jvmncs/vllm that referenced this pull request Feb 14, 2024
xjpang pushed a commit to xjpang/vllm that referenced this pull request Feb 20, 2024
xjpang pushed a commit to xjpang/vllm that referenced this pull request Feb 22, 2024
xjpang pushed a commit to xjpang/vllm that referenced this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants