Skip to content

Commit

Permalink
Fix bug in tokengrams python types
Browse files Browse the repository at this point in the history
  • Loading branch information
luciaquirke committed Aug 16, 2024
1 parent 7919247 commit 536cca1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tokengrams/tokengrams.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class InMemoryIndex:
def batch_count_next(self, queries: list[list[int]]) -> list[list[int]]:
"""Count the occurrences of each token that directly follows each sequence in `queries`."""

def smoothed_probs(self, query: list[int]) -> list[float]:
def get_smoothed_probs(self, query: list[int]) -> list[float]:
"""Compute interpolated Kneser-Ney smoothed token probability distribution using all previous tokens in the query."""

def batch_smoothed_probs(self, queries: list[list[int]]) -> list[list[float]]:
def batch_get_smoothed_probs(self, queries: list[list[int]]) -> list[list[float]]:
"""Compute interpolated Kneser-Ney smoothed token probability distributions using all previous tokens in each query."""

def sample_smoothed(self, query: list[int], n: int, k: int, num_samples: int) -> list[list[int]]:
Expand Down Expand Up @@ -97,10 +97,10 @@ class MemmapIndex:
on the previous (n - 1) characters (n-gram prefix) in the sequence. If there are fewer than
(n - 1) characters all available characters are used."""

def smoothed_probs(self, query: list[int]) -> list[float]:
def get_smoothed_probs(self, query: list[int]) -> list[float]:
"""Compute interpolated Kneser-Ney smoothed token probability distribution using all previous tokens in the query."""

def batch_smoothed_probs(self, queries: list[list[int]]) -> list[list[float]]:
def batch_get_smoothed_probs(self, queries: list[list[int]]) -> list[list[float]]:
"""Compute interpolated Kneser-Ney smoothed token probability distributions using all previous tokens in each query."""

def estimate_deltas(self, n: int):
Expand Down Expand Up @@ -145,10 +145,10 @@ class ShardedMemmapIndex:
on the previous (n - 1) characters (n-gram prefix) in the sequence. If there are fewer than
(n - 1) characters all available characters are used."""

def smoothed_probs(self, query: list[int]) -> list[float]:
def get_smoothed_probs(self, query: list[int]) -> list[float]:
"""Compute interpolated Kneser-Ney smoothed token probability distribution using all previous tokens in the query."""

def batch_smoothed_probs(self, queries: list[list[int]]) -> list[list[float]]:
def batch_get_smoothed_probs(self, queries: list[list[int]]) -> list[list[float]]:
"""Compute interpolated Kneser-Ney smoothed token probability distributions using all previous tokens in each query."""

def estimate_deltas(self, n: int):
Expand Down

0 comments on commit 536cca1

Please sign in to comment.