File size: 1,810 Bytes
9101f6f 1c2c536 9101f6f 1c2c536 9101f6f 1c2c536 9101f6f 1c2c536 9101f6f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | {
"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
}
|