Download utils/separation.py from ZoneTwelve/bilibot: direct link, hf CLI and curl.
- Browser
- Download file 569 Bytes
-
https://huggingface.co/datasets/ZoneTwelve/bilibot/resolve/main/utils/separation.py
- Command line
-
hf download hf://datasets/ZoneTwelve/bilibot/utils/separation.py
-
curl -L -o separation.py https://huggingface.co/datasets/ZoneTwelve/bilibot/resolve/main/utils/separation.py
569 Bytes
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import functions | |
| import pandas as pd | |
| def main( | |
| in_file: str, | |
| out_file: str, | |
| func: str = '', | |
| ): | |
| try: | |
| # Default using jsonl | |
| processor = getattr(functions, func) | |
| df = pd.read_json(in_file, lines=True) | |
| out = processor.process(df) | |
| with open(out_file, 'w', encoding='utf-8') as file: | |
| out.to_json(file, force_ascii=False, lines=True, orient='records') | |
| except ValueError as e: | |
| print(e) | |
| if __name__ == '__main__': | |
| import fire | |
| fire.Fire(main) |