Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -38,14 +38,15 @@ GLOBAL_REGIONS = [
|
|
| 38 |
# HuggingFace Token for all providers
|
| 39 |
HF_TOKEN = os.getenv('HF_TOKEN', '')
|
| 40 |
|
| 41 |
-
# Initialize InferenceClient instances for DeepSeek models
|
| 42 |
inference_clients = []
|
| 43 |
if HF_TOKEN:
|
| 44 |
try:
|
| 45 |
-
# Primary DeepSeek-V3.2-Exp client
|
| 46 |
primary_client = InferenceClient(
|
| 47 |
model="deepseek-ai/DeepSeek-V3.2-Exp",
|
| 48 |
-
token=HF_TOKEN
|
|
|
|
| 49 |
)
|
| 50 |
inference_clients.append({
|
| 51 |
"name": "deepseek-v3.2-exp",
|
|
@@ -53,10 +54,11 @@ if HF_TOKEN:
|
|
| 53 |
"model": "deepseek-ai/DeepSeek-V3.2-Exp"
|
| 54 |
})
|
| 55 |
|
| 56 |
-
# Secondary DeepSeek-V3-Base client
|
| 57 |
secondary_client = InferenceClient(
|
| 58 |
model="deepseek-ai/DeepSeek-V3-Base",
|
| 59 |
-
token=HF_TOKEN
|
|
|
|
| 60 |
)
|
| 61 |
inference_clients.append({
|
| 62 |
"name": "deepseek-v3-base",
|
|
@@ -64,10 +66,11 @@ if HF_TOKEN:
|
|
| 64 |
"model": "deepseek-ai/DeepSeek-V3-Base"
|
| 65 |
})
|
| 66 |
|
| 67 |
-
# Fallback client (same as primary)
|
| 68 |
fallback_client = InferenceClient(
|
| 69 |
model="deepseek-ai/DeepSeek-V3.2-Exp",
|
| 70 |
-
token=HF_TOKEN
|
|
|
|
| 71 |
)
|
| 72 |
inference_clients.append({
|
| 73 |
"name": "deepseek-fallback",
|
|
@@ -586,8 +589,9 @@ def initialize_system():
|
|
| 586 |
"""Initialize AEGIS system with DeepSeek-V3.2-Exp via HuggingFace InferenceClient"""
|
| 587 |
global loading_status
|
| 588 |
|
| 589 |
-
print("π AEGIS BIO LAB 10 CONDUCTOR initializing with DeepSeek-V3.2-Exp via HuggingFace
|
| 590 |
print(f"π€ Model: {MODEL_NAME}")
|
|
|
|
| 591 |
|
| 592 |
if inference_clients:
|
| 593 |
client_list = ', '.join([f"{c['name']} ({c['model']})" for c in inference_clients])
|
|
@@ -599,7 +603,7 @@ def initialize_system():
|
|
| 599 |
print(f"π Global analysis across {len(GLOBAL_REGIONS)} regions")
|
| 600 |
print(f"π Using HuggingFace Token: {'β
Valid' if HF_TOKEN and len(HF_TOKEN) > 10 else 'β Missing'}")
|
| 601 |
|
| 602 |
-
loading_status = f"AEGIS BIO LAB {AEGIS_VERSION} CONDUCTOR ready with DeepSeek-V3.2-Exp via HuggingFace
|
| 603 |
print("β
AEGIS BIO LAB 10 CONDUCTOR ready!")
|
| 604 |
|
| 605 |
if __name__ == '__main__':
|
|
|
|
| 38 |
# HuggingFace Token for all providers
|
| 39 |
HF_TOKEN = os.getenv('HF_TOKEN', '')
|
| 40 |
|
| 41 |
+
# Initialize InferenceClient instances for DeepSeek models using new router endpoint
|
| 42 |
inference_clients = []
|
| 43 |
if HF_TOKEN:
|
| 44 |
try:
|
| 45 |
+
# Primary DeepSeek-V3.2-Exp client with new router endpoint
|
| 46 |
primary_client = InferenceClient(
|
| 47 |
model="deepseek-ai/DeepSeek-V3.2-Exp",
|
| 48 |
+
token=HF_TOKEN,
|
| 49 |
+
base_url="https://router.huggingface.co/v1"
|
| 50 |
)
|
| 51 |
inference_clients.append({
|
| 52 |
"name": "deepseek-v3.2-exp",
|
|
|
|
| 54 |
"model": "deepseek-ai/DeepSeek-V3.2-Exp"
|
| 55 |
})
|
| 56 |
|
| 57 |
+
# Secondary DeepSeek-V3-Base client with new router endpoint
|
| 58 |
secondary_client = InferenceClient(
|
| 59 |
model="deepseek-ai/DeepSeek-V3-Base",
|
| 60 |
+
token=HF_TOKEN,
|
| 61 |
+
base_url="https://router.huggingface.co/v1"
|
| 62 |
)
|
| 63 |
inference_clients.append({
|
| 64 |
"name": "deepseek-v3-base",
|
|
|
|
| 66 |
"model": "deepseek-ai/DeepSeek-V3-Base"
|
| 67 |
})
|
| 68 |
|
| 69 |
+
# Fallback client (same as primary) with new router endpoint
|
| 70 |
fallback_client = InferenceClient(
|
| 71 |
model="deepseek-ai/DeepSeek-V3.2-Exp",
|
| 72 |
+
token=HF_TOKEN,
|
| 73 |
+
base_url="https://router.huggingface.co/v1"
|
| 74 |
)
|
| 75 |
inference_clients.append({
|
| 76 |
"name": "deepseek-fallback",
|
|
|
|
| 589 |
"""Initialize AEGIS system with DeepSeek-V3.2-Exp via HuggingFace InferenceClient"""
|
| 590 |
global loading_status
|
| 591 |
|
| 592 |
+
print("π AEGIS BIO LAB 10 CONDUCTOR initializing with DeepSeek-V3.2-Exp via HuggingFace Router...")
|
| 593 |
print(f"π€ Model: {MODEL_NAME}")
|
| 594 |
+
print(f"π Endpoint: https://router.huggingface.co/v1")
|
| 595 |
|
| 596 |
if inference_clients:
|
| 597 |
client_list = ', '.join([f"{c['name']} ({c['model']})" for c in inference_clients])
|
|
|
|
| 603 |
print(f"π Global analysis across {len(GLOBAL_REGIONS)} regions")
|
| 604 |
print(f"π Using HuggingFace Token: {'β
Valid' if HF_TOKEN and len(HF_TOKEN) > 10 else 'β Missing'}")
|
| 605 |
|
| 606 |
+
loading_status = f"AEGIS BIO LAB {AEGIS_VERSION} CONDUCTOR ready with DeepSeek-V3.2-Exp via HuggingFace Router"
|
| 607 |
print("β
AEGIS BIO LAB 10 CONDUCTOR ready!")
|
| 608 |
|
| 609 |
if __name__ == '__main__':
|