unitminer/urlslab_inference
0
1{2 "cells": [3 {4 "cell_type": "code",5 "execution_count": null,6 "metadata": {7 "collapsed": true,8 "ExecuteTime": {9 "start_time": "2023-04-26T19:47:22.233231Z",10 "end_time": "2023-04-26T19:47:40.809471Z"11 }12 },13 "outputs": [],14 "source": [15 "from handler import EndpointHandler\n",16 "\n",17 "# init handler\n",18 "my_handler = EndpointHandler(path=\".\")"19 ]20 },21 {22 "cell_type": "code",23 "execution_count": null,24 "outputs": [],25 "source": [26 "result=my_handler({\"task\":\"embeddings\", \"text\":\"hello world\"})\n",27 "result"28 ],29 "metadata": {30 "collapsed": false31 }32 },33 {34 "cell_type": "code",35 "execution_count": null,36 "outputs": [],37 "source": [38 "result=my_handler({\"task\":\"transcribe\", \"yt_id\":\"XpPVOujTnGE\"})\n",39 "result"40 ],41 "metadata": {42 "collapsed": false43 }44 },45 {46 "cell_type": "code",47 "execution_count": null,48 "outputs": [],49 "source": [50 "import jax\n",51 "\n",52 "num_devices = jax.device_count()\n",53 "device_type = jax.devices()[0].device_kind\n",54 "print(jax.devices())\n",55 "print(f\"Found {num_devices} JAX devices of type {device_type}.\")"56 ],57 "metadata": {58 "collapsed": false,59 "ExecuteTime": {60 "start_time": "2023-04-26T19:48:50.605300Z",61 "end_time": "2023-04-26T19:48:50.610557Z"62 }63 }64 }65 ],66 "metadata": {67 "kernelspec": {68 "display_name": "Python 3",69 "language": "python",70 "name": "python3"71 },72 "language_info": {73 "codemirror_mode": {74 "name": "ipython",75 "version": 276 },77 "file_extension": ".py",78 "mimetype": "text/x-python",79 "name": "python",80 "nbconvert_exporter": "python",81 "pygments_lexer": "ipython2",82 "version": "2.7.6"83 }84 },85 "nbformat": 4,86 "nbformat_minor": 087}88 