Actually i don’t think the issue is with that, the below lines are in a different function
let’s say:
def transcibe(audio_data):
mem_usage = memory_usage(max_usage=True) # Get max memory usage in MB
logger.info(f"Current memory usage in transciber before generating output: {mem_usage} MB")
text = self.transcriber(arr)
# Clean up
del arr, audio_data
torch.cuda.empty_cache()
mem_usage = memory_usage(max_usage=True) # Get max memory usage in MB
logger.info(f"Current memory usage in transciber after generating output: {mem_
this self.transcriber is consuming it, the significant increase in memory is between these two lines
and self.transcriber is basically huggingface pipeline i.e
self.transcriber = pipeline(
“automatic-speech-recognition”,
model=self.model,
tokenizer=self.processor.tokenizer,
feature_extractor=self.processor.feature_extractor,
max_new_tokens=128,
use_fast=False,
chunk_length_s=10,
batch_size=8,
torch_dtype=torch_dtype,
device=device
)
so is the pipeline using some memory and not clearing it. I am quite not able to figure out the issue here
when i ran the same code on colab as well, where i transcribed a audio file using the same pipeline continously, there also ram usage was increasing slowly and it was not freeing