Skip to content

Commit f956aab

Browse files
committed
fixed sampler rolleback method
1 parent 7a19c33 commit f956aab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

common/sampling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ std::string common_sampler_prev_str(common_sampler * gsmpl, llama_context * ctx_
387387
return result;
388388
}
389389

390-
const std::vector<llama_token>& common_sampler_prev(common_sampler * gsmpl) {
391-
return gsmpl->prev.data;
390+
const std::vector<llama_token> common_sampler_prev(common_sampler * gsmpl) {
391+
return gsmpl->prev.to_vector();
392392
}
393393

394394
void common_sampler_rollback(common_sampler * gsmpl, int rollback_num) {

common/sampling.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ std::string common_sampler_print(const struct common_sampler * gsmpl);
7777

7878
// get a string representation of the last accepted tokens
7979
std::string common_sampler_prev_str(common_sampler * gsmpl, llama_context * ctx, int n);
80-
const std::vector<llama_token>& common_sampler_prev(common_sampler * gsmpl);
80+
const std::vector<llama_token> common_sampler_prev(common_sampler * gsmpl);
8181
void common_sampler_rollback(common_sampler * gsmpl, int rollback_num);
8282

8383
char common_sampler_type_to_chr(enum common_sampler_type cnstr);

0 commit comments

Comments
 (0)