Spaces:
Runtime error
Runtime error
Update off_topic.py
Browse files- off_topic.py +2 -2
off_topic.py
CHANGED
@@ -116,14 +116,14 @@ class OffTopicDetector:
|
|
116 |
invalid_probas = probas[:, n_valid:n_classes].sum(axis=1, keepdims=True)
|
117 |
return probas, valid_probas, invalid_probas
|
118 |
|
119 |
-
def predict_probas_url(self, img_urls: List[str], domain: str,
|
120 |
title: Optional[str] = None,
|
121 |
valid_templates: Optional[List[str]] = None,
|
122 |
invalid_classes: Optional[List[str]] = None,
|
123 |
autocast: bool = True):
|
124 |
images = self.get_images(img_urls)
|
125 |
dedup_images = self._filter_dups(images)
|
126 |
-
return self.predict_probas(images, domain, title, valid_templates, invalid_classes, autocast)
|
127 |
|
128 |
def predict_probas_item(self, url_or_id: str,
|
129 |
use_title: bool = False,
|
|
|
116 |
invalid_probas = probas[:, n_valid:n_classes].sum(axis=1, keepdims=True)
|
117 |
return probas, valid_probas, invalid_probas
|
118 |
|
119 |
+
def predict_probas_url(self, img_urls: List[str], domain: str, site:str,
|
120 |
title: Optional[str] = None,
|
121 |
valid_templates: Optional[List[str]] = None,
|
122 |
invalid_classes: Optional[List[str]] = None,
|
123 |
autocast: bool = True):
|
124 |
images = self.get_images(img_urls)
|
125 |
dedup_images = self._filter_dups(images)
|
126 |
+
return self.predict_probas(images, domain, site, title, valid_templates, invalid_classes, autocast)
|
127 |
|
128 |
def predict_probas_item(self, url_or_id: str,
|
129 |
use_title: bool = False,
|