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

add vLLM surpport for gradio demo, inference script and openai api demo #35

Merged
merged 10 commits into from
Aug 2, 2023

Conversation

GoGoJoestar
Copy link
Collaborator

Description

This PR add support for gradio demo (gradio_demo.py), inference script (inference_hf.py) and openai api demo (add 3 new file in directionary openai_server_demo)

Related Issue

None.

@airaria
Copy link
Contributor

airaria commented Aug 1, 2023

Why we need openai_server_demo/README_vllm.md?
Can we just use one README file?

@GoGoJoestar
Copy link
Collaborator Author

Some contents in openai_server_demo/README_vllm.md and openai_server_demo/README.md are similar or even same, but some are different, it's hard to merge. If add README_vllm.md to the end of README.md, the doc is too long. So, I create a new README file.

Comment on lines 105 to 111
model_vocab_size = base_model.get_input_embeddings().weight.size(0)
tokenzier_vocab_size = len(tokenizer)
print(f"Vocab of the base model: {model_vocab_size}")
print(f"Vocab of the tokenizer: {tokenzier_vocab_size}")
if model_vocab_size!=tokenzier_vocab_size:
print("Resize model embeddings to fit tokenizer")
base_model.resize_token_embeddings(tokenzier_vocab_size)
Copy link
Contributor

Choose a reason for hiding this comment

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

tokenzier->tokenizer

@ymcui ymcui merged commit 7b0c3b7 into ymcui:main Aug 2, 2023
1 check passed
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.

3 participants