Update README.md
Browse files
README.md
CHANGED
|
@@ -33,7 +33,8 @@ The following provides the code to implement the task of detecting personality f
|
|
| 33 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 34 |
import torch
|
| 35 |
|
| 36 |
-
|
|
|
|
| 37 |
tokenizer = AutoTokenizer.from_pretrained("KevSun/Personality_LM")
|
| 38 |
|
| 39 |
# Choose between direct text input or file input
|
|
@@ -83,8 +84,10 @@ from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
|
| 83 |
import torch
|
| 84 |
import argparse
|
| 85 |
|
|
|
|
|
|
|
| 86 |
def load_model_and_tokenizer(model_name):
|
| 87 |
-
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 88 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 89 |
return model, tokenizer
|
| 90 |
|
|
|
|
| 33 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 34 |
import torch
|
| 35 |
|
| 36 |
+
warnings.filterwarnings('ignore')
|
| 37 |
+
model = AutoModelForSequenceClassification.from_pretrained("KevSun/Personality_LM", ignore_mismatched_sizes=True)
|
| 38 |
tokenizer = AutoTokenizer.from_pretrained("KevSun/Personality_LM")
|
| 39 |
|
| 40 |
# Choose between direct text input or file input
|
|
|
|
| 84 |
import torch
|
| 85 |
import argparse
|
| 86 |
|
| 87 |
+
warnings.filterwarnings('ignore')
|
| 88 |
+
|
| 89 |
def load_model_and_tokenizer(model_name):
|
| 90 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name, ignore_mismatched_sizes=True)
|
| 91 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 92 |
return model, tokenizer
|
| 93 |
|