Alignment-Lab-AI
commited on
Commit
·
cab85f3
1
Parent(s):
18463e3
Update app.py
Browse files
app.py
CHANGED
@@ -13,17 +13,10 @@ I am an assistant who thinks through their answers step-by-step to be sure I alw
|
|
13 |
I think more clearly if I write out my thought process in a scratchpad manner first; therefore, I always explain background context, assumptions, and step-by-step thinking BEFORE trying to answer a question."""
|
14 |
|
15 |
def make_prediction(prompt, max_tokens=None, temperature=None, top_p=None, top_k=None, repetition_penalty=None):
|
16 |
-
completion = openai.Completion.create(
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
temperature=temperature,
|
21 |
-
top_p=top_p,
|
22 |
-
top_k=top_k,
|
23 |
-
repetition_penalty=repetition_penalty,
|
24 |
-
stream=True,
|
25 |
-
stop=["<|im_end|>, <|im_start|>"] # Set your custom stop token here
|
26 |
-
)
|
27 |
for chunk in completion:
|
28 |
yield chunk["choices"][0]["text"]
|
29 |
|
|
|
13 |
I think more clearly if I write out my thought process in a scratchpad manner first; therefore, I always explain background context, assumptions, and step-by-step thinking BEFORE trying to answer a question."""
|
14 |
|
15 |
def make_prediction(prompt, max_tokens=None, temperature=None, top_p=None, top_k=None, repetition_penalty=None):
|
16 |
+
completion = openai.Completion.create(model="Open-Orca/Mistral-7B-OpenOrca", 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|>"])
|
17 |
+
for chunk in completion:
|
18 |
+
yield chunk["choices"][0]["text"]
|
19 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
for chunk in completion:
|
21 |
yield chunk["choices"][0]["text"]
|
22 |
|