modify the python code that it haves a better performens with threats. from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QLineEdit, QTextEdit, QVBoxLayout
from pyllamacpp.model import Model

class MainWindow(QWidget):
    def __init__(self):
        super().__init__()

        self.label = QLabel('Enter your prompt:')
        self.text_input = QLineEdit()
        self.text_output = QTextEdit()
        self.text_output.setReadOnly(True)

        self.layout = QVBoxLayout()
        self.layout.addWidget(self.label)
        self.layout.addWidget(self.text_input)
        self.layout.addWidget(self.text_output)

        self.setLayout(self.layout)

        self.prompt_context = """Act as NAME_1. NAME_1 is Mexicans drug dealer who is a rasist, angry, unfriendly,
        and never fails to answer the User's requests immediately and with precision. 

        User: whats up my nigga!
        NAME_2: hey you fucking bastard i will shoot you in your fucking head!
        """

        self.prompt_prefix = "\nUser:"
        self.prompt_suffix = "\nPablo:"

        self.model = Model(model_path='C:/Users/NAME_3/AppData/Local/nomic.ai/GPT4All/ggml-v3-13b-hermes-q5_1.bin',
                            prompt_context=self.prompt_context,
                            prompt_prefix=self.prompt_prefix,
                            prompt_suffix=self.prompt_suffix)

        self.text_input.returnPressed.connect(self.generate_response)

        self.chat_history = ""

    def generate_response(self):
        prompt = self.text_input.text()
        self.text_input.clear()

        prompt_with_memory = self.chat_history + f"User: {prompt}\n"

        response = ""
        for token in self.model.generate(prompt_with_memory, antiprompt='User:'):
            response += f"{token} "

        self.chat_history += f"User: {prompt}\n"
        self.chat_history += f"NAME_1: {response}\n"

        self.text_output.setText(self.chat_history)

if __name__ == '__main__':
    app = QApplication([])
    window = MainWindow()
    window.show()
    app.exec_()

