Skip to content

Commit

Permalink
fix test case && try fix windows & metal
Browse files Browse the repository at this point in the history
  • Loading branch information
Weaxs committed Dec 2, 2023
1 parent 60b6490 commit b131392
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
#include <signal.h>
#include <unistd.h>
#elif defined (_WIN32)
#endif
#if defined (_WIN32)
#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <signal.h>
#endif

#ifdef GGML_USE_CUBLAS
#include <ggml-cuda.h>
#endif

#ifdef GGML_USE_METAL
#include <ggml-metal.h>
#endif

#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) || defined (_WIN32)
Expand Down
2 changes: 1 addition & 1 deletion chatglm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestCodeInterpreter(t *testing.T) {
assert.Fail(t, "call code interpreter failed.")
}
messages = append(messages, NewAssistantMsg(ret, modelType))
assert.Equal(t, ret, "好的,我会为您列出100以内的所有质数。\\n\\n质数是指只能被1和它本身整除的大于1的整数。例如,2、3、5、7等都是质数。\\n\\n让我们开始吧!")
assert.Contains(t, ret, "好的,我会为您列出100以内的所有质数。\\n\\n质数是指只能被1和它本身整除的大于1的整数。例如,2、3、5、7等都是质数。\\n\\n让我们开始吧!")
messages = append(messages, NewObservationMsg("[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]"))

ret, err = chatglm.Chat(messages, SetDoSample(false))
Expand Down

0 comments on commit b131392

Please sign in to comment.