Update app.py
Browse files1 unmodified line234567839 unmodified lines484950515253545530 unmodified lines868788899091929394951 unmodified lineimport gradio as grimport jsoncomponent_filter = ["scheduler", "safety_checker", "tokenizer"]def format_size(num: int) -> str:39 unmodified linesindex_dict = load_model_index(pipeline_id, token=token, revision=revision)# Check if all the concerned components have the checkpoints in the requested "variant" and "extension".index_filter = component_filter.copy()index_filter.extend(["_class_name", "_diffusers_version"])for current_component in index_dict:if current_component not in index_filter:current_component_fileobjs = list(filter(lambda x: current_component in x.rfilename, files_in_repo))30 unmodified lines# Handle pipeline components.if is_text_encoder_shared:component_filter.append("text_encoder")for current_file in files_in_repo:if all(substring not in current_file.rfilename for substring in component_filter):is_folder = len(current_file.rfilename.split("/")) == 2if is_folder and current_file.rfilename.split("/")[0] in index_dict:selected_file = None1 unmodified line234567839 unmodified lines484950515253545530 unmodified lines868788899091929394951 unmodified lineimport gradio as grimport jsonCOMPONENT_FILTER = ["scheduler", "safety_checker", "tokenizer"]def format_size(num: int) -> str:39 unmodified linesindex_dict = load_model_index(pipeline_id, token=token, revision=revision)# Check if all the concerned components have the checkpoints in the requested "variant" and "extension".index_filter = COMPONENT_FILTER.copy()index_filter.extend(["_class_name", "_diffusers_version", "force_zeros_for_empty_prompt", "add_watermarker"])for current_component in index_dict:if current_component not in index_filter:current_component_fileobjs = list(filter(lambda x: current_component in x.rfilename, files_in_repo))30 unmodified lines# Handle pipeline components.if is_text_encoder_shared:COMPONENT_FILTER.append("text_encoder")for current_file in files_in_repo:if all(substring not in current_file.rfilename for substring in COMPONENT_FILTER):is_folder = len(current_file.rfilename.split("/")) == 2if is_folder and current_file.rfilename.split("/")[0] in index_dict:selected_file = None
app.py+5-5