Commit ·
dc5d564
1
Parent(s): 77bc910
Fix LSTM tokenizer mismatch
Browse files- inference_lstm.py +1 -3
inference_lstm.py
CHANGED
|
@@ -14,9 +14,8 @@ import copy
|
|
| 14 |
if __name__ == "__main__":
|
| 15 |
parser = argparse.ArgumentParser(description="Document Classification with LSTM")
|
| 16 |
parser.add_argument("--data_path", type=str, required=True, help="Path to the dataset")
|
| 17 |
-
parser.add_argument("--bert_model", type=str, default="bert-base-uncased", help="BERT model name or path used for distillation")
|
| 18 |
parser.add_argument("--model_path", type=str, required=True, help="Path to the trained model")
|
| 19 |
-
parser.add_argument("--tokenizer_path", type=str, required=True, help="Path to the tokenizer")
|
| 20 |
parser.add_argument("--max_seq_length", type=int, default=512, help="Maximum sequence length for LSTM")
|
| 21 |
parser.add_argument("--batch_size", type=int, default=32, help="Batch size for training and evaluation")
|
| 22 |
parser.add_argument("--num_classes", type=int, required=True, help="Number of classes for classification")
|
|
@@ -35,7 +34,6 @@ if __name__ == "__main__":
|
|
| 35 |
|
| 36 |
class_names = args.class_names
|
| 37 |
|
| 38 |
-
|
| 39 |
# Set device
|
| 40 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 41 |
|
|
|
|
| 14 |
if __name__ == "__main__":
|
| 15 |
parser = argparse.ArgumentParser(description="Document Classification with LSTM")
|
| 16 |
parser.add_argument("--data_path", type=str, required=True, help="Path to the dataset")
|
| 17 |
+
parser.add_argument("--bert_model", type=str, default="bert-base-uncased", help="BERT model name or path used for distillation (as we'll use its tokenizer)")
|
| 18 |
parser.add_argument("--model_path", type=str, required=True, help="Path to the trained model")
|
|
|
|
| 19 |
parser.add_argument("--max_seq_length", type=int, default=512, help="Maximum sequence length for LSTM")
|
| 20 |
parser.add_argument("--batch_size", type=int, default=32, help="Batch size for training and evaluation")
|
| 21 |
parser.add_argument("--num_classes", type=int, required=True, help="Number of classes for classification")
|
|
|
|
| 34 |
|
| 35 |
class_names = args.class_names
|
| 36 |
|
|
|
|
| 37 |
# Set device
|
| 38 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 39 |
|