Skip to content

Commit

Permalink
use datadir variable and not pwd
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnitzel committed Aug 17, 2023
1 parent 785f765 commit 7475716
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hug_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

def symlink_model(data_dir, model_path):
# Creating a symbolic link from destination to "model.bin"
data_dir = '.'
model_bin = os.path.join(data_dir, "model.bin")
if os.path.isfile(model_bin):
os.remove(model_bin) # remove the existing link if any
Expand Down Expand Up @@ -52,7 +51,7 @@ def download_file(url, destination, params):
print('.', end='', flush=True)
total_downloaded = 0
print("\nDownload complete.")

symlink_model(params['datadir'], destination)
else:
print(f"Download failed with status code {response.status_code}")
Expand All @@ -76,7 +75,7 @@ def get_user_choice(model_list):
print("Invalid input. Please enter a number corresponding to a model.")
except IndexError:
print("Invalid choice. Index out of range.")

return None

def main():
Expand All @@ -96,7 +95,7 @@ def main():
help='HuggingFace model repository filename substring match')
parser.add_argument('-d', '--datadir', type=str, default='/data',
help='Data directory to store HuggingFace models')

# Parse the arguments
args = parser.parse_args()

Expand Down

0 comments on commit 7475716

Please sign in to comment.