divakantpandey commited on
Commit
4173047
·
verified ·
1 Parent(s): 136e647

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +70 -1
README.md CHANGED
@@ -281,7 +281,7 @@ When filtering by parameter scale for lightweight, production-ready edge models
281
  | 🏅 **#8** | **`CoIR`** | $\le$ 141M (`2M – 141.3M`) | **`0.5343`** | 👉 [CoIR Leaderboard (Rank #8)](https://mteb-leaderboard.hf.space/benchmark/CoIR?minSize=2&maxSize=141.2537544622754) |
282
  | 🏅 **#9** | **`MTEB(Code, v1)`** | $\le$ 141M (`2M – 141.3M`) | **`0.5475`** | 👉 [MTEB Code Leaderboard (Rank #9)](https://mteb-leaderboard.hf.space/benchmark/MTEB(Code%2C%20v1)?minSize=2&maxSize=141.2537544622754) |
283
 
284
- ---
285
 
286
  ### 🌟 Key Benchmark Highlights *(Sorted by Rank Ascending)*
287
 
@@ -652,6 +652,75 @@ for doc in matched_docs:
652
 
653
  ---
654
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  ## 📜 License & Citation
656
 
657
  This project and its model weights are licensed under the **Creative Commons Attribution-NonCommercial 4.0 International License (CC-BY-NC 4.0)**.
 
281
  | 🏅 **#8** | **`CoIR`** | $\le$ 141M (`2M – 141.3M`) | **`0.5343`** | 👉 [CoIR Leaderboard (Rank #8)](https://mteb-leaderboard.hf.space/benchmark/CoIR?minSize=2&maxSize=141.2537544622754) |
282
  | 🏅 **#9** | **`MTEB(Code, v1)`** | $\le$ 141M (`2M – 141.3M`) | **`0.5475`** | 👉 [MTEB Code Leaderboard (Rank #9)](https://mteb-leaderboard.hf.space/benchmark/MTEB(Code%2C%20v1)?minSize=2&maxSize=141.2537544622754) |
283
 
284
+ ### 🌟 Key Benchmark Highlights
285
 
286
  ### 🌟 Key Benchmark Highlights *(Sorted by Rank Ascending)*
287
 
 
652
 
653
  ---
654
 
655
+ ### Example 7: Local Serving with Ollama
656
+
657
+ Run `code-embed-v2` locally with Ollama (native embed API or OpenAI-compatible endpoint):
658
+
659
+ ```bash
660
+ # 1. Pull & run directly from Hugging Face
661
+ ollama pull hf.co/divakantpandey/code-embed-v2:code-embed-v2-q8_0.gguf
662
+
663
+ # Or if pulled from the Ollama registry:
664
+ # ollama pull divakantpandey/code-embed-v2
665
+
666
+ # 2. Generate embeddings via cURL:
667
+ curl http://localhost:11434/api/embed -d '{
668
+ "model": "divakantpandey/code-embed-v2",
669
+ "input": "def binary_search(arr, target):"
670
+ }'
671
+
672
+ # 3. Query via OpenAI-compatible endpoint (/v1/embeddings):
673
+ curl http://localhost:11434/v1/embeddings \
674
+ -H "Content-Type: application/json" \
675
+ -d '{
676
+ "model": "divakantpandey/code-embed-v2",
677
+ "input": "def binary_search(arr, target):"
678
+ }'
679
+ ```
680
+
681
+ ---
682
+
683
+ ### Example 8: High-Performance C++ Inference with `llama.cpp`
684
+
685
+ Use the Q8_0 GGUF quantized weights for standalone C++ embedding generation or an OpenAI-compatible microservice:
686
+
687
+ ```bash
688
+ # Download GGUF weights (135MB)
689
+ wget https://huggingface.co/divakantpandey/code-embed-v2/resolve/main/code-embed-v2-q8_0.gguf
690
+
691
+ # Start an OpenAI-compatible embedding server:
692
+ llama-server \
693
+ -m code-embed-v2-q8_0.gguf \
694
+ --embedding \
695
+ -c 8192 \
696
+ --port 8080
697
+
698
+ # Query with standard OpenAI Python SDK:
699
+ from openai import OpenAI
700
+
701
+ client = OpenAI(base_url="http://localhost:8080/v1", api_key="not-needed")
702
+ response = client.embeddings.create(
703
+ model="code-embed-v2",
704
+ input="def find_max(nums):"
705
+ )
706
+ print("Vector length:", len(response.data[0].embedding))
707
+ ```
708
+
709
+ ---
710
+
711
+ ### Example 9: Production Serving with Text Embeddings Inference (TEI)
712
+
713
+ For enterprise throughput with dynamic batching and token truncation:
714
+
715
+ ```bash
716
+ # Deploy with Hugging Face TEI (Docker)
717
+ docker run --gpus all -p 8080:80 \
718
+ ghcr.io/huggingface/text-embeddings-inference:1.5 \
719
+ --model-id divakantpandey/code-embed-v2
720
+ ```
721
+
722
+ ---
723
+
724
  ## 📜 License & Citation
725
 
726
  This project and its model weights are licensed under the **Creative Commons Attribution-NonCommercial 4.0 International License (CC-BY-NC 4.0)**.