Update src/components/model_nlp_intent.py
Browse files
src/components/model_nlp_intent.py
CHANGED
|
@@ -4,21 +4,21 @@ from huggingface_hub import snapshot_download
|
|
| 4 |
import joblib
|
| 5 |
import os
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
repo_path = snapshot_download(
|
| 10 |
repo_id="samithcs/nlp_intent_model",
|
| 11 |
repo_type="model"
|
| 12 |
)
|
| 13 |
-
print(f"Model downloaded to: {repo_path}")
|
| 14 |
|
| 15 |
-
|
|
|
|
| 16 |
MODEL_PATH = os.path.join(repo_path, "nlp_intent", "intent_model")
|
| 17 |
TOKENIZER_PATH = os.path.join(repo_path, "nlp_intent", "intent_tokenizer")
|
| 18 |
LABEL_PATH = os.path.join(repo_path, "nlp_intent", "label_encoder.joblib")
|
| 19 |
|
| 20 |
-
|
| 21 |
-
model = TFDistilBertForSequenceClassification.from_pretrained(MODEL_PATH
|
| 22 |
tokenizer = DistilBertTokenizer.from_pretrained(TOKENIZER_PATH)
|
| 23 |
label_encoder = joblib.load(LABEL_PATH)
|
| 24 |
|
|
|
|
| 4 |
import joblib
|
| 5 |
import os
|
| 6 |
|
| 7 |
+
|
| 8 |
+
|
| 9 |
repo_path = snapshot_download(
|
| 10 |
repo_id="samithcs/nlp_intent_model",
|
| 11 |
repo_type="model"
|
| 12 |
)
|
|
|
|
| 13 |
|
| 14 |
+
|
| 15 |
+
|
| 16 |
MODEL_PATH = os.path.join(repo_path, "nlp_intent", "intent_model")
|
| 17 |
TOKENIZER_PATH = os.path.join(repo_path, "nlp_intent", "intent_tokenizer")
|
| 18 |
LABEL_PATH = os.path.join(repo_path, "nlp_intent", "label_encoder.joblib")
|
| 19 |
|
| 20 |
+
|
| 21 |
+
model = TFDistilBertForSequenceClassification.from_pretrained(MODEL_PATH)
|
| 22 |
tokenizer = DistilBertTokenizer.from_pretrained(TOKENIZER_PATH)
|
| 23 |
label_encoder = joblib.load(LABEL_PATH)
|
| 24 |
|