Spaces:
Running
Running
| # Test script for all embedding models | |
| BASE_URL="https://ipepe-nomic-embeddings.hf.space" | |
| TEST_TEXT="Hello world test" | |
| echo "Testing all embedding models..." | |
| echo "=================================" | |
| # Get list of models | |
| MODELS=$(curl -s "${BASE_URL}/models" | grep -o '"[^"]*"' | grep -E "(nomic|BAAI|sentence|Snowflake|granite|Qwen|stella|nvidia|Alibaba|intfloat)" | tr -d '"') | |
| # Test each model | |
| for model in $MODELS; do | |
| echo "Testing: $model" | |
| # Test with 30 second timeout | |
| response=$(timeout 30 curl -X POST "${BASE_URL}/embed" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"text\": \"$TEST_TEXT\", \"model\": \"$model\"}" \ | |
| -w "\nHTTP_STATUS:%{http_code}" \ | |
| -s 2>/dev/null) | |
| if [ $? -eq 124 ]; then | |
| echo " ❌ TIMEOUT (>30s)" | |
| else | |
| status=$(echo "$response" | grep "HTTP_STATUS" | cut -d: -f2) | |
| if [ "$status" = "200" ]; then | |
| # Check if response contains embedding | |
| if echo "$response" | grep -q '"embedding":\['; then | |
| echo " ✅ SUCCESS" | |
| else | |
| echo " ⚠️ PARTIAL - No embedding in response" | |
| fi | |
| else | |
| # Extract error message | |
| error_msg=$(echo "$response" | grep -o '"error":"[^"]*"' | cut -d'"' -f4) | |
| echo " ❌ ERROR ($status): $error_msg" | |
| fi | |
| fi | |
| echo "" | |
| done | |
| echo "Testing complete!" |