text
Browse files
app.py
CHANGED
@@ -1,9 +1,8 @@
|
|
1 |
-
# Uncomment if run locally
|
2 |
import os
|
3 |
-
#
|
4 |
-
#
|
5 |
-
#sys.path.append(os.path.abspath("../../../molvault"))
|
6 |
-
#sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
7 |
|
8 |
from requests import head
|
9 |
from concrete.ml.deployment import FHEModelClient
|
@@ -68,6 +67,15 @@ formatted_text = (
|
|
68 |
|
69 |
st.markdown(formatted_text, unsafe_allow_html=True)
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
interesting_text = """
|
72 |
Machine learning (**ML**) has become a cornerstone of modern drug discovery. However, the data used to evaluate the ML models is often **confidential**.
|
73 |
This is especially true for the pharmaceutical industry where new drug candidates are considered as the most valuable asset.
|
@@ -272,11 +280,9 @@ def run_fhe(user_id):
|
|
272 |
)
|
273 |
else:
|
274 |
print("Invalid task number")
|
275 |
-
|
276 |
encrypted_prediction = base64.b64decode(response.json()["encrypted_prediction"])
|
277 |
-
|
278 |
-
# Save encrypted_prediction in a file, since too large to pass through regular Gradio
|
279 |
-
# buttons, https://github.com/gradio-app/gradio/issues/1877
|
280 |
numpy.save(f"tmp/tmp_encrypted_prediction_{user_id}.npy", encrypted_prediction)
|
281 |
encrypted_prediction_shorten = list(encrypted_prediction)[
|
282 |
:ENCRYPTED_DATA_BROWSER_LIMIT
|
|
|
|
|
1 |
import os
|
2 |
+
# Uncomment if run locally
|
3 |
+
# import sys
|
4 |
+
# sys.path.append(os.path.abspath("../../../molvault"))
|
5 |
+
# sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
6 |
|
7 |
from requests import head
|
8 |
from concrete.ml.deployment import FHEModelClient
|
|
|
67 |
|
68 |
st.markdown(formatted_text, unsafe_allow_html=True)
|
69 |
|
70 |
+
# make a small hint that the app needs a few seconds to start
|
71 |
+
st.markdown(
|
72 |
+
"<p style='text-align: center; color: grey;'>"
|
73 |
+
+ "The app needs a second to start..."
|
74 |
+
+ "</p>",
|
75 |
+
unsafe_allow_html=True,
|
76 |
+
)
|
77 |
+
|
78 |
+
|
79 |
interesting_text = """
|
80 |
Machine learning (**ML**) has become a cornerstone of modern drug discovery. However, the data used to evaluate the ML models is often **confidential**.
|
81 |
This is especially true for the pharmaceutical industry where new drug candidates are considered as the most valuable asset.
|
|
|
280 |
)
|
281 |
else:
|
282 |
print("Invalid task number")
|
283 |
+
|
284 |
encrypted_prediction = base64.b64decode(response.json()["encrypted_prediction"])
|
285 |
+
|
|
|
|
|
286 |
numpy.save(f"tmp/tmp_encrypted_prediction_{user_id}.npy", encrypted_prediction)
|
287 |
encrypted_prediction_shorten = list(encrypted_prediction)[
|
288 |
:ENCRYPTED_DATA_BROWSER_LIMIT
|