Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr_qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.13
- name: Run qa
run: |
make dev
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/publish_pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish to Guardrails Hub

on:
workflow_dispatch:
push:
branches:
- main

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Build & Deploy
uses: guardrails-ai/guardrails/.github/actions/validator_pypi_publish@main
with:
guardrails_token: ${{ secrets.PRIV_PYPI_PUBLISH_TOKEN }}
validator_id: guardrails/competitor_check
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "competitor_check"
version = "0.0.1"
version = "0.0.2"
description = "Validates that LLM-generated text is not naming any competitors from a given list."
authors = [
{name = "Guardrails AI", email = "contact@guardrailsai.com"}
Expand All @@ -11,7 +11,7 @@ requires-python = ">= 3.8.1"
dependencies = [
"nltk",
"spacy",
"numpy<2.0", # When spacy starts to support numpy >= 2.0, we can remove this pin.
"numpy",
"guardrails-ai>=0.4.0"
]

Expand Down
2 changes: 1 addition & 1 deletion validator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def _inference_remote(self, model_input: Any) -> List[List[str]]:
}
]
}
response = self._hub_inference_request(json.dumps(request_body), self.validation_endpoint)
response = self._hub_inference_request(json.dumps(request_body), self.validation_endpoint) # type: ignore

if not response or "outputs" not in response:
raise ValueError("Invalid response from remote inference", response)
Expand Down
4 changes: 2 additions & 2 deletions validator/post-install.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import nltk
import nltk # noqa
import spacy

def load_nltk_data():
import re
import nltk
import nltk # noqa
from importlib.metadata import version

nltk_version = version("nltk")
Expand Down