gracilaria0's picture
Update app.py
ac6ab54 verified
raw
history blame contribute delete
397 Bytes
# 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()