Simple access to the TIRA API.
Project description
Running Jupyter Notebooks with TIRA
docker build -t tira/submission-base-image:1.0.0 -f Dockerfile .
Testing the model locally can be done using the following command:
tira-run \
--input-directory ${PWD}/input \
--output-directory ${PWD}/output \
--image tira/submission-base-image:1.0.0 \
--command 'tira-run-notebook --input $inputDataset --output $outputDir /workspace/template-notebook.ipynb'
Afterwards you can push the image to TIRA
docker push tira/submission-base-image:1.0.0
and set the command:
tira-run-notebook --input $inputDataset --output $outputDir /workspace/template-notebook.ipynb
Finally, if the actual processing in notebook is toggled via is_running_as_inference_server()
(as seen in the
template notebook)
and your notebook defines a function named predict
in the format
def predict(input_list: List) -> List:
you can start an inference server for your model with:
PORT=8001
docker run --rm -it --init \
-v "$PWD/logs:/workspace/logs" \
-p $PORT:$PORT \
tira/submission-base-image:1.0.0 \
tira-run-inference-server --notebook /workspace/template-notebook.ipynb --port $PORT
Exemplary request for a server running on localhost:8001
are
# POST (JSON list as payload)
curl -X POST -H "application/json" \
-d "[\"element 1\", \"element 2\", \"element 3\"]" \
localhost:8001
and
# GET (JSON object string(s) passed to the 'payload' parameter)
curl "localhost:8001?payload=\"element+1\"&payload=\"element+2\"&payload=\"element+3\""
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tira-0.0.42.tar.gz
(23.2 kB
view details)
Built Distribution
tira-0.0.42-py3-none-any.whl
(27.4 kB
view details)
File details
Details for the file tira-0.0.42.tar.gz
.
File metadata
- Download URL: tira-0.0.42.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bce886fda929d08fcaec20869fce9f41bf84abbba4769bc24eb17683109c827d |
|
MD5 | 178edd786e3a8a8bac86215393e140ff |
|
BLAKE2b-256 | 9b3291ff3a85f02797f686261ccf163abc2e631989a5f414cc756efdce372347 |
File details
Details for the file tira-0.0.42-py3-none-any.whl
.
File metadata
- Download URL: tira-0.0.42-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a53346f1a91c44afa7bf44d8e23495957109ebb359c97274074e2bb8c1b46885 |
|
MD5 | 1924931d38a8b6f90345884ae20a2782 |
|
BLAKE2b-256 | 64bc4c1240f8f8477db5228e7c93ca449fc7a956d9606c2a43ee7d67f000c2ec |