-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DeepSeek R1 WebGPU demo #74
Conversation
@ibelem PTAL, thanks! |
@Jiawei-Shao I found code not format following the rules defined in |
Done @NingW101 |
Thanks. I'll update UI based on your commits |
if (!VITE_ENV_USE_REMOTE_MODELS) { | ||
env.backends.onnx.wasm.wasmPaths = `${baseUrl}/models/frameworks/ort-web/ort-web@transformers_js_3_3_1/`; | ||
env.allowLocalModels = true; | ||
env.allowRemoteModels = false; | ||
env.localModelPath = `${baseUrl}/models/`; | ||
} else { | ||
env.allowLocalModels = false; | ||
env.allowRemoteModels = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!VITE_ENV_USE_REMOTE_MODELS) { | |
env.backends.onnx.wasm.wasmPaths = `${baseUrl}/models/frameworks/ort-web/ort-web@transformers_js_3_3_1/`; | |
env.allowLocalModels = true; | |
env.allowRemoteModels = false; | |
env.localModelPath = `${baseUrl}/models/`; | |
} else { | |
env.allowLocalModels = false; | |
env.allowRemoteModels = true; | |
} | |
env.allowLocalModels = true; | |
env.localModelPath = `${baseUrl}/models/`; |
These options enable users to fetch .json and .onnx files from both local and remote sources. The priority is to fetch from local storage first, and if unavailable, fall back to the remote source. Since users will be uploading .onnx models themselves, we only need to allow fetching .json files (such as tokenizer configurations) from local server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -41,7 +41,9 @@ function copyResourcesIntoDist(args) { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the entire models directory will not be copied only in --use-remote-models mode, we need to explicitly copy the resources required by the deepseek sample. Otherwise, deepseek won’t be able to fetch them from the deployed github.io server.
You can push "models/onnx-communify/DeepSeek-R1.." folder string into the RESOURCES_ARRAY
or define another array variable const EXTRA_RESOURCE_ARRAY= ["models/onnx-communify/DeepSeek-R1.."]
then execute the copy command as the
for (let path of EXTRA_RESOURCE_ARRAY) {
if (path)
execSync(
`powershell -Command "Copy-Item -Path "${path}" -Destination "dist/${path}" -Recurse -Force"`,
{ stdio: "inherit" }
);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
* update UI of deepseek-r1 sample * UI tunning for deepseek r1 sample
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Jiawei-Shao and @NingW101 's great efforts!
@Jiawei-Shao Could you please fix the two linting issues? Thanks |
@Jiawei-Shao Thanks for fixing the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.