small fixes
This commit is contained in:
		
							parent
							
								
									83595402b7
								
							
						
					
					
						commit
						ac7596c183
					
				| 
						 | 
				
			
			@ -12,5 +12,5 @@ class WhisperTranscriber:
 | 
			
		|||
        print("Whisper model loaded.")
 | 
			
		||||
 | 
			
		||||
    def transcribe(self, audio_file: str) -> str:
 | 
			
		||||
        result = self.pipe(audio_file, return_timestamps=True)
 | 
			
		||||
        result = self.pipe(audio_file, batch_size=4, return_timestamps=True)
 | 
			
		||||
        return result.get("text", "").strip()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,6 +50,7 @@ async def handle_voice_and_video(message: types.Message, redis_service, storage_
 | 
			
		|||
        chat_id=message.chat.id,
 | 
			
		||||
        message_id=message.message_id
 | 
			
		||||
    )
 | 
			
		||||
    os.remove(wav_destination)
 | 
			
		||||
    if text:
 | 
			
		||||
        await send_long_message(message, text)
 | 
			
		||||
    else:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue