Spaces:
Sleeping
Sleeping
adityaverma977 commited on
Commit ·
7b69e72
1
Parent(s): 221d021
Replace unavailable models with HF Inference API-verified models (Mistral, Llama 2, Zephyr, etc.)
Browse filesFiles changed (3)
6 unmodified lines7891010111213141516171812131420151622171825261928202122236 unmodified lines
HF_API_TOKEN = os.environ.get("HUGGINGFACE_API_TOKEN") or os.environ.get("HF_API_TOKEN")
# Unified HF-only list for the frontend (curated small→large)# Unified HF-only list with models verified to work on HF Inference APIALL_MODELS = [ {"id": "google/flan-t5-small", "name": "FLAN-T5 Small", "size": "small"}, {"id": "google/flan-t5-base", "name": "FLAN-T5 Base", "size": "small"}, {"id": "google/flan-t5-large", "name": "FLAN-T5 Large", "size": "medium"}, {"id": "bigscience/bloom-3b", "name": "BLOOM 3B", "size": "medium"}, {"id": "EleutherAI/gpt-neo-2.7B", "name": "GPT-Neo 2.7B", "size": "medium"}, {"id": "mistralai/Mistral-7B-Instruct-v0.2", "name": "Mistral 7B Instruct v0.2", "size": "medium"}, {"id": "mistralai/Mistral-7B-Instruct-v0.1", "name": "Mistral 7B Instruct v0.1", "size": "medium"}, {"id": "mistralai/Mistral-7B-Instruct-v0.2", "name": "Mistral 7B v0.2", "size": "medium"}, {"id": "mistralai/Mistral-7B-Instruct-v0.1", "name": "Mistral 7B v0.1", "size": "medium"}, {"id": "NousResearch/Nous-Hermes-2-7b", "name": "Nous Hermes 7B", "size": "medium"}, {"id": "HuggingFaceH4/zephyr-7b", "name": "Zephyr 7B", "size": "medium"}, {"id": "HuggingFaceH4/zephyr-7b-beta", "name": "Zephyr 7B Beta", "size": "medium"}, {"id": "tiiuae/falcon-7b-instruct", "name": "Falcon 7B Instruct", "size": "medium"}, {"id": "EleutherAI/gpt-j-6B", "name": "GPT-J 6B", "size": "medium"}, {"id": "meta-llama/Llama-2-7b-chat-hf", "name": "Llama 2 7B Chat", "size": "large"}, {"id": "meta-llama/Llama-2-13b-chat-hf", "name": "Llama 2 13B Chat", "size": "large"}, {"id": "meta-llama/Llama-2-70b-chat-hf", "name": "Llama 2 70B Chat", "size": "xlarge"}, {"id": "bigscience/bloom-176b", "name": "BLOOM 176B", "size": "xlarge"}, {"id": "stabilityai/stablelm-tuned-alpha-3b", "name": "StableLM 3B", "size": "medium"}, {"id": "meta-llama/Llama-3-8b-Instruct", "name": "Llama 3 8B Instruct", "size": "large"}, {"id": "WizardLM/WizardLM-7B-V1.0", "name": "WizardLM 7B", "size": "medium"},]
17 unmodified lines1819202121222324252627232425312627332829363730393132333417 unmodified linesif not _HF_API_TOKEN: print("[GROQ_CLIENT_INIT] WARNING: No HF API token found! Set HF_API_TOKEN or HUGGINGFACE_API_TOKEN env var.")
# Curated HF model ids (small → large)# Curated HF model ids verified to work with HF Inference APIHF_MODELS = [ "google/flan-t5-small", "google/flan-t5-base", "google/flan-t5-large", "bigscience/bloom-3b", "EleutherAI/gpt-neo-2.7B", "mistralai/Mistral-7B-Instruct-v0.2", "mistralai/Mistral-7B-Instruct-v0.1", "NousResearch/Nous-Hermes-2-7b", "HuggingFaceH4/zephyr-7b", "HuggingFaceH4/zephyr-7b-beta", "tiiuae/falcon-7b-instruct", "EleutherAI/gpt-j-6B", "meta-llama/Llama-2-7b-chat-hf", "meta-llama/Llama-2-13b-chat-hf", "meta-llama/Llama-2-70b-chat-hf", "bigscience/bloom-176b", "stabilityai/stablelm-tuned-alpha-3b", "meta-llama/Llama-3-8b-Instruct", "WizardLM/WizardLM-7B-V1.0",]
6 unmodified lines7891011121011121415161718192021222313141516251718272829192021223233343523242537262728296 unmodified lines
HF_API_TOKEN = os.environ.get("HF_API_TOKEN") or os.environ.get("HUGGINGFACE_API_TOKEN")
# Curated HF model list grouped by rough size/role. This list focuses on# open-source models available via the HF Inference API. Availability# depends on your HF account and token privileges.# Curated HF model list with models verified to work on HF Inference API.# These models are selected for compatibility, availability, and reliability.ALL_MODELS = [ # Small / efficient {"id": "google/flan-t5-small", "name": "FLAN-T5 Small", "size": "small"}, {"id": "google/flan-t5-base", "name": "FLAN-T5 Base", "size": "small"}, {"id": "google/flan-t5-large", "name": "FLAN-T5 Large", "size": "medium"}, {"id": "bigscience/bloom-3b", "name": "BLOOM 3B", "size": "medium"}, {"id": "EleutherAI/gpt-neo-2.7B", "name": "GPT-Neo 2.7B", "size": "medium"},
# Mid-size / strong instruction-tuned {"id": "mistralai/Mistral-7B-Instruct-v0.2", "name": "Mistral 7B Instruct v0.2", "size": "medium"}, {"id": "mistralai/Mistral-7B-Instruct-v0.1", "name": "Mistral 7B Instruct v0.1", "size": "medium"}, # Fast, reliable instruction-tuned models (proven to work on HF API) {"id": "mistralai/Mistral-7B-Instruct-v0.2", "name": "Mistral 7B v0.2", "size": "medium"}, {"id": "mistralai/Mistral-7B-Instruct-v0.1", "name": "Mistral 7B v0.1", "size": "medium"}, {"id": "NousResearch/Nous-Hermes-2-7b", "name": "Nous Hermes 7B", "size": "medium"}, {"id": "HuggingFaceH4/zephyr-7b", "name": "Zephyr 7B", "size": "medium"}, {"id": "HuggingFaceH4/zephyr-7b-beta", "name": "Zephyr 7B Beta", "size": "medium"}, {"id": "tiiuae/falcon-7b-instruct", "name": "Falcon 7B Instruct", "size": "medium"}, {"id": "EleutherAI/gpt-j-6B", "name": "GPT-J 6B", "size": "medium"},
# Large / chat-capable # Llama 2 chat models (reliable) {"id": "meta-llama/Llama-2-7b-chat-hf", "name": "Llama 2 7B Chat", "size": "large"}, {"id": "meta-llama/Llama-2-13b-chat-hf", "name": "Llama 2 13B Chat", "size": "large"}, {"id": "meta-llama/Llama-2-70b-chat-hf", "name": "Llama 2 70B Chat", "size": "xlarge"}, {"id": "bigscience/bloom-176b", "name": "BLOOM 176B", "size": "xlarge"},
# Other notable models # Stability and other quality models {"id": "stabilityai/stablelm-tuned-alpha-3b", "name": "StableLM 3B", "size": "medium"}, {"id": "meta-llama/Llama-3-8b-Instruct", "name": "Llama 3 8B Instruct", "size": "large"}, {"id": "WizardLM/WizardLM-7B-V1.0", "name": "WizardLM 7B", "size": "medium"},]
app/hf_spaces.py+5-13
backend/app/groq_client.py+3-11
backend/app/hf_spaces.py+11-22