Skip to content

Commit

Permalink
build: improved model tagging script
Browse files Browse the repository at this point in the history
  • Loading branch information
oroszgy committed Oct 27, 2023
1 parent 6cd3590 commit 860cce9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/tag_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@


@app.command()
def main(repo_name: str, tag: str, message: Optional[str] = typer.Option(None, "-m", help="Tag message"),
organization=typer.Option("huspacy", "-o", help="Organization slug")):
def main(repo_name: str, tag: str,
message: Optional[str] = typer.Option(None, "-m", help="Tag message"),
organization: str=typer.Option("huspacy", "-o", help="Organization slug"),
delete_existing: bool = typer.Option(False, "-d", help="Delete tag if exists")):
# token = typer.prompt("Auth token")
api = HfApi()
if delete_existing:
api.delete_tag(repo_id=f"{organization}/{repo_name}", tag=tag)
api.create_tag(repo_id=f"{organization}/{repo_name}", tag=tag, tag_message=message)


Expand Down

0 comments on commit 860cce9

Please sign in to comment.