File size: 2,047 Bytes
b0258be
2c62053
b0258be
 
 
 
 
 
 
 
 
1d697a7
b0258be
 
3ffb602
 
1d697a7
 
 
 
 
3ffb602
 
 
1d697a7
 
 
 
 
 
 
 
3ffb602
1d697a7
3ffb602
1d697a7
 
3ffb602
1d697a7
 
 
 
 
 
3ffb602
1d697a7
 
3ffb602
1d697a7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
title: NINA
emoji: ๐Ÿš€
colorFrom: gray
colorTo: red
sdk: gradio
sdk_version: 6.14.0
python_version: '3.13'
app_file: app.py
pinned: false
license: apache-2.0
short_description: Chat with a video, grounded only in the footage
---

# NINA โ€” Neural Information & Narrative Abstraction

Upload a recording (or paste a link from a known video site) and chat about it. NINA
answers using **only** the video: what is *said* (Whisper, two passes, with a
reliability gate), what is *shown* (CLIP retrieval and a vision-language model that
reads the sampled keyframes), speaker turns where available, and a whole-transcript
digest for summaries. The app that drives this Space is **https://app.nnlabs.pl/nina**.

## Running this Space

* **Secrets:** `HF_TOKEN` (inference providers; the pyannote models are gated, accept
  their terms on this token) and `NINA_SIGNING_SECRET` (shared with the website's
  Worker; without it every request is refused). Optional: `YT_DLP_COOKIES_B64`,
  `YT_DLP_PROXY` for pasted links; `TOKEN_REQUIRE_SCOPE=1` once the Worker emits
  scoped tokens.
* **Hardware:** CPU (`cpu-upgrade`); sleeps after 15 minutes and takes about two
  minutes to wake (Whisper, CLIP and the cross-encoder load at start).
* **Limits:** 500 MB and 45 minutes per video; uploads are purged after 15 minutes.

## API

Every endpoint takes a signed, single-use token minted by the website for that
endpoint's scope. There is no anonymous access.

| api_name | inputs | output |
| --- | --- | --- |
| `chat` | video (optional), payload JSON `{messages, transcript, force_analyze, force_answer, has_video}`, token | streams `[answer, analyzed, transcript]` |
| `route` | payload JSON, token | `analyze_first` / `confirm` / `answer` |
| `fetch` | url, token | `[video, title_or_error]` |
| `run` | video, prompt, token | streamed answer (legacy single shot) |

Refusals and failures start with `โ›”`; the website shows them as errors and does not
store them as answers.

Config reference: https://huggingface.co/docs/hub/spaces-config-reference