(self, model_runner=None)
| 110 | sample_rate=self.audio_sr, |
| 111 | slice_frame=self.slice_frame, |
| 112 | prev_frame=self.prev_frame_length, |
| 113 | stream_config=self.stream_config, |
| 114 | ) |
| 115 | |
| 116 | def init_reader(self, model_runner=None): |
| 117 | if not isinstance(self.audio_path, dict): |
| 118 | return |
| 119 | assert self.audio_path["type"] == "stream", f"unexcept audio_path: {self.audio_path}" |
| 120 | segment_duration = self.max_num_frames / self.target_fps |
| 121 | prev_duration = self.prev_frame_length / self.target_fps |
| 122 | omni_work_dir = os.getenv("OMNI_WORK_DIR", None) |
| 123 | if omni_work_dir: |
| 124 | from lightx2v.utils.va_reader_omni import OmniVAReader, SekoAROmniVAReader |
| 125 | |
| 126 | if self.is_seko_talk_ar: |
| 127 | self.reader = SekoAROmniVAReader( |
| 128 | rank=self.rank, |
| 129 | world_size=self.world_size, |
| 130 | stream_url=self.audio_path["data"], |
| 131 | sample_rate=self.audio_sr, |
| 132 | latent_per_chunk=self.latent_per_chunk, |
| 133 | audio_window_secs=self.audio_window_secs, |
| 134 | look_ahead_secs=self.look_ahead_secs, |
| 135 | video_fps=self.target_fps, |
| 136 | target_rank=self.target_reader_rank, |
| 137 | model_runner=model_runner, |
| 138 | huoshan_tts_voice_type=self.audio_path.get("huoshan_tts_voice_type", None), |
| 139 | stream_config=self.stream_config, |
| 140 | ) |
| 141 | return |
| 142 | |
| 143 | self.reader = OmniVAReader( |
| 144 | rank=self.rank, |
| 145 | world_size=self.world_size, |
| 146 | stream_url=self.audio_path["data"], |
| 147 | sample_rate=self.audio_sr, |
| 148 | segment_duration=segment_duration, |
| 149 | prev_duration=prev_duration, |
no test coverage detected