Spaces:
Sleeping
Sleeping
update
Browse files
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 =
|
12 |
-
pragformer =
|
13 |
-
|
14 |
-
|
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
|