Skip to content

Commit

Permalink
Not necessary + fix new downloaded models index not auto selected
Browse files Browse the repository at this point in the history
  • Loading branch information
aitronz committed Jan 31, 2024
1 parent 00c93df commit feed566
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tabs/inference/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ def match_index(model_file: str) -> tuple:
base_model_name = model_file_name

sid_directory = os.path.join(model_root_relative, base_model_name)
double_sid_directory = os.path.join(sid_directory, base_model_name)
directories_to_search = [sid_directory] if os.path.exists(sid_directory) else []
directories_to_search += (
[double_sid_directory] if os.path.exists(double_sid_directory) else []
)
directories_to_search.append(model_root_relative)
matching_index_files = []

Expand All @@ -157,7 +153,8 @@ def match_index(model_file: str) -> tuple:

if name_match or folder_match:
index_path = os.path.join(directory, filename)
if index_path in indexes_list:
updated_indexes_list = get_indexes()
if index_path in updated_indexes_list:
matching_index_files.append(
(
index_path,
Expand Down

0 comments on commit feed566

Please sign in to comment.