File size: 459 Bytes
933562f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os
from datasets import Dataset

def load_dataset():
    # Get the list of binary files in the current directory
    binary_files = [f for f in os.listdir(".") if f.endswith(".bin")]

    # Read the binary files and create a dataset
    data = []
    for file in binary_files:
        with open(file, "rb") as f:
            binary_data = f.read()
            data.append({"file_name": file, "content": binary_data})

    return Dataset.from_list(data)