Skip to content

Commit

Permalink
quora (poe) [gpt-4/3.5] create bot feature fix
Browse files Browse the repository at this point in the history
fixed custom model not working
  • Loading branch information
xtekky committed Apr 13, 2023
1 parent bd326b3 commit d0f5814
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions quora/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def create(

models = {
'gpt-3.5-turbo' : 'chinchilla',
'claude-instant-v1.0': 'a2'
'claude-instant-v1.0': 'a2',
'gpt-4': 'beaver'
}

if not handle:
Expand Down Expand Up @@ -230,7 +231,7 @@ def get():
class StreamingCompletion:
def create(
model : str = 'gpt-4',
custom_model : str = None,
custom_model : bool = None,
prompt: str = 'hello world',
token : str = ''):

Expand All @@ -246,7 +247,7 @@ def create(

client = PoeClient(token)

for chunk in client.send_message(models[model], prompt):
for chunk in client.send_message(_model, prompt):

yield PoeResponse({
'id' : chunk["messageId"],
Expand Down Expand Up @@ -285,7 +286,7 @@ def create(

client = PoeClient(token)

for chunk in client.send_message(models[model], prompt):
for chunk in client.send_message(_model, prompt):
pass

return PoeResponse({
Expand All @@ -304,4 +305,4 @@ def create(
'completion_tokens' : len(chunk["text"]),
'total_tokens' : len(prompt) + len(chunk["text"])
}
})
})

0 comments on commit d0f5814

Please sign in to comment.