Spaces:
Runtime error
Runtime error
import GPy | |
import GPyOpt | |
import pickle | |
import tensorflow as tf | |
import numpy as np | |
import pandas as pd | |
from preprocessing_utils import encode_categorical, scale_numerical, fill_nans | |
import os | |
import gradio as gr | |
# Load access tokens | |
WRITE_TOKEN = os.environ.get("WRITE_PER") # write | |
# Logs repo path | |
dataset_url = "https://huggingface.co/datasets/sandl/upload_alloy_hardness" | |
dataset_path = "logs_alloy_hardness.csv" | |
# Input parameters | |
model_path = "model_coatings.h5" | |
model = tf.keras.models.load_model(model_path) | |
df_columns = ['Binder', 'NMs_Type', 'Primary_Size (nm)', 'NM-Shape', 'Substrate', | |
'Microorganism ', 'Duration (h)', 'Washing_cycles', 'Reduction_%', | |
'Concetration (µg/mL)', 'NPs_Synthesis_method', 'Application method\n', | |
'Evalutation_Standard', 'Evalutation_Method', 'Durability test', | |
'Washing_Detergent', 'Washing_Temp'] | |
targets = ["Reduction_%"] | |
numerical_columns = [#'Fabric diameter for antibacterial evaluation\n(cm)', | |
'Primary_Size (nm)', 'Duration (h)', 'Washing_cycles', 'Reduction_%', | |
'Concetration (µg/mL)'] | |
categorical_columns = [column for column in df_columns if column not in numerical_columns] | |
numerical_columns.remove(targets[0]) | |
for column in targets: | |
df_columns.remove(column) | |
# Unpickle files | |
with open("one_hot_scaler.pickle", "rb") as file: | |
unpickler = pickle.Unpickler(file) | |
one_hot_scaler = unpickler.load() | |
with open("minmax_scaler_targets.pickle", "rb") as file: | |
unpickler = pickle.Unpickler(file) | |
minmax_scaler_targets = unpickler.load() | |
with open("minmax_scaler_inputs.pickle", "rb") as file: | |
unpickler = pickle.Unpickler(file) | |
minmax_scaler_inputs = unpickler.load() | |
with open("one_hot_scaler.pickle", "rb") as file: | |
unpickler = pickle.Unpickler(file) | |
one_hot_scaler = unpickler.load() | |
test_data_columns = ['Binder_ADA', | |
'Binder_Alginates', | |
'Binder_Anatase', | |
'Binder_Butane tetracarboxylic', | |
'Binder_CDA', | |
'Binder_CF4 plasma', | |
'Binder_CTAB', | |
'Binder_Carboxylic acid ', | |
'Binder_Carboxymethyl chitosan (CMCTS)', | |
'Binder_Cellulase', | |
'Binder_Chitosan', | |
'Binder_Citric acid ', | |
'Binder_Copper phosphide', | |
'Binder_Date seed extract', | |
'Binder_Dendrimer', | |
'Binder_HSDA', | |
'Binder_HY', | |
'Binder_Mesosilver', | |
'Binder_Multi-amino compound (RSD-NH2)', | |
'Binder_NIDA', | |
'Binder_Nano-clay', | |
'Binder_Organosilicon', | |
'Binder_PEG', | |
'Binder_PS-b-PAA', | |
'Binder_PUBK (hydrophilic aliphatic polyester-urethanes)', | |
'Binder_Poly(quaternary ammonium salt-epoxy)', | |
'Binder_Printofix® Binder MTB EG liquid', | |
'Binder_Rutile', | |
'Binder_SDS', | |
'Binder_Seaweed', | |
'Binder_Silane ', | |
'Binder_Silica', | |
'Binder_Silpure', | |
'Binder_Sodium citrate', | |
'Binder_Starch', | |
'Binder_TX-100', | |
'Binder_Thioglycolic acid (TGA)', | |
'Binder_hexadecyltrimethoxysilane(HDTMS)', | |
'Binder_hexamethyltriethylenetetramine', | |
'Binder_poly-hydroxy-amino methyl silicone', | |
'Binder_polyamide network polymer (PNP)', | |
'NMs_Type_Ag', | |
'NMs_Type_Au', | |
'NMs_Type_CS', | |
'NMs_Type_Ce', | |
'NMs_Type_Ce_ZnO', | |
'NMs_Type_Co', | |
'NMs_Type_CuO', | |
'NMs_Type_CuO_TiO2', | |
'NMs_Type_Fe3O4', | |
'NMs_Type_Fe3O4_ZnO', | |
'NMs_Type_Mn', | |
'NMs_Type_SA_TSA', | |
'NMs_Type_SiO2_Ag_Cu', | |
'NMs_Type_TiO2', | |
'NMs_Type_ZnO', | |
'NMs_Type_ZnO_Cs', | |
'NMs_Type_ZrO2', | |
'NM-Shape_Crystalline', | |
'NM-Shape_Disc', | |
'NM-Shape_Ellipsoidal', | |
'NM-Shape_Hexagonal', | |
'NM-Shape_Hierarchical', | |
'NM-Shape_Irregular', | |
'NM-Shape_Nanotube', | |
'NM-Shape_Nanowire', | |
'NM-Shape_Polygonal', | |
'NM-Shape_Prism', | |
'NM-Shape_Rod ', | |
'NM-Shape_Spherical', | |
'NM-Shape_rectangle', | |
'Substrate_Bamboo', | |
'Substrate_Cotton', | |
'Substrate_Cotton_Polyester', | |
'Substrate_Denim', | |
'Substrate_PET', | |
'Substrate_Polyamide', | |
'Substrate_Polyester', | |
'Substrate_Silk', | |
'Substrate_Viscose', | |
'Substrate_Wool', | |
'Substrate_Wool_Polyester', | |
'Substrate_cotton', | |
'Microorganism _Aci_baumannii', | |
'Microorganism _Alt_brassicicola', | |
'Microorganism _Asp_niger', | |
'Microorganism _Bac_subtilis', | |
'Microorganism _C_albicans', | |
'Microorganism _E_coli', | |
'Microorganism _Enter_faecalis', | |
'Microorganism _Fus_oxysporum', | |
'Microorganism _K_aerogens', | |
'Microorganism _Kle_pneumoniae', | |
'Microorganism _MRSA', | |
'Microorganism _Mi_canis', | |
'Microorganism _Pse_aeruginosa', | |
'Microorganism _S_aureus', | |
'Microorganism _S_epidermis', | |
'Microorganism _S_pyogenes', | |
'Microorganism _Sal_typhimurium', | |
'Microorganism _Tric_mentagraphytes', | |
'NPs_Synthesis_method_Bio synthesis', | |
'NPs_Synthesis_method_Biosythesis ', | |
'NPs_Synthesis_method_Degradation', | |
'NPs_Synthesis_method_Dip_coated_Temp curated_Ultrasound', | |
'NPs_Synthesis_method_Not_applicable', | |
'NPs_Synthesis_method_Photochemical Reduction', | |
'NPs_Synthesis_method_Supplied', | |
'NPs_Synthesis_method_Wet chemical reduced', | |
'NPs_Synthesis_method_Wet chemistry', | |
'NPs_Synthesis_method_biosynthesis-green', | |
'NPs_Synthesis_method_ex situ synthesis', | |
'NPs_Synthesis_method_fungal process (biosynthesis)_green synthesis', | |
'NPs_Synthesis_method_green synthesis', | |
'NPs_Synthesis_method_in situ', | |
'NPs_Synthesis_method_in situ synthesis', | |
'NPs_Synthesis_method_in situ biosythesis', | |
'NPs_Synthesis_method_in situ desposition (alkalization and deposition)', | |
'NPs_Synthesis_method_in situ microwave irradiation', | |
'NPs_Synthesis_method_in situ reduction', | |
'NPs_Synthesis_method_in situ sol gel immersion', | |
'NPs_Synthesis_method_in situ sol–gel method', | |
'NPs_Synthesis_method_in situ synthesis', | |
'NPs_Synthesis_method_in situ synthesized', | |
'NPs_Synthesis_method_in situ ultrasound irradiation', | |
'NPs_Synthesis_method_ionic gelation', | |
'NPs_Synthesis_method_nebulize', | |
'NPs_Synthesis_method_reducing', | |
'NPs_Synthesis_method_reduction in situ', | |
'NPs_Synthesis_method_reduction of celluloce in viscose', | |
'NPs_Synthesis_method_reverse micellar cores', | |
'NPs_Synthesis_method_sol gel', | |
'NPs_Synthesis_method_sol-gel', | |
'NPs_Synthesis_method_sonication', | |
'NPs_Synthesis_method_sonochemical', | |
'NPs_Synthesis_method_ultrasound irradiation', | |
'NPs_Synthesis_method_wet chemical method', | |
'NPs_Synthesis_method_wet chemistry', | |
'Application method\n_ exhaustion and Pad_squeeze_dry', | |
'Application method\n_Dip coating', | |
'Application method\n_Dip coating and shaking', | |
'Application method\n_Dip padding and microwave irradiation', | |
'Application method\n_Dip-coating and Ultrasound irradiation', | |
'Application method\n_Dip_coating', | |
'Application method\n_Exhaust dyeing', | |
'Application method\n_Grafting Wet chemical ', | |
'Application method\n_Immersion', | |
'Application method\n_In situ Immersion', | |
'Application method\n_In situ dip-coating', | |
'Application method\n_Mist', | |
'Application method\n_Pad-Dry-Cure ', | |
'Application method\n_Pad-Dry-Cure and Dip coating', | |
'Application method\n_Pad-dry-cure', | |
'Application method\n_Padding', | |
'Application method\n_Pre-alkalization/sorption', | |
'Application method\n_Sonochemical', | |
'Application method\n_Sonochemical throwingstones', | |
'Application method\n_Sonochemical/Roll to roll ', | |
'Application method\n_Sonochemical/Ultrasonic irradiation', | |
'Application method\n_Sonochemical/ultrasonic transducer', | |
'Application method\n_Sorption', | |
'Application method\n_Top-coating with Pericoat', | |
'Application method\n_Ultrasonic irradiation', | |
'Application method\n_Ultrasonic-mediated dip coating', | |
'Application method\n_Ultrasound irradiation', | |
'Application method\n_Wet-on-wet padding', | |
'Application method\n_Wetting-Immersion', | |
'Application method\n_Wetting-Immersion or spraying', | |
'Application method\n_Wetting-Spraying', | |
'Application method\n_direct multi-layer coating with a socalled\nair blade', | |
'Application method\n_pad-dry-cure', | |
'Application method\n_plasma jet', | |
'Application method\n_ultrasonic ', | |
'Evalutation_Standard_AATCC_100', | |
'Evalutation_Standard_AATCC_147', | |
'Evalutation_Standard_AATCC_147_ISO_20645', | |
'Evalutation_Standard_AATCC_30', | |
'Evalutation_Standard_ASTME_2149', | |
'Evalutation_Standard_ASTM_2180', | |
'Evalutation_Standard_GB_T_20944_AATCC_61', | |
'Evalutation_Standard_ISO_20645', | |
'Evalutation_Standard_ISO_20743', | |
'Evalutation_Method_Agar_diffusion', | |
'Evalutation_Method_Dyn_shake', | |
'Durability test_ Memeret shaker', | |
'Durability test_AATCC 124', | |
'Durability test_AATCC 61', | |
'Durability test_AATCC standard wash machine', | |
'Durability test_Boiled', | |
'Durability test_GB/T 20944.3-2008(China)', | |
'Durability test_Hand washes', | |
'Durability test_Home laundering machine', | |
'Durability test_Home laundry washing', | |
'Durability test_Home/commercial laundering', | |
'Durability test_IS 687:1979', | |
'Durability test_ISO 105 CO3-1982', | |
'Durability test_ISO 105-C014:1989', | |
'Durability test_ISO 105-C06: 2010', | |
'Durability test_ISO 105-C06:1994', | |
'Durability test_ISO 105-C10:2006', | |
'Durability test_ISO 105-CO6-1M', | |
'Durability test_ISO 105-CO6-1M ', | |
'Durability test_ISO 6330 : 2000', | |
'Durability test_Industrial washing machine ISO standards', | |
'Durability test_Not_applicable', | |
'Durability test_Ordinary washing machine', | |
'Durability test_PNEN ISO 6330:2002/A1:2011', | |
'Durability test_Repeated washing', | |
'Durability test_UV transmission', | |
'Durability test_Ultrasonic cleaner', | |
'Durability test_Ultrasound bath', | |
'Durability test_Washed in a bath', | |
'Durability test_Washed in bath', | |
'Durability test_laundering cycles', | |
'Durability test_laundry cycle', | |
'Durability test_laundry regimes used in hospitals', | |
'Durability test_vigorous magnetic stirring', | |
'Washing_Detergent_AATCC Standard Detergent WOB', | |
'Washing_Detergent_AATCC WOB standard detergent', | |
'Washing_Detergent_AATCC standard detergent WOB', | |
'Washing_Detergent_AATCC standards specified detergent WOB', | |
'Washing_Detergent_Anionic detergent', | |
'Washing_Detergent_Commercial detergent', | |
'Washing_Detergent_Deionized water', | |
'Washing_Detergent_Distilled water', | |
'Washing_Detergent_IS-I neutral soap', | |
'Washing_Detergent_Na2CO3/commercial detergent', | |
'Washing_Detergent_Neutral soap solution', | |
'Washing_Detergent_Non-ionic detergent, Triton X-100', | |
'Washing_Detergent_Nonionic detergent', | |
'Washing_Detergent_Nonionic washing agent Felosan RG-N', | |
'Washing_Detergent_Not_applicable', | |
'Washing_Detergent_Ordinary detergent', | |
'Washing_Detergent_SDC standard detergent-Sodium carbonate', | |
'Washing_Detergent_Soap', | |
'Washing_Detergent_Soap detergent', | |
'Washing_Detergent_Sodium carbonate', | |
'Washing_Detergent_Sodium carbonate and soap', | |
'Washing_Detergent_Standard detergent', | |
'Washing_Detergent_Tap and deionized water', | |
'Washing_Detergent_Tap water', | |
'Washing_Detergent_Triton-X, non-ionic detergent', | |
'Washing_Detergent_nonionic detergent', | |
'Washing_Detergent_sodium dodecanesulphonate', | |
'Washing_Detergent_“Li Bai” washing powder', | |
'Washing_Temp_25', | |
'Washing_Temp_40', | |
'Washing_Temp_49', | |
'Washing_Temp_50', | |
'Washing_Temp_60', | |
'Washing_Temp_75', | |
'Washing_Temp_83', | |
'Washing_Temp_92', | |
'Washing_Temp_95', | |
'Washing_Temp_Not_applicable', | |
'Washing_Temp_Room_Temp', | |
'Washing_Temp_Warm water', | |
'Washing_Temp_machine set with warm\nwater', | |
'Washing_Temp_warm water', | |
'Primary_Size (nm)', | |
'Duration (h)', | |
'Washing_cycles', | |
'Concetration (µg/mL)'] | |
def write_logs(message, message_type="Prediction"): | |
""" | |
Write logs | |
""" | |
#with Repository(local_dir="data", clone_from=dataset_url, use_auth_token=WRITE_TOKEN).commit(commit_message="from private", blocking=False): | |
# with open(dataset_path, "a") as csvfile: | |
# writer = csv.DictWriter(csvfile, fieldnames=["name", "message", "time"]) | |
# writer.writerow( | |
# {"name": message_type, "message": message, "time": str(datetime.now())} | |
# ) | |
return | |
def fit_outputs_constraints(X, antimicrobial_activity_target, request: gr.Request): | |
reduction_target = 100 - int(antimicrobial_activity_target) | |
reduction_target_df = pd.DataFrame({'Reduction_%':[reduction_target]}) | |
reduction_target_df = scale_numerical(reduction_target_df, ['Reduction_%'], scaler=minmax_scaler_targets, fit=False) | |
predictions = model.predict(X)[0] | |
error = np.sqrt(np.square(predictions[0]-reduction_target_df)) | |
return error | |
def predict_inverse(antimicrobial_activity_target, substrate, microorganism, num_washing_cycles, request: gr.Request): | |
### Define space and constrains | |
dimensionality_dict = {} | |
one_hot_mapping = {} | |
for c in categorical_columns: | |
dimensionality_dict[c] = 0 | |
one_hot_mapping[c] = [] | |
for c in categorical_columns: | |
for t in test_data_columns: | |
if c in t: | |
dimensionality_dict[c]+=1 | |
one_hot_mapping[c].append(t) | |
domain = [] | |
constrained_columns = ['Substrate', 'Washing_cycles', 'Microorganism '] | |
### Add input domain | |
for df_column in df_columns: | |
if df_column == "Substrate": | |
for one_hot_column in one_hot_mapping[df_column]: | |
if one_hot_column == substrate: | |
domain.append({'name': str(one_hot_column), 'type': 'categorical', 'domain': (1.0, 1.0)}) | |
else: | |
domain.append({'name': str(one_hot_column), 'type': 'categorical', 'domain': (0.0, 0.0)}) | |
elif df_column == 'Microorganism ': | |
for one_hot_column in one_hot_mapping[df_column]: | |
if one_hot_column == microorganism: | |
domain.append({'name': str(one_hot_column), 'type': 'categorical', 'domain': (1.0, 1.0)}) | |
else: | |
domain.append({'name': str(one_hot_column), 'type': 'categorical', 'domain': (0.0, 0.0)}) | |
elif df_column == 'Washing_cycles': | |
washing_cycles_target_df = pd.DataFrame([[0]*len(numerical_columns)], columns=numerical_columns) | |
washing_cycles_target_df['Washing_cycles'].iloc[0] = int(num_washing_cycles) | |
washing_cycles_target_df = scale_numerical(washing_cycles_target_df, numerical_columns, scaler=minmax_scaler_inputs, fit=False) | |
domain.append({'name': str(df_column), 'type': 'continuous', 'domain': (washing_cycles_target_df["Washing_cycles"].iloc[0], | |
washing_cycles_target_df["Washing_cycles"].iloc[0])}) | |
elif df_column in numerical_columns: | |
domain.append({'name': str(df_column), 'type': 'continuous', 'domain': (0.0,1.)}) | |
else: | |
domain.append({'name': str(df_column), 'type': 'categorical', 'domain': (0,1), | |
'dimensionality': dimensionality_dict[df_column]}) | |
print("Domain is ", domain) | |
print(len(domain)) | |
# Constraints | |
constraints = [] | |
def fit_outputs(x): | |
return fit_outputs_constraints(x, antimicrobial_activity_target, request) | |
opt = GPyOpt.methods.BayesianOptimization(f = fit_outputs, # function to optimize | |
domain = domain, # box-constraints of the problem | |
constraints = constraints, | |
acquisition_type ='LCB', # LCB acquisition | |
acquisition_weight = 0.1) # Exploration exploitation | |
# it may take a few seconds | |
opt.run_optimization(max_iter=10) | |
opt.plot_convergence() | |
opt = GPyOpt.methods.BayesianOptimization(f = fit_outputs, # function to optimize | |
domain = domain, # box-constraints of the problem | |
constraints = constraints, | |
acquisition_type ='LCB', # LCB acquisition | |
acquisition_weight = 0.1) # Exploration exploitation | |
x_best = opt.X[np.argmin(opt.Y)] | |
best_params = dict(zip( | |
[el['name'] for el in domain], | |
[[x] for x in x_best])) | |
optimized_x = pd.DataFrame.from_dict(best_params) | |
optimized_x[numerical_columns] = minmax_scaler_inputs.inverse_transform(optimized_x[numerical_columns]) | |
for column in optimized_x.columns: | |
if column in one_hot_mapping: | |
optimized_x.loc[0, column] = one_hot_mapping[column][int(optimized_x.loc[0, column])] | |
optimal_concentration = optimized_x['Concetration (µg/mL)'].iloc[0] if optimized_x['Concetration (µg/mL)'].iloc[0] > 0 else 11.2 | |
return (optimized_x['Binder'].iloc[0], optimized_x['NMs_Type'].iloc[0], np.round(optimized_x['Primary_Size (nm)'].iloc[0], 1), | |
optimized_x['NM-Shape'].iloc[0], np.round(optimized_x['Concetration (µg/mL)'].iloc[0], 1) if optimized_x['Concetration (µg/mL)'].iloc[0] else 0.1, | |
optimized_x['NPs_Synthesis_method'].iloc[0], optimized_x['Application method\n'].iloc[0], | |
optimized_x['Washing_Detergent'].iloc[0], optimized_x['Washing_Temp'].iloc[0]) | |
example_inputs = [80, "Substrate_Bamboo", "Microorganism _Alt_brassicicola", 50] | |
css_styling = """#submit {background: #1eccd8} | |
#submit:hover {background: #a2f1f6} | |
.output-image, .input-image, .image-preview {height: 250px !important} | |
.output-plot {height: 250px !important}""" | |
light_theme_colors = gr.themes.Color(c50="#e4f3fa", # Dataframe background cell content - light mode only | |
c100="#e4f3fa", # Top corner of clear button in light mode + markdown text in dark mode | |
c200="#a1c6db", # Component borders | |
c300="#FFFFFF", # | |
c400="#e4f3fa", # Footer text | |
c500="#0c1538", # Text of component headers in light mode only | |
c600="#a1c6db", # Top corner of button in dark mode | |
c700="#475383", # Button text in light mode + component borders in dark mode | |
c800="#0c1538", # Markdown text in light mode | |
c900="#a1c6db", # Background of dataframe - dark mode | |
c950="#0c1538") # Background in dark mode only | |
# secondary color used for highlight box content when typing in light mode, and download option in dark mode | |
# primary color used for login button in dark mode | |
osium_theme = gr.themes.Default(primary_hue="cyan", secondary_hue="cyan", neutral_hue=light_theme_colors) | |
page_title = "Recommendation of optimal parameters to fulfill coating antimicrobial activity requirement and constraints" | |
favicon_path = "osiumai_favicon.ico" | |
logo_path = "osiumai_logo.jpg" | |
html = f"""<html> <link rel="icon" type="image/x-icon" href="file={favicon_path}"> | |
<img src='file={logo_path}' alt='Osium AI logo' width='200' height='100'> </html>""" | |
with gr.Blocks(css=css_styling, title=page_title, theme=osium_theme) as demo: | |
#gr.HTML(html) | |
gr.Markdown("# <p style='text-align: center;'>Get optimal textile coating recommendation to fufill your target antimicrobial activity requirement</p>") | |
gr.Markdown("Recommendation of optimal parameters to fulfill textile coating antimicrobial activity requirement") | |
with gr.Row(): | |
clear_button = gr.Button("Clear") | |
prediction_button = gr.Button("Predict", elem_id="submit") | |
with gr.Row(): | |
with gr.Column(): | |
gr.Markdown("### The target antimicrobial activity of your textile coating") | |
antimicrobial_activity_target = gr.Number(label="Enter the minimum acceptable antimicrobial activity for your textile coating") | |
gr.Markdown("### Your constraints") | |
substrate = gr.Dropdown(label="Your substrate", choices=[c for c in test_data_columns if c.startswith("Substrate")]) | |
microorganism = gr.Dropdown(label="Microorganism", choices=[c for c in test_data_columns if c.startswith("Microorganism")]) | |
num_washing_cycles = gr.Number(label="Your number of washing cycles") | |
with gr.Column(): | |
with gr.Row(): | |
with gr.Column(): | |
# gr.Markdown("### Optimal conditions") | |
gr.Markdown("### Optimal nanomaterial characteristics") | |
optimal_binder = gr.Textbox(label="Optimal binder") | |
optimal_nms_type = gr.Textbox(label="Optimal nanomaterial type") | |
optimal_primary_size = gr.Textbox(label="Optimal primary size (nm)") | |
optimal_nm_shape = gr.Textbox(label="Optimal nanomaterial shape") | |
gr.Markdown("### Optimal nanomaterial application") | |
optimal_concentration = gr.Textbox(label="Optimal concentration (µg/mL)") | |
optimal_nps_synthesis = gr.Textbox(label="Optimal nanomaterial synthesis method") | |
optimal_application_method = gr.Textbox(label="Optimal application method") | |
gr.Markdown("### Optimal washing conditions") | |
optimal_washing_detergent = gr.Textbox(label="Optimal washing detergent") | |
optimal_washing_temperature = gr.Textbox(label="Optimal washing temperature") | |
with gr.Row(): | |
gr.Examples([example_inputs], [antimicrobial_activity_target, substrate, microorganism, num_washing_cycles]) | |
prediction_button.click( | |
fn=predict_inverse, | |
inputs=[antimicrobial_activity_target, substrate, microorganism, num_washing_cycles], | |
outputs=[optimal_binder, optimal_nms_type, optimal_primary_size, optimal_nm_shape, | |
optimal_concentration, optimal_nps_synthesis, optimal_application_method, | |
optimal_washing_detergent, optimal_washing_temperature], | |
show_progress=True, | |
) | |
clear_button.click( | |
lambda x: [gr.update(value=None)] * 14, | |
[], | |
[ | |
antimicrobial_activity_target, | |
substrate, microorganism, num_washing_cycles, | |
optimal_binder, optimal_nms_type, optimal_primary_size, optimal_nm_shape, | |
optimal_concentration, optimal_nps_synthesis, optimal_application_method, | |
optimal_washing_detergent, optimal_washing_temperature, | |
], | |
) | |
if __name__ == "__main__": | |
demo.queue(concurrency_count=2) | |
demo.launch() |