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.34.tar.gz
(20.0 kB
view details)
Built Distribution
tira-0.0.34-py3-none-any.whl
(23.6 kB
view details)
File details
Details for the file tira-0.0.34.tar.gz
.
File metadata
- Download URL: tira-0.0.34.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9653952c6ab7d78ed4bf4b75be6a1b95dcd419a2fd746d6f3e1d6c99bd011d55 |
|
MD5 | 8518de5eca18fbb49dfab0894af224e9 |
|
BLAKE2b-256 | e9afc0a766737a22c5eb461b98e5acd24e06f241ba671fabc0dd40346360436a |
File details
Details for the file tira-0.0.34-py3-none-any.whl
.
File metadata
- Download URL: tira-0.0.34-py3-none-any.whl
- Upload date:
- Size: 23.6 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 | abfaf355cd0b2c08eb23de71de6e8243185617aa313b504ebca043e13d08c9b6 |
|
MD5 | 01b9ea5206b105dd5dabc4a230e7c55f |
|
BLAKE2b-256 | ded4ff700ad31c8e5502e37fee382d9c0851bb39ae5670f181c4cf199ddf892a |