mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-30 02:53:41 +08:00
nits
This commit is contained in:
parent
b84b483e9f
commit
32d8793583
@ -9,13 +9,10 @@ def ask_for_confirmation(message: str) -> bool:
|
|||||||
"""Ask user for confirmation with Y/N prompt.
|
"""Ask user for confirmation with Y/N prompt.
|
||||||
Returns True for Y/yes, False for N/no/empty."""
|
Returns True for Y/yes, False for N/no/empty."""
|
||||||
y = ("y", "yes", "1")
|
y = ("y", "yes", "1")
|
||||||
n = ("n", "no", "0")
|
n = ("n", "no", "0", "")
|
||||||
all_values = y + n + ("",)
|
full_message = f"{message} (y/n) "
|
||||||
full_message = f"{message} (y/N) "
|
|
||||||
while True:
|
while True:
|
||||||
answer = input(full_message).lower()
|
answer = input(full_message).lower()
|
||||||
if answer == "":
|
|
||||||
return False
|
|
||||||
if answer in y:
|
if answer in y:
|
||||||
return True
|
return True
|
||||||
if answer in n:
|
if answer in n:
|
||||||
@ -45,9 +42,7 @@ def main():
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.scan:
|
if args.scan:
|
||||||
print(
|
print(f'Scanning Hugging Face cache for models with pattern "{args.pattern}".')
|
||||||
f'Scanning Hugging Face cache for models with pattern "{args.pattern}".'
|
|
||||||
)
|
|
||||||
hf_cache_info = scan_cache_dir()
|
hf_cache_info = scan_cache_dir()
|
||||||
print(
|
print(
|
||||||
tabulate(
|
tabulate(
|
||||||
@ -107,7 +102,9 @@ def main():
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
confirmed = ask_for_confirmation("\nAre you sure you want to delete these models?")
|
confirmed = ask_for_confirmation(
|
||||||
|
"\nAre you sure you want to delete these models?"
|
||||||
|
)
|
||||||
if confirmed:
|
if confirmed:
|
||||||
for model_info in repos:
|
for model_info in repos:
|
||||||
print(f"\nDeleting {model_info.repo_id}...")
|
print(f"\nDeleting {model_info.repo_id}...")
|
||||||
|
Loading…
Reference in New Issue
Block a user