mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-12-23 19:11:48 +03:00
quora (poe) [gpt-4/3.5] create bot feature fix
fixed custom model not working
This commit is contained in:
parent
bd326b354d
commit
d0f58147bb
@ -67,7 +67,8 @@ class Model:
|
|||||||
|
|
||||||
models = {
|
models = {
|
||||||
'gpt-3.5-turbo' : 'chinchilla',
|
'gpt-3.5-turbo' : 'chinchilla',
|
||||||
'claude-instant-v1.0': 'a2'
|
'claude-instant-v1.0': 'a2',
|
||||||
|
'gpt-4': 'beaver'
|
||||||
}
|
}
|
||||||
|
|
||||||
if not handle:
|
if not handle:
|
||||||
@ -230,7 +231,7 @@ class Account:
|
|||||||
class StreamingCompletion:
|
class StreamingCompletion:
|
||||||
def create(
|
def create(
|
||||||
model : str = 'gpt-4',
|
model : str = 'gpt-4',
|
||||||
custom_model : str = None,
|
custom_model : bool = None,
|
||||||
prompt: str = 'hello world',
|
prompt: str = 'hello world',
|
||||||
token : str = ''):
|
token : str = ''):
|
||||||
|
|
||||||
@ -246,7 +247,7 @@ class StreamingCompletion:
|
|||||||
|
|
||||||
client = PoeClient(token)
|
client = PoeClient(token)
|
||||||
|
|
||||||
for chunk in client.send_message(models[model], prompt):
|
for chunk in client.send_message(_model, prompt):
|
||||||
|
|
||||||
yield PoeResponse({
|
yield PoeResponse({
|
||||||
'id' : chunk["messageId"],
|
'id' : chunk["messageId"],
|
||||||
@ -285,7 +286,7 @@ class Completion:
|
|||||||
|
|
||||||
client = PoeClient(token)
|
client = PoeClient(token)
|
||||||
|
|
||||||
for chunk in client.send_message(models[model], prompt):
|
for chunk in client.send_message(_model, prompt):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return PoeResponse({
|
return PoeResponse({
|
||||||
@ -304,4 +305,4 @@ class Completion:
|
|||||||
'completion_tokens' : len(chunk["text"]),
|
'completion_tokens' : len(chunk["text"]),
|
||||||
'total_tokens' : len(prompt) + len(chunk["text"])
|
'total_tokens' : len(prompt) + len(chunk["text"])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user