Skip to content

Commit

Permalink
Use temporary file for tarball instead of tmp directory
Browse files Browse the repository at this point in the history
  • Loading branch information
viswavi committed Dec 30, 2023
1 parent 04bd8a4 commit e7a597f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions prompt2model/model_retriever/description_based_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@ def load_model_info(self):
"""
if not os.path.isdir(self.model_descriptions_index_path):
# If the model descriptions directory is not populated, then populate it.
urllib.request.urlretrieve(
"http://phontron.com/data/prompt2model/model_info.tgz",
"/tmp/model_info.tgz",
temporary_file, _ = urllib.request.urlretrieve(
"http://phontron.com/data/prompt2model/model_info.tgz"
)
tar = tarfile.open("/tmp/model_info.tgz")
tar = tarfile.open(temporary_file)
os.makedirs(self.model_descriptions_index_path)
tar.extractall(path=self.model_descriptions_index_path)

Expand Down

0 comments on commit e7a597f

Please sign in to comment.