Deploy hyper3labs/HyperView-DeepFashion-Text-Search from Hyper3Labs/hyperview-spaces@ae41c8d
Browse files- .hyperview/extensions/fashion-search-readout/panel.jsx +3 -2
- Dockerfile +9 -6
- demo.py +1 -1
.hyperview/extensions/fashion-search-readout/panel.jsx
CHANGED
|
@@ -50,12 +50,13 @@ export default function FashionSearchPanel() {
|
|
| 50 |
setError(null);
|
| 51 |
void (async () => {
|
| 52 |
try {
|
| 53 |
-
await showResults(
|
| 54 |
item.results.hyper3.map((result) => result.sampleId),
|
| 55 |
{ focus: false, source: `${item.label} · Hyper3-CLIP` },
|
| 56 |
);
|
| 57 |
const anchorSampleId = nextMode === "photo" ? item.anchorSampleId : null;
|
| 58 |
-
|
|
|
|
| 59 |
await updateProps(props.clipSamplesPanelId || "fashion-clip-results", { mode: "results", collectionId: item.collectionIds.clip, anchorSampleId });
|
| 60 |
await patchState(nextMode === "photo" ? { activeMode: "photo", activePhotoCaseId: item.id } : { activeMode: "text", activeTextCaseId: item.id });
|
| 61 |
await setSelection([nextMode === "photo" ? item.anchorSampleId : item.target.sampleId]);
|
|
|
|
| 50 |
setError(null);
|
| 51 |
void (async () => {
|
| 52 |
try {
|
| 53 |
+
const hyper3Results = await showResults(
|
| 54 |
item.results.hyper3.map((result) => result.sampleId),
|
| 55 |
{ focus: false, source: `${item.label} · Hyper3-CLIP` },
|
| 56 |
);
|
| 57 |
const anchorSampleId = nextMode === "photo" ? item.anchorSampleId : null;
|
| 58 |
+
const hyper3CollectionId = hyper3Results?.result?.collection_id || item.collectionIds.hyper3;
|
| 59 |
+
await updateProps("samples", { mode: "results", collectionId: hyper3CollectionId, anchorSampleId });
|
| 60 |
await updateProps(props.clipSamplesPanelId || "fashion-clip-results", { mode: "results", collectionId: item.collectionIds.clip, anchorSampleId });
|
| 61 |
await patchState(nextMode === "photo" ? { activeMode: "photo", activePhotoCaseId: item.id } : { activeMode: "text", activeTextCaseId: item.id });
|
| 62 |
await setSelection([nextMode === "photo" ? item.anchorSampleId : item.target.sampleId]);
|
Dockerfile
CHANGED
|
@@ -20,8 +20,8 @@ WORKDIR $HOME/app
|
|
| 20 |
|
| 21 |
RUN pip install --upgrade pip
|
| 22 |
|
| 23 |
-
ARG HYPERVIEW_VERSION=0.
|
| 24 |
-
ARG HYPER_MODELS_VERSION=0.3.
|
| 25 |
|
| 26 |
# Install CPU-only PyTorch first so the Space does not pull the default CUDA bundle.
|
| 27 |
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
|
@@ -40,14 +40,17 @@ RUN pip install \
|
|
| 40 |
|
| 41 |
COPY --chown=user . .
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
ENV HYPERVIEW_HOST=0.0.0.0 \
|
| 44 |
HYPERVIEW_PORT=7860 \
|
| 45 |
-
HYPERVIEW_WORKSPACE_ID=fashion-
|
| 46 |
HYPERVIEW_DATASETS_DIR=/home/user/app/demo_data/datasets \
|
| 47 |
HYPERVIEW_MEDIA_DIR=/home/user/app/demo_data/media \
|
| 48 |
-
FASHION_ENABLE_CONTEXT_MAPS=1 \
|
| 49 |
-
DEEPFASHION_SAMPLES_PER_CATEGORY=10 \
|
| 50 |
-
DEEPFASHION_MAX_SAMPLES=180 \
|
| 51 |
HF_HUB_ETAG_TIMEOUT=30 \
|
| 52 |
HF_HUB_DOWNLOAD_TIMEOUT=120
|
| 53 |
|
|
|
|
| 20 |
|
| 21 |
RUN pip install --upgrade pip
|
| 22 |
|
| 23 |
+
ARG HYPERVIEW_VERSION=1.0.0
|
| 24 |
+
ARG HYPER_MODELS_VERSION=0.3.1
|
| 25 |
|
| 26 |
# Install CPU-only PyTorch first so the Space does not pull the default CUDA bundle.
|
| 27 |
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
|
|
|
| 40 |
|
| 41 |
COPY --chown=user . .
|
| 42 |
|
| 43 |
+
# HyperView 1.0 mints a session token and rejects unauthenticated runtime
|
| 44 |
+
# commands. A public Space has no way to hand visitors that token, so panel
|
| 45 |
+
# creation and case switching 401 without this. It marks the server public:
|
| 46 |
+
# visitors get the viewer commands and nothing else, so provider registration,
|
| 47 |
+
# extension install, tool execution and compute stay closed.
|
| 48 |
+
ENV HYPERVIEW_NO_AUTH=1
|
| 49 |
ENV HYPERVIEW_HOST=0.0.0.0 \
|
| 50 |
HYPERVIEW_PORT=7860 \
|
| 51 |
+
HYPERVIEW_WORKSPACE_ID=fashion-typed-search-business-evidence-v3 \
|
| 52 |
HYPERVIEW_DATASETS_DIR=/home/user/app/demo_data/datasets \
|
| 53 |
HYPERVIEW_MEDIA_DIR=/home/user/app/demo_data/media \
|
|
|
|
|
|
|
|
|
|
| 54 |
HF_HUB_ETAG_TIMEOUT=30 \
|
| 55 |
HF_HUB_DOWNLOAD_TIMEOUT=120
|
| 56 |
|
demo.py
CHANGED
|
@@ -221,7 +221,7 @@ def build_demo_view(
|
|
| 221 |
)
|
| 222 |
hyper3_samples = hv.ui.Samples(
|
| 223 |
id="samples",
|
| 224 |
-
title="
|
| 225 |
position="center",
|
| 226 |
props={
|
| 227 |
"mode": "auto",
|
|
|
|
| 221 |
)
|
| 222 |
hyper3_samples = hv.ui.Samples(
|
| 223 |
id="samples",
|
| 224 |
+
title="Hyper3-CLIP · Product matches",
|
| 225 |
position="center",
|
| 226 |
props={
|
| 227 |
"mode": "auto",
|