"lmdeploy/serve/turbomind/deploy.py" did not exist on "0cc48011aba1de3fc926019489a831bed81373a1"
utils.py 709 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import re

# Original Prompt
# Question: What is (9 + 8) * 2? Answer:

def style_01(docs):

    # What is (9 + 8) * 2?
    return docs["context"].replace("Question: ", "").replace(" Answer:", "")

def style_02(docs):

    # Q: What is (9 + 8) * 2? A:
    return docs["context"].replace("Question: ", "Q: ").replace(" Answer:", " A:")

def style_03(docs):

    # Solve (9 + 8) * 2.
    return docs["context"].replace("Question: What is", "Solve").replace(" Answer:", ".")

def style_04(docs):

    # (9 + 8) * 2 =
    return docs["context"].replace("Question: What is ", "").replace(" Answer:", " =")

def style_05(docs):

    # What is (9 + 8) * 2? Answer:
    return docs["context"].replace("Question: ", "")