Skip to main content

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.32.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

tira-0.0.32-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file tira-0.0.32.tar.gz.

File metadata

  • Download URL: tira-0.0.32.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for tira-0.0.32.tar.gz
Algorithm Hash digest
SHA256 7e6a42a02ca0eca30cbf91306fd26faba833318726c69cbe67d5769b2df151f7
MD5 8c26c38ef5733bc8b1deb5a7e9ec6ebe
BLAKE2b-256 38a0161baae0318bfdcddbfcf5db32ed9d4cae3fe98621be9861bf0009953faf

See more details on using hashes here.

File details

Details for the file tira-0.0.32-py3-none-any.whl.

File metadata

  • Download URL: tira-0.0.32-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

Hashes for tira-0.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 b59f06f253804c8165749bb79303358016a8637fd53d6289595669c102345e7c
MD5 351c677db45618213b26c7fc65b5cd8e
BLAKE2b-256 c0c3a11b4b5f4f2959ca0739f1a71c64b2170c5fe9c4b762c74a818a184dfdf0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page