Spaces:
Running
Running
Ad download progress bar...
Browse files
utils.py
CHANGED
@@ -24,6 +24,13 @@ class CustomDataSet(torch.utils.data.Dataset):
|
|
24 |
image = PilImage.open(img_loc).convert("RGB")
|
25 |
tensor_image = self.transform(image)
|
26 |
return tensor_image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
|
29 |
def text_encoder(text, model, tokenizer):
|
|
|
24 |
image = PilImage.open(img_loc).convert("RGB")
|
25 |
tensor_image = self.transform(image)
|
26 |
return tensor_image
|
27 |
+
|
28 |
+
|
29 |
+
class DownloadProgressBar(tqdm):
|
30 |
+
def update_to(self, b=1, bsize=1, tsize=None):
|
31 |
+
if tsize is not None:
|
32 |
+
self.total = tsize
|
33 |
+
self.update(b * bsize - self.n)
|
34 |
|
35 |
|
36 |
def text_encoder(text, model, tokenizer):
|