Future-House / paper-qa

High accuracy RAG for answering questions from scientific documents with citations
Apache License 2.0
6.37k stars 604 forks source link

Increasing token limit in CLI #571

Open Litreviewing opened 1 month ago

Litreviewing commented 1 month ago

How can I increase the token limit for a query using CLI?

dosubot[bot] commented 1 month ago

To increase the token limit for a query using the CLI, you would need to modify the check_rate_limit method in the code. This method is responsible for enforcing the token limit. You can adjust the rate_limit configuration in the self.config dictionary to set a higher limit.

Here's a snippet of the relevant code:

async def check_rate_limit(self, token_count: float, **kwargs) -> None:
    if "rate_limit" in self.config:
        await GLOBAL_LIMITER.try_acquire(
            ("client", self.name),
            self.config["rate_limit"],
            weight=max(int(token_count), 1),
            **kwargs,
        )

You would need to ensure that the rate_limit value in self.config is set to your desired token limit [1].

To continue talking to Dosu, mention @dosu.