Skip to content

Commit 2ef06c2

Browse files
Installation guide for installing release branches (#637)
Added installation guide for installing release branches --------- Signed-off-by: Rishin Raj <[email protected]> Signed-off-by: Abukhoyer Shaik <[email protected]> Co-authored-by: Abukhoyer Shaik <[email protected]>
1 parent e4c8878 commit 2ef06c2

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,13 @@ python3.10 -m venv qeff_env
9393
source qeff_env/bin/activate
9494
pip install -U pip
9595

96-
# Clone and Install the QEfficient Repo.
96+
# Clone and Install the QEfficient repository from the mainline branch
9797
pip install git+https://github.com/quic/efficient-transformers
9898

99+
# Clone and Install the QEfficient repository from a specific branch, tag or commit by appending @ref
100+
# Release branch (e.g., release/v1.20.0):
101+
pip install "git+https://github.com/quic/efficient-transformers@release/v1.20.0"
102+
99103
# Or build wheel package using the below command.
100104
pip install build wheel
101105
python -m build --wheel --outdir dist

docs/source/quick_start.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,26 @@ Benchmark the model on Cloud AI 100, run the infer API to print tokens and tok/s
221221
tokenizer = AutoTokenizer.from_pretrained(model_name)
222222
qeff_model.generate(prompts=["My name is"],tokenizer=tokenizer)
223223
```
224+
225+
### Local Model Execution
226+
If the model and tokenizer are already downloaded, we can directly load them from local path.
227+
228+
```python
229+
from QEfficient import QEFFAutoModelForCausalLM
230+
from transformers import AutoTokenizer
231+
232+
# Local path to the downloaded model. You can find downloaded HF models in:
233+
# - Default location: ~/.cache/huggingface/hub/models--{model_name}/snapshots/{snapshot_id}/
234+
local_model_repo = "~/.cache/huggingface/hub/models--gpt2/snapshots/607a30d783dfa663caf39e06633721c8d4cfcd7e"
235+
236+
# Load model from local path
237+
model = QEFFAutoModelForCausalLM.from_pretrained(pretrained_model_name_or_path=local_model_repo)
238+
239+
model.compile(num_cores=16)
240+
241+
# Load tokenizer from the same local path
242+
tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path=local_model_repo)
243+
244+
model.generate(prompts=["Hi there!!"], tokenizer=tokenizer)
245+
```
224246
End to End demo examples for various models are available in [**notebooks**](https://github.com/quic/efficient-transformers/tree/main/notebooks) directory. Please check them out.

0 commit comments

Comments
 (0)