Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
add huggingface tab
Browse files
app.py
CHANGED
@@ -680,6 +680,67 @@ with gr.Blocks(fill_height=True) as demo:
|
|
680 |
- **Microsoft**: Phi-3 series
|
681 |
- And other providers including Qwen, Databricks, DeepSeek, etc.
|
682 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
683 |
|
684 |
demo.launch(ssr_mode=False)
|
685 |
|
|
|
680 |
- **Microsoft**: Phi-3 series
|
681 |
- And other providers including Qwen, Databricks, DeepSeek, etc.
|
682 |
""")
|
683 |
+
with gr.Tab("Hugging Face"):
|
684 |
+
with gr.Row():
|
685 |
+
hf_model = gr.Dropdown(
|
686 |
+
choices=[
|
687 |
+
# Latest Large Models
|
688 |
+
'Qwen/Qwen2.5-Coder-32B-Instruct',
|
689 |
+
'Qwen/Qwen2.5-72B-Instruct',
|
690 |
+
'meta-llama/Llama-3.1-70B-Instruct',
|
691 |
+
'mistralai/Mixtral-8x7B-Instruct-v0.1',
|
692 |
+
# Mid-size Models
|
693 |
+
'meta-llama/Llama-3.1-8B-Instruct',
|
694 |
+
'google/gemma-2-9b-it',
|
695 |
+
'mistralai/Mistral-7B-v0.1',
|
696 |
+
'meta-llama/Llama-2-7b-chat-hf',
|
697 |
+
# Smaller Models
|
698 |
+
'meta-llama/Llama-3.2-3B-Instruct',
|
699 |
+
'meta-llama/Llama-3.2-1B-Instruct',
|
700 |
+
'Qwen/Qwen2.5-1.5B-Instruct',
|
701 |
+
'microsoft/Phi-3.5-mini-instruct',
|
702 |
+
'HuggingFaceTB/SmolLM2-1.7B-Instruct',
|
703 |
+
'google/gemma-2-2b-it',
|
704 |
+
# Base Models
|
705 |
+
'meta-llama/Llama-3.2-3B',
|
706 |
+
'meta-llama/Llama-3.2-1B',
|
707 |
+
'openai-community/gpt2'
|
708 |
+
],
|
709 |
+
value='HuggingFaceTB/SmolLM2-1.7B-Instruct', # Default to a powerful model
|
710 |
+
label="Select Hugging Face Model",
|
711 |
+
interactive=True
|
712 |
+
)
|
713 |
+
|
714 |
+
hf_interface = gr.load(
|
715 |
+
name=hf_model.value,
|
716 |
+
src="models", # Use direct model loading from HF
|
717 |
+
fill_height=True
|
718 |
+
)
|
719 |
+
|
720 |
+
def update_hf_model(new_model):
|
721 |
+
return gr.load(
|
722 |
+
name=new_model,
|
723 |
+
src="models",
|
724 |
+
fill_height=True
|
725 |
+
)
|
726 |
+
|
727 |
+
hf_model.change(
|
728 |
+
fn=update_hf_model,
|
729 |
+
inputs=[hf_model],
|
730 |
+
outputs=[hf_interface]
|
731 |
+
)
|
732 |
+
|
733 |
+
gr.Markdown("""
|
734 |
+
**Note:** These models are loaded directly from Hugging Face Hub. Some models may require authentication.
|
735 |
+
|
736 |
+
Models are organized by size:
|
737 |
+
- **Large Models**: 32B-72B parameters
|
738 |
+
- **Mid-size Models**: 7B-9B parameters
|
739 |
+
- **Smaller Models**: 1B-3B parameters
|
740 |
+
- **Base Models**: Original architectures
|
741 |
+
|
742 |
+
Visit [Hugging Face](https://huggingface.co/) to learn more about available models.
|
743 |
+
""")
|
744 |
|
745 |
demo.launch(ssr_mode=False)
|
746 |
|