def __init__()

in pyspark_huggingface/huggingface_sink.py [0:0]


    def __init__(self, options):
        super().__init__(options)

        if "path" not in options or not options["path"]:
            raise Exception("You must specify a dataset name.")

        from huggingface_hub import get_token

        kwargs = dict(self.options)
        self.repo_id = kwargs.pop("path")
        self.path_in_repo = kwargs.pop("path_in_repo", None)
        self.split = kwargs.pop("split", None)
        self.revision = kwargs.pop("revision", None)
        self.token = kwargs.pop("token", None) or get_token()
        self.endpoint = kwargs.pop("endpoint", None)
        for arg in kwargs:
            if kwargs[arg].lower() == "true":
                kwargs[arg] = True
            elif kwargs[arg].lower() == "false":
                kwargs[arg] = False
            else:
                try:
                    kwargs[arg] = ast.literal_eval(kwargs[arg])
                except ValueError:
                    pass
        self.kwargs = kwargs