nucypher / nufhe

NuCypher fully homomorphic encryption (NuFHE) library implemented in Python
https://nufhe.readthedocs.io/en/latest/
GNU General Public License v3.0
441 stars 53 forks source link

nufhe not integrating with gradio #45

Open bpradeep508 opened 11 months ago

bpradeep508 commented 11 months ago

To create a public link, set share=True in launch(). ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1'] ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1'] twos completed Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1431, in process_api result = await self.call_function( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1109, in call_function prediction = await anyio.to_thread.run_sync( File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, args) File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 706, in wrapper response = f(args, *kwargs) File "", line 111, in greet ciX=ctx.encrypt(secret_key, A) File "/usr/local/lib/python3.10/dist-packages/nufhe/api_high_level.py", line 232, in encrypt return encrypt(self.thread, self.rng, secret_key, message) File "/usr/local/lib/python3.10/dist-packages/nufhe/api_low_level.py", line 277, in encrypt result = empty_ciphertext(thr, key.params, message.shape) File "/usr/local/lib/python3.10/dist-packages/nufhe/api_low_level.py", line 302, in empty_ciphertext return LweSampleArray.empty(thr, params.in_out_params, shape) File "/usr/local/lib/python3.10/dist-packages/nufhe/lwe.py", line 154, in empty a = thr.array(shape + (params.size,), Torus32) File "/usr/local/lib/python3.10/dist-packages/reikna/cluda/cuda.py", line 191, in array return Array( File "/usr/local/lib/python3.10/dist-packages/reikna/cluda/cuda.py", line 89, in init gpuarray.GPUArray.init( File "/usr/local/lib/python3.10/dist-packages/pycuda/gpuarray.py", line 268, in init self.gpudata = self.allocator(self.size self.dtype.itemsize) pycuda._driver.LogicError: cuMemAlloc failed: invalid device context