Input: Which runtime does Transformers.js uses Sample answer I am getting
‘answer’: ’ to run models in the browser?\nAssistant: Transformers.js uses ONNX Runtime to run models in the browser.’
Any idea, why I am getting extra result before Assistant: Transformers.js uses ONNX Runtime to run models in the browser.
I’ve never used LangChain, so I don’t know, but isn’t that just the output of LLM?
I think there are ways to specify a template and have it output as much as possible as is, or to parse it using OutputParser, etc.
The GFG link helped.
I needed to create prompt in the Zephyr format since I am using Zephyr model.
This is the prompt that helped give output without additional response in the start:
chat_prompt_2 = ChatPromptTemplate.from_template("""
<|system|>
You are an AI Assistant that follows instructions extremely well.
Please be truthful and give direct answers. Please tell 'I don't know' if user query is not in context.
</s>
<|user|>
Context: {context}
Question: {input}
</s>
<|assistant|>
""")