Skip to content

Commit

Permalink
Merge pull request opendatahub-io#86 from heyselbi/update-bootstrap
Browse files Browse the repository at this point in the history
Update model conversion instructions
  • Loading branch information
openshift-merge-robot authored Sep 20, 2023
2 parents 3382f48 + b433c35 commit dfac4bb
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions demo/kserve/built-tip.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
# Bootstrap process(optional)
# Bootstrap process (optional)

Caikit-TGIS image always requires a Caikit-formatted model. Below are the instructions from converting a model to a Caikit-formatted one.

1. Clone the model repository (or have the model folder in a directory). In the below example, Bloom-560m model repo is cloned.
~~~
yum -y install git git-lfs
git lfs install
git clone https://huggingface.co/bigscience/bloom-560m
~~~

python3 -m virtualenv venv
2. Clone the caikit-nlp repo:
~~~
git clone https://github.com/caikit/caikit-nlp.git
~~~

3. Create a virtual environment with Python 3.9 and install the caikit-nlp
~~~
python3 -m virtualenv -p python3.9 venv
source venv/bin/activate
python3.9 -m pip install ./caikit-nlp
~~~

4. (Optional) Clone the caikit-tgis-serving repo, if not already available.
~~~
git clone https://github.com/opendatahub-io/caikit-tgis-serving.git
~~~

git clone https://github.com/Xaenalt/caikit-nlp
python3.9 -m pip install ./caikit-nlp/ (python 3.11 can not compile) <pip install ./caikit-nlp>
cp ../convert.py .
5. Invoke the conversion script located in /utils of caikit-tgis-serving repo.
~~~
cp caikit-tgis-serving/utils/convert.py .
./convert.py --model-path ./bloom-560m/ --model-save-path ./bloom-560m-caikit
~~~

6. Move the model folder (ie. `/bloom-560m-caikit`) into desired storage (ie. S3, MinIO, PVC or other)
7. Do *not* include the model folder name/directory directly in InferenceService, but rather point to the directory where the model folder is located. Let's say the `bloom-560m-caikit` directory is located at: `example-models/llm/models/bloom-560m-caikit/`, then `storageUri` value in the InferenceService CR should look like:
~~~
storageUri: s3://example-models/llm/models
~~~

0 comments on commit dfac4bb

Please sign in to comment.