Skip to content

Commit

Permalink
Revert movement of model info (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
neubig authored Aug 24, 2023
1 parent 076b080 commit 53fc272
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions prompt2model/model_retriever/description_based_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,14 @@ def load_model_info(self):
os.makedirs(self.model_descriptions_index_path)
tar.extractall(path=self.model_descriptions_index_path)

model_info_dir_path = os.path.join(
self.model_descriptions_index_path, "model_info"
)
description_files = os.listdir(model_info_dir_path)
description_files = os.listdir(self.model_descriptions_index_path)
# We store model names and descriptions in a list of ModelInfo objects.
self.model_infos: list[ModelInfo] = []
for f in tqdm(description_files):
if (
f.startswith(".")
or len(open(os.path.join(model_info_dir_path, f)).read()) == 0
or len(open(os.path.join(self.model_descriptions_index_path, f)).read())
== 0
):
continue
block = False
Expand All @@ -158,7 +156,9 @@ def load_model_info(self):
break
if block:
continue
model_dict = json.load(open(os.path.join(model_info_dir_path, f)))
model_dict = json.load(
open(os.path.join(self.model_descriptions_index_path, f))
)
if model_dict.get("size_bytes", 0) == 0:
continue
if "description" not in model_dict:
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 53fc272

Please sign in to comment.