Skip to content

Commit

Permalink
remove model specification in README
Browse files Browse the repository at this point in the history
Signed-off-by: Chendi Xue <[email protected]>
  • Loading branch information
xuechendi committed Jun 20, 2024
1 parent b9e5030 commit a399e70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions comps/guardrails/pii_detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ python pii_detection.py

## 2.1 Prepare PII detection model

export HUGGINGFACEHUB_API_TOKEN=${HP_TOKEN}

## 2.1.1 use LLM endpoint (will add later)

intro placeholder

## 2.1.2 use NER model (default mode)

```bash
mkdir -p pii/bigcode
apt install git-lfs
cd pii/bigcode; git clone https://{hf_username}:{hf_token}@huggingface.co/bigcode/starpii/; cd ../..
```

## 2.2 Build Docker Image

```bash
Expand All @@ -44,13 +38,13 @@ docker build -t opea/guardrails-pii-detection:latest --build-arg https_proxy=$ht
## 2.3 Run Docker with CLI

```bash
docker run -d --rm --runtime=runc --name="guardrails-pii-detection-endpoint" -p 6357:6357 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy opea/guardrails-pii-detection:latest
docker run -d --rm --runtime=runc --name="guardrails-pii-detection-endpoint" -p 6357:6357 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} opea/guardrails-pii-detection:latest
```

> debug mode
```bash
docker run --rm --runtime=runc --name="guardrails-pii-detection-endpoint" -p 6357:6357 -v ./comps/guardrails/pii_detection/:/home/user/comps/guardrails/pii_detection/ --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy opea/guardrails-pii-detection:latest
docker run --rm --runtime=runc --name="guardrails-pii-detection-endpoint" -p 6357:6357 -v ./comps/guardrails/pii_detection/:/home/user/comps/guardrails/pii_detection/ --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} opea/guardrails-pii-detection:latest
```

# 🚀3. Get Status of Microservice
Expand Down
2 changes: 1 addition & 1 deletion comps/guardrails/pii_detection/pii_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

def get_pii_detection_inst(strategy="dummy", settings=None):
if strategy == "ner":
return PIIDetectorWithNER(model_path="pii")
return PIIDetectorWithNER()
elif strategy == "ml":
return PIIDetectorWithML()
elif strategy == "llm":
Expand Down

0 comments on commit a399e70

Please sign in to comment.