phi3-mini-finetuned / utils /process_input.py
DenCT's picture
Create process_input.py
6dfdd8f verified
raw
history blame contribute delete
558 Bytes
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"]