You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Make sure to replace the token value (`OVH_AI_ENDPOINTS_ACCESS_TOKEN`) by yours.** If you do not have one yet, follow the instructions in the [AI Endpoints - Getting Started](/pages/public_cloud/ai_machine_learning/endpoints_guide_01_getting_started) guide.
54
54
55
+
In this tutorial, we will be using the `Whisper-Large-V3` and `Mixtral-8x7b-Instruct-V01` models. Feel free to choose alternative models available on the [AI Endpoints catalog](https://catalog.endpoints.ai.ovh.net/).
56
+
55
57
Then, create a `requirements.txt` file with the following libraries:
56
58
57
59
```bash
@@ -89,62 +91,89 @@ After these lines, load and access the environnement variables of your `.env` fi
89
91
```python
90
92
# access the environment variables from the .env file
- A call is made to the TTS AI endpoint named `nvr-tts-en-us`.
197
+
- The audio sample and the sample rate are returned to play the audio automatically.
198
+
164
199
⚡️ You're almost there! The final step is to build your web app, making your solution easy to use with just a few lines of code.
165
200
166
201
### Build the LLM chat app with Streamlit
167
202
168
-
In this last step, create the chatbot app using [Mixtral8x7B](https://endpoints.ai.cloud.ovh.net/models/e2ecb4a7-98d5-420d-9789-e0aa6ddf0ffc) endpoint (or any other model) and [Streamlit](https://streamlit.io/), an open-source Python library that allows to quickly create user interfaces for Machine Learning models and demos. Here is a working code example:
203
+
In this last step, create the chatbot app using [Streamlit](https://streamlit.io/), an open-source Python library that allows to quickly create user interfaces for Machine Learning models and demos. Here is a working code example:
🚀 That’s it! Now your web app is ready to be used! You can start this Streamlit app locally by launching the following command:
220
248
221
249
```python
222
-
streamlit run audio-virtual-assistant.py
250
+
streamlit run audio-virtual-assistant-app.py
223
251
```
224
252
225
253

226
254
255
+
### Improvements
256
+
257
+
By default, the `nvr-tts-en-us` model supports only a limited number of characters per request when generating audio. If you exceed this limit, you will encounter errors in your application.
258
+
259
+
To work around this limitation, you can replace the existing `tts_synthesis` function with the following implementation, which processes text in chunks:
260
+
261
+
```python
262
+
deftts_synthesis(response, tts_client):
263
+
# Split response into chunks of max 1000 characters
You’ve just created an Audio Virtual Assistant capable of natural conversation using voice, powered by ASR, LLM, and TTS endpoints.
@@ -245,4 +315,4 @@ If you need training or technical assistance to implement our solutions, contact
245
315
246
316
Please feel free to send us your questions, feedback, and suggestions regarding AI Endpoints and its features:
247
317
248
-
- In the #ai-endpoints channel of the OVHcloud [Discord server](https://discord.gg/ovhcloud), where you can engage with the community and OVHcloud team members.
318
+
- In the #ai-endpoints channel of the OVHcloud [Discord server](https://discord.gg/ovhcloud), where you can engage with the community and OVHcloud team members.
0 commit comments