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.30.tar.gz
(18.1 kB
view details)
Built Distribution
tira-0.0.30-py3-none-any.whl
(22.8 kB
view details)
File details
Details for the file tira-0.0.30.tar.gz
.
File metadata
- Download URL: tira-0.0.30.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14f48dee17e383b91b60219e030ee691a1fa07e4b0833e3ed0d5917e0ada2763 |
|
MD5 | e5f16b9a99044dda5b49323ada86bf1a |
|
BLAKE2b-256 | 7a1a2572b9f678acbe5d5a876bb603af1ccbf3f4252f6793df338bafe08f3e50 |
File details
Details for the file tira-0.0.30-py3-none-any.whl
.
File metadata
- Download URL: tira-0.0.30-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 944b442ba76fb8953ad0db4fdcbf2294c8799a25e68fa80423f15d5ad85e1432 |
|
MD5 | 067be200fbdce9a1d363d3a5e507abd1 |
|
BLAKE2b-256 | 099ed54ec1fe4c0342bc34324fc0625e607488e5456c8edd3aa9e04fbc7ed612 |