parth parekh
commited on
Commit
·
3562e57
1
Parent(s):
dfb2eec
removed the fucking cache let the hugging face servers suffer
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ app = FastAPI(
|
|
14 |
class ContactDetector:
|
15 |
def __init__(self):
|
16 |
cache_dir = "/app/model_cache"
|
17 |
-
self.tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased',
|
18 |
-
self.model = DistilBertForSequenceClassification.from_pretrained('distilbert-base-uncased', num_labels=2,
|
19 |
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
20 |
self.model.to(self.device)
|
21 |
self.model.eval()
|
|
|
14 |
class ContactDetector:
|
15 |
def __init__(self):
|
16 |
cache_dir = "/app/model_cache"
|
17 |
+
self.tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased', use_fast=True, no_cache=True)
|
18 |
+
self.model = DistilBertForSequenceClassification.from_pretrained('distilbert-base-uncased', num_labels=2, no_cache=True)
|
19 |
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
20 |
self.model.to(self.device)
|
21 |
self.model.eval()
|