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

anaghaj111
/
codebert-base-code-embed-mrl-langchain-langgraph

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

Instructions to use anaghaj111/codebert-base-code-embed-mrl-langchain-langgraph with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use anaghaj111/codebert-base-code-embed-mrl-langchain-langgraph with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("anaghaj111/codebert-base-code-embed-mrl-langchain-langgraph")
    
    sentences = [
        "Explain the __init__ logic",
        "async def test_handler_with_async_execution() -> None:\n    \"\"\"Test handler works correctly with async tool execution.\"\"\"\n\n    @tool\n    def async_add(a: int, b: int) -> int:\n        \"\"\"Async add two numbers.\"\"\"\n        return a + b\n\n    def modifying_handler(\n        request: ToolCallRequest,\n        execute: Callable[[ToolCallRequest], ToolMessage | Command],\n    ) -> ToolMessage | Command:\n        \"\"\"Handler that modifies arguments.\"\"\"\n        # Add 10 to both arguments using override method\n        modified_call = {\n            **request.tool_call,\n            \"args\": {\n                **request.tool_call[\"args\"],\n                \"a\": request.tool_call[\"args\"][\"a\"] + 10,\n                \"b\": request.tool_call[\"args\"][\"b\"] + 10,\n            },\n        }\n        modified_request = request.override(tool_call=modified_call)\n        return execute(modified_request)\n\n    tool_node = ToolNode([async_add], wrap_tool_call=modifying_handler)\n\n    result = await tool_node.ainvoke(\n        {\n            \"messages\": [\n                AIMessage(\n                    \"adding\",\n                    tool_calls=[\n                        {\n                            \"name\": \"async_add\",\n                            \"args\": {\"a\": 1, \"b\": 2},\n                            \"id\": \"call_13\",\n                        }\n                    ],\n                )\n            ]\n        },\n        config=_create_config_with_runtime(),\n    )\n\n    tool_message = result[\"messages\"][-1]\n    assert isinstance(tool_message, ToolMessage)\n    # Original: 1 + 2 = 3, with modifications: 11 + 12 = 23\n    assert tool_message.content == \"23\"",
        "def __init__(self) -> None:\n        self.loads: set[str] = set()\n        self.stores: set[str] = set()",
        "class InternalServerError(APIStatusError):\n    pass"
    ]
    embeddings = model.encode(sentences)
    
    similarities = model.similarity(embeddings, embeddings)
    print(similarities.shape)
    # [4, 4]
  • Notebooks
  • Google Colab
  • Kaggle
codebert-base-code-embed-mrl-langchain-langgraph
504 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
anaghaj111's picture
anaghaj111
Add new SentenceTransformer model
603f647 verified 4 months ago
  • 1_Pooling
    Add new SentenceTransformer model 4 months ago
  • .gitattributes
    1.52 kB
    initial commit 4 months ago
  • README.md
    86.4 kB
    Add new SentenceTransformer model 4 months ago
  • config.json
    648 Bytes
    Add new SentenceTransformer model 4 months ago
  • config_sentence_transformers.json
    277 Bytes
    Add new SentenceTransformer model 4 months ago
  • merges.txt
    456 kB
    Add new SentenceTransformer model 4 months ago
  • model.safetensors
    499 MB
    xet
    Add new SentenceTransformer model 4 months ago
  • modules.json
    229 Bytes
    Add new SentenceTransformer model 4 months ago
  • sentence_bert_config.json
    57 Bytes
    Add new SentenceTransformer model 4 months ago
  • special_tokens_map.json
    958 Bytes
    Add new SentenceTransformer model 4 months ago
  • tokenizer.json
    3.56 MB
    Add new SentenceTransformer model 4 months ago
  • tokenizer_config.json
    1.44 kB
    Add new SentenceTransformer model 4 months ago
  • vocab.json
    798 kB
    Add new SentenceTransformer model 4 months ago