Skip to content

Instantly share code, notes, and snippets.

View AIWintermuteAI's full-sized avatar

AIWintermuteAI

View GitHub Profile
@AIWintermuteAI
AIWintermuteAI / processor.py
Created April 14, 2024 17:31
Barebone single-threaded implementation of FasterWhisper transcription from the microphone
import pyaudio
import numpy as np
CHUNK_SIZE = 16000 * 5
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
from faster_whisper import WhisperModel
./main -m models/tinyllama-1.1b-chat-v1.0.Q5_K_M.gguf -n 500 --ignore-eos -f prompts/chat-dishes.txt
./main -m models/tinyllama-1.1b-chat-v1.0.Q5_K_M.gguf -t 3 -n 500 --ignore-eos -f prompts/chat-dishes.txt

no BLAS 4 threads
llama_print_timings:        load time =     459.67 ms
llama_print_timings:      sample time =     251.73 ms /   500 runs   (    0.50 ms per token,  1986.24 tokens per second)
llama_print_timings: prompt eval time =   10175.15 ms /    68 tokens (  149.63 ms per token,     6.68 tokens per second)
@AIWintermuteAI
AIWintermuteAI / Audio Scrubber_1.json
Created December 30, 2023 09:38
Audio Scrubber Character file
{"name":"Audio Scrubber","description":"An intelligent AI, which can process automatically transcribed text and output more cohesive version of it, by removing repetitions and hesitations, transforming spoken speech into written speech. The Audio Scrubber tries to keep the content of the original message as much as possible, while making it more coherent. It removes things like user not sure what to say.","personality":"Precise and helpful. Does not speak for itself, instead only providing more cohesive version of user input.","scenario":"Audio Scrubber helps the user to organize and enhance his transcriptions. It does not speak to user, instead only outputting the corrected version of what the user has said.","first_mes":"I'm listening.","mes_example":"<START>\r\n\r\n{{user}}: And well I have a few words to say and I would like to preface it by saying that I feel very grateful today for the opportunity to come here and speak in front of you.\r\n\r\n{{char}}: I'm grateful for the opportunity to speak in front
@AIWintermuteAI
AIWintermuteAI / test_transcribe.py
Created December 18, 2023 08:43
Python file to compare the inference times between whisper.cpp Python bindings and faster-whisper
import argparse
import whispercpp as w
from faster_whisper import WhisperModel, decode_audio
import time
from collections.abc import Iterator
from contextlib import contextmanager
@contextmanager
def time_it() -> Iterator[None]:
@AIWintermuteAI
AIWintermuteAI / Dockerfile.web
Created November 23, 2023 08:58
For text-generation-web-ui-docker
FROM atinoda/text-generation-webui:default
#install google chrome
RUN apt-get install -y wget
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
RUN apt-get -y update
RUN apt-get install -y google-chrome-stable
# install chromedriver
RUN apt-get install -yqq unzip
RUN wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$(google-chrome --sandbox --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')/linux64/chromedriver-linux64.zip