Выдает ошибку при работает с tiktoken. 
 An error occurred in the prompt function: 'Could not automatically map llama-3.1-70b-versatile to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.'
Работаю с Groq sdk и их API, у меня есть бакет. В чем проблема? Модель берется из API Groq, для чего нужен tokenizer и как мне использовать его, если у меня нет модели локально?
import time
from threading import Lock

import tiktoken

def count_tokens(text, model_name):
    encoding = tiktoken.encoding_for_model(model_name)
    return len(encoding.encode(text))


def split_text_into_chunks(text, max_chunk_tokens, model_name):
    encoding = tiktoken.encoding_for_model(model_name)
    encoded_text = encoding.encode(text)
    chunks = []
    for i in range(0, len(encoded_text), max_chunk_tokens):
        chunk = encoding.decode(encoded_text[i:i + max_chunk_tokens])
        chunks.append(chunk)
    return chunks


class TokenBucket:
    """Custom token bucket rate limiter"""
    def __init__(self, tokens_per_minute):
        self.capacity = tokens_per_minute
        self.tokens = tokens_per_minute
        self.fill_rate = tokens_per_minute / 60.0  # tokens per second
        self.timestamp = time.time()
        self.lock = Lock()

    def consume(self, tokens_needed):
        with self.lock:
            now = time.time()
            elapsed = now - self.timestamp
            self.timestamp = now
            self.tokens += elapsed * self.fill_rate
            if self.tokens > self.capacity:
                self.tokens = self.capacity
            if self.tokens >= tokens_needed:
                self.tokens -= tokens_needed
                return True
            else:
                return False

token_bucket = TokenBucket(tokens_per_minute=14400)

def wait_for_tokens(tokens_needed):
    while not token_bucket.consume(tokens_needed):
        time.sleep(1)

и код, где я использую его:
@shared_task(name="prompt_queue")
def prompt(text, action_type_id, file_id, language_code, kit_id=None):
    try:
        action_type = TranscriptionActionType.objects.get(id=action_type_id)
        total_tokens_used = 0

        model_name = "llama-3.1-70b-versatile"
        max_tokens_per_request = 6000  # as per your max_tokens parameter
        reserved_tokens = 1000  # adjust based on expected completion length and messages
        max_chunk_tokens = max_tokens_per_request - reserved_tokens

        # split the transcription text into chunks
        chunks = split_text_into_chunks(text, max_chunk_tokens, model_name)

        max_completion_tokens = 1000  # adjust based on your expected completion length

        messages = [
            {"role": "system", "content": action_type.system_content},
        ]

        for chunk in chunks:
            user_message = {
                "role": "user",
                "content": action_type.user_content.format(
                    text=chunk, language=language_code
                )
            }

            messages.append(user_message)

            # estimate tokens for the prompt
            input_tokens = sum(count_tokens(m['content'], model_name) for m in messages)
            total_tokens = input_tokens + max_completion_tokens

            if total_tokens > max_tokens_per_request:
                while total_tokens > max_tokens_per_request and len(messages) > 2:
                    messages.pop(1)
                    input_tokens = sum(count_tokens(m['content'], model_name) for m in messages)
                    total_tokens = input_tokens + max_completion_tokens

            # wait for tokens to be available
            tokens_needed = total_tokens
            wait_for_tokens(tokens_needed)

            completion = client.chat.completions.create(
                model=model_name,
                messages=messages,
                temperature=0.1,
                max_tokens=max_completion_tokens,
                top_p=1,
                stream=False,
                stop=None,
            )

            # extract the content
            assistant_message = completion.choices[0].message
            content = assistant_message.content
            messages.append({"role": "assistant", "content": content})

            # update the total tokens used
            if hasattr(completion, 'usage') and hasattr(completion.usage, 'total_tokens'):
                total_tokens_used += completion.usage.total_tokens
            else:
                total_tokens_used += total_tokens  # use estimated tokens

        # combine the summaries
        final_summary = messages[-1]['content']

        transcription_action = TranscriptionAction.objects.create(
            file_id=file_id, action_type_id=action_type_id, content=final_summary, kit_id=kit_id
        )
        return transcription_action.id
    except Exception as e:
        error_message = f"An error occurred in the prompt function: {e}"
        print(error_message)
        sentry_sdk.capture_exception(e)
        return None