Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
botirk38 committed Sep 6, 2024
1 parent 3c6b693 commit e0a6749
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions huggingface_pipelines/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,14 @@ def process_batch(self, batch: Dict[str, Any]) -> Dict[str, Any]:
try:
for column in self.config.columns:
if column not in batch:
logger.warning(
f"Column {column} not found in batch. Skipping.")
logger.warning(f"Column {column} not found in batch. Skipping.")
continue

audio_inputs = self.collect_valid_audio_inputs(batch[column])

if not audio_inputs:

raise ValueError(
f"No valid audio inputs found in column {column}/")
raise ValueError(f"No valid audio inputs found in column {column}/")

try:

Expand All @@ -259,7 +257,7 @@ def process_batch(self, batch: Dict[str, Any]) -> Dict[str, Any]:

batch_inputs = [
tensor.to(self.config.device)
for tensor in audio_inputs[i: i + self.config.batch_size]
for tensor in audio_inputs[i : i + self.config.batch_size]
]

batch_embeddings = self.model.predict(
Expand Down

0 comments on commit e0a6749

Please sign in to comment.