Skip to content

Commit 4be5180

Browse files
committed
Add documentation on how to measure model perplexity
1 parent ab52a52 commit 4be5180

File tree

6 files changed

+37
-5
lines changed

6 files changed

+37
-5
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@
44

55
# Ignore Sublime Text files.
66
*.sublime-workspace
7-
8-
# Ignore OpenBLAS directories and files
9-
vendor/OpenBLAS/*

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.1.0] - 2023-07-03
8+
9+
### Added
10+
- Add dataset "wikitext-2-raw-v1"
11+
- Add documentation on how to measure model perplexity
12+
713
## [1.0.0] - 2023-06-28
814

915
### Added

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,20 @@ You can now chat with the model:
103103
--interactive
104104
```
105105

106+
### Measure model perplexity
107+
108+
Execute the following to measure the perplexity of the GGML formatted model:
109+
110+
```PowerShell
111+
./vendor/llama.cpp/build/bin/Release/perplexity `
112+
--model "./vendor/llama.cpp/models/open-llama-7B-open-instruct.ggmlv3.q4_K_M.bin" `
113+
--ctx-size 2048 `
114+
--n-predict 2048 `
115+
--threads 16 `
116+
--n-gpu-layers 32 `
117+
--file "./vendor/wikitext-2-raw-v1/wikitext-2-raw/wiki.test.raw"
118+
```
119+
106120
### Rebuild llama.cpp
107121

108122
Every time there is a new release of [llama.cpp](https://github.com/ggerganov/llama.cpp) you can simply execute the script to automatically rebuild everything:

rebuild_llama.cpp.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ if (-not(Test-Path -Path "./vendor/OpenBLAS/OpenBLAS-${openBLASVersion}-x64.zip"
3737
-Force
3838
}
3939

40+
if (-not(Test-Path -Path "./vendor/wikitext-2-raw-v1/wikitext-2-raw-v1.zip")) {
41+
42+
Invoke-WebRequest `
43+
-Uri "https://s3.amazonaws.com/research.metamind.io/wikitext/wikitext-2-raw-v1.zip" `
44+
-OutFile "./vendor/wikitext-2-raw-v1/wikitext-2-raw-v1.zip"
45+
46+
Expand-Archive `
47+
-Path "./vendor/wikitext-2-raw-v1/wikitext-2-raw-v1.zip" `
48+
-DestinationPath "./vendor/wikitext-2-raw-v1" `
49+
-Force
50+
}
51+
4052
function Resolve-UnixPath {
4153
Param ([String] $path)
4254
Write-Output ((Resolve-Path "$path").Path -replace '\\','/')
@@ -67,7 +79,7 @@ if (!(Select-String -Path "./vendor/llama.cpp/CMakeLists.txt" -Pattern $lines[0]
6779
Set-Content "./vendor/llama.cpp/CMakeLists.txt"
6880
}
6981

70-
Remove-Item -Path "./vendor/llama.cpp/build" -Force -Recurse
82+
Remove-Item -Path "./vendor/llama.cpp/build" -Force -Recurse
7183

7284
New-Item -Path "./vendor/llama.cpp" -Name "build" -ItemType "directory"
7385

vendor/llama.cpp

vendor/wikitext-2-raw-v1/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore everything in this directory except this file.
2+
*
3+
!.gitignore

0 commit comments

Comments
 (0)