Skip to content

Commit

Permalink
Added Default Template For the Huggingface
Browse files Browse the repository at this point in the history
  • Loading branch information
pranayasinghcsmpl committed Oct 8, 2024
1 parent b925855 commit d0e412f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion GANDLF/cli/huggingface_hub_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def validate_model_card(file_path: str):
def push_to_model_hub(
repo_id: str,
folder_path: str,
hf_template: str ,
hf_template: str,
path_in_repo: Union[str, None] = None,
commit_message: Union[str, None] = None,
commit_description: Union[str, None] = None,
Expand Down
6 changes: 3 additions & 3 deletions GANDLF/entrypoints/hf_hub_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

huggingfaceDir = Path(__file__).parent.absolute()

huggingfaceDir=huggingfaceDir.parent.absolute().__str__()
huggingfaceDir = huggingfaceDir.parent.absolute().__str__()

# Huggingface template Path for Model deployment
# Huggingface template Path for Model deployment
huggingface_file_path = huggingfaceDir + "\hugging_face.md"


Expand Down Expand Up @@ -97,7 +97,7 @@
"--hf-template",
"-hft",
help="Adding the template path for the model card it is Required during Uploaing a model",
default= huggingface_file_path,
default=huggingface_file_path,
type=click.Path(exists=True, file_okay=True, dir_okay=False),
)
@append_copyright_to_help
Expand Down
10 changes: 5 additions & 5 deletions testing/test_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -3264,7 +3264,7 @@ def test_upload_download_huggingface(device):
)

# Initialize the Hugging Face API instance
api = HfApi(token='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')
api = HfApi(token="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")
try:
api.create_repo(repo_id="Ritesh43/ndlf_model")
except Exception as e:
Expand All @@ -3276,16 +3276,16 @@ def test_upload_download_huggingface(device):
hf_template=testingDir + "/hugging_face.md",
token="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",
)
#Download the Model from Huggingface Hub
# Download the Model from Huggingface Hub
download_from_hub(repo_id="Ritesh43/ndlf_model", local_dir=modelDir)

api.delete_repo(repo_id='Ritesh43/ndlf_model')
api.delete_repo(repo_id="Ritesh43/ndlf_model")

sanitize_outputDir()
# Download the Model from Huggingface Hub
#download_from_hub(repo_id="Ritesh43/Gandlf_new_pr", local_dir=modelDir)
# download_from_hub(repo_id="Ritesh43/Gandlf_new_pr", local_dir=modelDir)

#sanitize_outputDir()
# sanitize_outputDir()
print("passed")


Expand Down

0 comments on commit d0e412f

Please sign in to comment.