generated from guardrails-ai/validator-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from guardrails-ai/fit-n-finish
Fit & Finish
- Loading branch information
Showing
6 changed files
with
33 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,5 @@ jobs: | |
python-version: 3.11 | ||
- name: Run qa | ||
run: | | ||
pip install ".[dev]" | ||
make dev | ||
make qa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
print("post-install starting...") | ||
print("This is where you would do things like download nltk tokenizers or login to the HuggingFace hub...") | ||
print("post-install complete!") | ||
import nltk | ||
import spacy | ||
|
||
try: | ||
nltk.data.find("tokenizers/punkt") | ||
except LookupError: | ||
nltk.download("punkt") | ||
|
||
|
||
model = "en_core_web_trf" | ||
if not spacy.util.is_package(model): | ||
print( | ||
f"Spacy model {model} not installed. " | ||
"Download should start now and take a few minutes." | ||
) | ||
spacy.cli.download(model) # type: ignore |