tanthinhdt commited on
Commit
8b82e75
·
1 Parent(s): 9b6c7de

Update how2sign-clips.py

Browse files
Files changed (1) hide show
  1. how2sign-clips.py +8 -7
how2sign-clips.py CHANGED
@@ -114,13 +114,14 @@ class How2SignClips(datasets.GeneratorBasedBuilder):
114
  video_path = os.path.join(
115
  video_dir, sample["view"], sample["id"] + ".mp4"
116
  )
117
- yield i, {
118
- "id": sample["id"],
119
- "type": sample["type"],
120
- "view": sample["view"],
121
- "text": sample["text"],
122
- "video": self.__get_binary_data(video_path),
123
- }
 
124
 
125
  def __get_binary_data(self, path):
126
  with open(path, "rb") as f:
 
114
  video_path = os.path.join(
115
  video_dir, sample["view"], sample["id"] + ".mp4"
116
  )
117
+ if os.path.exists(video_path):
118
+ yield i, {
119
+ "id": sample["id"],
120
+ "type": sample["type"],
121
+ "view": sample["view"],
122
+ "text": sample["text"],
123
+ "video": self.__get_binary_data(video_path),
124
+ }
125
 
126
  def __get_binary_data(self, path):
127
  with open(path, "rb") as f: