Patryk Ptasiński commited on
Commit
0b5e578
·
1 Parent(s): 3d96b43

Fix nvidia/NV-Embed-v2 to use trust_remote_code=True

Browse files
Files changed (2) hide show
  1. CLAUDE.md +5 -1
  2. test_models.sh +45 -0
CLAUDE.md CHANGED
@@ -71,4 +71,8 @@ result = client.predict("text to embed", "model-name", api_name="/predict")
71
  - Deployed on Hugging Face Spaces at https://huggingface.co/spaces/ipepe/nomic-embeddings
72
  - Runs on port 7860
73
  - Uses Gradio 4.36.1 (newer versions available)
74
- - PyTorch configured for CPU-only via `--extra-index-url` in requirements.txt
 
 
 
 
 
71
  - Deployed on Hugging Face Spaces at https://huggingface.co/spaces/ipepe/nomic-embeddings
72
  - Runs on port 7860
73
  - Uses Gradio 4.36.1 (newer versions available)
74
+ - PyTorch configured for CPU-only via `--extra-index-url` in requirements.txt
75
+
76
+ ## Development Constraints
77
+
78
+ - There is no python installed locally, everything needs to be deployed to hugging face first
test_models.sh ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Test script for all embedding models
4
+ BASE_URL="https://ipepe-nomic-embeddings.hf.space"
5
+ TEST_TEXT="Hello world test"
6
+
7
+ echo "Testing all embedding models..."
8
+ echo "================================="
9
+
10
+ # Get list of models
11
+ MODELS=$(curl -s "${BASE_URL}/models" | grep -o '"[^"]*"' | grep -E "(nomic|BAAI|sentence|Snowflake|granite|Qwen|stella|nvidia|Alibaba|intfloat)" | tr -d '"')
12
+
13
+ # Test each model
14
+ for model in $MODELS; do
15
+ echo "Testing: $model"
16
+
17
+ # Test with 30 second timeout
18
+ response=$(timeout 30 curl -X POST "${BASE_URL}/embed" \
19
+ -H "Content-Type: application/json" \
20
+ -d "{\"text\": \"$TEST_TEXT\", \"model\": \"$model\"}" \
21
+ -w "\nHTTP_STATUS:%{http_code}" \
22
+ -s 2>/dev/null)
23
+
24
+ if [ $? -eq 124 ]; then
25
+ echo " ❌ TIMEOUT (>30s)"
26
+ else
27
+ status=$(echo "$response" | grep "HTTP_STATUS" | cut -d: -f2)
28
+
29
+ if [ "$status" = "200" ]; then
30
+ # Check if response contains embedding
31
+ if echo "$response" | grep -q '"embedding":\['; then
32
+ echo " ✅ SUCCESS"
33
+ else
34
+ echo " ⚠️ PARTIAL - No embedding in response"
35
+ fi
36
+ else
37
+ # Extract error message
38
+ error_msg=$(echo "$response" | grep -o '"error":"[^"]*"' | cut -d'"' -f4)
39
+ echo " ❌ ERROR ($status): $error_msg"
40
+ fi
41
+ fi
42
+ echo ""
43
+ done
44
+
45
+ echo "Testing complete!"