Skip to content

Commit

Permalink
C# example README update (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
natke authored Mar 15, 2024
1 parent 143308f commit b740fd3
Showing 1 changed file with 6 additions and 7 deletions.
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

0 comments on commit b740fd3

Please sign in to comment.