Unverified Commit 5a3c52ab authored by Yan Ru Pei's avatar Yan Ru Pei Committed by GitHub
Browse files

chore: more mocker rusty cleanups (#6271)


Signed-off-by: default avatarPeaBrane <yanrpei@gmail.com>
parent a582f4df
This diff is collapsed.
...@@ -161,6 +161,18 @@ impl MockEngineArgs { ...@@ -161,6 +161,18 @@ impl MockEngineArgs {
MockEngineArgsBuilder::default() MockEngineArgsBuilder::default()
} }
pub fn is_prefill(&self) -> bool {
self.worker_type == WorkerType::Prefill
}
pub fn is_decode(&self) -> bool {
self.worker_type == WorkerType::Decode
}
pub fn needs_kv_publisher(&self) -> bool {
self.enable_prefix_caching && !self.is_decode()
}
/// Create MockEngineArgs from a JSON file containing extra engine arguments /// Create MockEngineArgs from a JSON file containing extra engine arguments
pub fn from_json_file(path: &Path) -> anyhow::Result<Self> { pub fn from_json_file(path: &Path) -> anyhow::Result<Self> {
let mut builder = Self::builder(); let mut builder = Self::builder();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment