Skip to content

Commit

Permalink
Fix default prob
Browse files Browse the repository at this point in the history
  • Loading branch information
slundberg committed Dec 4, 2023
1 parent 9224a35 commit f790e98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion guidance/_cpp/byte_trie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ByteTrie : public std::enable_shared_from_this<ByteTrie> { // enable_share
int match_version = -1;
bool match = false;
bool partial_match = false;
double prob = 0;
double prob = 1;
int value = -1;
std::map<char, std::shared_ptr<ByteTrie>> children;

Expand Down
5 changes: 3 additions & 2 deletions guidance/models/transformers/_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class Transformers(Model):
def __init__(self, model=None, tokenizer=None, echo=True, caching=True, temperature=0.0, device=None, **kwargs):
def __init__(self, model=None, tokenizer=None, echo=True, caching=True, temperature=0.0, compute_log_probs=False, device=None, **kwargs):

# fill in default model value
if model is None:
Expand Down Expand Up @@ -52,7 +52,8 @@ def __init__(self, model=None, tokenizer=None, echo=True, caching=True, temperat
byte_tokens,
tkz.bos_token_id,
tkz.eos_token_id,
echo=echo
echo=echo,
compute_log_probs=compute_log_probs
)

self._cache_state["past_key_values"] = None
Expand Down

0 comments on commit f790e98

Please sign in to comment.