forked from certik/fastGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request certik#39 from certik/tests4
Add a test for another input text
- Loading branch information
Showing
3 changed files
with
70 additions
and
17 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,31 @@ | ||
program test_more_inputs | ||
use driver, only: gpt2_driver2 | ||
implicit none | ||
|
||
integer, parameter :: input_ref(*) = [46, 358, 129, 247, 68, 73, 34754, 234, & | ||
861, 8836, 74, 373, 4642, 287] | ||
integer, parameter :: output_ref(*) = [1248, 5332, 287, 262, 7404, 286, & | ||
25370, 254, 368, 83, 6557, 81, 11] | ||
integer, allocatable :: input(:), output(:) | ||
|
||
call gpt2_driver2("Ondřej Čertík was born in ", 13, input, output) | ||
|
||
print * | ||
print *, "TESTS:" | ||
|
||
if (all(input == input_ref)) then | ||
print *, "Input tokens agree with reference results" | ||
else | ||
print *, "Input tokens DO NOT agree with reference results" | ||
error stop | ||
end if | ||
|
||
if (all(output == output_ref)) then | ||
print *, "Output tokens agree with reference results" | ||
else | ||
print *, "Output tokens DO NOT agree with reference results" | ||
error stop | ||
end if | ||
|
||
|
||
end program |