Spaces:
Runtime error
Runtime error
Teddy Xinyuan Chen
commited on
2024-05-10T12-05-25Z
Browse files
app.py
CHANGED
@@ -35,4 +35,4 @@ interface = gr.Interface(
|
|
35 |
)
|
36 |
|
37 |
# Launch the app
|
38 |
-
interface.launch()
|
|
|
35 |
)
|
36 |
|
37 |
# Launch the app
|
38 |
+
interface.launch(share=True)
|
main.py
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from taibun import Converter # Assuming the taibun package provides a Converter class
|
3 |
-
|
4 |
-
|
5 |
-
def convert_text(text, system="Tailo", dialect="south", format="mark", sandhi="none"):
|
6 |
-
# Create a converter object with selected options
|
7 |
-
converter = Converter(system=system, dialect=dialect, format=format, sandhi=sandhi)
|
8 |
-
# Return the converted text
|
9 |
-
return converter.get(text)
|
10 |
-
|
11 |
-
|
12 |
-
# Define the interface
|
13 |
-
interface = gr.Interface(
|
14 |
-
fn=convert_text,
|
15 |
-
inputs=[
|
16 |
-
gr.Textbox(label="Enter Hokkien text", placeholder="Type Hokkien text here..."),
|
17 |
-
gr.Dropdown(
|
18 |
-
choices=["Tailo", "POJ", "Zhuyin", "TLPA", "Pingyim", "Tongiong", "IPA"],
|
19 |
-
label="System",
|
20 |
-
value="Tailo",
|
21 |
-
),
|
22 |
-
gr.Dropdown(choices=["south", "north"], label="Dialect", value="south"),
|
23 |
-
gr.Dropdown(
|
24 |
-
choices=["mark", "number", "strip"], label="Tone Format", value="mark"
|
25 |
-
),
|
26 |
-
gr.Dropdown(
|
27 |
-
choices=["none", "auto", "exc_last", "incl_last"],
|
28 |
-
label="Tone Sandhi",
|
29 |
-
value="none",
|
30 |
-
),
|
31 |
-
],
|
32 |
-
outputs=[gr.Textbox(label="Converted Text")],
|
33 |
-
title="Hokkien Transliteration Converter",
|
34 |
-
description="Convert Hokkien text between various transliteration systems using the <a href='https://github.com/andreihar/taibun' target='_blank'>taibun</a> package. Made by <a href='https://teddysc.me'>Teddy</a>.",
|
35 |
-
)
|
36 |
-
|
37 |
-
# Launch the app
|
38 |
-
interface.launch(share=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|