Update README.md
This commit is contained in:
parent
474b29ef61
commit
467adac814
12
README.md
12
README.md
@ -20,11 +20,7 @@ Phi-1.5 can write poems, draft emails, create stories, summarize texts, write Py
|
||||
|
||||
## How to Use
|
||||
|
||||
Phi-1.5 has been integrated in the `transformers` version 4.37.0. If you are using a lower version, ensure that you are doing the following:
|
||||
|
||||
* When loading the model, ensure that `trust_remote_code=True` is passed as an argument of the `from_pretrained()` function.
|
||||
|
||||
The current `transformers` version can be verified with: `pip list | grep transformers`.
|
||||
Phi-1.5 has been integrated in the `transformers` version 4.37.0, please ensure that you are using a version equal or higher than it.
|
||||
|
||||
## Intended Uses
|
||||
|
||||
@ -91,8 +87,6 @@ where the model generates the text after the comments.
|
||||
|
||||
* Phi-1.5 has not been tested to ensure that it performs adequately for any production-level application. Please refer to the limitation sections of this document for more details.
|
||||
|
||||
* If you are using `transformers<4.37.0`, always load the model with `trust_remote_code=True` to prevent side-effects.
|
||||
|
||||
## Sample Code
|
||||
|
||||
```python
|
||||
@ -101,8 +95,8 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
torch.set_default_device("cuda")
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-1_5", torch_dtype="auto", trust_remote_code=True)
|
||||
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-1_5", trust_remote_code=True)
|
||||
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-1_5", torch_dtype="auto")
|
||||
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-1_5")
|
||||
|
||||
inputs = tokenizer('''def print_prime(n):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user