generated from guardrails-ai/validator-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #5 from guardrails-ai/jc/change_behavior
Fix 'OnFix' behavior.
- Loading branch information
Showing
6 changed files
with
127 additions
and
44 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Publish to Guardrails Hub | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
# Publish when new releases are tagged. | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build & Deploy | ||
uses: guardrails-ai/guardrails/.github/actions/validator_pypi_publish@main | ||
with: | ||
guardrails_token: ${{ secrets.GR_GUARDRAILS_TOKEN }} | ||
validator_id: guardrails/bias_check |
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,17 +1,20 @@ | ||
[project] | ||
name = "bias_check" | ||
version = "0.2.0" | ||
version = "0.3.0" | ||
description = "Wrapping a bias check model into a validator." | ||
authors = [ | ||
{name = "Guardrails AI", email = "[email protected]"} | ||
] | ||
license = {file = "LICENSE"} | ||
readme = "README.md" | ||
requires-python = ">= 3.8.1" | ||
requires-python = ">= 3.9" | ||
dependencies = [ | ||
"guardrails-ai>=0.4.0", | ||
"transformers>=4.40.2", | ||
"tensorflow>=2.18.0" | ||
"guardrails-ai>=0.5.15", | ||
"transformers>=4.37.0", | ||
"tf-keras", | ||
"sentencepiece", | ||
"tensorflow>=2.16.0", # Required for the dbias model, but not as a direct dependency. | ||
"sentence-splitter>=1.4" | ||
] | ||
|
||
[project.optional-dependencies] | ||
|
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
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,4 +1,8 @@ | ||
from transformers import pipeline | ||
print("post-install starting...") | ||
_ = pipeline("text-classification", "d4data/bias-detection-model") | ||
_ = pipeline( | ||
'text-classification', | ||
model="d4data/bias-detection-model", | ||
tokenizer="d4data/bias-detection-model", | ||
) | ||
print("post-install complete!") |