Update README.md
Browse files
README.md
CHANGED
@@ -24,30 +24,22 @@ Attention has been given to make it immediately useful:
|
|
24 |
|
25 |
# Use At Your Own Risk
|
26 |
|
27 |
-
The products/services/information provided herein are offered on an "as is" and "as available" basis, without any warranties or representations, express or implied. The user assumes all responsibility and risk for the use of these products/services/information. We do not guarantee the accuracy, completeness, or usefulness of any information provided and expressly disclaim all liability for any damages or losses arising from their use. By utilizing these products/services/information, you acknowledge and agree that you do so entirely at your own risk.
|
28 |
|
29 |
|
30 |
### Usage
|
31 |
|
32 |
To use this model, install the `transformers` library and load the model and tokenizer as follows:
|
33 |
|
34 |
-
```
|
35 |
-
from transformers import
|
|
|
|
|
36 |
|
37 |
-
|
38 |
-
model = GPT2LMHeadModel.from_pretrained("your-username/sandboxlm")
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
# "command: <your command>"
|
43 |
-
# the output is a JSON object with two keys "risk" for the precieved risk, and "context" which you can present to a human
|
44 |
-
# to support them in deciding if to continue running the command or not.
|
45 |
-
|
46 |
-
input_text = "command: rm -rf /"
|
47 |
-
inputs = tokenizer(input_text, return_tensors="pt")
|
48 |
-
outputs = model.generate(**inputs)
|
49 |
-
|
50 |
-
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
51 |
```
|
52 |
|
53 |
|
|
|
24 |
|
25 |
# Use At Your Own Risk
|
26 |
|
27 |
+
The products/services/information provided herein are offered on an **"as is"** and "as available" basis, **without** any warranties or representations, express or implied. The user assumes all responsibility and risk for the use of these products/services/information. We do not guarantee the accuracy, completeness, or usefulness of any information provided and expressly disclaim all liability for any damages or losses arising from their use. By utilizing these products/services/information, you acknowledge and agree that you do so entirely at your own risk.
|
28 |
|
29 |
|
30 |
### Usage
|
31 |
|
32 |
To use this model, install the `transformers` library and load the model and tokenizer as follows:
|
33 |
|
34 |
+
```ipython
|
35 |
+
from transformers import pipeline
|
36 |
+
sboxlm = pipeline('text-generation', model='sivang/sandboxlm', tokenizer='sivang/sandboxlm', temperature=0.1)
|
37 |
+
import json
|
38 |
|
39 |
+
json.loads(sboxlm("command: rm -rf /")[0]['generated_text'].split("verdict:")[1])
|
|
|
40 |
|
41 |
+
{'risk': 'dangerous',
|
42 |
+
'explain': 'Deletes the root folder on the system, rendering it unusable and all data is lost.'}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
```
|
44 |
|
45 |
|