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

Update README #1

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,19 @@ See full documentation at [https://onnxruntime.ai/docs/genai].

[Install](https://onnxruntime.ai/docs/genai/howto/install) the onnxruntime-genai Python package.

1. Build the model
```shell
python -m onnxruntime_genai.models.builder -m microsoft/phi-2 -e cpu -p int4 -o ./models/phi2
```

2. Run inference
```python
import os
import onnxruntime_genai as og

model = og.Model(f'models/microsoft/phi-2')
model_path = os.path.abspath("./models/phi2")

model = og.Model(model_path)

tokenizer = og.Tokenizer(model)

Expand All @@ -64,7 +73,7 @@ prompt = '''def print_prime(n):

tokens = tokenizer.encode(prompt)

params = og.SearchParams(model)
params = og.GeneratorParams(model)
params.set_search_options({"max_length":200})
params.input_ids = tokens

Expand Down
4 changes: 2 additions & 2 deletions benchmark/python/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ This is an end-to-end benchmarking script for any GenAI-supported ONNX model.


Prerequisites:
0) Install onnxruntime-genai and onnxruntime
0) Install pandas, onnxruntime-genai and onnxruntime

1) Use builder.py to build the desired ONNX model

2) Run this script with the desired arguments. Run benchmark_e2e.py -h for help.


Example call to benchmarking script
python benchmark_e2e.py -i {model folder} -b 1 -l 128 -g 256 -r 100 -w 10 -k 5 -o {output csv file name}
python benchmark_e2e.py -i {model folder} -b 1 -l 128 -g 256 -r 100 -w 10 -k 5 -o {output csv file name}
Loading