feat: Ignore pre-existing model files
This commit is contained in:
parent
b1c922fec7
commit
0732bd9051
|
|
@ -246,6 +246,12 @@ class HFHubModel(HFHubBase):
|
||||||
def _request_single_file(
|
def _request_single_file(
|
||||||
self, model_repo: str, file_name: str, file_path: pathlib.Path
|
self, model_repo: str, file_name: str, file_path: pathlib.Path
|
||||||
) -> bool:
|
) -> bool:
|
||||||
|
# NOTE: Consider optional `force` parameter if files need to be updated.
|
||||||
|
# e.g. The model creator updated the vocabulary to resolve an issue or add a feature.
|
||||||
|
if file_path.exists():
|
||||||
|
self.logger.info(f"skipped - downloaded {file_path} exists already.")
|
||||||
|
return False
|
||||||
|
|
||||||
# NOTE: Do not use bare exceptions! They mask issues!
|
# NOTE: Do not use bare exceptions! They mask issues!
|
||||||
# Allow the exception to occur or explicitly handle it.
|
# Allow the exception to occur or explicitly handle it.
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue