File size: 558 Bytes
6dfdd8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
def get_response(model, instructions, input_texts):
    prompt = """<|system|>
        You are an expert NLP tool. Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.<|end|>

        <|user|>
        {}

        {}<|end|>
        
        <|assistant|>""".format(
        instructions, input_texts
    )
    output = model(
        prompt,
        max_tokens=1024,
        stop=["Q:"],
        echo=False,
    )

    return output["choices"][0]["text"]