Update README.md
Browse files
README.md
CHANGED
@@ -36,7 +36,20 @@ Current Labels Available:
|
|
36 |
|
37 |
```python
|
38 |
from classifier import MistralForSequenceClassification
|
|
|
|
|
|
|
|
|
39 |
model = MistralForSequenceClassification.from_pretrained('malaysia-ai/malaysian-sfw-classifier')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
```
|
41 |
|
42 |
|
|
|
36 |
|
37 |
```python
|
38 |
from classifier import MistralForSequenceClassification
|
39 |
+
from transformers import AutoTokenizer
|
40 |
+
from transformers import pipeline
|
41 |
+
|
42 |
+
|
43 |
model = MistralForSequenceClassification.from_pretrained('malaysia-ai/malaysian-sfw-classifier')
|
44 |
+
tokenizer = AutoTokenizer.from_pretrained('malaysia-ai/malaysian-sfw-classifier')
|
45 |
+
|
46 |
+
|
47 |
+
pipe = pipeline("text-classification",
|
48 |
+
tokenizer = tokenizer,
|
49 |
+
model=model)
|
50 |
+
|
51 |
+
input_str = ["INSERT_INPUT_HERE"]
|
52 |
+
print(pipe(input_str))
|
53 |
```
|
54 |
|
55 |
|