Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,6 @@ openai.api_model2 = os.environ.get("OPENAI_API_MODEL2")
|
|
14 |
|
15 |
BASE_SYSTEM_MESSAGE = """"""
|
16 |
|
17 |
-
|
18 |
def make_prediction(prompt, api_model, api_key, api_base, max_tokens=None, temperature=None, top_p=None, top_k=None, repetition_penalty=None):
|
19 |
completion = openai.Completion.create(
|
20 |
model=api_model,
|
@@ -56,7 +55,7 @@ def chat(api_model, history, system_message, max_tokens, temperature, top_p, top
|
|
56 |
history = history or []
|
57 |
|
58 |
messages = BASE_SYSTEM_MESSAGE + system_message.strip() + "\n" + \
|
59 |
-
"\n".join(["\n".join(["###Instruction
|
60 |
for item in history])
|
61 |
# strip the last `<|end_of_turn|>` from the messages
|
62 |
#messages = messages.rstrip("<|end_of_turn|>")
|
|
|
14 |
|
15 |
BASE_SYSTEM_MESSAGE = """"""
|
16 |
|
|
|
17 |
def make_prediction(prompt, api_model, api_key, api_base, max_tokens=None, temperature=None, top_p=None, top_k=None, repetition_penalty=None):
|
18 |
completion = openai.Completion.create(
|
19 |
model=api_model,
|
|
|
55 |
history = history or []
|
56 |
|
57 |
messages = BASE_SYSTEM_MESSAGE + system_message.strip() + "\n" + \
|
58 |
+
"\n".join(["\n".join(["### Instruction:\n"+item[0]+"\n\n", "### Response:\n"+item[1]+"\n\n"])
|
59 |
for item in history])
|
60 |
# strip the last `<|end_of_turn|>` from the messages
|
61 |
#messages = messages.rstrip("<|end_of_turn|>")
|