chembfn-webui 1.2.2__py3-none-any.whl → 1.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of chembfn-webui might be problematic. Click here for more details.

chembfn_webui/bin/app.py CHANGED
@@ -32,6 +32,7 @@ from bayesianflow_for_chem.tool import (
32
32
  quantise_model_,
33
33
  )
34
34
  from lib.utilities import (
35
+ sys_info,
35
36
  find_model,
36
37
  find_vocab,
37
38
  parse_prompt,
@@ -265,7 +266,7 @@ def run(
265
266
  # ------- build model -------
266
267
  prompt_info = parse_prompt(prompt)
267
268
  sar_flag = parse_sar_control(sar_control)
268
- print("Prompt summary:", prompt_info) # show prompt info
269
+ print("Prompt summary:", prompt_info, "semi-autoregression:", sar_flag) # prompt
269
270
  if not prompt_info["lora"]:
270
271
  if model_name in base_model_dict:
271
272
  lmax = sequence_size
@@ -431,8 +432,11 @@ def run(
431
432
  )
432
433
 
433
434
 
434
- with gr.Blocks(title="ChemBFN WebUI") as app:
435
- gr.Markdown("### WebUI to generate and visualise molecules for ChemBFN method.")
435
+ with gr.Blocks(
436
+ title="ChemBFN WebUI",
437
+ css="footer {display: none !important} .custom_footer {text-align:center;bottom:0;}",
438
+ analytics_enabled=False,
439
+ ) as app:
436
440
  with gr.Row():
437
441
  with gr.Column(scale=1):
438
442
  btn = gr.Button("RUN", variant="primary")
@@ -557,6 +561,7 @@ with gr.Blocks(title="ChemBFN WebUI") as app:
557
561
  label="sort result",
558
562
  info="sorting based on entropy",
559
563
  )
564
+ gr.HTML(sys_info(), elem_classes="custom_footer", elem_id="footer")
560
565
  # ------ user interaction events -------
561
566
  btn.click(
562
567
  fn=run,
@@ -0,0 +1 @@
1
+ CCOC(=O)NC1(C)CCCc2ccccc21
@@ -14,6 +14,33 @@ if "CHEMBFN_WEBUI_MODEL_DIR" in os.environ:
14
14
  _model_path = Path(os.environ["CHEMBFN_WEBUI_MODEL_DIR"])
15
15
 
16
16
 
17
+ def sys_info() -> str:
18
+ """
19
+ Get system information.
20
+
21
+ :return: system info in html format
22
+ :rtype: str
23
+ """
24
+ import sys
25
+ import torch
26
+ import gradio as gr
27
+ import bayesianflow_for_chem as bfn
28
+ from .version import __version__
29
+
30
+ _python_version = ".".join([str(i) for i in sys.version_info[:3]])
31
+ return f"""
32
+ version: <a href="https://github.com/Augus1999/ChemBFN-WebUI">{__version__}</a>
33
+ &#x2000;•&#x2000;
34
+ bayesianflow-for-chem: <a href="https://github.com/Augus1999/bayesian-flow-network-for-chemistry">{bfn.__version__}</a>
35
+ &#x2000;•&#x2000;
36
+ python: {_python_version}
37
+ &#x2000;•&#x2000;
38
+ torch: {getattr(torch, '__long_version__', torch.__version__)}
39
+ &#x2000;•&#x2000;
40
+ gradio: {gr.__version__}
41
+ """
42
+
43
+
17
44
  def find_vocab() -> Dict[str, str]:
18
45
  """
19
46
  Find customised vocabulary files.
@@ -4,5 +4,5 @@
4
4
  Version info.
5
5
  """
6
6
 
7
- __version__ = "1.2.2"
7
+ __version__ = "1.2.3"
8
8
  __author__ = "Nianze A. TAO"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chembfn_webui
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: WebUI for ChemBFN
5
5
  Home-page: https://github.com/Augus1999/ChemBFN-WebUI
6
6
  Author: Nianze A. Tao
@@ -1,17 +1,17 @@
1
1
  chembfn_webui/__init__.py,sha256=AXUdd_PrlfVO56losFUP7A8XrqCDPylwRbTpe_WG3Uc,87
2
- chembfn_webui/bin/app.py,sha256=tAyXJrzs855oAJ71pk1hyb-PbqM2dAq5AWtXqs9-Nx8,22437
2
+ chembfn_webui/bin/app.py,sha256=yLRw9OmnM2XB4_U8OeMHQtSSvAiT2Lu4gN1BvcuGJs8,22588
3
3
  chembfn_webui/bin/favicon.png,sha256=B-Wf_yKtpiLWeLSuLimIXq_oi8YrFs7DLrcV0OVp-rA,42514
4
4
  chembfn_webui/cache/cache_file_here.txt,sha256=hi60T_q6Cf5WPtXuwe4CqjiWpaUqrczsmGMhKIUL--M,28
5
- chembfn_webui/cache/results.csv,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- chembfn_webui/lib/utilities.py,sha256=ALPw-Evjd9DdsU_RQA6Zp2Gc6XnRR7Y_5fZrqG9azWo,7460
7
- chembfn_webui/lib/version.py,sha256=7GDAyyuN0ZYKqteibHSYP4V8oqj25OuNnFTI6TjQTds,138
5
+ chembfn_webui/cache/results.csv,sha256=2b9AN5vS4QbBHv95daSRq3ttTLdDh36IVOV9Ba-zQxQ,26
6
+ chembfn_webui/lib/utilities.py,sha256=EbaWEaUmaqtbmBSuTQB_67hdw1fcPccqadTNONp47Go,8325
7
+ chembfn_webui/lib/version.py,sha256=ntlL5NQQkn27x4QOusif6zBSzI4_Bhb4CRS_UOxchbc,138
8
8
  chembfn_webui/model/base_model/place_base_model_here.txt,sha256=oa8_ILaAlWpTXICVDi-Y46_OahV7wB6Che6gbiEIh-c,39
9
9
  chembfn_webui/model/lora/place_lora_folder_here.txt,sha256=YYOo0Cj278DyRcgVrCLa1f2Q-cqgNeMnelaLiA3Fuic,69
10
10
  chembfn_webui/model/standalone_model/place_standalone_model_folder_here.txt,sha256=Dp42UscfI0Zp3SnvRv5vOfWiJZnxdY7rG3jo0kf86VM,80
11
11
  chembfn_webui/model/vocab/place_vocabulary_file_here.txt,sha256=fLOINvZP2022oE7RsmfDjgyaw2yMi7glmdu_cTwmo88,28
12
- chembfn_webui-1.2.2.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
13
- chembfn_webui-1.2.2.dist-info/METADATA,sha256=NddgSYTVdf1KCLwuvoCiZ3J3QbJcfctEECqHH6HwreM,6412
14
- chembfn_webui-1.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- chembfn_webui-1.2.2.dist-info/entry_points.txt,sha256=fp8WTPybvwpeYKrUhTi456wwZbmCMJXN1TeFGpR1SlY,55
16
- chembfn_webui-1.2.2.dist-info/top_level.txt,sha256=VdWt3Z7jhbB0pQO_mkRawnU5s75SBT9BV8fGaAIJTDI,14
17
- chembfn_webui-1.2.2.dist-info/RECORD,,
12
+ chembfn_webui-1.2.3.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
13
+ chembfn_webui-1.2.3.dist-info/METADATA,sha256=KA19yAlXXoLnv1g90lQkpqBsQ2LKxEwM_bhtp3g2bhI,6412
14
+ chembfn_webui-1.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ chembfn_webui-1.2.3.dist-info/entry_points.txt,sha256=fp8WTPybvwpeYKrUhTi456wwZbmCMJXN1TeFGpR1SlY,55
16
+ chembfn_webui-1.2.3.dist-info/top_level.txt,sha256=VdWt3Z7jhbB0pQO_mkRawnU5s75SBT9BV8fGaAIJTDI,14
17
+ chembfn_webui-1.2.3.dist-info/RECORD,,