peterkros commited on
Commit
79860af
·
1 Parent(s): 422b23a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -3,7 +3,7 @@ from transformers import BertConfig, BertForSequenceClassification, AutoTokenize
3
  from safetensors import safe_open
4
  import torch
5
 
6
- config_path = "modelbert2/config.json"
7
  config = BertConfig.from_json_file(config_path)
8
  model = BertForSequenceClassification(config)
9
 
@@ -12,11 +12,11 @@ model_path = "modelbert2"
12
  model = BertForSequenceClassification.from_pretrained(model_path)
13
  tokenizer = AutoTokenizer.from_pretrained(model_path)
14
 
15
- tokenizer = AutoTokenizer.from_pretrained("modelbert2/")
16
 
17
  # Load the label encoder
18
  import pickle
19
- with open('label_encoder.pkl', 'rb') as file:
20
  label_encoder = pickle.load(file)
21
 
22
  def predict(text):
@@ -31,9 +31,9 @@ def predict(text):
31
 
32
  # Define the markdown text with bullet points
33
  markdown_text = """
34
- - This is for test purpose only.
35
  - Input one budget line per time.
36
- - Accuracy of the model is around 72%.
37
  """
38
 
39
  # Define the interface
 
3
  from safetensors import safe_open
4
  import torch
5
 
6
+ config_path = "peterkros/cofogv1-bert/modelbert2/config.json"
7
  config = BertConfig.from_json_file(config_path)
8
  model = BertForSequenceClassification(config)
9
 
 
12
  model = BertForSequenceClassification.from_pretrained(model_path)
13
  tokenizer = AutoTokenizer.from_pretrained(model_path)
14
 
15
+ tokenizer = AutoTokenizer.from_pretrained("peterkros/cofogv1-bert/modelbert2/")
16
 
17
  # Load the label encoder
18
  import pickle
19
+ with open('peterkros/cofogv1-bert/label_encoder.pkl', 'rb') as file:
20
  label_encoder = pickle.load(file)
21
 
22
  def predict(text):
 
31
 
32
  # Define the markdown text with bullet points
33
  markdown_text = """
34
+ - Trainied with ~1500 rows of data on bert-base-uncased 110M, English
35
  - Input one budget line per time.
36
+ - Accuracy of the model is ~72%.
37
  """
38
 
39
  # Define the interface