text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
# coding=utf-8 # Copyright 2020 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/utils/check_copies.py/0
{ "file_path": "transformers/utils/check_copies.py", "repo_id": "transformers", "token_count": 20516 }
764
[tool.black] # Only used by `hf-doc-builder´. line-length = 119 target-version = ['py38'] [tool.ruff] target-version = "py38" line-length = 119 [tool.ruff.lint] extend-select = [ "C", # Complexity "E", # PEP8 errors "F", # PEP8 formatting "I", # Import sorting "UP", # Pyupgrade upgrades "W", #...
peft/pyproject.toml/0
{ "file_path": "peft/pyproject.toml", "repo_id": "peft", "token_count": 403 }
345
# Copyright 2022 Meta Platforms authors and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
transformers/tests/models/flava/test_processor_flava.py/0
{ "file_path": "transformers/tests/models/flava/test_processor_flava.py", "repo_id": "transformers", "token_count": 4041 }
815
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-joplin/llama_index/readers/joplin/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-joplin/llama_index/readers/joplin/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,387
python_sources()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-milvus/llama_index/vector_stores/milvus/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-milvus/llama_index/vector_stores/milvus/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,527
from __future__ import annotations import json import queue import random import time from functools import partial from typing import Any, Dict, Iterator, List, Optional, Sequence, Union import google.protobuf.json_format import numpy as np import tritonclient.grpc as grpcclient from langchain_core.callbacks import ...
langchain/libs/partners/nvidia-trt/langchain_nvidia_trt/llms.py/0
{ "file_path": "langchain/libs/partners/nvidia-trt/langchain_nvidia_trt/llms.py", "repo_id": "langchain", "token_count": 6480 }
632
[flake8] exclude = venv .venv __pycache__ notebooks # Recommend matching the black line length (default 88), # rather than using the flake8 default of 79: max-line-length = 88 extend-ignore = # See https://github.com/PyCQA/pycodestyle/issues/373 E203,
langchain/libs/langchain/.flake8/0
{ "file_path": "langchain/libs/langchain/.flake8", "repo_id": "langchain", "token_count": 105 }
454
## Privacy > Last updated: October 4, 2023 Users of HuggingChat are authenticated through their HF user account. By default, your conversations may be shared with the respective models' authors to improve their training data and model over time. Model authors are the custodians of the data collected by their model, ...
chat-ui/PRIVACY.md/0
{ "file_path": "chat-ui/PRIVACY.md", "repo_id": "chat-ui", "token_count": 762 }
93
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: milvus Source: https://github.com/milvus-io/milvus Files: * Copyright: 2019-2022, Zilliz <yunmei.li@zilliz.com> License: Apache-2.0 Files: debian/* Copyright: 2022 Zilliz <yunmei.li@zilliz.com> License: GPL-2+ License: GPL-2+ ...
milvus/build/deb/debian/copyright/0
{ "file_path": "milvus/build/deb/debian/copyright", "repo_id": "milvus", "token_count": 397 }
1,609
import os from langchain_community.embeddings import BedrockEmbeddings from langchain_community.llms.bedrock import Bedrock from langchain_community.vectorstores import FAISS from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain_core.pydantic_v1 ...
langchain/templates/rag-aws-bedrock/rag_aws_bedrock/chain.py/0
{ "file_path": "langchain/templates/rag-aws-bedrock/rag_aws_bedrock/chain.py", "repo_id": "langchain", "token_count": 508 }
650
/* eslint-disable no-process-env */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { test, expect } from "@jest/globals"; import { Bedrock } from "../bedrock/index.js"; test("Test Bedrock LLM: AI21", async () => { const region = process.env.BEDROCK_AWS_REGION!; const model = "ai21.j2-grande-...
langchainjs/libs/langchain-community/src/llms/tests/bedrock.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/llms/tests/bedrock.int.test.ts", "repo_id": "langchainjs", "token_count": 2052 }
973
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-presidio/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-presidio/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,353
from typing import Optional from llama_index.legacy.storage.docstore.keyval_docstore import KVDocumentStore from llama_index.legacy.storage.docstore.types import DEFAULT_BATCH_SIZE from llama_index.legacy.storage.kvstore.firestore_kvstore import FirestoreKVStore class FirestoreDocumentStore(KVDocumentStore): """...
llama_index/llama-index-legacy/llama_index/legacy/storage/docstore/firestore_docstore.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/docstore/firestore_docstore.py", "repo_id": "llama_index", "token_count": 548 }
1,774
from langchain_community.utilities.redis import ( TokenEscaper, check_redis_module_exist, get_client, ) __all__ = [ "TokenEscaper", "check_redis_module_exist", "get_client", ]
langchain/libs/langchain/langchain/utilities/redis.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/redis.py", "repo_id": "langchain", "token_count": 86 }
577
# get build time MACRO(get_current_time CURRENT_TIME) execute_process(COMMAND "date" "+%Y-%m-%d %H:%M.%S" OUTPUT_VARIABLE ${CURRENT_TIME}) string(REGEX REPLACE "\n" "" ${CURRENT_TIME} ${${CURRENT_TIME}}) ENDMACRO(get_current_time) # get build type MACRO(get_build_type) cmake_parse_arguments(BUILD_TYPE "" "...
milvus/internal/core/cmake/Utils.cmake/0
{ "file_path": "milvus/internal/core/cmake/Utils.cmake", "repo_id": "milvus", "token_count": 1679 }
1,916
from __future__ import annotations from enum import Enum from typing import TYPE_CHECKING, Any, Dict, List, Optional from langchain_core.callbacks import ( AsyncCallbackManagerForRetrieverRun, CallbackManagerForRetrieverRun, ) from langchain_core.documents import Document from langchain_core.pydantic_v1 impor...
langchain/libs/community/langchain_community/retrievers/zep.py/0
{ "file_path": "langchain/libs/community/langchain_community/retrievers/zep.py", "repo_id": "langchain", "token_count": 2521 }
299
[build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] [tool.codespell] check-filenames = true check-hidden = true skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb" [tool.llamahub] classes = ["DocstringWalker"] contains_example = false import_path = "llama_index.readers.docstring_w...
llama_index/llama-index-integrations/readers/llama-index-readers-docstring-walker/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-docstring-walker/pyproject.toml", "repo_id": "llama_index", "token_count": 669 }
1,307
from llama_index.core.embeddings.mock_embed_model import MockEmbedding from llama_index.core.embeddings.utils import resolve_embed_model from pytest import MonkeyPatch def test_resolve_embed_model(monkeypatch: MonkeyPatch) -> None: # Test None embed_model = resolve_embed_model(None) assert isinstance(embe...
llama_index/llama-index-core/tests/embeddings/test_utils.py/0
{ "file_path": "llama_index/llama-index-core/tests/embeddings/test_utils.py", "repo_id": "llama_index", "token_count": 112 }
1,154
import { ChatOllama } from "@langchain/community/chat_models/ollama"; import { HumanMessage } from "@langchain/core/messages"; import * as fs from "node:fs/promises"; const imageData = await fs.readFile("./hotdog.jpg"); const chat = new ChatOllama({ model: "llava", baseUrl: "http://127.0.0.1:11434", }); const res ...
langchainjs/examples/src/models/chat/integration_ollama_multimodal.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/integration_ollama_multimodal.ts", "repo_id": "langchainjs", "token_count": 339 }
824
from typing import Any, Dict, List, Optional, Union import responses from langchain_core.documents import Document from langchain_community.utilities.you import YouSearchAPIWrapper TEST_ENDPOINT = "https://api.ydc-index.io" # Mock you.com response for testing MOCK_RESPONSE_RAW: Dict[str, List[Dict[str, Union[str, L...
langchain/libs/community/tests/unit_tests/utilities/test_you.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/utilities/test_you.py", "repo_id": "langchain", "token_count": 2592 }
383
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/pkg/util/paramtable/service_param_test.go/0
{ "file_path": "milvus/pkg/util/paramtable/service_param_test.go", "repo_id": "milvus", "token_count": 2555 }
1,947
"""LlamaIndex toolkit.""" from typing import List from llama_index.legacy.bridge.langchain import BaseTool, BaseToolkit from llama_index.legacy.bridge.pydantic import Field from llama_index.legacy.langchain_helpers.agents.tools import ( IndexToolConfig, LlamaIndexTool, ) class LlamaToolkit(BaseToolkit): ...
llama_index/llama-index-legacy/llama_index/legacy/langchain_helpers/agents/toolkits.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/langchain_helpers/agents/toolkits.py", "repo_id": "llama_index", "token_count": 316 }
1,574
from abc import ABC, abstractmethod from typing import Callable, List, Optional from langchain_experimental.data_anonymizer.deanonymizer_mapping import MappingDataType from langchain_experimental.data_anonymizer.deanonymizer_matching_strategies import ( exact_matching_strategy, ) DEFAULT_DEANONYMIZER_MATCHING_STR...
langchain/libs/experimental/langchain_experimental/data_anonymizer/base.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/data_anonymizer/base.py", "repo_id": "langchain", "token_count": 716 }
429
# Supabase Self Query Retriever This example shows how to use a self query retriever with a [Supabase](https://supabase.com) vector store. If you haven't already set up Supabase, please [follow the instructions here](/docs/integrations/vectorstores/supabase). ## Usage import IntegrationInstallTooltip from "@mdx_com...
langchainjs/docs/core_docs/docs/modules/data_connection/retrievers/self_query/supabase-self-query.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/retrievers/self_query/supabase-self-query.mdx", "repo_id": "langchainjs", "token_count": 478 }
811
# README ## Overview Milvus 2.2.3 supports rolling update. This script helps you to perform a rolling update with zero downtime. > Note: > 1. Milvus version must be after 2.2.0. > 2. This script only applies to update Milvus installed with Helm and does not apply to Milvus installed with Milvus Operator. > 3. Thi...
milvus/deployments/upgrade/README.md/0
{ "file_path": "milvus/deployments/upgrade/README.md", "repo_id": "milvus", "token_count": 970 }
1,640
<!--- Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
transformers/examples/legacy/seq2seq/README.md/0
{ "file_path": "transformers/examples/legacy/seq2seq/README.md", "repo_id": "transformers", "token_count": 5084 }
523
"""Test the APIOperation class.""" import json import os from pathlib import Path from typing import Iterable, List, Tuple import pytest # Keep at top of file to ensure that pydantic test can be skipped before # pydantic v1 related imports are attempted by openapi_pydantic. from langchain_core.pydantic_v1 import _PYD...
langchain/libs/community/tests/unit_tests/tools/openapi/test_api_models.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/tools/openapi/test_api_models.py", "repo_id": "langchain", "token_count": 3083 }
386
# @langchain/google-genai This package contains the LangChain.js integrations for Gemini through their generative-ai SDK. ## Installation ```bash npm2yarn npm install @langchain/google-genai ``` This package, along with the main LangChain package, depends on [`@langchain/core`](https://npmjs.com/package/@langchain/...
langchainjs/libs/langchain-google-genai/README.md/0
{ "file_path": "langchainjs/libs/langchain-google-genai/README.md", "repo_id": "langchainjs", "token_count": 1326 }
1,035
"""Official evaluation script for SQuAD version 2.0. In addition to basic functionality, we also compute additional statistics and plot precision-recall curves if an additional na_prob.json file is provided. This file is expected to map question ID's to the model's predicted probability that a question is unanswerable...
datasets/metrics/squad_v2/evaluate.py/0
{ "file_path": "datasets/metrics/squad_v2/evaluate.py", "repo_id": "datasets", "token_count": 5443 }
145
# coding=utf-8 # Copyright 2024 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/siglip/processing_siglip.py/0
{ "file_path": "transformers/src/transformers/models/siglip/processing_siglip.py", "repo_id": "transformers", "token_count": 2823 }
678
search_performance: collections: - server: db_config.primary_path: /test/milvus/db_data_gpu/jaccard_50m_128_512_jaccard_ivf cache_config.cpu_cache_capacity: 32 engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: tr...
milvus/tests/benchmark/milvus_benchmark/suites/gpu_search_performance_jaccard50m.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/gpu_search_performance_jaccard50m.yaml", "repo_id": "milvus", "token_count": 375 }
2,096
import { z } from "zod"; import { expect, test } from "@jest/globals"; import { Document } from "@langchain/core/documents"; import { ChatOpenAI } from "@langchain/openai"; import { PromptTemplate } from "@langchain/core/prompts"; import { createMetadataTaggerFromZod } from "../openai_functions.js"; const taggingChai...
langchainjs/langchain/src/document_transformers/tests/openai_functions.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/document_transformers/tests/openai_functions.int.test.ts", "repo_id": "langchainjs", "token_count": 540 }
915
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 // protoc v4.23.4 // source: chromadb/proto/coordinator.proto package coordinatorpb import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptyp...
chroma/go/coordinator/internal/proto/coordinatorpb/coordinator.pb.go/0
{ "file_path": "chroma/go/coordinator/internal/proto/coordinatorpb/coordinator.pb.go", "repo_id": "chroma", "token_count": 34067 }
53
from llama_index.embeddings.together.base import TogetherEmbedding __all__ = ["TogetherEmbedding"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-together/llama_index/embeddings/together/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-together/llama_index/embeddings/together/__init__.py", "repo_id": "llama_index", "token_count": 31 }
1,198
"""Wrapper around Google VertexAI chat-based models.""" from __future__ import annotations import base64 import logging import re from dataclasses import dataclass, field from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Union, cast from urllib.parse import urlparse import requests from langchain...
langchain/libs/community/langchain_community/chat_models/vertexai.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_models/vertexai.py", "repo_id": "langchain", "token_count": 6300 }
229
"""Test WatsonxLLM API wrapper.""" from langchain_community.llms import WatsonxLLM def test_watsonxllm_call() -> None: watsonxllm = WatsonxLLM( model_id="google/flan-ul2", url="https://us-south.ml.cloud.ibm.com", apikey="***", project_id="***", ) response = watsonxllm("Wha...
langchain/libs/community/tests/integration_tests/llms/test_watsonxllm.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_watsonxllm.py", "repo_id": "langchain", "token_count": 166 }
368
python_sources()
llama_index/experimental/classifier/BUILD/0
{ "file_path": "llama_index/experimental/classifier/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,168
import wandb import numpy as np import torch, torchvision import torch.nn.functional as F from PIL import Image from tqdm.auto import tqdm from fastcore.script import call_parse from torchvision import transforms from diffusers import DDPMPipeline from diffusers import DDIMScheduler from datasets import load_dataset fr...
diffusion-models-class/units/fr/unit2/finetune_model.py/0
{ "file_path": "diffusion-models-class/units/fr/unit2/finetune_model.py", "repo_id": "diffusion-models-class", "token_count": 2153 }
307
python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/retrievers/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/retrievers/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,678
"""Tool for the Bing search API.""" from typing import Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.tools import BaseTool from langchain_community.utilities.bing_search import BingSearchAPIWrapper class BingSearchRun(BaseTool): """Tool that queries the Bing search...
langchain/libs/community/langchain_community/tools/bing_search/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/bing_search/tool.py", "repo_id": "langchain", "token_count": 527 }
297
from __future__ import annotations import logging import math import warnings from abc import ABC, abstractmethod from typing import ( TYPE_CHECKING, Any, Callable, ClassVar, Collection, Dict, Iterable, List, Optional, Tuple, Type, TypeVar, ) from langchain_core.embeddi...
langchain/libs/core/langchain_core/vectorstores.py/0
{ "file_path": "langchain/libs/core/langchain_core/vectorstores.py", "repo_id": "langchain", "token_count": 11066 }
427
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/sam/test_modeling_sam.py/0
{ "file_path": "transformers/tests/models/sam/test_modeling_sam.py", "repo_id": "transformers", "token_count": 13033 }
748
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-opendal/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-opendal/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,396
 backend-test:J  xytest"Relu SingleReluZ x   b y   B
candle/test.onnx/0
{ "file_path": "candle/test.onnx", "repo_id": "candle", "token_count": 76 }
79
from chromadb.config import Component, System, Settings from overrides import overrides from threading import local import random data = local() # use thread local just in case tests ever run in parallel def reset() -> None: global data data.starts = [] data.stops = [] data.inits = [] class Compon...
chroma/chromadb/test/test_config.py/0
{ "file_path": "chroma/chromadb/test/test_config.py", "repo_id": "chroma", "token_count": 1656 }
29
from langchain_community.embeddings.mlflow import MlflowEmbeddings __all__ = ["MlflowEmbeddings"]
langchain/libs/langchain/langchain/embeddings/mlflow.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/mlflow.py", "repo_id": "langchain", "token_count": 35 }
547
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/hnswlib", }); export * from "@langchain/community/vectorstores/hnswlib";
langchainjs/langchain/src/vectorstores/hnswlib.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/hnswlib.ts", "repo_id": "langchainjs", "token_count": 74 }
964
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/pipelines/kandinsky/pipeline_kandinsky.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/kandinsky/pipeline_kandinsky.py", "repo_id": "diffusers", "token_count": 7949 }
243
import threading import pytest import os import time import json from time import sleep from pymilvus import connections from chaos.checker import (CollectionCreateChecker, InsertChecker, FlushChecker, SearchChecker, QueryChecker, IndexCreateChecker, DeleteChecker, Op) from common.cus_resour...
milvus/tests/python_client/chaos/test_chaos.py/0
{ "file_path": "milvus/tests/python_client/chaos/test_chaos.py", "repo_id": "milvus", "token_count": 4955 }
1,963
package connection import ( "context" "testing" "time" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) func Test_withDuration(t *testing.T) { s := &connectionManager{} s.apply(withDuration(defaultConnCheckDuration)) assert.Equal(t, defaultConnCheckDuration, s.du...
milvus/internal/proxy/connection/manager_test.go/0
{ "file_path": "milvus/internal/proxy/connection/manager_test.go", "repo_id": "milvus", "token_count": 663 }
1,736
# coding=utf-8 # Copyright 2020 The Microsoft Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
transformers/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py/0
{ "file_path": "transformers/src/transformers/models/xlm_prophetnet/configuration_xlm_prophetnet.py", "repo_id": "transformers", "token_count": 3551 }
720
import time import logging from locust import User, events from milvus_benchmark.client import MilvusClient logger = logging.getLogger("milvus_benchmark.runners.locust_task") class MilvusTask(object): def __init__(self, *args, **kwargs): self.request_type = "grpc" connection_type = kwargs.get("co...
milvus/tests/benchmark/milvus_benchmark/runners/locust_task.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/runners/locust_task.py", "repo_id": "milvus", "token_count": 688 }
2,136
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/seamless_m4t/test_modeling_seamless_m4t.py/0
{ "file_path": "transformers/tests/models/seamless_m4t/test_modeling_seamless_m4t.py", "repo_id": "transformers", "token_count": 21929 }
810
""" **Agent** is a class that uses an LLM to choose a sequence of actions to take. In Chains, a sequence of actions is hardcoded. In Agents, a language model is used as a reasoning engine to determine which actions to take and in which order. Agents select and use **Tools** and **Toolkits** for actions. **Class hier...
langchain/libs/langchain/langchain/agents/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/__init__.py", "repo_id": "langchain", "token_count": 1849 }
431
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/src/transformers/models/x_clip/configuration_x_clip.py/0
{ "file_path": "transformers/src/transformers/models/x_clip/configuration_x_clip.py", "repo_id": "transformers", "token_count": 8112 }
770
python_tests( interpreter_constraints=["==3.10.*"], )
llama_index/llama-index-integrations/retrievers/llama-index-retrievers-pathway/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/retrievers/llama-index-retrievers-pathway/tests/BUILD", "repo_id": "llama_index", "token_count": 22 }
1,448
from llama_index.storage.chat_store.redis.base import RedisChatStore __all__ = ["RedisChatStore"]
llama_index/llama-index-integrations/storage/chat_store/llama-index-storage-chat-store-redis/llama_index/storage/chat_store/redis/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/storage/chat_store/llama-index-storage-chat-store-redis/llama_index/storage/chat_store/redis/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,588
label: 'Graph databases' position: 1
langchainjs/docs/core_docs/docs/modules/data_connection/experimental/graph_databases/_category_.yml/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/experimental/graph_databases/_category_.yml", "repo_id": "langchainjs", "token_count": 10 }
731
#!/bin/bash # Exit immediately for non zero status set -e instance_name=$1 ns_name=${2:-"chaos-testing"} log_dir=${3:-"k8s_logs"} #show proxy pod log array=($(kubectl get pod -n ${ns_name} -l "app.kubernetes.io/component=proxy, app.kubernetes.io/instance=${instance_name}"| awk 'NR == 1 {next} {print $1}')) echo ${a...
milvus/tests/scripts/export_log_k8s_for_operator.sh/0
{ "file_path": "milvus/tests/scripts/export_log_k8s_for_operator.sh", "repo_id": "milvus", "token_count": 984 }
1,986
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "stores/message/upstash_redis", }); export * from "@langchain/community/stores/message/upstash_redis";
langchainjs/langchain/src/stores/message/upstash_redis.ts/0
{ "file_path": "langchainjs/langchain/src/stores/message/upstash_redis.ts", "repo_id": "langchainjs", "token_count": 83 }
913
# coding=utf-8 # Copyright 2024 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/tests/models/siglip/test_tokenization_siglip.py/0
{ "file_path": "transformers/tests/models/siglip/test_tokenization_siglip.py", "repo_id": "transformers", "token_count": 9751 }
812
"""Loader that uses unstructured to load files.""" import collections from abc import ABC, abstractmethod from typing import IO, Any, Callable, Dict, List, Optional, Sequence, Union from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader def satisfies_min_unstr...
langchain/libs/community/langchain_community/document_loaders/unstructured.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/unstructured.py", "repo_id": "langchain", "token_count": 5691 }
270
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/pipelines/stable_diffusion_ldm3d/test_stable_diffusion_ldm3d.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_ldm3d/test_stable_diffusion_ldm3d.py", "repo_id": "diffusers", "token_count": 5572 }
269
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-openalex/llama_index/readers/openalex/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-openalex/llama_index/readers/openalex/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,408
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/util/cache/lru_impl.go/0
{ "file_path": "milvus/pkg/util/cache/lru_impl.go", "repo_id": "milvus", "token_count": 886 }
1,896
"""Joint QA Summary graph.""" from typing import List, Optional, Sequence from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.core.callbacks.base import CallbackManager from llama_index.core.indices.list.base import SummaryIndex from llama_index.core.indices.vector_store import VectorSto...
llama_index/llama-index-core/llama_index/core/composability/joint_qa_summary.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/composability/joint_qa_summary.py", "repo_id": "llama_index", "token_count": 1900 }
1,167
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querycoordv2/task/utils_test.go/0
{ "file_path": "milvus/internal/querycoordv2/task/utils_test.go", "repo_id": "milvus", "token_count": 1410 }
1,846
"""Whatsapp chat data loader.""" import logging from pathlib import Path from typing import List from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class WhatsappChatLoader(BaseReader): """ Whatsapp chat data loader. Args: path (str): Path to Whats...
llama_index/llama-index-integrations/readers/llama-index-readers-whatsapp/llama_index/readers/whatsapp/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-whatsapp/llama_index/readers/whatsapp/base.py", "repo_id": "llama_index", "token_count": 796 }
1,448
# Copyright 2024 Salesforce.com, inc. # Copyright 2024 The HuggingFace Team. All rights reserved.# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE...
diffusers/src/diffusers/pipelines/blip_diffusion/pipeline_blip_diffusion.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/blip_diffusion/pipeline_blip_diffusion.py", "repo_id": "diffusers", "token_count": 6482 }
238
import { ChatMinimax } from "@langchain/community/chat_models/minimax"; import { HumanMessage } from "@langchain/core/messages"; const functionSchema = { name: "get_weather", description: " Get weather information.", parameters: { type: "object", properties: { location: { type: "string", ...
langchainjs/examples/src/models/chat/minimax_functions.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/minimax_functions.ts", "repo_id": "langchainjs", "token_count": 723 }
849
# OpenAI Function calling import CodeBlock from "@theme/CodeBlock"; import OpenAIFunctionsExample from "@examples/models/chat/openai_functions.ts"; import OpenAIFunctionsZodExample from "@examples/models/chat/openai_functions_zod.ts"; Function calling is a useful way to get structured output from an LLM for a wide ra...
langchainjs/docs/core_docs/docs/modules/model_io/chat/function_calling.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/model_io/chat/function_calling.mdx", "repo_id": "langchainjs", "token_count": 1228 }
747
# Copyright 2022 The OFA-Sys Team Authors and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
transformers/src/transformers/models/chinese_clip/__init__.py/0
{ "file_path": "transformers/src/transformers/models/chinese_clip/__init__.py", "repo_id": "transformers", "token_count": 1106 }
611
# LlamaIndex Llms Integration: Neutrino
llama_index/llama-index-integrations/llms/llama-index-llms-neutrino/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-neutrino/README.md", "repo_id": "llama_index", "token_count": 13 }
1,406
accuracy: collections: - milvus: db_config.primary_path: /test/milvus/db_data_011/sift_10m_128_l2_sq8 cache_config.cpu_cache_capacity: 8GB engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: false gpu_resour...
milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_accuracy.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_accuracy.yaml", "repo_id": "milvus", "token_count": 936 }
1,933
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datanode/metacache/segment_test.go/0
{ "file_path": "milvus/internal/datanode/metacache/segment_test.go", "repo_id": "milvus", "token_count": 690 }
1,842
<html> <head> <title>Chew dad's slippers</title> </head> <body> <h1> Instead of drinking water from the cat bowl, make sure to steal water from the toilet </h1> <h2>Chase the red dot</h2> <p> Munch, munch, chomp, chomp hate dogs. Spill litter box, scratch at owner, dest...
langchain/libs/community/tests/examples/example-utf8.html/0
{ "file_path": "langchain/libs/community/tests/examples/example-utf8.html", "repo_id": "langchain", "token_count": 338 }
345
"""SQL agent."""
langchain/libs/langchain/langchain/agents/agent_toolkits/sql/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/sql/__init__.py", "repo_id": "langchain", "token_count": 6 }
441
# Copyright 2024 TSAIL Team and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
diffusers/src/diffusers/schedulers/scheduling_unipc_multistep.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_unipc_multistep.py", "repo_id": "diffusers", "token_count": 17326 }
267
from overrides import override from typing import Optional, Sequence, Dict, Set, List, cast from uuid import UUID from chromadb.segment import VectorReader from chromadb.ingest import Consumer from chromadb.config import System, Settings from chromadb.segment.impl.vector.batch import Batch from chromadb.segment.impl.ve...
chroma/chromadb/segment/impl/vector/local_hnsw.py/0
{ "file_path": "chroma/chromadb/segment/impl/vector/local_hnsw.py", "repo_id": "chroma", "token_count": 5665 }
17
import json import logging import os import tempfile import zipfile from pathlib import Path from typing import Iterator, List, Union from langchain_core.chat_sessions import ChatSession from langchain_core.messages import AIMessage, BaseMessage, HumanMessage from langchain_community.chat_loaders.base import BaseChat...
langchain/libs/community/langchain_community/chat_loaders/telegram.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_loaders/telegram.py", "repo_id": "langchain", "token_count": 2499 }
219
from collections import defaultdict, abc from typing import cast from docutils import nodes from docutils.parsers.rst import Directive import sphinx from sphinx.locale import _ from sphinx.util.docutils import SphinxDirective from sphinx.errors import ExtensionError from conf import languages as LANGUAGES logger = ...
tokenizers/docs/source/_ext/entities.py/0
{ "file_path": "tokenizers/docs/source/_ext/entities.py", "repo_id": "tokenizers", "token_count": 4032 }
467
import tempfile import uuid from typing import Optional import pytest from langchain_core.documents import Document from langchain_community.vectorstores import Qdrant from langchain_community.vectorstores.qdrant import QdrantException from tests.integration_tests.vectorstores.fake_embeddings import ( ConsistentF...
langchain/libs/community/tests/integration_tests/vectorstores/qdrant/test_from_texts.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/qdrant/test_from_texts.py", "repo_id": "langchain", "token_count": 4569 }
352
# SK-ResNeXt **SK ResNeXt** is a variant of a [ResNeXt](https://www.paperswithcode.com/method/resnext) that employs a [Selective Kernel](https://paperswithcode.com/method/selective-kernel) unit. In general, all the large kernel convolutions in the original bottleneck blocks in ResNext are replaced by the proposed [SK ...
pytorch-image-models/docs/models/.templates/models/skresnext.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/skresnext.md", "repo_id": "pytorch-image-models", "token_count": 822 }
333
import asyncio from itertools import chain from threading import Thread from typing import ( Any, AsyncGenerator, Dict, Generator, List, Optional, Sequence, Tuple, Type, cast, ) from llama_index.legacy.agent.react.formatter import ReActChatFormatter from llama_index.legacy.agent...
llama_index/llama-index-legacy/llama_index/legacy/agent/legacy/react/base.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/agent/legacy/react/base.py", "repo_id": "llama_index", "token_count": 8450 }
1,636
<jupyter_start><jupyter_text>kNN>In statistics, the [k-nearest neighbors algorithm (k-NN)](https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm) is a non-parametric supervised learning method first developed by Evelyn Fix and Joseph Hodges in 1951, and later expanded by Thomas Cover. It is used for classificatio...
langchain/docs/docs/integrations/retrievers/knn.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/retrievers/knn.ipynb", "repo_id": "langchain", "token_count": 325 }
161
"""Tools for interacting with vectorstores.""" import json from typing import Any, Dict, Optional from langchain_core.callbacks import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) from langchain_core.language_models import BaseLanguageModel from langchain_core.pydantic_v1 import BaseModel, F...
langchain/libs/community/langchain_community/tools/vectorstore/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/vectorstore/tool.py", "repo_id": "langchain", "token_count": 2009 }
302
const fs = require("fs"); const path = require("path"); const BASE_TYPEDOC_CONFIG = { $schema: "https://typedoc.org/schema.json", out: "public", sort: [ "kind", "visibility", "instance-first", "required-first", "alphabetical", ], plugin: ["./typedoc_plugins/hide_underscore_lc.js"], tsco...
langchainjs/docs/api_refs/scripts/create-entrypoints.js/0
{ "file_path": "langchainjs/docs/api_refs/scripts/create-entrypoints.js", "repo_id": "langchainjs", "token_count": 1155 }
743
"""Chain that makes API calls and summarizes the responses to answer a question.""" from __future__ import annotations import json from typing import Any, Dict, List, NamedTuple, Optional, cast from langchain_community.tools.openapi.utils.api_models import APIOperation from langchain_community.utilities.requests impo...
langchain/libs/langchain/langchain/chains/api/openapi/chain.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/api/openapi/chain.py", "repo_id": "langchain", "token_count": 3861 }
479
import json import os from typing import Any, Dict, List, Optional from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, Extra, root_validator DEFAULT_MODEL = "sentence-transformers/all-mpnet-base-v2" VALID_TASKS = ("feature-extraction",) class HuggingFaceHubEmbeddings(B...
langchain/libs/community/langchain_community/embeddings/huggingface_hub.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/huggingface_hub.py", "repo_id": "langchain", "token_count": 2208 }
270
"""Unit tests for the Logical Fallacy chain, same format as CAI""" from langchain_experimental.fallacy_removal.base import FallacyChain TEXT_ONE = """ This text is bad.\ Fallacy Revision request: Make it great.\ Fallacy Revision:""" TEXT_TWO = """ This text is bad.\n\n""" TEXT_THREE = """ This text is bad.\ Falla...
langchain/libs/experimental/tests/unit_tests/test_logical_fallacy.py/0
{ "file_path": "langchain/libs/experimental/tests/unit_tests/test_logical_fallacy.py", "repo_id": "langchain", "token_count": 260 }
453
# 🦜️🔗 LangChain ⚡ Build context-aware reasoning applications ⚡ [![Release Notes](https://img.shields.io/github/release/langchain-ai/langchain)](https://github.com/langchain-ai/langchain/releases) [![CI](https://github.com/langchain-ai/langchain/actions/workflows/check_diffs.yml/badge.svg)](https://github.com/langch...
langchain/README.md/0
{ "file_path": "langchain/README.md", "repo_id": "langchain", "token_count": 2310 }
73
""" Twins A PyTorch impl of : `Twins: Revisiting the Design of Spatial Attention in Vision Transformers` - https://arxiv.org/pdf/2104.13840.pdf Code/weights from https://github.com/Meituan-AutoML/Twins, original copyright/license info below """ # -------------------------------------------------------- # Twins # ...
pytorch-image-models/timm/models/twins.py/0
{ "file_path": "pytorch-image-models/timm/models/twins.py", "repo_id": "pytorch-image-models", "token_count": 9685 }
369
""" NormAct (Normalizaiton + Activation Layer) Factory Create norm + act combo modules that attempt to be backwards compatible with separate norm + act isntances in models. Where these are used it will be possible to swap separate BN + act layers with combined modules like IABN or EvoNorms. Hacked together by / Copyr...
pytorch-image-models/timm/layers/create_norm_act.py/0
{ "file_path": "pytorch-image-models/timm/layers/create_norm_act.py", "repo_id": "pytorch-image-models", "token_count": 1594 }
366
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py/0
{ "file_path": "transformers/src/transformers/models/mobilenet_v1/configuration_mobilenet_v1.py", "repo_id": "transformers", "token_count": 1942 }
658
python_tests()
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-text-embeddings-inference/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-text-embeddings-inference/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,197
# Arxiv >[arXiv](https://arxiv.org/) is an open-access archive for 2 million scholarly articles in the fields of physics, > mathematics, computer science, quantitative biology, quantitative finance, statistics, electrical engineering and > systems science, and economics. ## Installation and Setup First, you need ...
langchain/docs/docs/integrations/providers/arxiv.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/arxiv.mdx", "repo_id": "langchain", "token_count": 257 }
130
<jupyter_start><jupyter_text>GraphQL Agent ToolThis example walks through two examples of connecting an Agent to a GraphQL server, one unauthenticated endpoint and one authenticated. To start, we initialize the OpenAI package with our api key.<jupyter_code># Setup OpenAI Agent import openai openai.api_key = "sk-your-k...
llama_index/llama-index-integrations/tools/llama-index-tools-graphql/examples/graphql.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-graphql/examples/graphql.ipynb", "repo_id": "llama_index", "token_count": 1361 }
1,482
import { loadEvaluator } from "langchain/evaluation"; const evaluator = await loadEvaluator("labeled_criteria", { criteria: "correctness", }); console.log("beginning evaluation"); const res = await evaluator.evaluateStrings({ input: "What is the capital of the US?", prediction: "Topeka, KS", reference: "T...
langchainjs/examples/src/guides/evaluation/string/criteria_with_reference.ts/0
{ "file_path": "langchainjs/examples/src/guides/evaluation/string/criteria_with_reference.ts", "repo_id": "langchainjs", "token_count": 263 }
864
<jupyter_start><jupyter_text>Benchmarking LLM Evaluators On A Mini MT-Bench (Single Grading) `LabelledEvaluatorDataset` In this notebook, we'll conduct an evaluation of three different evaluators that will be judging another LLM's response for response against a user query. More specifically, we will run benchmarks usi...
llama_index/docs/examples/evaluation/mt_bench_single_grading.ipynb/0
{ "file_path": "llama_index/docs/examples/evaluation/mt_bench_single_grading.ipynb", "repo_id": "llama_index", "token_count": 1735 }
1,184
from langchain.prompts.prompt import __all__ EXPECTED_ALL = ["Prompt", "PromptTemplate"] def test_all_imports() -> None: assert set(__all__) == set(EXPECTED_ALL)
langchain/libs/langchain/tests/unit_tests/prompts/test_prompt.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/prompts/test_prompt.py", "repo_id": "langchain", "token_count": 65 }
665