File size: 397 Bytes
3fd377f d0ab552 3fd377f 8177e9a ac6ab54 3fd377f d0ab552 dfb2e0d d0ab552 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# 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() |