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.7.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for rctmodelpool-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5cd783b0683e796001645d98c48b4f76ca700d71ecb26a0df5a979f53906416 |
|
MD5 | c6f66c732c46b1a565ae5cda5174625c |
|
BLAKE2b-256 | 3946f9dc027fcd67e8ae278bd84ca5f9f9237d5955ce1e1357a9f3f0a3ad0f93 |