Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

Alibaba-NLP
/
gte-Qwen2-1.5B-instruct

Sentence Similarity
sentence-transformers
Safetensors
Transformers
qwen2
text-generation
mteb
Qwen2
custom_code
Eval Results (legacy)
text-embeddings-inference
Model card Files Files and versions
xet
Community
38

Instructions to use Alibaba-NLP/gte-Qwen2-1.5B-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use Alibaba-NLP/gte-Qwen2-1.5B-instruct with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("Alibaba-NLP/gte-Qwen2-1.5B-instruct", trust_remote_code=True)
    
    sentences = [
        "That is a happy person",
        "That is a happy dog",
        "That is a very happy person",
        "Today is a sunny day"
    ]
    embeddings = model.encode(sentences)
    
    similarities = model.similarity(embeddings, embeddings)
    print(similarities.shape)
    # [4, 4]
  • Transformers

    How to use Alibaba-NLP/gte-Qwen2-1.5B-instruct with Transformers:

    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("Alibaba-NLP/gte-Qwen2-1.5B-instruct", trust_remote_code=True)
    model = AutoModelForCausalLM.from_pretrained("Alibaba-NLP/gte-Qwen2-1.5B-instruct", trust_remote_code=True)
  • Notebooks
  • Google Colab
  • Kaggle
gte-Qwen2-1.5B-instruct
7.12 GB
Ctrl+K
Ctrl+K
  • 8 contributors
History: 2 commits
zhangyanzhao.zyz
init model
a3fa269 about 2 years ago
  • scripts
    init model about 2 years ago
  • .gitattributes
    1.52 kB
    initial commit about 2 years ago
  • README.md
    144 kB
    init model about 2 years ago
  • added_tokens.json
    80 Bytes
    init model about 2 years ago
  • config.json
    879 Bytes
    init model about 2 years ago
  • config_sentence_transformers.json
    284 Bytes
    init model about 2 years ago
  • generation_config.json
    117 Bytes
    init model about 2 years ago
  • merges.txt
    1.67 MB
    init model about 2 years ago
  • model-00001-of-00002.safetensors
    4.99 GB
    xet
    init model about 2 years ago
  • model-00002-of-00002.safetensors
    2.11 GB
    xet
    init model about 2 years ago
  • model.safetensors.index.json
    27.8 kB
    init model about 2 years ago
  • modeling_qwen.py
    65.2 kB
    init model about 2 years ago
  • modules.json
    349 Bytes
    init model about 2 years ago
  • sentence_bert_config.json
    55 Bytes
    init model about 2 years ago
  • special_tokens_map.json
    370 Bytes
    init model about 2 years ago
  • tokenization_qwen.py
    10.8 kB
    init model about 2 years ago
  • tokenizer.json
    7.03 MB
    init model about 2 years ago
  • tokenizer_config.json
    1.31 kB
    init model about 2 years ago
  • vocab.json
    2.78 MB
    init model about 2 years ago