Tonic commited on
Commit
27731ec
1 Parent(s): b3758b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +55 -1
app.py CHANGED
@@ -33,7 +33,61 @@ def create_interface():
33
  Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community on 👻Discord: [Discord](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Polytonic](https://github.com/tonic-ai) & contribute to 🌟 [PolyGPT](https://github.com/tonic-ai/polygpt-alpha)
34
  """)
35
  with gr.Row():
36
- input_text = gr.Textbox(label="Input Text")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  submit_button = gr.Button("Submit")
38
  output_text = gr.Textbox(label="Nexus🐦‍⬛Raven")
39
 
 
33
  Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community on 👻Discord: [Discord](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Polytonic](https://github.com/tonic-ai) & contribute to 🌟 [PolyGPT](https://github.com/tonic-ai/polygpt-alpha)
34
  """)
35
  with gr.Row():
36
+ input_text = gr.Textbox(label="Input Text", examples=[
37
+ '''
38
+ Function:
39
+ def create_audio_sequence_order(text):
40
+ """
41
+ Analyzes the text and creates an order for each character and narrator segment.
42
+
43
+ Args:
44
+ text (str): The text containing the dialogues and narration.
45
+
46
+ Returns:
47
+ list: A list of tuples, each containing the character/narrator name and a segment of their dialogue/narration.
48
+ """
49
+ Function:
50
+ def convert_text_to_speech_single_voice(text, voice):
51
+ """
52
+ Converts a given text to speech using a specified voice. This function is used when there is only one character in the text.
53
+
54
+ Args:
55
+ text (str): The text to be converted to speech.
56
+ voice (str): The voice to be used for the audio generation.
57
+
58
+ Returns:
59
+ str: The path to the generated speech MP3 file.
60
+ """
61
+
62
+ User Query: Currently, one way that the wealthy distinguish themselves from others is through the collection of rare objects. In a Celebration Society, to own an “original” of something will remain significant. However, barring a desire to prevent others from enjoying the experience, it will become possible to have perfect replicas of all manner of objects including paintings and sculptures.
63
+ There will still be pride of ownership in the original. Others will be able to fully enjoy the “same” piece as well.
64
+ use either speech to single voice if there's no dialogue or create_audio_sequence_order if there is dialogue<human_end>
65
+ ''' ,
66
+ '''
67
+ Function:
68
+ def create_audio_sequence_order(text):
69
+ """
70
+ Analyzes the text and creates an order for each character and narrator segment.
71
+
72
+ Args:
73
+ text (str): The text containing the dialogues and narration.
74
+
75
+ Returns:
76
+ list: A list of tuples, each containing the character/narrator name and a segment of their dialogue/narration.
77
+ """
78
+
79
+ User Query: Thank you, my mother is remarkably well. Gone to Mr. Woodhouse’s. I made her take her shawl – for the
80
+ evenings are not warm – her large new shawl – Mrs. Dixon’s wedding present. So kind of her to think of my
81
+ mother! Bought at Weymouth, you know – Mr. Dixon’s choice. There were three others, Jane says, which they
82
+ hesitated about some time. Colonel Campbell rather preferred an olive. My dear Jane, are you sure you did not
83
+ wet your feet? – It was but a drop or two, but I am so afraid: but Mr. Frank Churchill was so extremely – and
84
+ there was a mat to step upon – I shall never forget his extreme politeness. (…) Do we not often talk of Mr. Frank
85
+ Churchill? – Ah, here’s Miss Woodhouse – Dear Miss Woodhouse, how do you do? Very well, I thank you, quite
86
+ well. This is a meeting quite in fairyland! Such a transformation! – Must not compliment, I know (...) – that would
87
+ be rude, but upon my word, Miss Woodhouse, you do look – how do you like Jane’s hair? (...)
88
+ use either speech to single voice if there's no dialogue or create_audio_sequence_order if there is dialogue<human_end>
89
+ '''
90
+ ])
91
  submit_button = gr.Button("Submit")
92
  output_text = gr.Textbox(label="Nexus🐦‍⬛Raven")
93