Jiahuita
commited on
Commit
·
58554e5
1
Parent(s):
b2de734
Pipeline change
Browse files- pipeline.py +2 -2
pipeline.py
CHANGED
|
@@ -11,10 +11,10 @@ def load_tokenizer(tokenizer_path):
|
|
| 11 |
class NewsClassificationPipeline(Pipeline):
|
| 12 |
def __init__(self, model=None, tokenizer=None, **kwargs):
|
| 13 |
super().__init__(**kwargs)
|
| 14 |
-
model_path = os.path.join(os.path.dirname(__file__), 'news_classifier.h5')
|
| 15 |
self.model = tf.keras.models.load_model(model_path)
|
| 16 |
|
| 17 |
-
tokenizer_path = os.path.join(os.path.dirname(__file__), 'tokenizer.json')
|
| 18 |
self.tokenizer_config = load_tokenizer(tokenizer_path)
|
| 19 |
|
| 20 |
def __call__(self, texts, **kwargs):
|
|
|
|
| 11 |
class NewsClassificationPipeline(Pipeline):
|
| 12 |
def __init__(self, model=None, tokenizer=None, **kwargs):
|
| 13 |
super().__init__(**kwargs)
|
| 14 |
+
model_path = os.path.join(os.path.dirname(__file__), './news_classifier.h5')
|
| 15 |
self.model = tf.keras.models.load_model(model_path)
|
| 16 |
|
| 17 |
+
tokenizer_path = os.path.join(os.path.dirname(__file__), './tokenizer.json')
|
| 18 |
self.tokenizer_config = load_tokenizer(tokenizer_path)
|
| 19 |
|
| 20 |
def __call__(self, texts, **kwargs):
|