Skip to content

Commit

Permalink
Fix error for downloading oss model_info file (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwxxzz authored Sep 18, 2024
1 parent 6e23539 commit ca65f3d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pai_rag/utils/download_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ def __init__(self):
self.download_directory_path = Path(DEFAULT_MODEL_DIR)
if not os.path.exists(self.download_directory_path):
os.makedirs(self.download_directory_path)
response = requests.get(OSS_URL)
response.raise_for_status()
self.model_info = response.json()
logger.info(
f"Create model directory: {self.download_directory_path} and get model info from oss {OSS_URL}."
)
response = requests.get(OSS_URL)
response.raise_for_status()
self.model_info = response.json()
logger.info(f"Model info loaded {self.model_info}.")

def load_model(self, model_name):
model_path = os.path.join(self.download_directory_path, model_name)
Expand Down

0 comments on commit ca65f3d

Please sign in to comment.