Spaces:
Runtime error
Runtime error
Add application file
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ description = """
|
|
30 |
This app enables users to upload academic articles in PDF format, specifically focusing on abstracts.
|
31 |
It efficiently summarizes the abstract and provides an audio playback of the summarized content.
|
32 |
Below are some example PDFs for you to experiment with. Feel free to explore the functionality of SpeechAbstractor!
|
33 |
-
(Please note: it works only with articles with an
|
34 |
|
35 |
examples = [
|
36 |
["Article_7.pdf"],["Article_11.pdf"]
|
@@ -159,7 +159,7 @@ def main_function(uploaded_filepath):
|
|
159 |
synthesiser = pipeline("text-to-speech", model="microsoft/speecht5_tts")
|
160 |
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
161 |
speaker_embedding = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
162 |
-
speech = synthesiser(
|
163 |
|
164 |
#saving the audio in a temporary file
|
165 |
audio_file_path = "summary.wav"
|
|
|
30 |
This app enables users to upload academic articles in PDF format, specifically focusing on abstracts.
|
31 |
It efficiently summarizes the abstract and provides an audio playback of the summarized content.
|
32 |
Below are some example PDFs for you to experiment with. Feel free to explore the functionality of SpeechAbstractor!
|
33 |
+
(Please note: it works only with articles with an abstract)."""
|
34 |
|
35 |
examples = [
|
36 |
["Article_7.pdf"],["Article_11.pdf"]
|
|
|
159 |
synthesiser = pipeline("text-to-speech", model="microsoft/speecht5_tts")
|
160 |
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
161 |
speaker_embedding = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
162 |
+
speech = synthesiser(first_sentence, forward_params={"speaker_embeddings": speaker_embedding})
|
163 |
|
164 |
#saving the audio in a temporary file
|
165 |
audio_file_path = "summary.wav"
|