adamtayzzz commited on
Commit
cbf489f
1 Parent(s): c733ea9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -40,7 +40,7 @@ MODEL_CLASSES = {
40
  "albert": (AlbertConfig, AlbertForSequenceClassification, AlbertTokenizer),
41
  }
42
 
43
- model = 'albert'
44
  dataset = 'STS-B'
45
  task_name = f'{dataset}'.lower()
46
  if task_name not in processors:
@@ -53,14 +53,14 @@ num_labels = len(label_list)
53
  output_dir = f'./outputs/train/{model}/{dataset}'
54
  data_dir = f'./glue_data/{dataset}'
55
 
56
- config_class, model_class, tokenizer_class = MODEL_CLASSES[model]
57
  tokenizer = tokenizer_class.from_pretrained(output_dir, do_lower_case=True)
58
- model = model_class.from_pretrained(best_model_path[f'{model}_{dataset}'])
59
 
60
  exit_type='patience'
61
  exit_value=3
62
 
63
- classifier = MyClassifier(model,tokenizer,label_list,output_mode,exit_type,exit_value,model)
64
 
65
  def greet(text,text2,exit_pos):
66
  text_input = [(text,text2)]
 
40
  "albert": (AlbertConfig, AlbertForSequenceClassification, AlbertTokenizer),
41
  }
42
 
43
+ model_name = 'albert'
44
  dataset = 'STS-B'
45
  task_name = f'{dataset}'.lower()
46
  if task_name not in processors:
 
53
  output_dir = f'./outputs/train/{model}/{dataset}'
54
  data_dir = f'./glue_data/{dataset}'
55
 
56
+ config_class, model_class, tokenizer_class = MODEL_CLASSES[model_name]
57
  tokenizer = tokenizer_class.from_pretrained(output_dir, do_lower_case=True)
58
+ model = model_class.from_pretrained(best_model_path[f'{model_name}_{dataset}'])
59
 
60
  exit_type='patience'
61
  exit_value=3
62
 
63
+ classifier = MyClassifier(model,tokenizer,label_list,output_mode,exit_type,exit_value,model_name)
64
 
65
  def greet(text,text2,exit_pos):
66
  text_input = [(text,text2)]