microsoft / onnxruntime-genai

Generative AI extensions for onnxruntime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[.NET] Phi-3 sample response is the same as input prompt

luisquintanilla opened this issue · comments

When running the HelloPhi sample using Phi-3, the generated response is the same as the user input.

Example Output:

-------------
Hello, Phi!
-------------
Please enter option number:
1. Complete Output
2. Streaming Output
1
Prompt:
What is AI?
Output:
What is AI?

Prompt:
What is ML? 
Output:
What is ML?
Prompt:

Additional Info:

model: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-onnx/tree/main/cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4
OS: Windows 11
ORT GenAI Version: 0.3.0-rc2
sample: https://github.com/microsoft/onnxruntime-genai/tree/main/examples/csharp/HelloPhi
hardware: CPU
.NET version: 6.0

Would you please try adding the chat template to your prompt?

<|user|>What is AI?<|end|><|assistant|>

@baijumeswani that fixed it. PR #553 ready when you get a chance.