MCPcopy Create free account
hub / github.com/ml-explore/mlx-data / CSVReader

Class CSVReader

mlx/data/stream/CSVReader.h:17–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15namespace stream {
16
17class CSVReader : public Stream {
18 public:
19 CSVReader(
20 const std::string& filename,
21 char sep = ',',
22 char quote = '"',
23 const std::filesystem::path& local_prefix = "",
24 std::shared_ptr<core::FileFetcher> fetcher = nullptr);
25 CSVReader(
26 const std::shared_ptr<std::istream>& f,
27 char sep = ',',
28 char quote = '"',
29 std::shared_ptr<core::FileFetcherHandle> file_handle = nullptr);
30 virtual Sample next() const override;
31 void reset() override;
32
33 private:
34 std::unique_ptr<core::CSVReader> csv_;
35 std::vector<std::string> keys_;
36 std::shared_ptr<core::FileFetcherHandle> fileHandle_;
37 mutable std::mutex mutex_;
38};
39
40class CSVReaderFromKey : public Compose {
41 public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected