Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: I want to add a debug flag to Flair #3330

Open
wh5938316 opened this issue Oct 11, 2023 · 0 comments
Open

[Feature]: I want to add a debug flag to Flair #3330

wh5938316 opened this issue Oct 11, 2023 · 0 comments
Labels
feature A new feature

Comments

@wh5938316
Copy link
Contributor

wh5938316 commented Oct 11, 2023

Problem statement

I want to add a debug flag to Flair so that I can quickly go through the entire process when training the model to troubleshoot potential issues.

Solution

When debug is set to True, in the init method of JsonlDataset, only parse the first n lines of the jsonl file.

DEBUG_CORPUS_LENGTH_LIMIT = 200

class JsonlDataset(FlairDataset):
    def __init__():
        ...
        with path_to_json_file.open(encoding=encoding) as jsonl_fp:
            ...
            if flair.debug and len(self.sentences) >= DEBUG_CORPUS_LENGTH_LIMIT:
                break

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

No branches or pull requests

1 participant