Spaces:
Sleeping
Sleeping
cordwainersmith
commited on
Commit
·
676f4c4
1
Parent(s):
b6dee00
v2
Browse files
app.py
CHANGED
@@ -58,10 +58,10 @@ class PIIMaskingModel:
|
|
58 |
self.model_name = model_name
|
59 |
hf_token = st.secrets["hf_token"]
|
60 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
61 |
-
model_name,
|
62 |
)
|
63 |
self.model = AutoModelForTokenClassification.from_pretrained(
|
64 |
-
model_name,
|
65 |
)
|
66 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
67 |
self.model.to(self.device)
|
@@ -296,7 +296,7 @@ def main():
|
|
296 |
|
297 |
if st.button("Process Text"):
|
298 |
texts = [text.strip() for text in text_input.split(",") if text.strip()]
|
299 |
-
model = PIIMaskingModel()
|
300 |
|
301 |
for text in texts:
|
302 |
st.markdown(
|
|
|
58 |
self.model_name = model_name
|
59 |
hf_token = st.secrets["hf_token"]
|
60 |
self.tokenizer = AutoTokenizer.from_pretrained(
|
61 |
+
model_name, token=hf_token
|
62 |
)
|
63 |
self.model = AutoModelForTokenClassification.from_pretrained(
|
64 |
+
model_name, token=hf_token
|
65 |
)
|
66 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
67 |
self.model.to(self.device)
|
|
|
296 |
|
297 |
if st.button("Process Text"):
|
298 |
texts = [text.strip() for text in text_input.split(",") if text.strip()]
|
299 |
+
model = PIIMaskingModel(MODEL_NAME)
|
300 |
|
301 |
for text in texts:
|
302 |
st.markdown(
|