Update README.md
Browse files
README.md
CHANGED
|
@@ -37,6 +37,8 @@ import torch.nn.functional as F
|
|
| 37 |
tokenizer = AutoTokenizer.from_pretrained("hbseong/HarmAug-Guard")
|
| 38 |
model = AutoModelForSequenceClassification.from_pretrained("hbseong/HarmAug-Guard")
|
| 39 |
|
|
|
|
|
|
|
| 40 |
def predict(prompt, response=None):
|
| 41 |
if response == None:
|
| 42 |
inputs = tokenizer(prompt, return_tensors="pt")
|
|
|
|
| 37 |
tokenizer = AutoTokenizer.from_pretrained("hbseong/HarmAug-Guard")
|
| 38 |
model = AutoModelForSequenceClassification.from_pretrained("hbseong/HarmAug-Guard")
|
| 39 |
|
| 40 |
+
# If response is not given, the model will predict the unsafe score of the prompt.
|
| 41 |
+
# If response is given, the model will predict the unsafe score of the response.
|
| 42 |
def predict(prompt, response=None):
|
| 43 |
if response == None:
|
| 44 |
inputs = tokenizer(prompt, return_tensors="pt")
|