Python ノードを使用した Seq2seq デモ#

イメージをビルド#

リポジトリーのルートから次を実行します:

git clone https://github.com/openvinotoolkit/model_server.git 
cd model_server make python_image

Python 計算機を使用した OpenVINO モデルサーバーのデプロイ#

必要条件:

  • Python サポートと Optimum がインストールされた OVMS のイメージ

以下を含む ./servable をマウント:

  • model.py および config.py - 実行に必要な Python スクリプトで、optimum-intel アクセラレーションを備えた Hugging Face ユーティリティーを使用します。

  • config.json - ロードするサーバブルを定義します

  • graph.pbtxt - Python 計算機を含む MediaPipe グラフを定義します

cd demos/python_demos/seq2seq_translation 
docker run -it --rm -p 9000:9000 -v ${PWD}/servable:/workspace openvino/model_server:py --config_path /workspace/config.json --port 9000

翻訳を要求#

クライアント・パッケージをインストール

pip3 install -r requirements.txt

クライアント・スクリプトを実行

python3 client.py --url localhost:9000

期待される出力:

Text: 
He never went out without a book under his arm, and he often came back with two.

Translation: 
Il n'est jamais sorti sans un livre sous son bras, et il est souvent revenu avec deux.