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

Add pre-commit: black+flake8+pylint+mypy+isort+bandit #98

Merged
merged 59 commits into from
May 30, 2023

Conversation

NanoCode012
Copy link
Collaborator

@NanoCode012 NanoCode012 commented May 28, 2023

Closes #43

  • black
  • pylint
  • flake8
  • mypy
  • isort
  • bandit
  • Run on previous files
  • Test

@NanoCode012
Copy link
Collaborator Author

NanoCode012 commented May 29, 2023

  • Successfully ran a simple fine-tune using QuickStart openllama lora.
  • Verify all configs are accurate.

Make sure this PR is squashed or things will be messy

@NanoCode012 NanoCode012 changed the title Add pre-commit: black+flake8+pylint Add pre-commit: black+flake8+pylint+mypy May 29, 2023
src/axolotl/prompters.py Outdated Show resolved Hide resolved
@NanoCode012
Copy link
Collaborator Author

NanoCode012 commented May 29, 2023

I could not apply isort to pre-commit. black and isort kept circular fixing each other despite setting profile in isort.

Fixed in c97a31c

@NanoCode012 NanoCode012 marked this pull request as ready for review May 29, 2023 11:54
@NanoCode012 NanoCode012 changed the title Add pre-commit: black+flake8+pylint+mypy Add pre-commit: black+flake8+pylint+mypy+isort+bandit May 29, 2023
@NanoCode012
Copy link
Collaborator Author

I will rebase before squash merge when you have finished review or when you think it's proper. I don't want to break the branch since you may be testing on it now.

@winglian
Copy link
Collaborator

I ran this dataset (Set shards high so it runs a quicker)

  - path: ehartford/wizard_vicuna_70k_unfiltered
    type: sharegpt:chat
    shards: 20

it's still correct on main
Screenshot 2023-05-30 at 9 37 48 AM
but the entire conversation is attention masked out on this branch
Screenshot 2023-05-30 at 9 37 08 AM

result["labels"][current_len : current_len + input_len] = labels
current_len += input_len

return result, current_len
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored this function out due to mypy. However, would this be a performance loss since we call this function, then return the result and overwrite previous result object?

@NanoCode012
Copy link
Collaborator Author

NanoCode012 commented May 30, 2023

Tested that it can finetune openllama config to step 25. Please make sure to squash into 1 commit.

@winglian winglian merged commit 01a75fd into axolotl-ai-cloud:main May 30, 2023
@NanoCode012 NanoCode012 deleted the feat/pre-commit branch May 31, 2023 01:30
mkeoliya pushed a commit to mkeoliya/axolotl that referenced this pull request Dec 15, 2023
Add pre-commit: black+flake8+pylint+mypy+isort+bandit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add pre-commit hook with pylint, flake8 and black
2 participants