Spaces:
Sleeping
Sleeping
Factor Studios
commited on
Update test_ai_integration_http.py
Browse files- test_ai_integration_http.py +18 -4
test_ai_integration_http.py
CHANGED
|
@@ -243,20 +243,34 @@ def test_ai_integration_http():
|
|
| 243 |
print("Falling back to placeholder model mode...")
|
| 244 |
# Try loading with placeholder model
|
| 245 |
try:
|
|
|
|
| 246 |
placeholder_model = {
|
| 247 |
"model_name": model_id,
|
| 248 |
"model_type": "placeholder",
|
| 249 |
"parameters": 1000000, # Small placeholder
|
| 250 |
-
"architecture":
|
|
|
|
|
|
|
|
|
|
| 251 |
"loaded_at": time.time(),
|
| 252 |
-
#
|
| 253 |
-
"num_sms": 108, #
|
| 254 |
"tensor_cores_per_sm": 4,
|
| 255 |
"cuda_cores_per_sm": 64,
|
| 256 |
"compute_capability": "8.0",
|
| 257 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
}
|
| 259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
success = ai_accelerator_for_loading.load_model(
|
| 261 |
model_id=model_id,
|
| 262 |
model=placeholder_model,
|
|
|
|
| 243 |
print("Falling back to placeholder model mode...")
|
| 244 |
# Try loading with placeholder model
|
| 245 |
try:
|
| 246 |
+
# Match server-side model configuration
|
| 247 |
placeholder_model = {
|
| 248 |
"model_name": model_id,
|
| 249 |
"model_type": "placeholder",
|
| 250 |
"parameters": 1000000, # Small placeholder
|
| 251 |
+
"architecture": {
|
| 252 |
+
"type": "nvidia_ampere",
|
| 253 |
+
"features": ["tensor_cores", "ray_tracing", "dynamic_scheduling"]
|
| 254 |
+
},
|
| 255 |
"loaded_at": time.time(),
|
| 256 |
+
# Server-validated GPU architecture configuration
|
| 257 |
+
"num_sms": 108, # A100 config
|
| 258 |
"tensor_cores_per_sm": 4,
|
| 259 |
"cuda_cores_per_sm": 64,
|
| 260 |
"compute_capability": "8.0",
|
| 261 |
+
"vram_config": {
|
| 262 |
+
"size_gb": 40,
|
| 263 |
+
"bandwidth_gbps": 1555,
|
| 264 |
+
"cache_size_mb": 40,
|
| 265 |
+
"allocation": "dynamic"
|
| 266 |
+
}
|
| 267 |
}
|
| 268 |
|
| 269 |
+
# Validate required fields before loading
|
| 270 |
+
required_fields = ["num_sms", "tensor_cores_per_sm", "cuda_cores_per_sm"]
|
| 271 |
+
if not all(field in placeholder_model for field in required_fields):
|
| 272 |
+
raise ValueError(f"Missing required GPU architecture fields: {[f for f in required_fields if f not in placeholder_model]}")
|
| 273 |
+
|
| 274 |
success = ai_accelerator_for_loading.load_model(
|
| 275 |
model_id=model_id,
|
| 276 |
model=placeholder_model,
|