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.6.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for rctmodelpool-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e0dbee8b5cecd62223736511aeff6d28dbf739c0cd02ff805c3da0bfbbc406c |
|
MD5 | 23131942fa7c4fe45d40680aa687b388 |
|
BLAKE2b-256 | 1e6ed746c30fb85cf11de8039341d9bc04b35f4de2a42408a15f9c23c901404a |