Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
cordwainersmith
commited on
Commit
•
5d89fbb
1
Parent(s):
c0b37e0
Add token
Browse files
app.py
CHANGED
@@ -66,9 +66,13 @@ MODEL_DETAILS = {
|
|
66 |
class PIIMaskingModel:
|
67 |
def __init__(self, model_name: str):
|
68 |
self.model_name = model_name
|
69 |
-
|
70 |
-
self.
|
71 |
-
|
|
|
|
|
|
|
|
|
72 |
|
73 |
def process_text(
|
74 |
self, text: str
|
|
|
66 |
class PIIMaskingModel:
|
67 |
def __init__(self, model_name: str):
|
68 |
self.model_name = model_name
|
69 |
+
hf_token = st.secrets["HF_TOKEN"] # Retrieve the token from secrets
|
70 |
+
self.tokenizer = AutoTokenizer.from_pretrained(
|
71 |
+
model_name, use_auth_token=hf_token
|
72 |
+
)
|
73 |
+
self.model = AutoModelForTokenClassification.from_pretrained(
|
74 |
+
model_name, use_auth_token=hf_token
|
75 |
+
)
|
76 |
|
77 |
def process_text(
|
78 |
self, text: str
|