Skip to content

Commit

Permalink
Small changes to the conversation mode to keep it on topic. Raising t…
Browse files Browse the repository at this point in the history
…he context window to maximum
  • Loading branch information
troed committed Apr 15, 2024
1 parent d501299 commit a72570d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ A bit of glue between components that is able to textually summarize Youtube vid

This script doesn't do anything clever, it just makes use of the great work done by other projects. Since the purpose is to not have to sit through 8-12 minutes of someone explaining what should've just been a short blog post, it's imperative that the summary is factually correct. That's the reason behind the default usage of the very capable Mixtral 8x7b LLM.

However. Thanks to the large context window of Mixtral, it's also possible to run the script against much longer videos. It's been tested on a 1 hour long podcast, where the conversation mode was subsequently used to dive into more details on one of the subjects mentioned in the summary.

# Prerequisites

* yt-dlp - to download Youtube videos
Expand Down Expand Up @@ -46,4 +48,4 @@ Make sure to compile/configure both whisper.cpp and ollama to make use of GPU if

* ~~After having printed the summary I will switch to a conversational interface where it's possible to ask the LLM questions regarding the transcribed content.~~
* Possibly: Make use of timestamped Whisper output to be able to query from which point in the original video a certain claim is made.
*
* ...
8 changes: 4 additions & 4 deletions summarize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

OLLAMA_HOST=127.0.0.1:11434
OLLAMA_MODEL=mixtral
OLLAMA_CONTEXT_SIZE=8192
OLLAMA_CONTEXT_SIZE=32768
WHISPER_CPP_PATH="$HOME/whisper.cpp"
WHISPER_CPP_MODEL=ggml-large-v3.bin

function help {
echo "Usage: summarize.sh [-q] [-c] <Youtube url>"
echo "Usage: summarize.sh [-q] [-c] [-d] <Youtube url>"
echo
echo "Optional parameters:"
echo
echo
echo " -q : Quiet, does not print any progress information or execution time"
echo " -c : Conversational, waits for further questions after the summary is printed"
echo " -d : Debug, prints all output from the called programs"
Expand Down Expand Up @@ -216,7 +216,7 @@ while true; do
if [ -z "$question" ]; then
break
else
resp=$(query "$question in the following textual representation of a video: $input")
resp=$(query "$question. Make sure to only use knowledge found in the following textual representation of a video: $input")
answer=$(echo ${resp} | jq '.response')
context=$(echo ${resp} | jq '.context')
echo -e $answer
Expand Down

0 comments on commit a72570d

Please sign in to comment.