chembfn-webui 1.0.0__py3-none-any.whl → 1.1.0__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
@@ -42,7 +42,8 @@ from lib.version import __version__
42
42
 
43
43
  vocabs = find_vocab()
44
44
  models = find_model()
45
- lora_selected = False # lora select flag
45
+ _lora_selected = False # lora select flag
46
+ _run_in_public = False # public flag
46
47
  cache_dir = Path(__file__).parent.parent / "cache"
47
48
 
48
49
  HTML_STYLE = gr.InputHTMLAttributes(
@@ -130,12 +131,12 @@ def select_lora(evt: gr.SelectData, prompt: str) -> str:
130
131
  :return: new prompt string
131
132
  :rtype: str
132
133
  """
133
- global lora_selected
134
- if lora_selected: # avoid double select
135
- lora_selected = False
134
+ global _lora_selected
135
+ if _lora_selected and not _run_in_public: # avoid double select
136
+ _lora_selected = False
136
137
  return prompt
137
138
  selected_lora = evt.value
138
- lora_selected = True
139
+ _lora_selected = True
139
140
  if evt.index[1] != 0:
140
141
  return prompt
141
142
  if not prompt:
@@ -344,7 +345,11 @@ def run(
344
345
  if len(sar_flag) == 1:
345
346
  sar_flag = [sar_flag[0] for _ in range(len(weights))]
346
347
  bfn = EnsembleChemBFN(base_model_dir, lora_dir, mlps, weights)
347
- y = [torch.tensor([i], dtype=torch.float32) for i in prompt_info["objective"]]
348
+ y = (
349
+ [torch.tensor([i], dtype=torch.float32) for i in prompt_info["objective"]]
350
+ if prompt_info["objective"]
351
+ else None
352
+ )
348
353
  if quantise == "on":
349
354
  bfn.quantise()
350
355
  if jited == "on":
@@ -616,10 +621,12 @@ def main() -> None:
616
621
  formatter_class=argparse.ArgumentDefaultsHelpFormatter,
617
622
  )
618
623
  parser.add_argument(
619
- "--public", default=False, help="open to public", action="store_true"
624
+ "-P", "--public", default=False, help="open to public", action="store_true"
620
625
  )
621
626
  parser.add_argument("-V", "--version", action="version", version=__version__)
622
627
  args = parser.parse_args()
628
+ global _run_in_public
629
+ _run_in_public = args.public
623
630
  app.launch(share=args.public, allowed_paths=[cache_dir.absolute().__str__()])
624
631
 
625
632
 
@@ -1 +0,0 @@
1
- CN1CCOCC1c1cccc(C(=O)Nc2ccnn2C(C)C)c1
@@ -4,5 +4,5 @@
4
4
  Version info.
5
5
  """
6
6
 
7
- __version__ = "1.0.0"
7
+ __version__ = "1.1.0"
8
8
  __author__ = "Nianze A. TAO"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chembfn_webui
3
- Version: 1.0.0
3
+ Version: 1.1.0
4
4
  Summary: WebUI for ChemBFN
5
5
  Home-page: https://github.com/Augus1999/ChemBFN-WebUI
6
6
  Author: Nianze A. Tao
@@ -83,6 +83,21 @@ For example,
83
83
  └───moses_selfies_vocab.txt
84
84
  ```
85
85
 
86
+ > Note:
87
+ >
88
+ > >The file `config.json` is automatically saved by CLI tool `Madmol` provided in `bayesianflow-for-chem` package. If you train models via Python API, you need to manually create that file for your models by filling in the tempate:
89
+ > >```json
90
+ > >{
91
+ > > "padding_index": 0,
92
+ > > "start_index": 1,
93
+ > > "end_index": 2,
94
+ > > "padding_strategy": "static",
95
+ > > "padding_length": PADDING_LENGTH,
96
+ > > "label": [LABEL_NAME_I, LABEL_NAME_II, ...],
97
+ > > "name": JOB_NAME
98
+ > >}
99
+ > >```
100
+
86
101
  If placed correctly, all these files can be seen in the "model explorer" tab.
87
102
 
88
103
  > You can use an external folder to host the models if it follows the same structure as [`chembfn_webui/model`](https://github.com/Augus1999/ChemBFN-WebUI/tree/main/chembfn_webui/model). See the next section for the method.
@@ -1,16 +1,16 @@
1
1
  chembfn_webui/__init__.py,sha256=AXUdd_PrlfVO56losFUP7A8XrqCDPylwRbTpe_WG3Uc,87
2
- chembfn_webui/bin/app.py,sha256=fqIP5O5aojwZmw2-eHBcuFm4YuQBIEuwOMTvDzW7jcA,21632
2
+ chembfn_webui/bin/app.py,sha256=Oguy3G8jaIuNT7RZWgtGweMKzCLipagMGH7E7y7C27A,21849
3
3
  chembfn_webui/cache/cache_file_here.txt,sha256=hi60T_q6Cf5WPtXuwe4CqjiWpaUqrczsmGMhKIUL--M,28
4
- chembfn_webui/cache/results.csv,sha256=xdSOWM1GGGJEFS1Y4sfCjA-9-66AECEo6El59_yW1hw,37
4
+ chembfn_webui/cache/results.csv,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  chembfn_webui/lib/utilities.py,sha256=ALPw-Evjd9DdsU_RQA6Zp2Gc6XnRR7Y_5fZrqG9azWo,7460
6
- chembfn_webui/lib/version.py,sha256=Mbvn1j2C-hWCKICax3XLfU-P0Q3j0oPQ4GQXoDFJ3fs,138
6
+ chembfn_webui/lib/version.py,sha256=9gQIR8VWU0vhANDgg8w-friQemzdDuGMpih04LtIwCY,138
7
7
  chembfn_webui/model/base_model/place_base_model_here.txt,sha256=oa8_ILaAlWpTXICVDi-Y46_OahV7wB6Che6gbiEIh-c,39
8
8
  chembfn_webui/model/lora/place_lora_folder_here.txt,sha256=YYOo0Cj278DyRcgVrCLa1f2Q-cqgNeMnelaLiA3Fuic,69
9
9
  chembfn_webui/model/standalone_model/place_standalone_model_folder_here.txt,sha256=Dp42UscfI0Zp3SnvRv5vOfWiJZnxdY7rG3jo0kf86VM,80
10
10
  chembfn_webui/model/vocab/place_vocabulary_file_here.txt,sha256=fLOINvZP2022oE7RsmfDjgyaw2yMi7glmdu_cTwmo88,28
11
- chembfn_webui-1.0.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
12
- chembfn_webui-1.0.0.dist-info/METADATA,sha256=iRpNEXoJZRG42fMjyHwsmcUJ5jV0MrGgWUMkZrqUb3s,5897
13
- chembfn_webui-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- chembfn_webui-1.0.0.dist-info/entry_points.txt,sha256=fp8WTPybvwpeYKrUhTi456wwZbmCMJXN1TeFGpR1SlY,55
15
- chembfn_webui-1.0.0.dist-info/top_level.txt,sha256=VdWt3Z7jhbB0pQO_mkRawnU5s75SBT9BV8fGaAIJTDI,14
16
- chembfn_webui-1.0.0.dist-info/RECORD,,
11
+ chembfn_webui-1.1.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
12
+ chembfn_webui-1.1.0.dist-info/METADATA,sha256=zLnFwjbkQsvqAm2fg5f17A7N-4X2sIFvJ4n4tcr2Sa0,6412
13
+ chembfn_webui-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ chembfn_webui-1.1.0.dist-info/entry_points.txt,sha256=fp8WTPybvwpeYKrUhTi456wwZbmCMJXN1TeFGpR1SlY,55
15
+ chembfn_webui-1.1.0.dist-info/top_level.txt,sha256=VdWt3Z7jhbB0pQO_mkRawnU5s75SBT9BV8fGaAIJTDI,14
16
+ chembfn_webui-1.1.0.dist-info/RECORD,,