Skip to main content

Convert huggingface encoder to onnx format.

Project description

Encoder converter

:rocket: Easy way to convert huggingface encoder model to other formats.

Description

Encoder converter is a package that allows you to convert the huggingface encoder model to other formats (e.g. onnx).

Features

Unfinished features will be implemented in future versions.

  • Convert encoder model to onnx.
  • Convert encoder model to openvino.
  • Convert model with custom wrapper.

Installation

pip install encoder-converter

Usage

Run

You can find the complied model at output_dir/huggingface_repo.extension:

  1. output_dir - --ouput-dir parameter.
  2. huggingface_repo - extracts from the --model-name parameter.
  3. extension - depends on selected format parameter:
    • onnx - onnx
    • openvino - xml
convertencoder --model-name project/huggingface_repo --format onnx --output-dir /my/output/dir --cache-dir /cache/dir

Parameters

Parameter Description Default
--model-name Huggingface model name
--format Compiled model format. Available: onnx, openvino
--output-dir Path to save compiled model and tokenizer artifacts.
--cache-dir Path to a directory in which a downloaded pretrained model configuration should be cached while compiling. /tmp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

encoder_converter-0.2.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

encoder_converter-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file encoder_converter-0.2.0.tar.gz.

File metadata

  • Download URL: encoder_converter-0.2.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.9 Darwin/24.3.0

File hashes

Hashes for encoder_converter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 33b21159a4aa5619232934834f7cc16a0448f7446166e5d6409f389569ae9299
MD5 65a6a2934f9b0419635158715169b6d0
BLAKE2b-256 e356cac69285dadc416837bd418476ba4c926f94c86af9b385661fd029fb34b8

See more details on using hashes here.

File details

Details for the file encoder_converter-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: encoder_converter-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.9 Darwin/24.3.0

File hashes

Hashes for encoder_converter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d4df0df9d9c8cf129986517521b5627188e74f619474274446a3913e252da0e
MD5 31b9dc1d408181d6fe15a9a59ad130c9
BLAKE2b-256 9a9e15cc1f9d229e46da48e450e83b60a01f5125d5b6c8327d21c035a8a04fb2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page