Skip to content

Commit 19f4a7b

Browse files
authored
llama : refactor samplers internal implementation (ggml-org#9370)
1 parent 2a358fb commit 19f4a7b

File tree

4 files changed

+841
-685
lines changed

4 files changed

+841
-685
lines changed

src/llama-impl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ struct ring_buffer {
101101
}
102102

103103
void push_back(const T & value) {
104+
if (capacity == 0) {
105+
throw std::runtime_error("ring buffer: capacity is zero");
106+
}
107+
104108
if (sz == capacity) {
105109
// advance the start when buffer is full
106110
first = (first + 1) % capacity;

0 commit comments

Comments
 (0)