Giter VIP home page Giter VIP logo

Comments (10)

jubueche avatar jubueche commented on June 19, 2024 1
# # log the initial model and architecture to an artifact
# with tempfile.TemporaryDirectory() as temp_dir:
#     model_name = (
#         f"model-{self._wandb.run.id}"
#         if (args.run_name is None or args.run_name == args.output_dir)
#         else f"model-{self._wandb.run.name}"
#     )
#     model_artifact = self._wandb.Artifact(
#         name=model_name,
#         type="model",
#         metadata={
#             "model_config": model.config.to_dict() if hasattr(model, "config") else None,
#             "num_parameters": self._wandb.config.get("model/num_parameters"),
#             "initial_model": True,
#         },
#     )
#     model.save_pretrained(temp_dir)
#     # add the architecture to a separate text file
#     save_model_architecture_to_file(model, temp_dir)

#     for f in Path(temp_dir).glob("*"):
#         if f.is_file():
#             with model_artifact.new_file(f.name, mode="wb") as fa:
#                 fa.write(f.read_bytes())
#     self._wandb.run.log_artifact(model_artifact, aliases=["base_model"])

#     badge_markdown = (
#         f'[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge'
#         f'-28.svg" alt="Visualize in Weights & Biases" width="20'
#         f'0" height="32"/>]({self._wandb.run.get_url()})'
#     )

#     modelcard.AUTOGENERATED_TRAINER_COMMENT += f"\n{badge_markdown}"

I just commented out the following in the integration_utils.py of transformers of Hugginggface.

from wandb.

ArtsiomWB avatar ArtsiomWB commented on June 19, 2024

Hi @jubueche, could you please talk a bit about your workflow, and why you are interested in turning off the artifact logging ?

from wandb.

jubueche avatar jubueche commented on June 19, 2024

Hi,

I don't need to turn off the artifact logging. I just don't want my model to get synced to wandb. My models are multiple GB and it takes quite some space and time when I upload them.

from wandb.

ArtsiomWB avatar ArtsiomWB commented on June 19, 2024

Gotcha, could you please try setting os.environ["WANDB_LOG_MODEL"] = "false"

Here are our docs on it

from wandb.

umarbutler avatar umarbutler commented on June 19, 2024

Gotcha, could you please try setting os.environ["WANDB_LOG_MODEL"] = "false"

Here are our docs on it

This does not work.

from wandb.

jubueche avatar jubueche commented on June 19, 2024

@ArtsiomWB I can confirm. This does not work.

from wandb.

ArtsiomWB avatar ArtsiomWB commented on June 19, 2024

Hey @jubueche, thank you so much for the workaround. It is strange that os.environ["WANDB_LOG_MODEL"] = "false" is not working on your side. What version of wandb are you currently on? Will try reproducing this on my side.

from wandb.

ArtsiomWB avatar ArtsiomWB commented on June 19, 2024

Hi there, I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved.

from wandb.

jubueche avatar jubueche commented on June 19, 2024

Hi sorry, my wandb version is

>>> wandb.__version__
'0.16.4'

For now I am just using the code with the commented out section.

from wandb.

umarbutler avatar umarbutler commented on June 19, 2024
# # log the initial model and architecture to an artifact
# with tempfile.TemporaryDirectory() as temp_dir:
#     model_name = (
#         f"model-{self._wandb.run.id}"
#         if (args.run_name is None or args.run_name == args.output_dir)
#         else f"model-{self._wandb.run.name}"
#     )
#     model_artifact = self._wandb.Artifact(
#         name=model_name,
#         type="model",
#         metadata={
#             "model_config": model.config.to_dict() if hasattr(model, "config") else None,
#             "num_parameters": self._wandb.config.get("model/num_parameters"),
#             "initial_model": True,
#         },
#     )
#     model.save_pretrained(temp_dir)
#     # add the architecture to a separate text file
#     save_model_architecture_to_file(model, temp_dir)

#     for f in Path(temp_dir).glob("*"):
#         if f.is_file():
#             with model_artifact.new_file(f.name, mode="wb") as fa:
#                 fa.write(f.read_bytes())
#     self._wandb.run.log_artifact(model_artifact, aliases=["base_model"])

#     badge_markdown = (
#         f'[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge'
#         f'-28.svg" alt="Visualize in Weights & Biases" width="20'
#         f'0" height="32"/>]({self._wandb.run.get_url()})'
#     )

#     modelcard.AUTOGENERATED_TRAINER_COMMENT += f"\n{badge_markdown}"

I just commented out the following in the integration_utils.py of transformers of Hugginggface.

Do you know if this was a new addition to transformers? Maybe the problem is on their side? This problem doesn't arise for me on a different system which has an older version of transformers.

from wandb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.