File size: 2,126 Bytes
a6d6517
 
 
9094c47
 
 
 
 
 
 
 
d29187e
776d0fd
d29187e
776d0fd
d29187e
776d0fd
d29187e
776d0fd
d29187e
 
 
776d0fd
d29187e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
---
<p align="center">
<!-- product name logo -->
  <img width=600 src="https://user-images.githubusercontent.com/5758427/231206363-a6639df8-2253-40d8-836e-e3c22d36d6ad.png">
</p>
<p align="center">
  <a href="https://github.com/zama-ai/concrete-ml"> πŸ“ Github</a> | <a href="https://docs.zama.ai/concrete-ml"> πŸ“’ Documentation</a> | <a href="https://zama.ai/community"> πŸ’› Community support</a> | <a href="https://github.com/zama-ai/awesome-zama"> πŸ“š FHE resources by Zama</a>
</p>
<hr>

# Iris classification with a QNN with Concrete ML

In this repository, we allow Iris classification, without seing the inputs! Indeed, inputs are sent encrypted to the HF endpoints, and are classified without the server seeing them in the clear, thanks to fully homomorphic encryption (FHE). This is done thanks to Zama's Concrete ML.

Concrete ML is Zama's open-source privacy-preserving ML package, FHE. We refer the reader to fhe.org or Zama's websites for more information on FHE.

This directory was creating from the template https://huggingface.co./zama-fhe/concrete-ml-template-alpha.

## Deploying a compiled model on HF inference endpoint

If you would like to deploy, it is very easy.
- click on 'Deploy' button in HF interface
- chose "Inference endpoints"
- chose the right model repository
- (the rest of the options are classical to HF end points; we refer you to their documentation for more information)
and then click on 'Create endpoint'

And now, your model should be deployed, after few secunds of installation.

## Using HF entry points on privacy-preserving models

Now, this is the final step: using the entry point. You should:
- if your inference endpoint is private, set an environment variable HF_TOKEN with your HF token
- edit `play_with_endpoint.py`
- replace `API_URL` by your entry point URL
- replace the part between "# BEGIN: replace this part with your privacy-preserving application" and
"# END: replace this part with your privacy-preserving application" with your application

Finally, you'll be able to launch your application with `python play_with_endpoint.py`.