Spaces:
Runtime error
Runtime error
nehalelkaref
commited on
Commit
•
e2a9e04
1
Parent(s):
ec237ef
Update app.py
Browse files
app.py
CHANGED
@@ -4,18 +4,13 @@ from huggingface_hub import Repository
|
|
4 |
|
5 |
tokenizer = AutoTokenizer.from_pretrained("UBC-NLP/MARBERT")
|
6 |
model = AutoAdapterModel.from_pretrained("UBC-NLP/MARBERT")
|
7 |
-
sarcasm_adapter = Repository(local_dir="sarcasm_adapter", clone_from="nehalelkaref/sarcasm_adapter")
|
8 |
-
aoc3_adapter = Repository(local_dir="aoc3_adapter", clone_from="nehalelkaref/aoc3_adapter")
|
9 |
-
aoc4_adapter = Repository(local_dir="aoc4_adapter", clone_from="nehalelkaref/aoc4_adapter")
|
10 |
-
fusion_adapter = Repository(local_dir="fusion_adapter", clone_from="nehalelkaref/region_fusion")
|
11 |
|
12 |
|
|
|
|
|
|
|
13 |
|
14 |
-
model.
|
15 |
-
model.load_adapter("aoc4_adapter", set_active=True, with_head=False)
|
16 |
-
model.load_adapter("sarcasm_adapter", set_active=True, with_head=False)
|
17 |
-
|
18 |
-
model.load_adapter_fusion("fusion_adapter/aoc(3),aoc(4),sarcasm",with_head=True, set_active=True)
|
19 |
|
20 |
pipe = TextClassificationPipeline(tokenizer=tokenizer, model=model)
|
21 |
|
|
|
4 |
|
5 |
tokenizer = AutoTokenizer.from_pretrained("UBC-NLP/MARBERT")
|
6 |
model = AutoAdapterModel.from_pretrained("UBC-NLP/MARBERT")
|
|
|
|
|
|
|
|
|
7 |
|
8 |
|
9 |
+
model.load_adapter("adapters/aoc3_adapter", set_active=True, with_head=False)
|
10 |
+
model.load_adapter("adapters/aoc4_adapter", set_active=True, with_head=False)
|
11 |
+
model.load_adapter("adapters/sarcasm_adapter", set_active=True, with_head=False)
|
12 |
|
13 |
+
model.load_adapter_fusion("adapters/fusion_adapter/aoc(3),aoc(4),sarcasm",with_head=True, set_active=True)
|
|
|
|
|
|
|
|
|
14 |
|
15 |
pipe = TextClassificationPipeline(tokenizer=tokenizer, model=model)
|
16 |
|