import gradio as gr from khmerphonemizer import phonemize def merge(x): if isinstance(x, str): return x return "".join(x) def processor(text: str): _, phones = phonemize(text) return " ".join(map(merge, phones)) iface = gr.Interface( title="Khmer Phonemizer", description="Convert Khmer & English into Phonetic Symbols", fn=processor, inputs="text", outputs=["text"], allow_flagging="never", ) iface.launch(show_api=False)