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

shubharuidas
/
codebert-embed-base-dense-retriever

Sentence Similarity
sentence-transformers
Safetensors
English
roberta
feature-extraction
dense
Generated from Trainer
dataset_size:900
loss:MatryoshkaLoss
loss:MultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Model card Files Files and versions
xet
Community

Instructions to use shubharuidas/codebert-embed-base-dense-retriever with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use shubharuidas/codebert-embed-base-dense-retriever with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("shubharuidas/codebert-embed-base-dense-retriever")
    
    sentences = [
        "Best practices for _invocation_params",
        "def after_model(self, state: StateT, runtime: Runtime[ContextT]) -> dict[str, Any] | None:\n        \"\"\"Logic to run after the model is called.\n\n        Args:\n            state: The current agent state.\n            runtime: The runtime context.\n\n        Returns:\n            Agent state updates to apply after model call.\n        \"\"\"",
        "def _get_trace_callbacks(\n    project_name: str | None = None,\n    example_id: str | UUID | None = None,\n    callback_manager: CallbackManager | AsyncCallbackManager | None = None,\n) -> Callbacks:\n    if _tracing_v2_is_enabled():\n        project_name_ = project_name or _get_tracer_project()\n        tracer = tracing_v2_callback_var.get() or LangChainTracer(\n            project_name=project_name_,\n            example_id=example_id,\n        )\n        if callback_manager is None:\n            cb = cast(\"Callbacks\", [tracer])\n        else:\n            if not any(\n                isinstance(handler, LangChainTracer)\n                for handler in callback_manager.handlers\n            ):\n                callback_manager.add_handler(tracer)\n                # If it already has a LangChainTracer, we don't need to add another one.\n                # this would likely mess up the trace hierarchy.\n            cb = callback_manager\n    else:\n        cb = None\n    return cb",
        "def _invocation_params(self) -> dict[str, Any]:\n        params: dict = {\"model\": self.model, **self.model_kwargs}\n        if self.dimensions is not None:\n            params[\"dimensions\"] = self.dimensions\n        return params"
    ]
    embeddings = model.encode(sentences)
    
    similarities = model.similarity(embeddings, embeddings)
    print(similarities.shape)
    # [4, 4]
  • Notebooks
  • Google Colab
  • Kaggle
codebert-embed-base-dense-retriever
503 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 2 commits
Shubha Ruidas
Add new SentenceTransformer model
9594580 verified 5 months ago
  • 1_Pooling
    Add new SentenceTransformer model 5 months ago
  • .gitattributes
    1.52 kB
    initial commit 5 months ago
  • README.md
    41 kB
    Add new SentenceTransformer model 5 months ago
  • config.json
    648 Bytes
    Add new SentenceTransformer model 5 months ago
  • config_sentence_transformers.json
    283 Bytes
    Add new SentenceTransformer model 5 months ago
  • merges.txt
    456 kB
    Add new SentenceTransformer model 5 months ago
  • model.safetensors
    499 MB
    xet
    Add new SentenceTransformer model 5 months ago
  • modules.json
    229 Bytes
    Add new SentenceTransformer model 5 months ago
  • sentence_bert_config.json
    57 Bytes
    Add new SentenceTransformer model 5 months ago
  • special_tokens_map.json
    958 Bytes
    Add new SentenceTransformer model 5 months ago
  • tokenizer.json
    3.56 MB
    Add new SentenceTransformer model 5 months ago
  • tokenizer_config.json
    1.25 kB
    Add new SentenceTransformer model 5 months ago
  • vocab.json
    798 kB
    Add new SentenceTransformer model 5 months ago