FediScanner

#python

← Back

Голосовой ввод в любое окно Windows за секунду. Офлайн, на CPU, без единого гигабайта torch

Голосовой ввод для Windows за ~1 секунду | Полностью локально • CPU • Open Source Как заставить Whisper распознавать речь почти в 4 раза быстрее на обычном CPU без GPU и без облака. Разбираю архитектуру WhisperType, сужение окна энкодера, потоковую обработку аудио, оптимизацию faster-whisper и подводные камни WinAPI.

habr.com/ru/articles/1068154/

#Whisper #WhisperType #fasterwhisper #CTranslate2 #SpeechtoText #распознавание_речи #Windows #Python #CPU #Open_Source

Show Original PostReport

After a week of Python coding for a project, I'm craving to replace all my Python code into R.

Before R, I was a Python person for a couple of years and before that few years of Perl. I still from time to time go back to Perl, but I don't miss Python at all. It feels much more limiting than R and Perl.

#RStats #Python

Show Original PostReport

The controller for my sprinkler system died last year, and the good controllers are ridiculously expensive.

So I spent the afternoon writing a Python script to run my sprinkler system with a Raspberry Pi. I got it wired into an 8 relay module and verified that things are turning on and off like they're supposed to. Now just waiting for a 24VAC transformer, which should be here tomorrow, and my automatic sprinkler system will be back in business.

#Python #RaspberryPi #DIY #HomeAutomation

Show Original PostReport

Python Tip #219 (of 365):

Validate your ducks with goose typing.

You can use isinstance() WHILE duck typing. This is called goose typing (coined by Alex Martelli).

>>> from collections‍.abc import Iterable
>>> isinstance([1, 2, 3], Iterable)
True

Point doesn't inherit from Iterable:

class Point:
def __init__(self, x, y): self.x, self.y = x, y
def __iter__(self): yield from (self.x, self.y)

And yet...

>>> isinstance(Point(1, 2), Iterable)
True

🧵 (1/3)

Show Original PostReport