chembfn-webui 1.2.1__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,
@@ -43,6 +44,7 @@ from lib.version import __version__
43
44
  vocabs = find_vocab()
44
45
  models = find_model()
45
46
  cache_dir = Path(__file__).parent.parent / "cache"
47
+ favicon_dir = Path(__file__).parent / "favicon.png"
46
48
  _result_count = 0
47
49
 
48
50
  HTML_STYLE = gr.InputHTMLAttributes(
@@ -264,7 +266,7 @@ def run(
264
266
  # ------- build model -------
265
267
  prompt_info = parse_prompt(prompt)
266
268
  sar_flag = parse_sar_control(sar_control)
267
- print("Prompt summary:", prompt_info) # show prompt info
269
+ print("Prompt summary:", prompt_info, "semi-autoregression:", sar_flag) # prompt
268
270
  if not prompt_info["lora"]:
269
271
  if model_name in base_model_dict:
270
272
  lmax = sequence_size
@@ -430,8 +432,11 @@ def run(
430
432
  )
431
433
 
432
434
 
433
- with gr.Blocks(title="ChemBFN WebUI") as app:
434
- 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:
435
440
  with gr.Row():
436
441
  with gr.Column(scale=1):
437
442
  btn = gr.Button("RUN", variant="primary")
@@ -556,6 +561,7 @@ with gr.Blocks(title="ChemBFN WebUI") as app:
556
561
  label="sort result",
557
562
  info="sorting based on entropy",
558
563
  )
564
+ gr.HTML(sys_info(), elem_classes="custom_footer", elem_id="footer")
559
565
  # ------ user interaction events -------
560
566
  btn.click(
561
567
  fn=run,
@@ -635,7 +641,12 @@ def main() -> None:
635
641
  )
636
642
  parser.add_argument("-V", "--version", action="version", version=__version__)
637
643
  args = parser.parse_args()
638
- app.launch(share=args.public, allowed_paths=[cache_dir.absolute().__str__()])
644
+ print(f"This is ChemBFN WebUI version {__version__}")
645
+ app.launch(
646
+ share=args.public,
647
+ allowed_paths=[cache_dir.absolute().__str__()],
648
+ favicon_path=favicon_dir.absolute().__str__(),
649
+ )
639
650
 
640
651
 
641
652
  if __name__ == "__main__":
Binary file
@@ -1,5 +1 @@
1
- CN(Cc1ccccc1)C(=O)Cc1cccc(F)c1F
2
- Cc1cnc(NC(=O)c2cccc3ccccc23)s1
3
- COc1ccc(NC(=O)Cc2ccccc2C)cc1
4
- O=C(CNC(=O)c1ccccc1)NCc1ccccc1
5
- CCOc1ccccc1C(=O)Nc1ccc(F)cc1
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.1"
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.1
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
@@ -0,0 +1,17 @@
1
+ chembfn_webui/__init__.py,sha256=AXUdd_PrlfVO56losFUP7A8XrqCDPylwRbTpe_WG3Uc,87
2
+ chembfn_webui/bin/app.py,sha256=yLRw9OmnM2XB4_U8OeMHQtSSvAiT2Lu4gN1BvcuGJs8,22588
3
+ chembfn_webui/bin/favicon.png,sha256=B-Wf_yKtpiLWeLSuLimIXq_oi8YrFs7DLrcV0OVp-rA,42514
4
+ chembfn_webui/cache/cache_file_here.txt,sha256=hi60T_q6Cf5WPtXuwe4CqjiWpaUqrczsmGMhKIUL--M,28
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
+ chembfn_webui/model/base_model/place_base_model_here.txt,sha256=oa8_ILaAlWpTXICVDi-Y46_OahV7wB6Che6gbiEIh-c,39
9
+ chembfn_webui/model/lora/place_lora_folder_here.txt,sha256=YYOo0Cj278DyRcgVrCLa1f2Q-cqgNeMnelaLiA3Fuic,69
10
+ chembfn_webui/model/standalone_model/place_standalone_model_folder_here.txt,sha256=Dp42UscfI0Zp3SnvRv5vOfWiJZnxdY7rG3jo0kf86VM,80
11
+ chembfn_webui/model/vocab/place_vocabulary_file_here.txt,sha256=fLOINvZP2022oE7RsmfDjgyaw2yMi7glmdu_cTwmo88,28
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,,
@@ -1,16 +0,0 @@
1
- chembfn_webui/__init__.py,sha256=AXUdd_PrlfVO56losFUP7A8XrqCDPylwRbTpe_WG3Uc,87
2
- chembfn_webui/bin/app.py,sha256=Pe5KjPy-EOom-qUKSF0O8AeQLgpI6zg1DkM-V_G59-c,22249
3
- chembfn_webui/cache/cache_file_here.txt,sha256=hi60T_q6Cf5WPtXuwe4CqjiWpaUqrczsmGMhKIUL--M,28
4
- chembfn_webui/cache/results.csv,sha256=Z1IOb5NqNuzCdq00TXex8cPpxWlTg5Qi-46HNINcNZg,151
5
- chembfn_webui/lib/utilities.py,sha256=ALPw-Evjd9DdsU_RQA6Zp2Gc6XnRR7Y_5fZrqG9azWo,7460
6
- chembfn_webui/lib/version.py,sha256=5CABifnS6Arnwe8Or6Z9N5ZxwaP9EHjFHhaMM64RF-E,138
7
- chembfn_webui/model/base_model/place_base_model_here.txt,sha256=oa8_ILaAlWpTXICVDi-Y46_OahV7wB6Che6gbiEIh-c,39
8
- chembfn_webui/model/lora/place_lora_folder_here.txt,sha256=YYOo0Cj278DyRcgVrCLa1f2Q-cqgNeMnelaLiA3Fuic,69
9
- chembfn_webui/model/standalone_model/place_standalone_model_folder_here.txt,sha256=Dp42UscfI0Zp3SnvRv5vOfWiJZnxdY7rG3jo0kf86VM,80
10
- chembfn_webui/model/vocab/place_vocabulary_file_here.txt,sha256=fLOINvZP2022oE7RsmfDjgyaw2yMi7glmdu_cTwmo88,28
11
- chembfn_webui-1.2.1.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
12
- chembfn_webui-1.2.1.dist-info/METADATA,sha256=NQBmy41ZZmg8sAFkddQBpWZMrdoVSRx2rZO_0kBHaG4,6412
13
- chembfn_webui-1.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- chembfn_webui-1.2.1.dist-info/entry_points.txt,sha256=fp8WTPybvwpeYKrUhTi456wwZbmCMJXN1TeFGpR1SlY,55
15
- chembfn_webui-1.2.1.dist-info/top_level.txt,sha256=VdWt3Z7jhbB0pQO_mkRawnU5s75SBT9BV8fGaAIJTDI,14
16
- chembfn_webui-1.2.1.dist-info/RECORD,,