please fix : import sys
import re
import os
import subprocess
from PyQt6.QtWidgets import (
    QApplication, QWidget, QVBoxLayout, QLabel, QLineEdit,
    QPushButton, QSlider, QTextEdit
)
from PyQt6.QtCore import Qt
from gradio_client import Client

class ChatGPTApp(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("ChatGPT API Interface")
        self.setGeometry(100, 100, 600, 600)

        self.client = Client("yuntian-deng/ChatGPT")
        self.initUI()

    def initUI(self):
        layout = QVBoxLayout()

        # Input field for the chat input
        self.input_field = QLineEdit(self)
        self.input_field.setPlaceholderText("Type your message here...")
        layout.addWidget(self.input_field)

        # Top-p slider
        self.top_p_slider = QSlider(Qt.Orientation.Horizontal)
        self.top_p_slider.setRange(0, 100)
        self.top_p_slider.setValue(100)
        self.top_p_slider.setSingleStep(1)
        layout.addWidget(QLabel("Top-p (nucleus sampling):"))
        layout.addWidget(self.top_p_slider)

        # Temperature slider
        self.temperature_slider = QSlider(Qt.Orientation.Horizontal)
        self.temperature_slider.setRange(0, 100)
        self.temperature_slider.setValue(100)
        self.temperature_slider.setSingleStep(1)
        layout.addWidget(QLabel("Temperature:"))
        layout.addWidget(self.temperature_slider)

        # Prediction button
        self.predict_button = QPushButton("Predict", self)
        self.predict_button.clicked.connect(self.make_prediction)
        layout.addWidget(self.predict_button)

        # Reset button
        self.reset_button = QPushButton("Reset Textbox", self)
        self.reset_button.clicked.connect(self.reset_textbox)
        layout.addWidget(self.reset_button)

        # Code output text area
        self.code_area = QTextEdit(self)
        self.code_area.setReadOnly(True)
        layout.addWidget(QLabel("Extracted Code:"))
        layout.addWidget(self.code_area)

        # Response text area
        self.response_area = QTextEdit(self)
        self.response_area.setReadOnly(True)
        layout.addWidget(QLabel("Response:"))
        layout.addWidget(self.response_area)

        self.setLayout(layout)

        # Create directory for output
        os.makedirs("GPT40-mini", exist_ok=True)

    def make_prediction(self):
        inputs = self.input_field.text()
        top_p = self.top_p_slider.value() / 100.0
        temperature = self.temperature_slider.value() / 100.0

        # Make the API call
        result = self.client.predict(
            inputs=inputs,
            top_p=top_p,
            temperature=temperature,
            chat_counter=0,
            chatbot=[],
            api_name="/predict"
        )

        # Extract the relevant parts of the response
        response_text = result[0][0][1]
        status_code = result[2]

        # Set the response in the response area
        formatted_response = f"AI: {response_text}\n\nStatus Code: {status_code}"
        self.response_area.setPlainText(formatted_response)

        # Extract Python code if available
        self.extract_code(response_text)

    def extract_code(self, text):
        pattern = r' D:\Spatial>python GPT4omini_Coder.py
  File "D:\Spatial\GPT4omini_Coder.py", line 99
    pattern = r'
              ^
SyntaxError: unterminated string literal (detected at line 99)