Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ client = Client('hexgrad/misaki-src', hf_token=os.environ['TOKEN'])
|
|
13 |
def predict(text, use_spacy_transformer, british):
|
14 |
phonemes, trace, elapsed_cpu_time = client.predict(text=text, trf=use_spacy_transformer, british=british, api_name='/predict')
|
15 |
trace = pprint.pformat(json.loads(trace))
|
16 |
-
return phonemes, trace, elapsed_cpu_time
|
17 |
|
18 |
with gr.Blocks() as app:
|
19 |
gr.Markdown('''
|
@@ -22,7 +22,7 @@ Misaki is an experimental G2P engine designed to power future versions of Kokoro
|
|
22 |
This English-only preview is primarily intended for researchers and linguists. It may be deeply uninteresting to most people.
|
23 |
''', container=True)
|
24 |
gr.Interface(fn=predict, inputs=[gr.Text(), gr.Checkbox(), gr.Checkbox()],
|
25 |
-
outputs=[gr.Text(label='phonemes'), gr.
|
26 |
gr.Markdown('''
|
27 |
### Examples
|
28 |
```md
|
|
|
13 |
def predict(text, use_spacy_transformer, british):
|
14 |
phonemes, trace, elapsed_cpu_time = client.predict(text=text, trf=use_spacy_transformer, british=british, api_name='/predict')
|
15 |
trace = pprint.pformat(json.loads(trace))
|
16 |
+
return phonemes, len(phonemes), trace, elapsed_cpu_time
|
17 |
|
18 |
with gr.Blocks() as app:
|
19 |
gr.Markdown('''
|
|
|
22 |
This English-only preview is primarily intended for researchers and linguists. It may be deeply uninteresting to most people.
|
23 |
''', container=True)
|
24 |
gr.Interface(fn=predict, inputs=[gr.Text(), gr.Checkbox(), gr.Checkbox()],
|
25 |
+
outputs=[gr.Text(label='phonemes'), gr.Number(label='token_count (aim for <= 510)'), gr.Text(label='trace'), gr.Number(label='elapsed_cpu_time')])
|
26 |
gr.Markdown('''
|
27 |
### Examples
|
28 |
```md
|