API start endpoint requires hf_token for Parakeet and Canary diarization even when HF_TOKEN is set

Aperta Adatta ai principianti
#495 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@jayhemnani9910 ci sta già lavorando.

Dal 5/11/2026.

  • #510 di @jayhemnani9910 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
77/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
api, backend

Direzione di ricerca

Inizia dalla convalida intorno alle righe 1115–1121 di internal/api/handlers.go e confrontala con il fallback dell’adattatore aggiunto nel commit ff12270. Segui il modo in cui il gestore di avvio legge HF_TOKEN e memorizza i parametri del job; conferma che la richiesta riesce senza hf_token quando la variabile d’ambiente è impostata, mentre il token non viene restituito nel record del job.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

POST /api/v1/transcription/{id}/start rejects Parakeet and Canary jobs with pyannote diarization unless the request body contains hf_token, even when the HF_TOKEN environment variable is set. As a result, API clients must hold the Hugging Face token, and the token is stored in the job record.

Environment

  • Scriberr built from main at a353078 with Dockerfile.cuda.12.9
  • Docker 29.7.2 on x86_64 (Linux), NVIDIA RTX PRO 6000 Blackwell, driver 595.91.07
  • Fresh named volumes for /app/data and /app/whisperx-env
  • HF_TOKEN set in the container environment

Steps to reproduce

  1. Upload a file with POST /api/v1/transcription/upload.
  2. Start it without hf_token.
curl -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
  -d '{"model_family":"nvidia_parakeet","model":"parakeet-tdt-0.6b-v3","device":"cuda","diarize":true,"diarize_model":"pyannote","max_speakers":6}' \
  http://scriberr:8080/api/v1/transcription/$ID/start

Actual behavior

HTTP 400
{"error":"Hugging Face token (hf_token) is required for Pyannote diarization"}

ff12270 added the HF_TOKEN fallback to the adapters, but the handler still validates the request body on its own (handlers.go#L1115-L1121). When the client passes the token in the body to get past this check, the token is saved with the job parameters and returned by GET /api/v1/transcription/{id} as parameters.hf_token.

Expected behavior

The job starts and the adapter uses HF_TOKEN from the environment, a fallback the adapters have supported since ff12270.

Suggestion

Apply the same fallback in the handler, for example by accepting the request when hf_token is empty and HF_TOKEN is configured.

Lingua principale
Go
Stelle
3.1k
Fork
272
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rishikanthc/Scriberr

Tutte le issue di rishikanthc/Scriberr

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.