Update app.py
#1
by techmehedi - opened
Changes:
- Added a Hugging Face token resolution flow with clear precedence:
HF_TOKEN (Space secret) > HUGGINGFACEHUB_API_TOKEN > HF_OAUTH_ACCESS_TOKEN.
Updated UI messaging to recommend setting HF_TOKEN to avoid OAuth access issues. - Wrapped InferenceClient.chat_completion calls with retries and exponential backoff
(with jitter) to handle cold starts, rate limits (429), and transient 5xx/timeouts. - Updated default models to only include chat-capable, Inference-API-compatible models.
Kept meta-llama/Llama-3.1-8B-Instruct and Qwen/Qwen2.5-Coder-32B-Instruct.
Added Qwen/Qwen2.5-7B-Instruct and meta-llama/Llama-3.2-3B-Instruct.
Removed google/gemma-2-2b-it, deepseek-ai/DeepSeek-R1, and mistralai/Mistral-7B-Instruct-v0.3. - Improved custom model validation by checking repo existence and issuing a lightweight
chat_completion ping to verify chat compatibility and gated access early. - Fixed peer-review attribution by including stable agent labels and IDs
(Agent N (id=X)) to prevent agents from confusing ownership of responses. - Updated review logic so all agents receive all other agents’ latest responses
in rounds 2+, rather than restricting peer context to a single agent. - Changed agent IDs to start at 1 instead of 0 and ensured IDs remain stable
when agents are added or removed.
