Update app.py
Browse files
app.py
CHANGED
|
@@ -67,16 +67,15 @@ class TextClassifier:
|
|
| 67 |
self.model = None
|
| 68 |
self.processor = TextWindowProcessor()
|
| 69 |
self.initialize_model()
|
| 70 |
-
|
| 71 |
def initialize_model(self):
|
| 72 |
"""Initialize the model and tokenizer."""
|
| 73 |
logger.info("Initializing model and tokenizer...")
|
| 74 |
|
| 75 |
-
#
|
| 76 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
| 77 |
self.model_name,
|
| 78 |
-
|
| 79 |
-
trust_remote_code=True # Add this parameter
|
| 80 |
)
|
| 81 |
|
| 82 |
# First initialize the base model
|
|
|
|
| 67 |
self.model = None
|
| 68 |
self.processor = TextWindowProcessor()
|
| 69 |
self.initialize_model()
|
| 70 |
+
|
| 71 |
def initialize_model(self):
|
| 72 |
"""Initialize the model and tokenizer."""
|
| 73 |
logger.info("Initializing model and tokenizer...")
|
| 74 |
|
| 75 |
+
# Remove the use_fast parameter completely
|
| 76 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
| 77 |
self.model_name,
|
| 78 |
+
model_max_length=MAX_LENGTH
|
|
|
|
| 79 |
)
|
| 80 |
|
| 81 |
# First initialize the base model
|