Spaces:
Running
Running
app.py
CHANGED
@@ -37,7 +37,7 @@ def video_identity(video,user_name,class_name,trainortest,ready):
|
|
37 |
|
38 |
def __call__(self, batch):
|
39 |
encodings = self.feature_extractor([x[0] for x in batch], return_tensors='pt')
|
40 |
-
encodings['labels'] = torch.tensor([x[1] for x in batch], dtype=torch.
|
41 |
return encodings
|
42 |
feature_extractor = ViTFeatureExtractor.from_pretrained('google/vit-base-patch16-224-in21k')
|
43 |
model = ViTForImageClassification.from_pretrained(
|
|
|
37 |
|
38 |
def __call__(self, batch):
|
39 |
encodings = self.feature_extractor([x[0] for x in batch], return_tensors='pt')
|
40 |
+
encodings['labels'] = torch.tensor([x[1] for x in batch], dtype=torch.float)
|
41 |
return encodings
|
42 |
feature_extractor = ViTFeatureExtractor.from_pretrained('google/vit-base-patch16-224-in21k')
|
43 |
model = ViTForImageClassification.from_pretrained(
|