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

convertencoder --model-name project/huggingface_repo --format onnx --output-dir /my/output/dir --cache-dir /cache/dir --output-model-name t5_encoder

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
--output-model-name If not specified, the default output model name will be parsed depends on the --model_name parameter.
If --output-model-name is not specified, 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

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.1.tar.gz (3.3 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.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: encoder_converter-0.2.1.tar.gz
  • Upload date:
  • Size: 3.3 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.1.tar.gz
Algorithm Hash digest
SHA256 a85602aa6d663934b12b42a8b2cd8d5ed4304beb41996362e9f49098a37e8ecf
MD5 afc7940980080aa10ce7affea248b36c
BLAKE2b-256 9123ebfce05f5a6c2fa10681e60b49be17a9e3fd7e62f5c926f707e3389e9b33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: encoder_converter-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ada481b661397a0f11b3cbe97c867455a6768acb230c0b55841682f6b32d3eb4
MD5 54e82818b2f0bda0e25fb83a8adcb60e
BLAKE2b-256 0dbf8a9c062f0ae600e92a4c25ad7d90efb43c5dea4f2cd1d3f2e17a0856f0b2

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