Skip to content

Commit

Permalink
Updating the text2speech readme
Browse files Browse the repository at this point in the history
@ZanSara I noticed the 'Usage' section was missing even though it was listed here. I also created this PR for the integrations page, would be great if you can review. That one is just an index repo for the website: deepset-ai/haystack-integrations#14
  • Loading branch information
TuanaCelik committed Apr 20, 2023
1 parent bd9936a commit 2f0d0ca
Showing 1 changed file with 24 additions and 8 deletions.
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

0 comments on commit 2f0d0ca

Please sign in to comment.