Spaces:
Runtime error
Runtime error
Update model.py
Browse files
model.py
CHANGED
|
@@ -230,8 +230,10 @@ def predict_location_preds(tokenizer, model, feature_text, pn_history):
|
|
| 230 |
return location_preds, ', '.join(x)
|
| 231 |
|
| 232 |
def get_predictions(feature_text, pn_history):
|
|
|
|
|
|
|
|
|
|
| 233 |
location_preds, pred_string = predict_location_preds(tokenizer, model, [feature_text], [pn_history])
|
| 234 |
-
# print(pred_string)
|
| 235 |
return pred_string
|
| 236 |
|
| 237 |
tokenizer = AutoTokenizer.from_pretrained(config['tokenizer_path'])
|
|
|
|
| 230 |
return location_preds, ', '.join(x)
|
| 231 |
|
| 232 |
def get_predictions(feature_text, pn_history):
|
| 233 |
+
feature_text = feature_text.lower().replace("-OR-", ";-").replace("-", " ")
|
| 234 |
+
pn_history = pn_history.lower()
|
| 235 |
+
|
| 236 |
location_preds, pred_string = predict_location_preds(tokenizer, model, [feature_text], [pn_history])
|
|
|
|
| 237 |
return pred_string
|
| 238 |
|
| 239 |
tokenizer = AutoTokenizer.from_pretrained(config['tokenizer_path'])
|