Chidam Gopal commited on
Commit
1c56cce
1 Parent(s): 1b53210

version update for intent app

Browse files
Files changed (2) hide show
  1. infer_intent.py +3 -3
  2. infer_location.py +2 -1
infer_intent.py CHANGED
@@ -4,7 +4,7 @@ import numpy as np
4
  import requests
5
  import os
6
 
7
-
8
  class IntentClassifier:
9
  def __init__(self):
10
  self.id2label = {0: 'information_intent',
@@ -18,8 +18,8 @@ class IntentClassifier:
18
  self.label2id = {label: id for id, label in self.id2label.items()}
19
 
20
  self.tokenizer = AutoTokenizer.from_pretrained("Mozilla/mobilebert-uncased-finetuned-LoRA-intent-classifier")
21
-
22
- model_url = "https://huggingface.co/Mozilla/mobilebert-uncased-finetuned-LoRA-intent-classifier/resolve/main/onnx/model_quantized.onnx"
23
  model_dir_path = "models"
24
  model_path = f"{model_dir_path}/mobilebert-uncased-finetuned-LoRA-intent-classifier_model_quantized.onnx"
25
  if not os.path.exists(model_dir_path):
 
4
  import requests
5
  import os
6
 
7
+ VERSION = "v0.1.1"
8
  class IntentClassifier:
9
  def __init__(self):
10
  self.id2label = {0: 'information_intent',
 
18
  self.label2id = {label: id for id, label in self.id2label.items()}
19
 
20
  self.tokenizer = AutoTokenizer.from_pretrained("Mozilla/mobilebert-uncased-finetuned-LoRA-intent-classifier")
21
+
22
+ model_url = "https://huggingface.co/Mozilla/mobilebert-uncased-finetuned-LoRA-intent-classifier/resolve/{VERSION}/onnx/model_quantized.onnx"
23
  model_dir_path = "models"
24
  model_path = f"{model_dir_path}/mobilebert-uncased-finetuned-LoRA-intent-classifier_model_quantized.onnx"
25
  if not os.path.exists(model_dir_path):
infer_location.py CHANGED
@@ -4,10 +4,11 @@ import numpy as np
4
  import requests
5
  import os
6
 
 
7
  class LocationFinder:
8
  def __init__(self):
9
  self.tokenizer = AutoTokenizer.from_pretrained("Mozilla/distilbert-uncased-NER-LoRA")
10
- model_url = "https://huggingface.co/Mozilla/distilbert-uncased-NER-LoRA/resolve/main/onnx/model_quantized.onnx"
11
  model_dir_path = "models"
12
  model_path = f"{model_dir_path}/distilbert-uncased-NER-LoRA"
13
  if not os.path.exists(model_dir_path):
 
4
  import requests
5
  import os
6
 
7
+ VERSION = "v0.1.1"
8
  class LocationFinder:
9
  def __init__(self):
10
  self.tokenizer = AutoTokenizer.from_pretrained("Mozilla/distilbert-uncased-NER-LoRA")
11
+ model_url = f"https://huggingface.co/Mozilla/distilbert-uncased-NER-LoRA/resolve/{VERSION}/onnx/model_quantized.onnx"
12
  model_dir_path = "models"
13
  model_path = f"{model_dir_path}/distilbert-uncased-NER-LoRA"
14
  if not os.path.exists(model_dir_path):