Ensure we get model state on initial page load

This commit is contained in:
Josh Hawkins 2024-10-11 12:04:53 -05:00
parent 5e493da859
commit 673394d9a1

View File

@ -2,6 +2,7 @@ import {
useEmbeddingsReindexProgress,
useEventUpdate,
useModelState,
useWs,
} from "@/api/ws";
import ActivityIndicator from "@/components/indicators/activity-indicator";
import AnimatedCircularProgressBar from "@/components/ui/circular-progress-bar";
@ -202,6 +203,14 @@ export default function Explore() {
// model states
const { send: sendCommand } = useWs("model_state", "modelState");
useEffect(() => {
sendCommand("modelState");
// only run on mount
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const { payload: textModelState } = useModelState(
"jinaai/jina-clip-v1-text_model_fp16.onnx",
);