update
Browse filesFiles changed (5)
- README.md+1-1
- app.py+25-31
- model_cards/article.md+27-20
- model_cards/description.md+1-1
- model_cards/examples.csv+2-1
12345---title: GT4SD - Polymer Blocksemoji: 💡colorFrom: greencolorTo: blue12345---title: GT4SD - Diffusers (image)emoji: 💡colorFrom: greencolorTo: blue
1 unmodified line23456789101112131415161718192021222324252627282930311 unmodified line33343536373839404142439 unmodified lines5354555657585960616263646566676869707172731 unmodified lineimport pathlibimport gradio as grimport pandas as pdfrom gt4sd.algorithms.generation.polymer_blocks import (PolymerBlocksGenerator,PolymerBlocks,)from gt4sd.algorithms.registry import ApplicationsRegistryfrom utils import draw_grid_generatelogger = logging.getLogger(__name__)logger.addHandler(logging.NullHandler())def run_inference(algorithm_version: str, length: float, number_of_samples: int):config = PolymerBlocksGenerator(algorithm_version=algorithm_version,batch_size=32,generated_length=length,)model = PolymerBlocks(config)samples = list(model.sample(number_of_samples))return draw_grid_generate(samples=samples, n_cols=5, seeds=[])if __name__ == "__main__":1 unmodified line# Preparation (retrieve all available algorithms)all_algos = ApplicationsRegistry.list_available()algos = [x["algorithm_version"]for x in list(filter(lambda x: "PolymerBlocks" in x["algorithm_name"], all_algos))]# Load metadatametadata_root = pathlib.Path(__file__).parent.joinpath("model_cards")9 unmodified linesdemo = gr.Interface(fn=run_inference,title="Polymer Blocks",inputs=[gr.Dropdown(algos, label="Algorithm version", value="v0"),gr.Slider(minimum=5,maximum=400,value=100,label="Maximal sequence length",step=1,),gr.Slider(minimum=1, maximum=50, value=10, label="Number of samples", step=1),],outputs=gr.HTML(label="Output"),article=article,description=description,examples=examples.values.tolist(),1 unmodified line234567891011121314151617181920212223242526272829303132331 unmodified line353637383940414243449 unmodified lines54555657585960616263646566671 unmodified lineimport pathlibimport gradio as grimport pandas as pdfrom gt4sd.algorithms.generation.diffusion import (DiffusersGenerationAlgorithm,DDPMGenerator,DDIMGenerator,ScoreSdeGenerator,LDMTextToImageGenerator,LDMGenerator,StableDiffusionGenerator,)from gt4sd.algorithms.registry import ApplicationsRegistrylogger = logging.getLogger(__name__)logger.addHandler(logging.NullHandler())def run_inference(model_type: str, prompt: str):config = eval(f"{model_type}(prompt={prompt})")if config.modality != "token2image" and prompt != "":raise ValueError(f"{model_type} is an unconditional generative model, please remove prompt (not={prompt})")model = DiffusersGenerationAlgorithm(config)image = list(model.sample(1))[0]return imageif __name__ == "__main__":1 unmodified line# Preparation (retrieve all available algorithms)all_algos = ApplicationsRegistry.list_available()algos = [x["algorithm_application"]for x in list(filter(lambda x: "Diff" in x["algorithm_name"], all_algos))]algos = [a for a in algos if not "GeoDiff" in a]# Load metadatametadata_root = pathlib.Path(__file__).parent.joinpath("model_cards")9 unmodified linesdemo = gr.Interface(fn=run_inference,title="Diffusion-based image generators",inputs=[gr.Dropdown(algos, label="Diffusion model", value="StableDiffusionGenerator"),gr.Textbox(label="Text prompt", placeholder="A blue tree", lines=1),],outputs=gr.outputs.Image(type="pil"),article=article,description=description,examples=examples.values.tolist(),
1234567891011121314151617181920212223242526272829303132333435363738394010 unmodified lines51525354555657585960# Model documentation & parameters**Algorithm Version**: Which model version to use.**Maximal sequence length**: The maximal number of SMILES tokens in the generated molecule.**Number of samples**: How many samples should be generated (between 1 and 50).# Model card -- PolymerBlocks**Model Details**: *PolymerBlocks* is a sequence-based molecular generator tuned to generate blocks of polymers (e.g., catalysts and monomers). The model relies on a Variational Autoencoder architecture as described in [Born et al. (2021; *iScience*)](https://www.sciencedirect.com/science/article/pii/S2589004221002376)**Developers**: Matteo Manica and colleagues from IBM Research.**Distributors**: Original authors' code integrated into GT4SD.**Model date**: Not yet published.**Model version**: Only initial model version.**Model type**: A sequence-based molecular generator tuned to generate blocks of polymers (e.g., catalysts and monomers).**Information about training algorithms, parameters, fairness constraints or other applied approaches, and features**:N.A.**Paper or other resource for more information**:TBD**License**: MIT**Where to send questions or comments about the model**: Open an issue on [GT4SD repository](https://github.com/GT4SD/gt4sd-core).**Intended Use. Use cases that were envisioned during development**: Chemical research, in particular drug discovery.**Primary intended uses/users**: Researchers and computational chemists using the model for model comparison or research exploration purposes.**Out-of-scope use cases**: Production-level inference, producing molecules with harmful properties.10 unmodified lines## CitationTBD, temporarily please cite:```bib@article{manica2022gt4sd,title={GT4SD: Generative Toolkit for Scientific Discovery},author={Manica, Matteo and Cadow, Joris and Christofidellis, Dimitrios and Dave, Ashish and Born, Jannis and Clarke, Dean and Teukam, Yves Gaetan Nana and Hoffman, Samuel C and Buchan, Matthew and Chenthamarakshan, Vijil and others},journal={arXiv preprint arXiv:2207.03928},year={2022}}```12345678910111213141516171819202122232425262728293031323334353637383940414243444510 unmodified lines565758596061626364656667# Model documentation & parameters**Diffusion model**: Which model version to use.**Prompt**: The text prompt used, only applies to *conditional* diffusion image generators. These are `LDMTextToImageGenerator` and `StableDiffusionGenerator`. The other four models (`DDPMGenerator`, `DDPMGenerator`, `LDMGenerator` and `ScoreSdeGenerator`) are *unconditional*.# Model card -- Image diffusion models**Model Details**: Six diffusion models for image generation:- `LDMTextToImageGenerator`- `StableDiffusionGenerator`- `DDPMGenerator`- `DDPMGenerator`- `LDMGenerator`- `ScoreSdeGenerator`For details, see the [Diffusers docs](https://huggingface.co/docs/diffusers/index)**Developers**: Various developers of above models, wrapped by Diffusers developers into [`diffusers`](https://github.com/huggingface/diffusers)**Distributors**: Diffusers code integrated into GT4SD.**Model date**: 2022.**Model version**: Diffusion models, checkpoints provided and distributed by [`diffusers`](https://github.com/huggingface/diffusers).**Model type**: Various, see [`diffusers`](https://github.com/huggingface/diffusers) docs.**Information about training algorithms, parameters, fairness constraints or other applied approaches, and features**:N.A.**Paper or other resource for more information**:N.A.**License**: MIT**Where to send questions or comments about the model**: Open an issue on [`diffusers`](https://github.com/huggingface/diffusers) repo.**Intended Use. Use cases that were envisioned during development**: Computer vision researchers experimenting with image generative models.**Primary intended uses/users**: Computer vision researchers**Out-of-scope use cases**: Production-level inference, producing molecules with harmful properties.10 unmodified lines## CitationTBD, temporarily please cite:```bib@misc{von-platen-etal-2022-diffusers,author = {Patrick von Platen and Suraj Patil and Anton Lozhkov and Pedro Cuenca and Nathan Lambert and Kashif Rasul and Mishig Davaadorj and Thomas Wolf},title = {Diffusers: State-of-the-art diffusion models},year = {2022},publisher = {GitHub},journal = {GitHub repository},howpublished = {\url{https://github.com/huggingface/diffusers}}}```
123456<img align="right" src="https://raw.githubusercontent.com/GT4SD/gt4sd-core/main/docs/_static/gt4sd_logo.png" alt="logo" width="120" >*PolymerBlocks* is a sequence-based molecular generator tuned to generate blocks of polymers (e.g., catalysts and monomers). The model relies on a Variational Autoencoder architecture as described in [Born et al. (2021; *iScience*)](https://www.sciencedirect.com/science/article/pii/S2589004221002376)For **examples** and **documentation** of the model parameters, please see below.Moreover, we provide a **model card** ([Mitchell et al. (2019)](https://dl.acm.org/doi/abs/10.1145/3287560.3287596?casa_token=XD4eHiE2cRUAAAAA:NL11gMa1hGPOUKTAbtXnbVQBDBbjxwcjGECF_i-WC_3g1aBgU1Hbz_f2b4kI_m1in-w__1ztGeHnwHs)) at the bottom of this page.123456<img align="right" src="https://raw.githubusercontent.com/GT4SD/gt4sd-core/main/docs/_static/gt4sd_logo.png" alt="logo" width="120" >This UI provides access to various diffusion-based image generators implemented in the [`diffusers`](https://github.com/huggingface/diffusers) library, wrapped and re-distributed by GT4SD.For **examples** and **documentation** of the model parameters, please see below.Moreover, we provide a **model card** ([Mitchell et al. (2019)](https://dl.acm.org/doi/abs/10.1145/3287560.3287596?casa_token=XD4eHiE2cRUAAAAA:NL11gMa1hGPOUKTAbtXnbVQBDBbjxwcjGECF_i-WC_3g1aBgU1Hbz_f2b4kI_m1in-w__1ztGeHnwHs)) at the bottom of this page.
1v0,100,1012LDMGenerator,LDMTextToImageGenerator,Generative models on the moon
README.md+1-1
app.py+25-31
model_cards/article.md+27-20
model_cards/description.md+1-1
model_cards/examples.csv+2-1