# code = utf-8 import gradio def greet(input:str) -> str: if input.endswith("吗?"): temp = input[ : -2] + "。" temp = temp.replace("我", "#$&") temp = temp.replace("你", "我") return temp.replace("#$&", "你") return input demo = gradio.Interface( fn = greet, inputs = ["text"], outputs = ["text"], theme = "soft", ) demo.launch()