Spaces:
Runtime error
Runtime error
nehalelkaref
commited on
Commit
•
bae20b2
1
Parent(s):
c6d903d
Update app.py
Browse files
app.py
CHANGED
@@ -2,14 +2,14 @@ from flask import Flask, jsonify, request
|
|
2 |
from transformers import AutoAdapterModel, AutoTokenizer, TextClassificationPipeline
|
3 |
from huggingface_hub import Repository
|
4 |
|
5 |
-
tokenizer = AutoTokenizer.from_pretrained("UBC-NLP/MARBERT")
|
6 |
-
|
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.load_adapter("aoc3_adapter", set_active=True, with_head=False)
|
15 |
model.load_adapter("aoc4_adapter", set_active=True, with_head=False)
|
|
|
2 |
from transformers import AutoAdapterModel, AutoTokenizer, TextClassificationPipeline
|
3 |
from huggingface_hub import Repository
|
4 |
|
5 |
+
tokenizer = AutoTokenizer.from_pretrained("UBC-NLP/MARBERT", cache_dir="new_cache_dir/)
|
6 |
+
model = AutoAdapterModel.from_pretrained("UBC-NLP/MARBERT", cache_dir="new_cache_dir/)
|
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.load_adapter("aoc3_adapter", set_active=True, with_head=False)
|
15 |
model.load_adapter("aoc4_adapter", set_active=True, with_head=False)
|