--- title: WeMM Semantic Universe emoji: đŸ§­ colorFrom: indigo colorTo: yellow sdk: gradio sdk_version: 6.26.0 python_version: 3.12 app_file: app.py pinned: false license: apache-2.0 short_description: Search meaning across text, images, video, and documents startup_duration_timeout: 1h suggested_hardware: zero-a10g models: - tencent/WeMM-Embedding-9B datasets: - sentence-transformers/example-documents preload_from_hub: - tencent/WeMM-Embedding-9B --- # WeMM Semantic Universe An immersive, retrieval-first showcase for [Tencent WeMM-Embedding-9B](https://huggingface.co/tencent/WeMM-Embedding-9B), a universal multimodal embedding model built on Qwen3.5. The interface is a fully custom HTML/CSS/JavaScript application served by `gr.Server`; Gradio provides the queued API engine and ZeroGPU integration without rendering the UI. The Space demonstrates the model as a shared semantic geometry rather than a single similarity score: - Search text, images, video, figures, and visual documents together. - Combine an image or video with text to form a multimodal query. - Add a custom mixed-media candidate collection alongside the curated universe. - Inspect rankings at every native Matryoshka size: 64, 128, 256, 512, 1,024, 2,048, and 4,096 dimensions. - Compare any two supported inputs in the Vector Microscope. - Explore ranked media cards, Matryoshka stability curves, compressed vector fingerprints, and structured API telemetry. - Launch five one-click curated expeditions or drag in your own visual query and candidate set. ## Runtime design The model loads once on CPU at startup. A ZeroGPU allocation moves it to GPU only for inference, then returns it to CPU. The built-in candidate universe is embedded on the first search and cached as normalized 4,096-dimensional CPU tensors; all later dimension choices use lossless prefix truncation followed by re-normalization, without re-encoding the corpus. The first curated search is therefore slower than warm searches. The five curated expeditions are implemented in the custom frontend and only invoke the model when selected, so opening the Space does not consume GPU quota. Live ZeroGPU validation measured 17.7 seconds for the cold 10-item multimodal corpus pass and 8.7 seconds for a video-plus-text to text retrieval pass. The callable GPU budgets use a 30-second heavy-path allowance and a 15-second light-path allowance; actual latency still varies with media length and queue conditions. This repository targets `zero-a10g` (the current 48 GB ZeroGPU allocation). `suggested_hardware` is advisory metadata: the Space owner must still select ZeroGPU in the Space settings. `GRADIO_SSR_MODE=false` is set before Gradio imports for the fastest startup path. ## API The custom frontend calls the queued endpoints through `@gradio/client`, which preserves Hugging Face iframe authentication and ZeroGPU quota handling. The generated schema is available at `/gradio_api/info` (also linked as **API** in the top bar). - `/search` ranks a mixed candidate collection from a text/image/video query. - `/compare` compares a query and candidate across every native Matryoshka dimension. Always call `Client.view_api()` before invoking either endpoint so the client uses the deployed schema. ## Interface architecture - `app.py` owns model loading, ZeroGPU functions, structured `/search` and `/compare` endpoints, and static routes. - `frontend/index.html` contains the semantic-search and vector-microscope application shell. - `frontend/app.css` provides the responsive visual system and motion. - `frontend/app.js` manages uploads, curated expeditions, queued client calls, and data visualizations. ## Score semantics Every output is an L2-normalized embedding. The displayed dot products are therefore cosine similarities. They are ranking signals within a candidate set—not calibrated probabilities or universal relevance grades. Audio is not supported by WeMM-Embedding-9B. ## Demo media The curated visual and video inputs come from [`sentence-transformers/example-documents`](https://huggingface.co/datasets/sentence-transformers/example-documents), the same example repository referenced in the WeMM model card. They are bundled locally so examples remain deterministic and do not depend on third-party URLs at runtime. ## References - [Model card](https://huggingface.co/tencent/WeMM-Embedding-9B) - [WeMM-Embedding technical report](https://arxiv.org/abs/2608.24053) - [Sentence Transformers usage](https://www.sbert.net/)