FlavioBF commited on
Commit
e223890
·
1 Parent(s): 3523945

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -320,12 +320,12 @@ from transformers import pipeline, AutoProcessor, AutoModel
320
  # =======================================
321
  #
322
  # =======================================
323
- def sentence_to_audio(summary_text):
324
  # Sentence 2 Speech
325
  processor = AutoProcessor.from_pretrained("suno/bark-small")
326
  model = AutoModel.from_pretrained("suno/bark-small")
327
  inputs = processor(
328
- text=summary_text,
329
  return_tensors="pt",
330
  )
331
  speech_values = model.generate(**inputs, do_sample=True)
@@ -333,10 +333,10 @@ def sentence_to_audio(summary_text):
333
  return sampling_rate, speech_values.cpu().numpy().squeeze()
334
 
335
 
336
- summary_txt="It is dangerous to think of machine learning as a free-to-use toolkit, as it is common to incur ongoing maintenance costs in real-world ML systems"
337
- sentence_to_audio(summary_txt)
338
 
339
- pdf_path=os.path.join(os.path.abspath(""), "hidden-technical-debt-in-machine-learning-systems-Paper")
340
  pdf_path2=os.path.join(os.path.abspath(""), "1812_05944.pdf")
341
 
342
  demo = gr.Interface(fn=sentence_to_audio, inputs="file", outputs="audio",examples=[pdf_path,pdf_path2])
 
320
  # =======================================
321
  #
322
  # =======================================
323
+ def sentence_to_audio(summary_txt):
324
  # Sentence 2 Speech
325
  processor = AutoProcessor.from_pretrained("suno/bark-small")
326
  model = AutoModel.from_pretrained("suno/bark-small")
327
  inputs = processor(
328
+ text=summary_txt,
329
  return_tensors="pt",
330
  )
331
  speech_values = model.generate(**inputs, do_sample=True)
 
333
  return sampling_rate, speech_values.cpu().numpy().squeeze()
334
 
335
 
336
+ #summary_txt="It is dangerous to think of machine learning as a free-to-use toolkit, as it is common to incur ongoing maintenance costs in real-world ML systems"
337
+ sentence_to_audio(summary_text)
338
 
339
+ pdf_path=os.path.join(os.path.abspath(""), "hidden-technical-debt-in-machine-learning-systems-Paper.pdf")
340
  pdf_path2=os.path.join(os.path.abspath(""), "1812_05944.pdf")
341
 
342
  demo = gr.Interface(fn=sentence_to_audio, inputs="file", outputs="audio",examples=[pdf_path,pdf_path2])