{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true, "ExecuteTime": { "start_time": "2023-04-26T19:47:22.233231Z", "end_time": "2023-04-26T19:47:40.809471Z" } }, "outputs": [], "source": [ "from handler import EndpointHandler\n", "\n", "# init handler\n", "my_handler = EndpointHandler(path=\".\")" ] }, { "cell_type": "code", "execution_count": null, "outputs": [], "source": [ "result=my_handler({\"task\":\"embeddings\", \"text\":\"hello world\"})\n", "result" ], "metadata": { "collapsed": false } }, { "cell_type": "code", "execution_count": null, "outputs": [], "source": [ "result=my_handler({\"task\":\"transcribe\", \"yt_id\":\"XpPVOujTnGE\"})\n", "result" ], "metadata": { "collapsed": false } }, { "cell_type": "code", "execution_count": null, "outputs": [], "source": [ "import jax\n", "\n", "num_devices = jax.device_count()\n", "device_type = jax.devices()[0].device_kind\n", "print(jax.devices())\n", "print(f\"Found {num_devices} JAX devices of type {device_type}.\")" ], "metadata": { "collapsed": false, "ExecuteTime": { "start_time": "2023-04-26T19:48:50.605300Z", "end_time": "2023-04-26T19:48:50.610557Z" } } } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }