From 7e130907c9ca208d32629277c2616001f08ab3a8 Mon Sep 17 00:00:00 2001 From: Gustavo de Rosa Date: Wed, 17 Apr 2024 13:46:25 +0000 Subject: [PATCH] Readme: fix generation, update transformers version instructions (#121) - Readme: fix generation, update transformers version instructions (96bc18c2e7946021a4f821caa7d6a32484bde76e) Co-authored-by: Pedro Cuenca --- README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0d00c90..09a4bda 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,7 @@ Our model hasn't been fine-tuned through reinforcement learning from human feedb ## How to Use -Phi-2 has been integrated in the development version (4.37.0.dev) of `transformers`. Until the official version is released through `pip`, ensure that you are doing one of the following: - -* When loading the model, ensure that `trust_remote_code=True` is passed as an argument of the `from_pretrained()` function. - -* Update your local `transformers` to the development version: `pip uninstall -y transformers && pip install git+https://github.com/huggingface/transformers`. The previous command is an alternative to cloning and installing from the source. - -The current `transformers` version can be verified with: `pip list | grep transformers`. +Phi-2 was integrated in `transformers` version 4.37. If you need to use an earlier version, you need to pass `trust_remote_code=True` to the `from_pretrained()` function. ## Intended Uses @@ -103,7 +97,7 @@ inputs = tokenizer('''def print_prime(n): """''', return_tensors="pt", return_attention_mask=False) outputs = model.generate(**inputs, max_length=200) -text = tokenizer.batch_decode(outputs)[0] +text = tokenizer.batch_decode(outputs[0]) print(text) ```