Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Update documentation

davidmezzetti07fa511211ce
diff --git a/docs/pipeline/audio/audiomixer.md b/docs/pipeline/audio/audiomixer.md
new file mode 100644
index 00000000..6a35ad3b
--- /dev/null
+++ b/docs/pipeline/audio/audiomixer.md
@@ -0,0 +1,62 @@
+# Audio Mixer
+
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
+
+The Audio Mixer pipeline mixes multiple audio streams into a single stream.
+
+## Example
+
+The following shows a simple example using this pipeline.
+
+```python
+from txtai.pipeline import AudioMixer
+
+# Create and run pipeline
+mixer = AudioMixer()
+mixer(((audio1, rate1), (audio2, rate2)))
+```
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api#local-instance).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+audiomixer:
+
+# Run pipeline with workflow
+workflow:
+ audiomixer:
+ tasks:
+ - action: audiomixer
+```
+
+### Run with Workflows
+
+```python
+from txtai import Application
+
+# Create and run pipeline with workflow
+app = Application("config.yml")
+list(app.workflow("audiomixer", [[[audio1, rate1], [audio2, rate2]]]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"audiomixer", "elements":[[[audio1, rate1], [audio2, rate2]]]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.AudioMixer.__init__
+### ::: txtai.pipeline.AudioMixer.__call__
diff --git a/docs/pipeline/audio/audiostream.md b/docs/pipeline/audio/audiostream.md
index 4674cadb..3399a3a4 100644
--- a/docs/pipeline/audio/audiostream.md
+++ b/docs/pipeline/audio/audiostream.md
@@ -42,7 +42,7 @@ from txtai import Application
# Create and run pipeline with workflow
app = Application("config.yml")
-list(app.workflow("audiostream", ["numpy data"]))
+list(app.workflow("audiostream", [["numpy data", "sample rate"]]))
```
### Run with API
@@ -53,7 +53,7 @@ CONFIG=config.yml uvicorn "txtai.api:app" &
curl \
-X POST "http://localhost:8000/workflow" \
-H "Content-Type: application/json" \
- -d '{"name":"audiostream", "elements":["numpy data"]}'
+ -d '{"name":"audiostream", "elements":[["numpy data", "sample rate"]]}'
```
## Methods
diff --git a/docs/pipeline/audio/texttoaudio.md b/docs/pipeline/audio/texttoaudio.md
new file mode 100644
index 00000000..3ef3b98b
--- /dev/null
+++ b/docs/pipeline/audio/texttoaudio.md
@@ -0,0 +1,62 @@
+# Text To Audio
+
+![pipeline](../../images/pipeline.png#only-light)
+![pipeline](../../images/pipeline-dark.png#only-dark)
+
+The Text To Audio pipeline generates audio from text.
+
+## Example
+
+The following shows a simple example using this pipeline.
+
+```python
+from txtai.pipeline import TextToAudio
+
+# Create and run pipeline
+tta = TextToAudio()
+tta("Describe the audio to generate here")
+```
+
+## Configuration-driven example
+
+Pipelines are run with Python or configuration. Pipelines can be instantiated in [configuration](../../../api/configuration/#pipeline) using the lower case name of the pipeline. Configuration-driven pipelines are run with [workflows](../../../workflow/#configuration-driven-example) or the [API](../../../api#local-instance).
+
+### config.yml
+```yaml
+# Create pipeline using lower case class name
+texttoaudio:
+
+# Run pipeline with workflow
+workflow:
+ tta:
+ tasks:
+ - action: texttoaudio
+```
+
+### Run with Workflows
+
+```python
+from txtai import Application
+
+# Create and run pipeline with workflow
+app = Application("config.yml")
+list(app.workflow("tta", ["Describe the audio to generate here"]))
+```
+
+### Run with API
+
+```bash
+CONFIG=config.yml uvicorn "txtai.api:app" &
+
+curl \
+ -X POST "http://localhost:8000/workflow" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"tta", "elements":["Describe the audio to generate here"]}'
+```
+
+## Methods
+
+Python documentation for the pipeline.
+
+### ::: txtai.pipeline.TextToAudio.__init__
+### ::: txtai.pipeline.TextToAudio.__call__
diff --git a/docs/pipeline/audio/texttospeech.md b/docs/pipeline/audio/texttospeech.md
index c9e8a3ac..98195eb6 100644
--- a/docs/pipeline/audio/texttospeech.md
+++ b/docs/pipeline/audio/texttospeech.md
@@ -25,6 +25,10 @@ yield from tts(
# Generate audio using a speaker id
tts = TextToSpeech("neuml/vctk-vits-onnx")
tts("Say something here", speaker=15)
+
+# Generate audio using speaker embeddings
+tts = TextToSpeech("neuml/txtai-speecht5-onnx")
+tts("Say something here", speaker=np.array(...))
```
See the link below for a more detailed example.
@@ -38,6 +42,7 @@ This pipeline is backed by ONNX models from the Hugging Face Hub. The following
- [ljspeech-jets-onnx](https://huggingface.co/NeuML/ljspeech-jets-onnx)
- [ljspeech-vits-onnx](https://huggingface.co/NeuML/ljspeech-vits-onnx)
- [vctk-vits-onnx](https://huggingface.co/NeuML/vctk-vits-onnx)
+- [txtai-speecht5-onnx](https://huggingface.co/NeuML/txtai-speecht5-onnx)
## Configuration-driven example
diff --git a/docs/pipeline/index.md b/docs/pipeline/index.md
index 4b831a96..8f11bf2b 100644
--- a/docs/pipeline/index.md
+++ b/docs/pipeline/index.md
@@ -12,8 +12,10 @@ Pipelines are run with Python or configuration. Pipelines can be instantiated in
The following is a list of the default pipelines available in txtai. All pipelines use default models when otherwise not specified. See the [model guide](../models) for the current model recommentations.
- Audio
+ - [AudioMixer](audio/audiomixer)
- [AudioStream](audio/audiostream)
- [Microphone](audio/microphone)
+ - [TextToAudio](audio/texttoaudio)
- [TextToSpeech](audio/texttospeech)
- [Transcription](audio/transcription)
- Data Processing
diff --git a/mkdocs.yml b/mkdocs.yml
index cc86eee2..2a3b960f 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -74,8 +74,10 @@ nav:
- Pipeline:
- pipeline/index.md
- Audio:
+ - Audio Mixer: pipeline/audio/audiomixer.md
- Audio Stream: pipeline/audio/audiostream.md
- Microphone: pipeline/audio/microphone.md
+ - Text To Audio: pipeline/audio/texttoaudio.md
- Text To Speech: pipeline/audio/texttospeech.md
- Transcription: pipeline/audio/transcription.md
- Data: