File size: 970 Bytes
dee4e5f
fc5623e
 
dee4e5f
fc5623e
dee4e5f
fc5623e
dee4e5f
fc5623e
bb64593
 
fc5623e
dee4e5f
 
fc5623e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Nugent Score AI 1.0
emoji: "🧪"
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
python_version: "3.11"
models:
- CarbGeM/Nugent-Score-AI-1.0
hf_oauth: true
---

# Nugent Score AI 1.0 - HF Image Echo Demo

This Hugging Face Space is a minimal frontend:

- User signs in with Hugging Face (`hf_oauth: true`)
- User uploads an image
- Frontend sends image + HF token to backend
- Backend validates token, checks in-memory quota, and returns the same image

## Space Secret

- `TRIAL_GATEWAY_URL` (backend base URL, for example `http://localhost:3000`)

## Backend contract

Frontend calls:

- `POST {TRIAL_GATEWAY_URL}/v1/trial/infer`
- Header: `Authorization: Bearer <hf_token>`
- Body: `multipart/form-data` with file field `image`

Expected backend behavior:

- Validate HF token against Hugging Face API
- Track remaining uses in memory by HF user
- Return image bytes unchanged
- Return `x-remaining-calls` response header