-
Notifications
You must be signed in to change notification settings - Fork 1.4k
transformers==4.37, yi & yuan2 & vicuna #11805
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
Conversation
ada-jt1725
commented
Aug 15, 2024
- added sample output for yi & vicuna
- updated vicuna example model to 7b-v1.5 & 13b-v1.5
- added yi-6b-chat model to yi
#### [lmsys/vicuna-13b-v1.5](https://huggingface.co/lmsys/vicuna-13b-v1.5) | ||
```log | ||
Inference time: xxxx s | ||
Inference time: 1.0269405841827393 s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't show real performance data in our example, just keep Inference time: xxxx s
.
#### [eachadea/vicuna-7b-v1.5](https://huggingface.co/lmsys/vicuna-7b-v1.5) | ||
```log | ||
Inference time: xxxx s | ||
Inference time: 0.7162051200866699 s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just keep Inference time: xxxx s
.
In the example, several arguments can be passed to satisfy your requirements: | ||
|
||
- `--repo-id-or-model-path REPO_ID_OR_MODEL_PATH`: argument defining the huggingface repo id for the Yi model (e.g. `01-ai/Yi-6B`) to be downloaded, or the path to the huggingface checkpoint folder. It is default to be `'01-ai/Yi-6B'`. | ||
- `--repo-id-or-model-path REPO_ID_OR_MODEL_PATH`: argument defining the huggingface repo id for the Yi model (e.g. `01-ai/Yi-6B`) to be downloaded, or the path to the huggingface checkpoint folder. It is default to be `'01-ai/Yi-6B-Chat'`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(e.g. 01-ai/Yi-6B
and 01-ai/Yi-6B-Chat
)
|
||
```log | ||
Inference time: xxxx s | ||
Inference time: 1.1255202293395996 s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just keep Inference time: xxxx s
.
|
||
#### [01-ai/Yi-6B-Chat](https://huggingface.co/01-ai/Yi-6B-Chat) | ||
```log | ||
Inference time: 0.5318927764892578 s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just keep Inference time: xxxx s
.
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser(description='Predict Tokens using `generate()` API for Yi model') | ||
parser.add_argument('--repo-id-or-model-path', type=str, default="01-ai/Yi-6B", | ||
parser.add_argument('--repo-id-or-model-path', type=str, default="/home/arda/jinhe/Yi-6B-Chat", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default="01-ai/Yi-6B-Chat"
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser(description='Predict Tokens using `generate()` API for Yi model') | ||
parser.add_argument('--repo-id-or-model-path', type=str, default="01-ai/Yi-6B", | ||
parser.add_argument('--repo-id-or-model-path', type=str, default="/01-ai/Yi-6B-Chat", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default="01-ai/Yi-6B-Chat"
from ipex_llm.transformers import AutoModelForCausalLM | ||
from transformers import AutoTokenizer | ||
|
||
# Refer to https://huggingface.co/01-ai/Yi-6B-Chat#31-use-the-chat-model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also delete this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM