Skip to main content

Hub for rct models

Project description

rct-modelpool

Installation

You can git install rctmodelpool via pip:

pip install git+https://github.com/rct-ai/rct-modelpool

or

pip install rctmodelpool

Usage

You can import the rctmodelpool.modelpool from the package like so:

sync_model

from rctmodelpool import modelpool

path = modelpool.sync_model("rcthub://CPM.csv")
print(path)

sync tgz

import os
import tarfile
from rctmodelpool import modelpool
from pathlib import Path

local_path = modelpool.sync_model("rcthub://"+config.bert_model_path)
parent_path = Path(local_path).parent
print("rcthub sync:",local_path)
modeltar = tarfile.open(local_path)
inside_folder = os.path.commonprefix(modeltar.getnames())
real_model_path = os.path.join(parent_path, inside_folder)
print('model folder:', real_model_path)
if not os.path.exists(real_model_path):
    modeltar.extractall(parent_path)
    print('tar extraction:', parent_path, local_path)

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

rctmodelpool-0.1.9.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

rctmodelpool-0.1.9-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

Supported by

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