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 lines789101112131415161718192021222324252627282930316 unmodified linesHF_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)ALL_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": "NousResearch/Nous-Hermes-2-7b", "name": "Nous Hermes 7B", "size": "medium"},{"id": "HuggingFaceH4/zephyr-7b", "name": "Zephyr 7B", "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"},]6 unmodified lines78910111213141516171819202122236 unmodified linesHF_API_TOKEN = os.environ.get("HUGGINGFACE_API_TOKEN") or os.environ.get("HF_API_TOKEN")# Unified HF-only list with models verified to work on HF Inference APIALL_MODELS = [{"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-beta", "name": "Zephyr 7B Beta", "size": "medium"},{"id": "tiiuae/falcon-7b-instruct", "name": "Falcon 7B Instruct", "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": "stabilityai/stablelm-tuned-alpha-3b", "name": "StableLM 3B", "size": "medium"},{"id": "WizardLM/WizardLM-7B-V1.0", "name": "WizardLM 7B", "size": "medium"},]
17 unmodified lines1819202122232425262728293031323334353637383940414217 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)HF_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","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",]17 unmodified lines181920212223242526272829303132333417 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 verified to work with HF Inference APIHF_MODELS = ["mistralai/Mistral-7B-Instruct-v0.2","mistralai/Mistral-7B-Instruct-v0.1","NousResearch/Nous-Hermes-2-7b","HuggingFaceH4/zephyr-7b-beta","tiiuae/falcon-7b-instruct","meta-llama/Llama-2-7b-chat-hf","meta-llama/Llama-2-13b-chat-hf","stabilityai/stablelm-tuned-alpha-3b","WizardLM/WizardLM-7B-V1.0",]
6 unmodified lines789101112131415161718192021222324252627282930313233343536373839406 unmodified linesHF_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.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"},{"id": "NousResearch/Nous-Hermes-2-7b", "name": "Nous Hermes 7B", "size": "medium"},{"id": "HuggingFaceH4/zephyr-7b", "name": "Zephyr 7B", "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{"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{"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"},]6 unmodified lines78910111213141516171819202122232425262728296 unmodified linesHF_API_TOKEN = os.environ.get("HF_API_TOKEN") or os.environ.get("HUGGINGFACE_API_TOKEN")# Curated HF model list with models verified to work on HF Inference API.# These models are selected for compatibility, availability, and reliability.ALL_MODELS = [# 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-beta", "name": "Zephyr 7B Beta", "size": "medium"},{"id": "tiiuae/falcon-7b-instruct", "name": "Falcon 7B Instruct", "size": "medium"},# 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"},# Stability and other quality models{"id": "stabilityai/stablelm-tuned-alpha-3b", "name": "StableLM 3B", "size": "medium"},{"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