Commit Β·
fe8d446
1
Parent(s): 68c9ed6
Compile deployment files on python 3.10
Browse filesFiles changed (9)
- SentimentClassification.ipynb+13-13
- compile.py+1-5
- deployment/sentiment_fhe_model/client.zip+1-1
- deployment/sentiment_fhe_model/server.zip+1-1
- deployment/serialized_model
- sentiment_fhe_model/deployment/client.zipDeleted-3
- sentiment_fhe_model/deployment/server.zipDeleted-3
- sentiment_fhe_model/deployment/versions.jsonDeleted-1
- sentiment_fhe_model/server_model.onnxDeleted-3
20 unmodified lines21222324252627284 unmodified lines31231331431531631731831970 unmodified lines39039139239339439539629 unmodified lines42642742842943043143296 unmodified lines529530531532533534535536254 unmodified lines79179279379479579679779879980080180280380480580680780880981081147 unmodified lines85986086186286386486524 unmodified lines89089189289389489589676 unmodified lines97397497597697797897920 unmodified lines},{"cell_type": "code","execution_count": 31,"metadata": {},"outputs": [],"source": [284 unmodified lines"name": "stdout","output_type": "stream","text": ["Compilation time: 5.4779 seconds\n","FHE inference time: 1.1039 seconds\n"]}],70 unmodified lines"name": "stderr","output_type": "stream","text": ["Some weights of the model checkpoint at cardiffnlp/twitter-roberta-base-sentiment-latest were not used when initializing RobertaForSequenceClassification: ['roberta.pooler.dense.bias', 'roberta.pooler.dense.weight']\n","- This IS expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n","- This IS NOT expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n"]29 unmodified lines"\t- Avoid using `tokenizers` before the fork if possible\n","\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"," 0%| | 0/30 [00:00<?, ?it/s]We strongly recommend passing in an `attention_mask` since your input_ids may be padded. See https://huggingface.co/docs/transformers/troubleshooting#incorrect-output-when-padding-tokens-arent-masked.\n","100%|ββββββββββ| 30/30 [00:20<00:00, 1.46it/s]\n"]}],96 unmodified lines"name": "stderr","output_type": "stream","text": ["100%|ββββββββββ| 13176/13176 [08:10<00:00, 26.88it/s]\n","100%|ββββββββββ| 1464/1464 [00:54<00:00, 26.90it/s]\n"]}],254 unmodified lines"name": "stdout","output_type": "stream","text": ["Compilation time: 5.9232 seconds\n"]},{"name": "stderr","output_type": "stream","text": ["100%|ββββββββββ| 1/1 [00:00<00:00, 17.83it/s]"]},{"name": "stdout","output_type": "stream","text": ["FHE inference time: 0.8374 seconds\n"]},{47 unmodified lines},{"cell_type": "code","execution_count": 40,"metadata": {},"outputs": [],"source": [24 unmodified lines},{"cell_type": "code","execution_count": null,"metadata": {},"outputs": [{76 unmodified lines"Transformer + XGBoost 0.74489 "]},"execution_count": 33,"metadata": {},"output_type": "execute_result"}20 unmodified lines21222324252627284 unmodified lines31231331431531631731831970 unmodified lines39039139239339439539629 unmodified lines42642742842943043143296 unmodified lines529530531532533534535536254 unmodified lines79179279379479579679779879980080180280380480580680780880981081147 unmodified lines85986086186286386486524 unmodified lines89089189289389489589676 unmodified lines97397497597697797897920 unmodified lines},{"cell_type": "code","execution_count": 1,"metadata": {},"outputs": [],"source": [284 unmodified lines"name": "stdout","output_type": "stream","text": ["Compilation time: 5.3550 seconds\n","FHE inference time: 1.1162 seconds\n"]}],70 unmodified lines"name": "stderr","output_type": "stream","text": ["Some weights of the model checkpoint at cardiffnlp/twitter-roberta-base-sentiment-latest were not used when initializing RobertaForSequenceClassification: ['roberta.pooler.dense.weight', 'roberta.pooler.dense.bias']\n","- This IS expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n","- This IS NOT expected if you are initializing RobertaForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n"]29 unmodified lines"\t- Avoid using `tokenizers` before the fork if possible\n","\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"," 0%| | 0/30 [00:00<?, ?it/s]We strongly recommend passing in an `attention_mask` since your input_ids may be padded. See https://huggingface.co/docs/transformers/troubleshooting#incorrect-output-when-padding-tokens-arent-masked.\n","100%|ββββββββββ| 30/30 [00:20<00:00, 1.45it/s]\n"]}],96 unmodified lines"name": "stderr","output_type": "stream","text": ["100%|ββββββββββ| 13176/13176 [09:24<00:00, 23.36it/s]\n","100%|ββββββββββ| 1464/1464 [01:00<00:00, 24.12it/s]\n"]}],254 unmodified lines"name": "stdout","output_type": "stream","text": ["Compilation time: 5.8594 seconds\n"]},{"name": "stderr","output_type": "stream","text": ["100%|ββββββββββ| 1/1 [00:00<00:00, 17.16it/s]"]},{"name": "stdout","output_type": "stream","text": ["FHE inference time: 0.9319 seconds\n"]},{47 unmodified lines},{"cell_type": "code","execution_count": 26,"metadata": {},"outputs": [],"source": [24 unmodified lines},{"cell_type": "code","execution_count": 27,"metadata": {},"outputs": [{76 unmodified lines"Transformer + XGBoost 0.74489 "]},"execution_count": 27,"metadata": {},"output_type": "execute_result"}
12345678910import onnximport pandas as pdfrom concrete.ml.deployment import FHEModelDev, FHEModelClientfrom concrete.ml.common.serialization.loaders import loadfrom concrete.ml.onnx.convert import get_equivalent_numpy_forward_from_onnx_treeimport jsonimport osimport shutilfrom pathlib import Path123456import pandas as pdfrom concrete.ml.deployment import FHEModelDevfrom concrete.ml.common.serialization.loaders import loadimport shutilfrom pathlib import Path
123version https://git-lfs.github.com/spec/v1oid sha256:972f0c7d83f12e3a43e8f923fc422cdb443b9f64bb6f74c1abf912836ba27e60size 3887326123version https://git-lfs.github.com/spec/v1oid sha256:fbde0af1d92d5c2b2e42d8d439ae75328773dac591826559fbc2043356c22388size 3887326
123version https://git-lfs.github.com/spec/v1oid sha256:216d2a78d7ec47ec2a478d5f32ed34cee8a9c45700325e5d8de4e087b7ed8dfcsize 3004123version https://git-lfs.github.com/spec/v1oid sha256:e6ab63f4cae95dd9c418df05b0041d567f485ae16ae84f02068165b3df659bafsize 3004
123version https://git-lfs.github.com/spec/v1oid sha256:3f8beae6d9bb5b3ec454dd868a644fb90ea09efefa42f1c016d82ae92f8ab732size 128047123version https://git-lfs.github.com/spec/v1oid sha256:9d1d588333062510d6f7075419228a940c4b6a0005e0f9345ef599cb3b6d0748size 95501{"concrete-ml": "1.1.0", "concrete-python": "1.1.0rc1", "python": "3.9.16"}123version https://git-lfs.github.com/spec/v1oid sha256:3c1835d9467bfdf77c48d3492cb7f6adaa20f6f9c106d22eecd4c4ca39f3256fsize 932509SentimentClassification.ipynb+13-13
compile.py+1-5
deployment/sentiment_fhe_model/client.zip+1-1
deployment/sentiment_fhe_model/server.zip+1-1
deployment/serialized_model
sentiment_fhe_model/deployment/client.zipDeleted-3
sentiment_fhe_model/deployment/server.zipDeleted-3
sentiment_fhe_model/deployment/versions.jsonDeleted-1
sentiment_fhe_model/server_model.onnxDeleted-3