mdj1412 commited on
Commit
1d7e124
1 Parent(s): 29aa5f0

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -13,7 +13,7 @@ README = """
13
  """
14
 
15
 
16
- model = "roberta-base"
17
  learning_rate = 5e-5
18
  batch_size_train = 64
19
  step = 1900
@@ -41,9 +41,9 @@ def tokenized_data(tokenizer, inputs):
41
 
42
 
43
  def greet(text):
44
- tokenizer = AutoTokenizer.from_pretrained(model)
45
  model = AutoModelForSequenceClassification.from_pretrained(
46
- model, num_labels=2, id2label=id2label, label2id=label2id,
47
  state_dict=state_dict
48
  )
49
  inputs = tokenized_data(tokenizer, text)
@@ -72,4 +72,4 @@ demo2 = gr.Interface(fn=greet, inputs="text", outputs="text",
72
  description=description, examples=examples)
73
 
74
  if __name__ == "__main__":
75
- demo1.launch()
 
13
  """
14
 
15
 
16
+ model_name = "roberta-base"
17
  learning_rate = 5e-5
18
  batch_size_train = 64
19
  step = 1900
 
41
 
42
 
43
  def greet(text):
44
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
45
  model = AutoModelForSequenceClassification.from_pretrained(
46
+ model_name, num_labels=2, id2label=id2label, label2id=label2id,
47
  state_dict=state_dict
48
  )
49
  inputs = tokenized_data(tokenizer, text)
 
72
  description=description, examples=examples)
73
 
74
  if __name__ == "__main__":
75
+ demo2.launch()