Skip to content

Commit

Permalink
allow concurrency by default for llm
Browse files Browse the repository at this point in the history
limit to linear behavior only if requested.
  • Loading branch information
Chris Kennedy committed Mar 23, 2024
1 parent 4c6f9cd commit 6756562
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 7 additions & 1 deletion scripts/twitch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ALIGNMENT=right
TEMPERATURE=0.8
CONTINUOUS=1
POLL_INTERVAL=0
PIPELINE_CONCURRENCY=3
PIPELINE_CONCURRENCY=2
TWITCH_LLM_CONCURRENCY=2
CONTEXT_SIZE=4000
SUBTITLES=1
Expand All @@ -28,13 +28,18 @@ QUANTIZED=0
GREETING="Hi I'm Alice, ask me a question!"
TWITCH_CHAT_HISTORY=8
TWITCH_MODEL=mistral
SINGLE_CONCURRENCY=0
# === END OF CONFIGURATION ===
#
#
SUBTITLE_CMD=
DAEMON_CMD=
NO_HISTORY_CMD=
QUANTIZED_CMD=
SINGLE_CONCURRENCY_CMD=
if [ "$SINGLE_CONCURRENCY" == 1 ]; then
SINGLE_CONCURRENCY_CMD="--single-concurrency"
fi
if [ "$SUBTITLES" == 1 ]; then
SUBTITLE_CMD="--subtitles"
fi
Expand Down Expand Up @@ -75,6 +80,7 @@ DYLD_LIBRARY_PATH=`pwd`:/usr/local/lib:$DYLD_LIBRARY_PATH \
--poll-interval $POLL_INTERVAL \
--llm-history-size $CONTEXT_SIZE \
--greeting "$GREETING" \
$SINGLE_CONCURRENCY_CMD \
$SUBTITLE_CMD \
$DAEMON_CMD \
$CONTINUOUS_CMD \
Expand Down
9 changes: 9 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,4 +712,13 @@ pub struct Args {
help = "Twitch LLM model."
)]
pub twitch_model: String,

/// single concurrency - bool single concurrency for all models, wait between each request
#[clap(
long,
env = "SINGLE_CONCURRENCY",
default_value_t = false,
help = "single concurrency - bool single concurrency for all models, wait between each request."
)]
pub single_concurrency: bool,
}
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,9 @@ async fn main() {
}

#[cfg(feature = "ndi")]
if args.sd_image || args.tts_enable || args.oai_tts || args.mimic3_tts {
if args.single_concurrency
&& (args.sd_image || args.tts_enable || args.oai_tts || args.mimic3_tts)
{
// Wait for the NDI done signal
std::io::stdout().flush().unwrap();
info!("Waiting for NDI done signal for LLM messages...");
Expand Down

0 comments on commit 6756562

Please sign in to comment.