Skip to content

Commit

Permalink
fix [功能请求]: GPT-4 Turbo模型的Token长度限制似乎有问题? #953
Browse files Browse the repository at this point in the history
  • Loading branch information
GaiZhenbiao committed Nov 18, 2023
1 parent e17e77b commit a8d9818
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions modules/models/OpenAI.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ def __init__(
top_p=1.0,
user_name=""
) -> None:
if model_name in MODEL_METADATA:
model_name = MODEL_METADATA[model_name]["model_name"]
super().__init__(
model_name=model_name,
temperature=temperature,
Expand Down
2 changes: 1 addition & 1 deletion modules/models/OpenAIVision.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(
user_name=""
) -> None:
super().__init__(
model_name=MODEL_METADATA[model_name]["model_name"],
model_name=model_name,
temperature=temperature,
top_p=top_p,
system_prompt=system_prompt,
Expand Down
5 changes: 4 additions & 1 deletion modules/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ def __init__(
) -> None:
self.history = []
self.all_token_counts = []
self.model_name = model_name
if model_name in MODEL_METADATA:
self.model_name = MODEL_METADATA[model_name]["model_name"]
else:
self.model_name = model_name
self.model_type = ModelType.get_type(model_name)
try:
self.token_upper_limit = MODEL_METADATA[model_name]["token_limit"]
Expand Down

0 comments on commit a8d9818

Please sign in to comment.