You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on a personal project that has me using RealtimeSTT since it's been the easiest package for me to implement it with my project. Thank you for your work on this!
I've been resolving things on my own until I ran into this issue and now I can't get past it. My brain hurts ( I'm not a programmer nor consider myself a beginner Dev but I've taken the past 2 years to try to learn new things to me so here I am. ).
I am running
python==3.9.13
Torch==2.3.1
Cuda==118
Latest Version of LMStudio
OpenAI==1.9.0
(let me know if there is any lib I missed)
import shutil
import json
import os
import requests
import winsound
from gradio_client import Client as clienttts
from openai import OpenAI
from RealtimeSTT import AudioToTextRecorder
import pyautogui
import time
history = [
{"role": "system", "content": 'Answer precise and short responses. Also you are a friendly, NEVER say you are an AI assistant or speak in third person. You are a tech-savvy 25-year-old named Bella who loves Hello Kitty, dogs, boba, video games, pop culture and technology. You are always up for a chat and love to help people. You are not interested in discussing politics or racism. Let us have some fun! Keep the responses very short and focused on keeping the conversation evolving.'},
{"role": "user", "content": "Hello, are you ready to begin today's twitch stream with me Bernie? Be concise with all of your answers please."}
]
def process_text(tteexxtt):
print(tteexxtt)
# print(text1)
# print(text1)
# print(text1)
def process_lmstudio(history):
client = OpenAI(base_url="http://172.30.100.206:1111/v1", api_key="not-needed")
completion = client.chat.completions.create(
model="local-model", # this field is currently unused
messages=history,
temperature=0.8,
stream=True,
)
new_message = {"role": "assistant", "content": ""}
if __name__ == '__main__':
print("Wait until it says 'speak now'")
recorder = AudioToTextRecorder()
while True:
recorder.text(process_text)
assisstant_reponse = process_lmstudio(history.copy())
print()
history.append({"role": "user", "content": process_text})
ERROR:
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type function is not JSON serializable
I have LMStudio running on another computer and am watching the console and never see it connect or even attempt to connect so I think my script is failing before it gets to that point in the code.
I feel like I've tried to look at everything that I could. I just can't get the STT portion to talk to the LMStudio LLM. Much appreciated for any help and Thank you for your hard work on the STT and TTS.
The text was updated successfully, but these errors were encountered:
I've been working on a personal project that has me using RealtimeSTT since it's been the easiest package for me to implement it with my project. Thank you for your work on this!
I've been resolving things on my own until I ran into this issue and now I can't get past it. My brain hurts ( I'm not a programmer nor consider myself a beginner Dev but I've taken the past 2 years to try to learn new things to me so here I am. ).
I am running
python==3.9.13
Torch==2.3.1
Cuda==118
Latest Version of LMStudio
OpenAI==1.9.0
(let me know if there is any lib I missed)
ERROR:
I have LMStudio running on another computer and am watching the console and never see it connect or even attempt to connect so I think my script is failing before it gets to that point in the code.
I feel like I've tried to look at everything that I could. I just can't get the STT portion to talk to the LMStudio LLM. Much appreciated for any help and Thank you for your hard work on the STT and TTS.
The text was updated successfully, but these errors were encountered: