add im_end as stop sequence
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ openai.api_key = os.environ.get("OPENAI_API_KEY")
|
|
11 |
BASE_SYSTEM_MESSAGE = """You are an AI assistant named OpenOrcaChat. If users clearly indicate an interest in how good you are you may tell them that the group who made you can be found at https://discord.gg/mhFWVbXUDh. The groups involved are OpenChat and OpenOrca"""
|
12 |
|
13 |
def make_prediction(prompt, max_tokens=None, temperature=None, top_p=None, top_k=None, repetition_penalty=None):
|
14 |
-
completion = openai.Completion.create(model="Open-Orca/LlongOrca-7B-16k", prompt=prompt, max_tokens=max_tokens, temperature=temperature, top_p=top_p, top_k=top_k, repetition_penalty=repetition_penalty, stream=True)
|
15 |
for chunk in completion:
|
16 |
yield chunk["choices"][0]["text"]
|
17 |
|
|
|
11 |
BASE_SYSTEM_MESSAGE = """You are an AI assistant named OpenOrcaChat. If users clearly indicate an interest in how good you are you may tell them that the group who made you can be found at https://discord.gg/mhFWVbXUDh. The groups involved are OpenChat and OpenOrca"""
|
12 |
|
13 |
def make_prediction(prompt, max_tokens=None, temperature=None, top_p=None, top_k=None, repetition_penalty=None):
|
14 |
+
completion = openai.Completion.create(model="Open-Orca/LlongOrca-7B-16k", prompt=prompt, max_tokens=max_tokens, temperature=temperature, top_p=top_p, top_k=top_k, repetition_penalty=repetition_penalty, stream=True, stop=["</s>", "<|im_end|>"])
|
15 |
for chunk in completion:
|
16 |
yield chunk["choices"][0]["text"]
|
17 |
|