Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
orangecat
ollama
Commits
69a2d4cc
"stubs/git@developer.sourcefind.cn:OpenDAS/fairscale.git" did not exist on "429f3d318b6ca9b970568e19170af9c5d77af010"
Unverified
Commit
69a2d4cc
authored
Jul 19, 2024
by
Jeffrey Morgan
Committed by
GitHub
Jul 19, 2024
Browse files
Fix generate test flakyness (#5804)
parent
e8b954c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
server/routes_generate_test.go
server/routes_generate_test.go
+4
-2
No files found.
server/routes_generate_test.go
View file @
69a2d4cc
...
@@ -73,8 +73,8 @@ func TestGenerateChat(t *testing.T) {
...
@@ -73,8 +73,8 @@ func TestGenerateChat(t *testing.T) {
getCpuFn
:
gpu
.
GetCPUInfo
,
getCpuFn
:
gpu
.
GetCPUInfo
,
reschedDelay
:
250
*
time
.
Millisecond
,
reschedDelay
:
250
*
time
.
Millisecond
,
loadFn
:
func
(
req
*
LlmRequest
,
ggml
*
llm
.
GGML
,
gpus
gpu
.
GpuInfoList
,
numParallel
int
)
{
loadFn
:
func
(
req
*
LlmRequest
,
ggml
*
llm
.
GGML
,
gpus
gpu
.
GpuInfoList
,
numParallel
int
)
{
// add
10ms
delay to simulate loading
// add
small
delay to simulate loading
time
.
Sleep
(
10
*
time
.
Millisecond
)
time
.
Sleep
(
time
.
Millisecond
)
req
.
successCh
<-
&
runnerRef
{
req
.
successCh
<-
&
runnerRef
{
llama
:
&
mock
,
llama
:
&
mock
,
}
}
...
@@ -371,6 +371,8 @@ func TestGenerate(t *testing.T) {
...
@@ -371,6 +371,8 @@ func TestGenerate(t *testing.T) {
getCpuFn
:
gpu
.
GetCPUInfo
,
getCpuFn
:
gpu
.
GetCPUInfo
,
reschedDelay
:
250
*
time
.
Millisecond
,
reschedDelay
:
250
*
time
.
Millisecond
,
loadFn
:
func
(
req
*
LlmRequest
,
ggml
*
llm
.
GGML
,
gpus
gpu
.
GpuInfoList
,
numParallel
int
)
{
loadFn
:
func
(
req
*
LlmRequest
,
ggml
*
llm
.
GGML
,
gpus
gpu
.
GpuInfoList
,
numParallel
int
)
{
// add small delay to simulate loading
time
.
Sleep
(
time
.
Millisecond
)
req
.
successCh
<-
&
runnerRef
{
req
.
successCh
<-
&
runnerRef
{
llama
:
&
mock
,
llama
:
&
mock
,
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment