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

C# example README update #202

Merged
merged 1 commit into from
Mar 15, 2024
Merged
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: 6 additions & 7 deletions examples/csharp/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# Gen-AI C# Phi-2 Example

## Install the onnxruntime-genai library


## Get the model

You can generate the model using the model builder this library, or bring your own model.

If you bring your own model, you need to provide the configuration. See the [config reference](https://onnxruntime.ai/docs/genai/reference/config).
You can generate the model using the model builder provided with this library, or bring your own model.

To generate the model with model builder:

1. Install the python package

Install the Python package according to the [installation instructions](https://onnxruntime.ai/docs/genai/install).


2. Install the model builder script dependencies

```bash
Expand All @@ -25,13 +19,18 @@ To generate the model with model builder:
pip install onnx
pip install onnxruntime
```

3. Run the model builder script to export, optimize, and quantize the model. More details can be found [here](../../src/python/py/models/README.md)

```bash
cd examples/python
python -m onnxruntime_genai.models.builder -m microsoft/phi-2 -e cpu -p int4 -o ./example-models/phi2-int4-cpu
```

The model builder also generates the configuration needed by the API to run generation. You can modify the config according to your scenario.

If you bring your own model, you need to provide the configuration. See the [config reference](https://onnxruntime.ai/docs/genai/reference/config).

## Run the phi-2 model

Install the OnnxRuntime.GenAI nuget according to the [installation instructions](https://onnxruntime.ai/docs/genai/install).
Expand Down
Loading