import gradio as gr import cg2all import os def runner(in_pdb, model_type): out_fn = in_pdb.name[:-4] + "-all.pdb" return out_fn + str(os.path.exists(in_pdb.name)) #print(in_pdb, in_pdb.name, os.path.exists(in_pdb.name)) #cg2all.convert_cg2all(in_pdb.name, out_fn, model_type=model_type) demo = gr.Interface(fn=runner, inputs=["file", gr.Radio(["CalphaBasedModel", "ResidueBasedModel", "Martini"])], outputs=["text"]) demo.launch()