talkad commited on
Commit
ccea342
1 Parent(s): 3130c7f
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -1,5 +1,7 @@
1
  import gradio as gr
2
  import transformers
 
 
3
  from simpletransformers.classification import ClassificationModel, ClassificationArgs
4
  import torch
5
  import json
@@ -8,14 +10,10 @@ import json
8
  deep_scc_model_args = ClassificationArgs(num_train_epochs=10,max_seq_length=300,use_multiprocessing=False)
9
  deep_scc_model = ClassificationModel("roberta", "NTUYG/DeepSCC-RoBERTa", num_labels=19, args=deep_scc_model_args, use_cuda=False)
10
 
11
- pragformer_config = transformers.AutoConfig.from_pretrained("Pragformer/PragFormer", trust_remote_code=True)
12
- pragformer = transformers.AutoModel.from_pretrained("Pragformer/PragFormer", config=pragformer_config, trust_remote_code=True)
13
-
14
- private_config = transformers.AutoConfig.from_pretrained("Pragformer/PragFormer_private", trust_remote_code=True)
15
- pragformer_private = transformers.AutoModel.from_pretrained("Pragformer/PragFormer_private", config=private_config, trust_remote_code=True)
16
-
17
- reduction_config = transformers.AutoConfig.from_pretrained("Pragformer/PragFormer_reduction", trust_remote_code=True)
18
- pragformer_reduction = transformers.AutoModel.from_pretrained("Pragformer/PragFormer_reduction", config=reduction_config, trust_remote_code=True)
19
 
20
 
21
  #Event Listeners
 
1
  import gradio as gr
2
  import transformers
3
+ from model_config import PragFormerConfig
4
+ from model import PragFormer
5
  from simpletransformers.classification import ClassificationModel, ClassificationArgs
6
  import torch
7
  import json
 
10
  deep_scc_model_args = ClassificationArgs(num_train_epochs=10,max_seq_length=300,use_multiprocessing=False)
11
  deep_scc_model = ClassificationModel("roberta", "NTUYG/DeepSCC-RoBERTa", num_labels=19, args=deep_scc_model_args, use_cuda=False)
12
 
13
+ pragformer_config = PragFormerConfig.from_pretrained("Pragformer/PragFormer", trust_remote_code=True)
14
+ pragformer = PragFormer.from_pretrained("Pragformer/PragFormer", config=pragformer_config, trust_remote_code=True)
15
+ pragformer_private = PragFormerConfig.from_pretrained("Pragformer/PragFormer_private", config=pragformer_config, trust_remote_code=True)
16
+ pragformer_reduction = PragFormerConfig.from_pretrained("Pragformer/PragFormer_reduction", config=pragformer_config, trust_remote_code=True)
 
 
 
 
17
 
18
 
19
  #Event Listeners