Skip to content

Commit

Permalink
replacing tts with piper + updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonzs13 committed Dec 28, 2024
1 parent f7b1f7f commit 20a5dab
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN apt-get update \
RUN rosdep update && rosdep install --from-paths src --ignore-src -r -y
RUN pip3 install -r src/llama_ros/requirements.txt --use-deprecated=legacy-resolver
RUN pip3 install -r src/whisper_ros/requirements.txt --use-deprecated=legacy-resolver
RUN pip3 install -r src/tts_ros/requirements.txt --use-deprecated=legacy-resolver
RUN pip3 install -r src/piper_ros/requirements.txt --use-deprecated=legacy-resolver

# colcon the ws
FROM deps AS builder
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

## Dependencies

- [yasmin](https://github.com/uleroboticsgroup/yasmin)[[3.0.1](https://github.com/uleroboticsgroup/yasmin/releases/tag/3.0.1)]
- [audio_common](https://github.com/mgonzs13/audio_common)[[4.0.2](https://github.com/mgonzs13/audio_common/releases/tag/4.0.2)]
- [llama_ros](https://github.com/mgonzs13/llama_ros)[[4.1.5](https://github.com/mgonzs13/llama_ros/releases/tag/4.1.5)]
- [whisper_ros](https://github.com/mgonzs13/whisper_ros)[[2.7.1](https://github.com/mgonzs13/whisper_ros/releases/tag/2.7.1)]
- [tts_ros](https://github.com/mgonzs13/tts_ros)[[2.4.0](https://github.com/mgonzs13/tts_ros/releases/tag/2.4.0)]
- [yasmin](https://github.com/uleroboticsgroup/yasmin)[[3.0.3](https://github.com/uleroboticsgroup/yasmin/releases/tag/3.0.3)]
- [audio_common](https://github.com/mgonzs13/audio_common)[[4.0.3](https://github.com/mgonzs13/audio_common/releases/tag/4.0.3)]
- [llama_ros](https://github.com/mgonzs13/llama_ros)[[4.1.7](https://github.com/mgonzs13/llama_ros/releases/tag/4.1.7)]
- [whisper_ros](https://github.com/mgonzs13/whisper_ros)[[3.0.2](https://github.com/mgonzs13/whisper_ros/releases/tag/3.0.2)]
- [piper_ros](https://github.com/mgonzs13/piper_ros)[[1.0.1](https://github.com/mgonzs13/piper_ros/releases/tag/1.0.1)]

## Installation

Expand All @@ -36,7 +36,7 @@ $ cd ~/ros2_ws
$ rosdep install --from-paths src --ignore-src -r -y
$ pip3 install -r src/llama_ros/requirements.txt
$ pip3 install -r src/whisper_ros/requirements.txt
$ pip3 install -r src/tts_ros/requirements.txt
$ pip3 install -r src/piper_ros/requirements.txt
$ colcon build --cmake-args -DGGML_CUDA=ON
```

Expand Down
48 changes: 23 additions & 25 deletions chatbot_bringup/launch/chatbot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
import os
from launch_ros.actions import Node
from launch import LaunchDescription
from launch.substitutions import LaunchConfiguration
from launch.actions import SetEnvironmentVariable, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory
from llama_bringup.utils import create_llama_launch
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration, PythonExpression


def generate_launch_description():
Expand All @@ -42,39 +41,39 @@ def generate_launch_description():
launch_arguments={
"launch_audio_capturer": LaunchConfiguration(
"launch_audio_capturer", default=True
)
),
"model_repo": "ggerganov/whisper.cpp",
"model_filename": "ggml-large-v3-turbo-q5_0.bin",
}.items(),
)

llama_cmd = create_llama_launch(
n_ctx=4096,
n_batch=256,
n_gpu_layers=33,
n_gpu_layers=29,
n_threads=-1,
n_predict=-1,
model_repo="QuantFactory/Hermes-2-Theta-Llama-3-8B-GGUF",
model_filename="Hermes-2-Theta-Llama-3-8B.Q4_K_M.gguf",
model_repo="bartowski/Qwen2.5-1.5B-Instruct-GGUF",
model_filename="Qwen2.5-1.5B-Instruct-Q4_K_M.gguf",
system_prompt_type="ChatML",
)

audio_player_cmd = Node(
package="audio_common",
executable="audio_player_node",
name="player_node",
namespace="audio",
output="both",
remappings=[("audio", "out")],
condition=IfCondition(
PythonExpression([LaunchConfiguration("launch_audio_player", default=True)])
piper_node_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(
get_package_share_directory("piper_bringup"),
"launch",
"piper.launch.py",
)
),
)

tts_node_cmd = Node(
package="tts_ros",
executable="tts_node",
output="both",
parameters=[{"device": "cuda"}],
remappings=[("audio", "/audio/out")],
launch_arguments={
"launch_audio_player": LaunchConfiguration(
"launch_audio_player", default=True
),
"model_repo": "rhasspy/piper-voices",
"model_filename": "en/en_US/lessac/low/en_US-lessac-low.onnx",
"config_filename": "en/en_US/lessac/low/en_US-lessac-low.onnx.json",
}.items(),
)

chatbot_node_cmd = Node(
Expand All @@ -95,9 +94,8 @@ def generate_launch_description():
ld.add_action(stdout_linebuf_envvar)

ld.add_action(whisper_cmd)
ld.add_action(piper_node_cmd)
ld.add_action(llama_cmd)
ld.add_action(audio_player_cmd)
ld.add_action(tts_node_cmd)
ld.add_action(chatbot_node_cmd)
ld.add_action(yasmin_viewer_cmd)

Expand Down
2 changes: 1 addition & 1 deletion chatbot_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<depend>audio_common</depend>
<depend>llama_bringup</depend>
<depend>whisper_bringup</depend>
<depend>tts_ros</depend>
<depend>piper_ros</depend>

<depend>chatbot_ros</depend>

Expand Down
14 changes: 7 additions & 7 deletions dependencies.repos
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ repositories:
yasmin:
type: git
url: https://github.com/uleroboticsgroup/yasmin
version: tags/3.0.1
version: tags/3.0.3
audio_common:
type: git
url: https://github.com/mgonzs13/audio_common
version: tags/4.0.2
version: tags/4.0.3
llama_ros:
type: git
url: https://github.com/mgonzs13/llama_ros
version: tags/4.1.5
version: tags/4.1.7
whisper_ros:
type: git
url: https://github.com/mgonzs13/whisper_ros
version: tags/2.7.1
tts_ros:
version: tags/3.0.2
piper_ros:
type: git
url: https://github.com/mgonzs13/tts_ros
version: tags/2.4.0
url: https://github.com/mgonzs13/piper_ros
version: tags/1.0.1

0 comments on commit 20a5dab

Please # to comment.