#note: I had to change the script for GPIO stuff. Go into chatbot.py (I use nano). I uncommented out the old RPI.GPIO stuff and put in the new gpiod stuff.
“cd local_llm_assistant
Sudo nano chatbot.py”
Edit the script by hashtagging the code below as shown:
try: while True: button_state = button_line.get_value()
if button_state == 1:
main()
finally:
button_line.release()
Then save chatbot.py
Make sure you are in:
“cd local_llm_assistant”
Start up the LLM with:
./TinyLlama-1.1B-Chat-v1.0.Q5_K_M.llamafile
Then, in a different window, start the voice assistant software:
python3 chatbot.py
Wait a few seconds until you see the "Ready..." message, then press the button when you want to talk. When you see the "recording" message, speak your request. After the LLM completes its work, the response will be spoken through the speaker. (Since I’m a noob, I didnt do this, I just watched the script output. Also, if you do not attach a button, mic loop just stays open for about 3 seconds and if you talk fast you can get your question in, lol)
Elektor Magazine has been one of the leading sources of information on electronics for engineers, designers, start-ups and companies for 65 years. Our magazine is powered by an active community of electronics engineers – from students to professionals – who are passionate about designing and sharing innovative ideas.
For them, we publish hundreds of items a year, in formats such as articles, videos, webinars, and other learning formats. Our mission is to share knowledge in every possible way and inspire readers with the latest developments within the electrical engineering sector.
Thank you for your vote!
Leave further comments in the fields below.
Thank you for your vote!
If you wish to leave a comment with your rating, please first use the login below. If not, just close this window.
Discussion (0 comments)