From 10b8c9734fffa6fb68457443b1400a65a88188e4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 19:12:29 +0000 Subject: [PATCH] Deployed 80df9dd with MkDocs version: 1.6.0 --- .nojekyll | 0 404.html | 548 ++ Adding_models/index.html | 743 ++ assets/_mkdocstrings.css | 119 + assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.fe8b6f2b.min.js | 29 + assets/javascripts/bundle.fe8b6f2b.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.b8dbb3d2.min.js | 42 + .../workers/search.b8dbb3d2.min.js.map | 7 + assets/stylesheets/main.6543a935.min.css | 1 + assets/stylesheets/main.6543a935.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + base_classes/index.html | 3030 ++++++++ getting-started/installation/index.html | 723 ++ getting-started/quickstart/index.html | 614 ++ home/index.html | 575 ++ index.html | 192 + llm_classes/index.html | 1549 ++++ main_logo.png | Bin 0 -> 26718 bytes main_logo_no_text.png | Bin 0 -> 26732 bytes objects.inv | Bin 0 -> 1002 bytes search/search_index.json | 1 + sitemap.xml | 3 + sitemap.xml.gz | Bin 0 -> 127 bytes stt_classes/index.html | 1093 +++ stt_utils/index.html | 1451 ++++ tts_classes/index.html | 1554 ++++ utils/index.html | 1639 ++++ 63 files changed, 21124 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 Adding_models/index.html create mode 100644 assets/_mkdocstrings.css create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.fe8b6f2b.min.js create mode 100644 assets/javascripts/bundle.fe8b6f2b.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js.map create mode 100644 assets/stylesheets/main.6543a935.min.css create mode 100644 assets/stylesheets/main.6543a935.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 base_classes/index.html create mode 100644 getting-started/installation/index.html create mode 100644 getting-started/quickstart/index.html create mode 100644 home/index.html create mode 100644 index.html create mode 100644 llm_classes/index.html create mode 100644 main_logo.png create mode 100644 main_logo_no_text.png create mode 100644 objects.inv create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 stt_classes/index.html create mode 100644 stt_utils/index.html create mode 100644 tts_classes/index.html create mode 100644 utils/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..c915d25 --- /dev/null +++ b/404.html @@ -0,0 +1,548 @@ + + + +
+ + + + + + + + + + + + + + +One of the goals of open voice chat is for it to be very easy to add new models +to the system. The code is meant to be process level not object level. We have made it so +that you can add your own models to the system with very little effort, so when the models +improve so does the overall system.
+To add a new STT model you need to create a new class that inherits from the BaseEar
class.
+This class should implement the transcribe
method that takes in an audio np array and returns
+a string.
Here is how the huggingface model is implemented:
+class Ear_hf(BaseEar):
+ def __init__(self, model_id='openai/whisper-base.en', device='cpu',
+ silence_seconds=2, generate_kwargs=None):
+ super().__init__(silence_seconds, stream=False)
+ self.pipe = pipeline('automatic-speech-recognition', model=model_id, device=device)
+ self.device = device
+ self.generate_kwargs = generate_kwargs
+
+ @torch.no_grad()
+ def transcribe(self, audio):
+ transcription = self.pipe(audio, generate_kwargs=self.generate_kwargs)
+ return transcription['text'].strip()
+
To add a new TTS model you need to create a new class that inherits from the BaseMouth
class.
+This class should implement the run_tts
method that takes in a string and returns an audio np array.
Here is how the piper-tts model is implemented: +
class Mouth_piper(BaseMouth):
+ def __init__(self, device='cpu', model_path='models/en_US-ryan-high.onnx',
+ config_path='models/en_en_US_ryan_high_en_US-ryan-high.onnx.json'):
+ self.model = piper.PiperVoice.load(model_path=model_path,
+ config_path=config_path,
+ use_cuda=True if device == 'cuda' else False)
+ super().__init__(sample_rate=self.model.config.sample_rate)
+
+ def run_tts(self, text):
+ audio = b''
+ for i in self.model.synthesize_stream_raw(text):
+ audio += i
+ return np.frombuffer(audio, dtype=np.int16)
+
To add a new LLM model you need to create a new class that inherits from the BaseChatbot
class.
+This class should implement the run
method that takes in the user message and yields the assistant's response, and
+the post_process
method that takes in the response of the assistant does any post-processing and returns it.
Here is how the gpt model is implemented: +
class Chatbot_gpt(BaseChatbot):
+ def __init__(self, sys_prompt='', Model='gpt-3.5-turbo'):
+ load_dotenv()
+ OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
+ self.MODEL = Model
+ self.client = OpenAI(api_key=OPENAI_API_KEY)
+ self.messages = []
+ self.messages.append({"role": "system", "content": sys_prompt})
+
+ def run(self, input_text):
+ self.messages.append({"role": "user", "content": input_text})
+ stream = self.client.chat.completions.create(
+ model=self.MODEL,
+ messages=self.messages,
+ stream=True,
+ )
+ for chunk in stream:
+ if chunk.choices[0].delta.content is not None:
+ yield chunk.choices[0].delta.content
+
+ def post_process(self, response):
+ self.messages.append({"role": "assistant", "content": response})
+ return response
+