Why I cannot set engine to "gpt-4" during my usage #1437
Replies: 2 comments
-
Supported engines: It seems that any engine input (regardless of implementation) by the user returns a def get_token_count(self, convo_id: str = "default") -> int:
"""
Get token count
"""
if self.engine not in ENGINES:
raise NotImplementedError(f"Unsupported engine {self.engine}")
tiktoken.model.MODEL_TO_ENCODING["gpt-4"] = "cl100k_base"
encoding = tiktoken.encoding_for_model(self.engine)
num_tokens = 0
for message in self.conversation[convo_id]:
# every message follows <im_start>{role/name}\n{content}<im_end>\n
num_tokens += 5
for key, value in message.items():
num_tokens += len(encoding.encode(value))
if key == "name": # if there's a name, the role is omitted
num_tokens += 5 # role is always required and always 1 token
num_tokens += 5 # every reply is primed with <im_start>assistant
return num_tokens |
Beta Was this translation helpful? Give feedback.
-
Your account doesn't have access to gpt-4. You need to apply on a waitlist |
Beta Was this translation helpful? Give feedback.
-
I found the engines in the file of "V3.py" has "gpt-4", thus I try to set the engine as "gpt-4" during my usage.
But then, I will meet 404 web request problem:
APIConnectionError: 404 Not Found {
"error": {
"message": "The model:
gpt-4
does not exist","type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}
Is there any explanation for the result? Why OpenAI returns a 404 for "gpt-4"?
Beta Was this translation helpful? Give feedback.
All reactions