MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / __init__

Method __init__

SPHINX/batch_inference.py:26–36  ·  view source on GitHub ↗
(self, image_size: int, list_path: str)

Source from the content-addressed store, hash-verified

24class Dataset(torch.utils.data.Dataset):
25
26 def __init__(self, image_size: int, list_path: str) -> None:
27 if list_path.endswith(".csv"):
28 df = pd.read_csv(list_path, sep="\t")
29 elif list_path.endswith(".parquet"):
30 df = pd.read_parquet(list_path)
31 else:
32 raise NotImplementedError("List path has unknown extension: " + list_path)
33
34 self.urls = df["url"].tolist()
35 self.transform = get_transform("padded_resize", image_size)
36 self.tokenizer = None
37
38 def __len__(self) -> int:
39 return len(self.urls)

Callers

nothing calls this directly

Calls 1

get_transformFunction · 0.90

Tested by

no test coverage detected