Open salimngit opened 1 month ago
@salimngit, it looks like you're encountering an error related to the presence of infinite values in the logits during the inference process with onnxruntime-web
. This can happen due to various reasons, including model issues, input data anomalies, or bugs in the runtime.
Here are a few steps you can take to troubleshoot and resolve this issue:
Check Input Data:
Model Integrity:
Runtime Version:
onnxruntime-web
and associated WASM files. Since you mentioned using a specific development version, confirm that the paths to the WASM files are correct and they are accessible.Check for Known Issues:
Error Handling:
Here is an example of how you might add error handling to check for infinite values in logits:
async function generateResponse(input) {
try {
const logits = await LLM.generate(input);
// Check for infinite values in logits
if (logits.some(value => !isFinite(value))) {
throw new Error("Found infinite value in logits");
}
const response = LLM.argmax(logits);
return response;
} catch (error) {
console.error("Error in generateResponse:", error);
// Handle the error appropriately
}
}
async function submitRequest(input) {
try {
const response = await generateResponse(input);
// Process the response
} catch (error) {
console.error("Error in submitRequest:", error);
// Handle the error appropriately
}
}
By following these steps, you should be able to identify and resolve the issue with infinite values in the logits during model inference.
Chat with onnxruntime-web example deployed with
"onnxruntime-web": "1.19.0-dev.20240509-69cfcba38a" and associated wasm files from https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.0-dev.20240509-69cfcba38a/dist/
live demo https://guschmue.github.io/ort-webgpu/chat/index.html works just fine.
When i run locally, i receive the below error