Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the text2speech readme #25

Merged
merged 3 commits into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions nodes/text2speech/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,38 @@

## Installation


Only for Debian-based systems: first install the audio system dependencies:
```console
sudo apt-get install libsndfile1 ffmpeg
```

Install the text2speech package:
```console
pip install farm-haystack-text2speech
```

## Installation

Step 1. Install the audio system dependencies. On Debian-based systems:
## Usage

```console
sudo apt-get install libsndfile1 ffmpeg
```
For a full example of how to use the `AnswerToSpeech` Node, you may try out our "[Make Your QA Pipelines Talk Tutorial](https://haystack.deepset.ai/tutorials/17_audio)"

Step 2. Install the package. With pip:
For example, in a simple Extractive QA Pipeline:

```console
pip install farm-haystack-text2speech
```
from haystack.nodes import BM25Retriever, FARMReader
from text2speech import AnswerToSpeech

retriever = BM25Retriever(document_store=document_store)
reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2", use_gpu=True)
answer2speech = AnswerToSpeech(
model_name_or_path="espnet/kan-bayashi_ljspeech_vits", generated_audio_dir=Path("./audio_answers")
)

audio_pipeline = Pipeline()
audio_pipeline.add_node(retriever, name="Retriever", inputs=["Query"])
audio_pipeline.add_node(reader, name="Reader", inputs=["Retriever"])
audio_pipeline.add_node(answer2speech, name="AnswerToSpeech", inputs=["Reader"])
```

## License
Expand Down