Update app.py
Browse files
app.py
CHANGED
|
@@ -487,39 +487,26 @@ with demo:
|
|
| 487 |
gr.Markdown(
|
| 488 |
"""
|
| 489 |
<p align="center">
|
| 490 |
-
<img width=200 src="https://
|
| 491 |
</p>
|
| 492 |
""")
|
| 493 |
|
| 494 |
gr.Markdown(
|
| 495 |
"""
|
| 496 |
-
<h1 style="text-align: center;"
|
| 497 |
-
<p align="center">
|
| 498 |
-
<a href="https://github.com/zama-ai/concrete-ml"> <img style="vertical-align: middle; display:inline-block; margin-right: 3px;" width=15 src="file/images/logos/github.png">Concrete-ML</a>
|
| 499 |
-
—
|
| 500 |
-
<a href="https://docs.zama.ai/concrete-ml"> <img style="vertical-align: middle; display:inline-block; margin-right: 3px;" width=15 src="file/images/logos/documentation.png">Documentation</a>
|
| 501 |
-
—
|
| 502 |
-
<a href=" https://community.zama.ai/c/concrete-ml/8"> <img style="vertical-align: middle; display:inline-block; margin-right: 3px;" width=15 src="file/images/logos/community.png">Community</a>
|
| 503 |
-
—
|
| 504 |
-
<a href="https://twitter.com/zama_fhe"> <img style="vertical-align: middle; display:inline-block; margin-right: 3px;" width=15 src="file/images/logos/x.png">@zama_fhe</a>
|
| 505 |
-
</p>
|
| 506 |
"""
|
| 507 |
)
|
| 508 |
|
| 509 |
gr.Markdown(
|
| 510 |
"""
|
| 511 |
<p align="center" style="font-size: 16px;">
|
| 512 |
-
|
| 513 |
-
a document in order to protect individual privacy.</p>
|
| 514 |
|
| 515 |
<p align="center" style="font-size: 16px;">
|
| 516 |
-
|
| 517 |
-
identifiable information (PII) within encrypted documents, enabling computations to be
|
| 518 |
-
performed on the encrypted data.</p>
|
| 519 |
|
| 520 |
<p align="center" style="font-size: 16px;">
|
| 521 |
-
|
| 522 |
-
services such as ChatGPT in a privacy-preserving manner.</p>
|
| 523 |
"""
|
| 524 |
)
|
| 525 |
|
|
@@ -535,15 +522,12 @@ with demo:
|
|
| 535 |
########################## Key Gen Part ##########################
|
| 536 |
|
| 537 |
gr.Markdown(
|
| 538 |
-
"##
|
| 539 |
-
"""
|
| 540 |
-
type, called secret keys, are used to encrypt and decrypt the user's data. The second type,
|
| 541 |
-
called evaluation keys, enables a server to work on the encrypted data without seeing the
|
| 542 |
-
actual data.
|
| 543 |
"""
|
| 544 |
)
|
| 545 |
|
| 546 |
-
gen_key_btn = gr.Button("
|
| 547 |
|
| 548 |
gen_key_btn.click(
|
| 549 |
key_gen_fn,
|
|
|
|
| 487 |
gr.Markdown(
|
| 488 |
"""
|
| 489 |
<p align="center">
|
| 490 |
+
<img width=200 src="https://www.yamu.com/uploads/image/20220602/1d3eb99b96d3a84ef37eda59989e5e2f.png">
|
| 491 |
</p>
|
| 492 |
""")
|
| 493 |
|
| 494 |
gr.Markdown(
|
| 495 |
"""
|
| 496 |
+
<h1 style="text-align: center;">用全同态加密实现加密匿名化</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 497 |
"""
|
| 498 |
)
|
| 499 |
|
| 500 |
gr.Markdown(
|
| 501 |
"""
|
| 502 |
<p align="center" style="font-size: 16px;">
|
| 503 |
+
匿名化是为了保护个人隐私从文档中删除个人身份信息 (PII) 数据的过程。</p>
|
|
|
|
| 504 |
|
| 505 |
<p align="center" style="font-size: 16px;">
|
| 506 |
+
通常的匿名化会删除隐私数据或者用没有意义的字符代替,这就使得数据失去了价值。而加密匿名化使用完全同态加密 (FHE) 对文档中的个人身份信息 (PII) 进行加密实现匿名化,从而可以对加密后的数据执行其他计算。</p>
|
|
|
|
|
|
|
| 507 |
|
| 508 |
<p align="center" style="font-size: 16px;">
|
| 509 |
+
在本示例中,我们展示了如何利用加密匿名化以保护隐私的方式使用ChatGPT等LLM服务。</p>
|
|
|
|
| 510 |
"""
|
| 511 |
)
|
| 512 |
|
|
|
|
| 522 |
########################## Key Gen Part ##########################
|
| 523 |
|
| 524 |
gr.Markdown(
|
| 525 |
+
"## 第一步: 生成密钥\n\n"
|
| 526 |
+
"""在全同态加密 (FHE) 方法中,会创建两种类型的密钥。第一种称为私钥,用于加密和解密用户的数据。第二种称为评估密钥,使服务器能够在不查看实际数据的情况下处理加密数据。
|
|
|
|
|
|
|
|
|
|
| 527 |
"""
|
| 528 |
)
|
| 529 |
|
| 530 |
+
gen_key_btn = gr.Button("生成私钥和评估密钥")
|
| 531 |
|
| 532 |
gen_key_btn.click(
|
| 533 |
key_gen_fn,
|