nalbion commited on
Commit
2fdd855
·
1 Parent(s): 84f8053

`speak` scripts for Windows

Browse files
examples/talk-llama/README.md CHANGED
@@ -42,8 +42,8 @@ Example usage:
42
  ## TTS
43
 
44
  For best experience, this example needs a TTS tool to convert the generated text responses to voice.
45
- You can use any TTS engine that you would like - simply edit the [speak.sh](speak.sh) script to your needs.
46
- By default, it is configured to use MacOS's `say`, but you can use whatever you wish.
47
 
48
  ## Discussion
49
 
 
42
  ## TTS
43
 
44
  For best experience, this example needs a TTS tool to convert the generated text responses to voice.
45
+ You can use any TTS engine that you would like - simply edit the [speak](speak) script to your needs.
46
+ By default, it is configured to use MacOS's `say` or Windows SpeechSynthesizer, but you can use whatever you wish.
47
 
48
  ## Discussion
49
 
examples/talk-llama/{speak.sh → speak} RENAMED
File without changes
examples/talk-llama/speak.bat ADDED
@@ -0,0 +1 @@
 
 
1
+ @powershell -ExecutionPolicy Bypass -F examples\talk\speak.ps1 %1 %2
examples/talk-llama/speak.ps1 ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
2
+ param(
3
+ # voice options are David or Zira
4
+ [Parameter(Mandatory=$true)][string]$voice,
5
+ [Parameter(Mandatory=$true)][string]$text
6
+ )
7
+
8
+ Add-Type -AssemblyName System.Speech;
9
+ $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;
10
+ $speak.SelectVoice("Microsoft $voice Desktop");
11
+ $speak.Rate="0";
12
+ $speak.Speak($text);
examples/talk-llama/talk-llama.cpp CHANGED
@@ -47,7 +47,7 @@ struct whisper_params {
47
  std::string language = "en";
48
  std::string model_wsp = "models/ggml-base.en.bin";
49
  std::string model_llama = "models/ggml-llama-7B.bin";
50
- std::string speak = "./examples/talk-llama/speak.sh";
51
  std::string prompt = "";
52
  std::string fname_out;
53
  std::string path_session = ""; // path to file for saving/loading model eval state
 
47
  std::string language = "en";
48
  std::string model_wsp = "models/ggml-base.en.bin";
49
  std::string model_llama = "models/ggml-llama-7B.bin";
50
+ std::string speak = "./examples/talk-llama/speak";
51
  std::string prompt = "";
52
  std::string fname_out;
53
  std::string path_session = ""; // path to file for saving/loading model eval state
examples/talk/README.md CHANGED
@@ -37,5 +37,5 @@ wget --quiet --show-progress -O models/ggml-gpt-2-117M.bin https://huggingface.c
37
  ## TTS
38
 
39
  For best experience, this example needs a TTS tool to convert the generated text responses to voice.
40
- You can use any TTS engine that you would like - simply edit the [speak.sh](speak.sh) script to your needs.
41
- By default, it is configured to use `espeak`, but you can use whatever you wish.
 
37
  ## TTS
38
 
39
  For best experience, this example needs a TTS tool to convert the generated text responses to voice.
40
+ You can use any TTS engine that you would like - simply edit the [speak](speak) script to your needs.
41
+ By default, it is configured to use MacOS's `say` or `espeak` or Windows SpeechSynthesizer, but you can use whatever you wish.
examples/talk/{speak.sh → speak} RENAMED
@@ -15,7 +15,7 @@ say "$2"
15
  # Eleven Labs
16
  # To use it, install the elevenlabs module from pip (pip install elevenlabs)
17
  # It's possible to use the API for free with limited number of characters. To increase this limit register to https://beta.elevenlabs.io to get an api key and paste it after 'ELEVEN_API_KEY='
18
- #Keep the line commented to use the free version whitout api key
19
  #
20
  #export ELEVEN_API_KEY=your_api_key
21
  #wd=$(dirname $0)
 
15
  # Eleven Labs
16
  # To use it, install the elevenlabs module from pip (pip install elevenlabs)
17
  # It's possible to use the API for free with limited number of characters. To increase this limit register to https://beta.elevenlabs.io to get an api key and paste it after 'ELEVEN_API_KEY='
18
+ #Keep the line commented to use the free version without api key
19
  #
20
  #export ELEVEN_API_KEY=your_api_key
21
  #wd=$(dirname $0)
examples/talk/speak.bat ADDED
@@ -0,0 +1 @@
 
 
1
+ @powershell -ExecutionPolicy Bypass -F examples\talk\speak.ps1 %1 %2
examples/talk/speak.ps1 ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
2
+ param(
3
+ # voice options are David or Zira
4
+ [Parameter(Mandatory=$true)][string]$voice,
5
+ [Parameter(Mandatory=$true)][string]$text
6
+ )
7
+
8
+ Add-Type -AssemblyName System.Speech;
9
+ $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;
10
+ $speak.SelectVoice("Microsoft $voice Desktop");
11
+ $speak.Rate="0";
12
+ $speak.Speak($text);
examples/talk/talk.cpp CHANGED
@@ -36,7 +36,7 @@ struct whisper_params {
36
  std::string language = "en";
37
  std::string model_wsp = "models/ggml-base.en.bin";
38
  std::string model_gpt = "models/ggml-gpt-2-117M.bin";
39
- std::string speak = "./examples/talk/speak.sh";
40
  std::string fname_out;
41
  };
42
 
 
36
  std::string language = "en";
37
  std::string model_wsp = "models/ggml-base.en.bin";
38
  std::string model_gpt = "models/ggml-gpt-2-117M.bin";
39
+ std::string speak = "./examples/talk/speak";
40
  std::string fname_out;
41
  };
42