rifkat commited on
Commit
0c09796
1 Parent(s): b852566
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -2,13 +2,17 @@ import gradio as gr
2
  from transformers import pipeline
3
  from espnet2.bin.tts_inference import Text2Speech
4
  import warnings
 
5
 
 
 
6
  warnings.filterwarnings('ignore')
7
 
8
 
9
  def generateTextAndAudio(inputText, numGen):
10
  # --- Generating the Text ---
11
  # With the provided text from user, generate more text up to `numGen` tokens/sub-words
 
12
  textOutput = textGenerator(inputText, max_length=numGen)
13
  # The output of the text generator is a list of dictionaries, grab the first dictionary
14
  # then get the generated text from the dictionary using the `generated_text` key
 
2
  from transformers import pipeline
3
  from espnet2.bin.tts_inference import Text2Speech
4
  import warnings
5
+ from krill_to_latin import Perevod
6
 
7
+
8
+ perevod = Perevod()
9
  warnings.filterwarnings('ignore')
10
 
11
 
12
  def generateTextAndAudio(inputText, numGen):
13
  # --- Generating the Text ---
14
  # With the provided text from user, generate more text up to `numGen` tokens/sub-words
15
+ inputText = perevod.translate_for_summarizer(inputText)
16
  textOutput = textGenerator(inputText, max_length=numGen)
17
  # The output of the text generator is a list of dictionaries, grab the first dictionary
18
  # then get the generated text from the dictionary using the `generated_text` key