Skip to content

Commit

Permalink
剩余token数改为4000 - history token
Browse files Browse the repository at this point in the history
  • Loading branch information
yehaodong-genomics-cn committed Mar 27, 2023
1 parent 09ee6ca commit 23220a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
from setuptools import find_namespace_packages
from setuptools import setup
from pathlib import Path

PATH = Path("README.md")

setup(
name="azureChatGPT",
version="0.0.1",
version="0.0.2",
description="ChatGPT is a reverse engineering of Azure ChatGPT API",
long_description=open(PATH, encoding="utf-8").read(),
long_description_content_type="text/markdown",
url="https://github.com/EvAnhaodong/azureChatGPT",
author="yehaodong",
author_email="yehaodong@genomics.cn",
Expand Down
4 changes: 2 additions & 2 deletions src/azureChatGPT/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def get_token_count(self, convo_id: str = "default") -> int:

def get_max_tokens(self, convo_id: str) -> int:
"""
Get max tokens
Get remaining tokens
"""
return self.max_tokens - self.get_token_count(convo_id)
return 4000 - self.get_token_count(convo_id)

def __messages2prompt(self, convo_id: str = "default"):
prompt = "".join(
Expand Down

0 comments on commit 23220a9

Please sign in to comment.