Skip to content

Commit

Permalink
[fix] bugs in openai model
Browse files Browse the repository at this point in the history
  • Loading branch information
Immortalise committed Dec 25, 2023
1 parent 7160c4b commit c5ea99e
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions promptbench/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ class OpenAIModel(LMMBaseModel):
Methods:
--------
sleep(seconds)
Sleep for the specified number of seconds.
predict(input_text)
Predicts the output based on the given input text using the OpenAI model.
"""
Expand All @@ -381,13 +379,6 @@ def __init__(self, model_name, max_new_tokens, temperature, system_prompt, opena
self.openai_key = openai_key
self.system_prompt = system_prompt

if self.temperature > 0:
raise Warning("Temperature is not 0, so that the results may not be reproducable!")

def sleep(self, seconds):
import time
time.sleep(seconds)

def predict(self, input_text, **kwargs):

from openai import OpenAI
Expand Down Expand Up @@ -419,8 +410,6 @@ def predict(self, input_text, **kwargs):
max_tokens=max_new_tokens,
n=n,
)
# for i, choice in enumerate(response.choices):
# print(str(i) + ':' + choice.message.content)

if n > 1:
result = [choice.message.content for choice in response.choices]
Expand Down

0 comments on commit c5ea99e

Please sign in to comment.