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.37.tar.gz
(22.2 kB
view details)
Built Distribution
tira-0.0.37-py3-none-any.whl
(26.1 kB
view details)
File details
Details for the file tira-0.0.37.tar.gz
.
File metadata
- Download URL: tira-0.0.37.tar.gz
- Upload date:
- Size: 22.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 | 903b809d983634ca5bfda0458e383c7a48fefd522350224a75c033d893d87dc1 |
|
MD5 | 520ba477320649480b357d2089906c37 |
|
BLAKE2b-256 | 7bea57ebc4d5aff2f1c2d466f96c87463d6263201457c5488afaaacebc613c63 |
File details
Details for the file tira-0.0.37-py3-none-any.whl
.
File metadata
- Download URL: tira-0.0.37-py3-none-any.whl
- Upload date:
- Size: 26.1 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 | 77de73db38c9fb79d06ef6be207dbf6dc894d11d4c85a96675482a39c6793e82 |
|
MD5 | cc010e20bd3c383e9bcd084eda6ba614 |
|
BLAKE2b-256 | ddb827325c25b9664a761028d3c635ceca319329d3021eaa38dfbb5a886885da |