Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#578 Feature/sg 516 support head replacement for local pretrained weights unknown dataset

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-516_support_head_replacement_for_local_pretrained_weights_unknown_dataset
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  1. import argparse
  2. import sys
  3. from typing import Any
  4. EXTRA_ARGS = []
  5. def pop_arg(arg_name: str, default_value: Any = None) -> Any:
  6. """Get the specified args and remove them from argv"""
  7. parser = argparse.ArgumentParser()
  8. parser.add_argument(f"--{arg_name}", default=default_value)
  9. args, _ = parser.parse_known_args()
  10. # Remove the ddp args to not have a conflict with the use of hydra
  11. for val in filter(lambda x: x.startswith(f"--{arg_name}"), sys.argv):
  12. EXTRA_ARGS.append(val)
  13. sys.argv.remove(val)
  14. return vars(args)[arg_name]
Discard
Tip!

Press p or to see the previous file or, n or to see the next file