diff --git a/examples/bash-comparemodels/README.md b/examples/bash-comparemodels/README.md index ad56aa7d..91499255 100644 --- a/examples/bash-comparemodels/README.md +++ b/examples/bash-comparemodels/README.md @@ -1,5 +1,10 @@ # Bash Shell examples -When you review the examples on this site, it is possible to think that making use of AI with Ollama will be hard. You need an orchestrator, and vector database, complicated infrastructure, and more. But that is not always the case. Ollama is designed to be easy to use, and to be used in any environment. +When calling `ollama`, you can pass it a file to run all the prompts in the file, one after the other: -The two examples here show how to list the models and query them from a simple bash script. +`ollama run llama2 < sourcequestions.txt` + +This concept is used in the following example. + +## Compare Models +`comparemodels.sh` is a script that runs all the questions in `sourcequestions.txt` using any 4 models you choose that you have already pulled from the Ollama library or have created locally. diff --git a/examples/bash-comparemodels/bulkquestions.sh b/examples/bash-comparemodels/bulkquestions.sh deleted file mode 100755 index b0e4a585..00000000 --- a/examples/bash-comparemodels/bulkquestions.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -# Run a model and pass in a text file of questions - -ollama run llama2 < sourcequestions diff --git a/examples/bash-comparemodels/comparemodels.sh b/examples/bash-comparemodels/comparemodels.sh index fa5520d7..1ce249a6 100755 --- a/examples/bash-comparemodels/comparemodels.sh +++ b/examples/bash-comparemodels/comparemodels.sh @@ -30,7 +30,7 @@ for ITEM in "${SELECTIONS[@]}"; do ollama run "$ITEM" "" echo "--------------------------------------------------------------" echo "Running the questions through the model $ITEM" - COMMAND_OUTPUT=$(ollama run "$ITEM" --verbose < sourcequestions 2>&1| tee /dev/stderr) + COMMAND_OUTPUT=$(ollama run "$ITEM" --verbose < sourcequestions.txt 2>&1| tee /dev/stderr) # eval duration is sometimes listed in seconds and sometimes in milliseconds. # Add up the values for each model diff --git a/examples/bash-comparemodels/sourcequestions b/examples/bash-comparemodels/sourcequestions.txt similarity index 100% rename from examples/bash-comparemodels/sourcequestions rename to examples/bash-comparemodels/sourcequestions.txt