dkjroot / iris-llm

IRIS: Intelligent Residential Integration System - a mind for your home!
GNU General Public License v3.0
59 stars 10 forks source link

HTML Coded Responses. #2

Open lessloveless opened 8 months ago

lessloveless commented 8 months ago

Hey Idk how long its been since anybody worked on this but..

Iris' outputs come out from the standalone turning apostrophes into "'".

I fixed this by adding

"import html"

and correcting the section "# Print and say the reply from the model" to the below.

EDIT: (The issue came back, perm fixed below)

def output_ai_reply(reply):
    decoded_reply = html.unescape(reply)
    decoded_again = decoded_reply.replace("'", "'")
    decoded_final = decoded_again.replace("'", "'")
    print("Iris:", decoded_final)
    tts_inst.speak(decoded_final)
dkjroot commented 7 months ago

Thanks! LLMs can be a bit unpredictable so it might depend on what model or what prompt you're using, but if/when I get back to this project I'll have a look and it'll be good to have your solution to return to :) Feel free to raise a PR too if you like, though it may be some time before I get around to merging it.