-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This runs https://ollama.ai/ in a gVisor container and loads two models: an English-Chinese translation model, and a code assistant model. It asks the first one to translate "Hello World" to Chinese, and then asks the second one to generate a test case to verify that the translation is correct. This change includes a server and client library for spawning ollama in a container and interacting through its HTTP API. This will be useful to turn it into a benchmark that measures its throughput in tokens/second. PiperOrigin-RevId: 590295278
- Loading branch information
1 parent
b3bb6fa
commit 07e86e2
Showing
9 changed files
with
690 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# https://hub.docker.com/r/ollama/ollama | ||
FROM ollama/ollama:0.1.13 | ||
|
||
ENV PATH=$PATH:/usr/local/nvidia/bin:/bin/nvidia/bin | ||
|
||
# Pre-install a few models. | ||
# Although these are the smallest possible model size (7B parameters), | ||
# these are still quite large and it would take too long for tests to | ||
# download them on every run. | ||
RUN bash -c ' \ | ||
( ollama serve ) & serverpid="$!"; \ | ||
sleep 5; \ | ||
ollama pull codellama:7b && \ | ||
ollama pull llama2-chinese:7b-chat && \ | ||
kill "$serverpid" && \ | ||
wait "$serverpid" \ | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
load("//tools:defs.bzl", "go_library") | ||
|
||
package( | ||
default_applicable_licenses = ["//:license"], | ||
licenses = ["notice"], | ||
) | ||
|
||
go_library( | ||
name = "ollama", | ||
testonly = 1, | ||
srcs = ["ollama.go"], | ||
visibility = ["//:sandbox"], | ||
deps = [ | ||
"//pkg/test/dockerutil", | ||
"//pkg/test/testutil", | ||
], | ||
) |
Oops, something went wrong.