text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
# 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 applicabl...
transformers/src/transformers/activations_tf.py/0
{ "file_path": "transformers/src/transformers/activations_tf.py", "repo_id": "transformers", "token_count": 1836 }
627
import { OpenAIEmbeddings } from "@langchain/openai"; export const run = async () => { const model = new OpenAIEmbeddings({ maxConcurrency: 1, }); const res = await model.embedQuery( "What would be a good company name a company that makes colorful socks?" ); console.log({ res }); };
langchainjs/examples/src/embeddings/max_concurrency.ts/0
{ "file_path": "langchainjs/examples/src/embeddings/max_concurrency.ts", "repo_id": "langchainjs", "token_count": 97 }
800
# Copyright 2022 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...
accelerate/src/accelerate/utils/other.py/0
{ "file_path": "accelerate/src/accelerate/utils/other.py", "repo_id": "accelerate", "token_count": 4199 }
17
from __future__ import annotations import logging from typing import Any, Dict, List, Optional from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, Field, root_validator from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env logger = logging.getLogg...
langchain/libs/community/langchain_community/embeddings/baidu_qianfan_endpoint.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/baidu_qianfan_endpoint.py", "repo_id": "langchain", "token_count": 2363 }
254
# 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/examples/community/stable_diffusion_ipex.py/0
{ "file_path": "diffusers/examples/community/stable_diffusion_ipex.py", "repo_id": "diffusers", "token_count": 18596 }
210
from llama_index.llms.together.base import TogetherLLM __all__ = ["TogetherLLM"]
llama_index/llama-index-integrations/llms/llama-index-llms-together/llama_index/llms/together/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-together/llama_index/llms/together/__init__.py", "repo_id": "llama_index", "token_count": 28 }
1,317
import { BaseOutputParser } from "@langchain/core/output_parsers"; import { AutoGPTAction } from "./schema.js"; /** * Utility function used to preprocess a string to be parsed as JSON. * It replaces single backslashes with double backslashes, while leaving * already escaped ones intact. * It also extracts the json...
langchainjs/langchain/src/experimental/autogpt/output_parser.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/autogpt/output_parser.ts", "repo_id": "langchainjs", "token_count": 926 }
984
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-vertex/llama_index/llms/vertex/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-vertex/llama_index/llms/vertex/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,248
readme_str = """# LlamaIndex {TYPE} Integration: {NAME} """
llama_index/llama-index-cli/llama_index/cli/new_package/templates/readme.py/0
{ "file_path": "llama_index/llama-index-cli/llama_index/cli/new_package/templates/readme.py", "repo_id": "llama_index", "token_count": 21 }
1,194
"""Integration tests for the StreamlitCallbackHandler module.""" import pytest # Import the internal StreamlitCallbackHandler from its module - and not from # the `langchain_community.callbacks.streamlit` package - so that we don't end up using # Streamlit's externally-provided callback handler. from langchain_commun...
langchain/libs/community/tests/integration_tests/callbacks/test_streamlit_callback.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/callbacks/test_streamlit_callback.py", "repo_id": "langchain", "token_count": 349 }
347
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-milvus/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-milvus/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,341
"""AINetwork toolkit."""
langchain/libs/langchain/langchain/agents/agent_toolkits/ainetwork/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/ainetwork/__init__.py", "repo_id": "langchain", "token_count": 9 }
456
from llama_index.packs.redis_ingestion_pipeline.base import RedisIngestionPipelinePack __all__ = ["RedisIngestionPipelinePack"]
llama_index/llama-index-packs/llama-index-packs-redis-ingestion-pipeline/llama_index/packs/redis_ingestion_pipeline/__init__.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-redis-ingestion-pipeline/llama_index/packs/redis_ingestion_pipeline/__init__.py", "repo_id": "llama_index", "token_count": 48 }
1,602
# coding=utf-8 # Copyright 2022 WenXiang ZhongzhiCheng LedellWu LiuGuang BoWenZhang and 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 # # ...
transformers/src/transformers/models/altclip/configuration_altclip.py/0
{ "file_path": "transformers/src/transformers/models/altclip/configuration_altclip.py", "repo_id": "transformers", "token_count": 7757 }
631
--- hide_table_of_contents: true --- # Knowledge Bases for Amazon Bedrock Knowledge Bases for Amazon Bedrock is a fully managed support for end-to-end RAG workflow provided by Amazon Web Services (AWS). It provides an entire ingestion workflow of converting your documents into embeddings (vector) and storing the embe...
langchainjs/docs/core_docs/docs/integrations/retrievers/bedrock-knowledge-bases.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/retrievers/bedrock-knowledge-bases.mdx", "repo_id": "langchainjs", "token_count": 267 }
733
accuracy: collections: - server: db_config.primary_path: /test/milvus/db_data_7/sift_1b_2048_128_l2_sq8h_wal cache_config.cpu_cache_capacity: 150 engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: true gpu_...
milvus/tests/benchmark/milvus_benchmark/suites/gpu_accuracy_debug.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/gpu_accuracy_debug.yaml", "repo_id": "milvus", "token_count": 702 }
1,975
from typing import Any, Callable, Dict, List, Optional, Union import PIL.Image import torch from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMScheduler, DiffusionPipeline, LMSDiscreteScheduler, PNDMScheduler, StableDiffusionImg...
diffusers/examples/community/stable_diffusion_mega.py/0
{ "file_path": "diffusers/examples/community/stable_diffusion_mega.py", "repo_id": "diffusers", "token_count": 4380 }
203
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,569
from typing import Any, Dict, List, Optional import requests from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader NOTION_BASE_URL = "https://api.notion.com/v1" DATABASE_URL = NOTION_BASE_URL + "/databases/{database_id}/query" PAGE_URL = NOTION_BASE_URL + "/pa...
langchain/libs/community/langchain_community/document_loaders/notiondb.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/notiondb.py", "repo_id": "langchain", "token_count": 3863 }
236
import argparse from typing import Any, Optional from llama_index.core.command_line.rag import RagCLI, default_ragcli_persist_dir from llama_index.core.command_line.upgrade import upgrade_dir, upgrade_file from llama_index.core.ingestion import IngestionCache, IngestionPipeline from llama_index.core.llama_dataset.down...
llama_index/llama-index-core/llama_index/core/command_line/command_line.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/command_line/command_line.py", "repo_id": "llama_index", "token_count": 3826 }
1,166
"""Base output parser class.""" from string import Formatter from typing import TYPE_CHECKING, Any, Optional from llama_index.legacy.output_parsers.base import ChainableOutputParser if TYPE_CHECKING: from llama_index.legacy.bridge.langchain import BaseOutputParser as LCOutputParser class LangchainOutputParser(...
llama_index/llama-index-legacy/llama_index/legacy/output_parsers/langchain.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/output_parsers/langchain.py", "repo_id": "llama_index", "token_count": 707 }
1,624
package utils import ( "fmt" "strconv" "strings" "github.com/milvus-io/milvus/internal/metastore/kv/rootcoord" "github.com/milvus-io/milvus/pkg/util/typeutil" ) type ( UniqueID = typeutil.UniqueID Timestamp = typeutil.Timestamp ) type errNotOfTsKey struct { key string } func (e errNotOfTsKey) Error() stri...
milvus/cmd/tools/migration/utils/util.go/0
{ "file_path": "milvus/cmd/tools/migration/utils/util.go", "repo_id": "milvus", "token_count": 416 }
1,758
"""Test ChatNVIDIA chat model.""" from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage from langchain_nvidia_ai_endpoints.chat_models import ChatNVIDIA def test_chat_ai_endpoints() -> None: """Test ChatNVIDIA wrapper.""" chat = ChatNVIDIA( model="llama2_13b", temperatu...
langchain/libs/partners/nvidia-ai-endpoints/tests/integration_tests/test_chat_models.py/0
{ "file_path": "langchain/libs/partners/nvidia-ai-endpoints/tests/integration_tests/test_chat_models.py", "repo_id": "langchain", "token_count": 1119 }
650
# Copyright 2021 The Fairseq Authors and 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 # #...
transformers/src/transformers/models/m2m_100/__init__.py/0
{ "file_path": "transformers/src/transformers/models/m2m_100/__init__.py", "repo_id": "transformers", "token_count": 768 }
686
import asyncio import uuid from typing import Any, Callable, Optional import git import langsmith import pytest from langchain.callbacks import manager, tracers from langchain.callbacks.tracers import run_collector from langsmith import schemas try: repo = git.Repo(search_parent_directories=True) _GITHASH = r...
langsmith-cookbook/testing-examples/pytest-ut/utils.py/0
{ "file_path": "langsmith-cookbook/testing-examples/pytest-ut/utils.py", "repo_id": "langsmith-cookbook", "token_count": 3769 }
1,098
import warnings from pathlib import Path from typing import List, Tuple, Union import fire from torch import nn from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, PreTrainedModel from transformers.utils import logging logger = logging.get_logger(__name__) def copy_layers(src_layers: nn.ModuleList, des...
transformers/examples/research_projects/seq2seq-distillation/make_student.py/0
{ "file_path": "transformers/examples/research_projects/seq2seq-distillation/make_student.py", "repo_id": "transformers", "token_count": 3522 }
538
import os from argparse import Namespace, _SubParsersAction from llama_index import SimpleDirectoryReader from .configuration import load_index, save_index def add_cli(args: Namespace) -> None: """Handle subcommand "add".""" index = load_index() for p in args.files: if not os.path.exists(p): ...
llama_index/experimental/cli/cli_add.py/0
{ "file_path": "llama_index/experimental/cli/cli_add.py", "repo_id": "llama_index", "token_count": 435 }
1,169
from langchain_community.retrievers.knn import KNNRetriever __all__ = ["KNNRetriever"]
langchain/libs/langchain/langchain/retrievers/knn.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/knn.py", "repo_id": "langchain", "token_count": 32 }
535
python_sources()
llama_index/llama-index-packs/llama-index-packs-deeplake-multimodal-retrieval/llama_index/packs/deeplake_multimodal_retrieval/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-deeplake-multimodal-retrieval/llama_index/packs/deeplake_multimodal_retrieval/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,697
""" Dataset reader that wraps Hugging Face datasets Hacked together by / Copyright 2022 Ross Wightman """ import io import math from typing import Optional import torch import torch.distributed as dist from PIL import Image try: import datasets except ImportError as e: print("Please install Hugging Face data...
pytorch-image-models/timm/data/readers/reader_hfds.py/0
{ "file_path": "pytorch-image-models/timm/data/readers/reader_hfds.py", "repo_id": "pytorch-image-models", "token_count": 1150 }
349
#!/usr/bin/env bash # 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...
milvus/scripts/run_cpp_unittest.sh/0
{ "file_path": "milvus/scripts/run_cpp_unittest.sh", "repo_id": "milvus", "token_count": 867 }
1,985
import os import time import pdb import logging import traceback from milvus_benchmark.env import helm_utils from milvus_benchmark.env.base import BaseEnv from milvus_benchmark import config logger = logging.getLogger("milvus_benchmark.env.helm") TIMEOUT = 5 class HelmEnv(BaseEnv): """helm env class wrapper""" ...
milvus/tests/benchmark/milvus_benchmark/env/helm.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/env/helm.py", "repo_id": "milvus", "token_count": 1469 }
1,862
import inspect import warnings from typing import Any, Dict, Optional, Union from packaging import version def deprecate(*args, take_from: Optional[Union[Dict, Any]] = None, standard_warn=True, stacklevel=2): from .. import __version__ deprecated_kwargs = take_from values = () if not isinstance(args...
diffusers/src/diffusers/utils/deprecation_utils.py/0
{ "file_path": "diffusers/src/diffusers/utils/deprecation_utils.py", "repo_id": "diffusers", "token_count": 793 }
268
// 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/proxy/multi_rate_limiter_test.go/0
{ "file_path": "milvus/internal/proxy/multi_rate_limiter_test.go", "repo_id": "milvus", "token_count": 5131 }
1,963
from llama_index.tools.salesforce.base import SalesforceToolSpec __all__ = ["SalesforceToolSpec"]
llama_index/llama-index-integrations/tools/llama-index-tools-salesforce/llama_index/tools/salesforce/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-salesforce/llama_index/tools/salesforce/__init__.py", "repo_id": "llama_index", "token_count": 31 }
1,452
from __future__ import annotations import logging import operator import os import pickle import uuid import warnings from pathlib import Path from typing import ( Any, Callable, Dict, Iterable, List, Optional, Sized, Tuple, Union, ) import numpy as np from langchain_core.documents...
langchain/libs/community/langchain_community/vectorstores/faiss.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/faiss.py", "repo_id": "langchain", "token_count": 20917 }
328
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-feishu-docs/llama_index/readers/feishu_docs/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-feishu-docs/llama_index/readers/feishu_docs/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,364
# YouTube >[YouTube](https://www.youtube.com/) is an online video sharing and social media platform by Google. > We download the `YouTube` transcripts and video information. ## Installation and Setup ```bash pip install youtube-transcript-api pip install pytube ``` See a [usage example](/docs/integrations/document_l...
langchain/docs/docs/integrations/providers/youtube.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/youtube.mdx", "repo_id": "langchain", "token_count": 164 }
158
from llama_index.core.storage.kvstore.types import BaseKVStore from llama_index.storage.kvstore.dynamodb import DynamoDBKVStore def test_class(): names_of_base_classes = [b.__name__ for b in DynamoDBKVStore.__mro__] assert BaseKVStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-dynamodb/tests/test_storage_kvstore_dynamodb.py/0
{ "file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-dynamodb/tests/test_storage_kvstore_dynamodb.py", "repo_id": "llama_index", "token_count": 104 }
1,498
import { Redis } from "@upstash/redis"; import { UpstashRedisStore } from "@langchain/community/storage/upstash_redis"; import { AIMessage, HumanMessage } from "@langchain/core/messages"; // Pro tip: define a helper function for getting your client // along with handling the case where your environment variables // ar...
langchainjs/examples/src/stores/upstash_redis_storage.ts/0
{ "file_path": "langchainjs/examples/src/stores/upstash_redis_storage.ts", "repo_id": "langchainjs", "token_count": 844 }
915
--- hide_table_of_contents: true --- import CodeBlock from "@theme/CodeBlock"; import Trajectory from "@examples/guides/evaluation/agent_trajectory/trajectory.ts"; # Agent Trajectory Agents can be difficult to holistically evaluate due to the breadth of actions and generation they can make. We recommend using multip...
langchainjs/docs/core_docs/docs/guides/evaluation/trajectory/trajectory_eval.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/guides/evaluation/trajectory/trajectory_eval.mdx", "repo_id": "langchainjs", "token_count": 386 }
772
# Copyright 2022 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...
transformers/src/transformers/models/whisper/__init__.py/0
{ "file_path": "transformers/src/transformers/models/whisper/__init__.py", "repo_id": "transformers", "token_count": 1768 }
717
<jupyter_start><jupyter_text>Vsdx > A [visio file](https://fr.wikipedia.org/wiki/Microsoft_Visio) (with extension .vsdx) is associated with Microsoft Visio, a diagram creation software. It stores information about the structure, layout, and graphical elements of a diagram. This format facilitates the creation and shari...
langchain/docs/docs/integrations/document_loaders/vsdx.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/vsdx.ipynb", "repo_id": "langchain", "token_count": 759 }
113
import sys import time import timeout_decorator from numpy import NaN from pymilvus import Collection sys.path.append("..") from check.func_check import ResponseChecker from utils.api_request import api_request from utils.wrapper import trace from utils.util_log import test_log as log from pymilvus.orm.types import C...
milvus/tests/python_client/base/collection_wrapper.py/0
{ "file_path": "milvus/tests/python_client/base/collection_wrapper.py", "repo_id": "milvus", "token_count": 7240 }
1,950
from llama_index.storage.index_store.redis.base import RedisIndexStore __all__ = ["RedisIndexStore"]
llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-redis/llama_index/storage/index_store/redis/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-redis/llama_index/storage/index_store/redis/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,602
# Copyright 2023-present 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 law or...
peft/src/peft/mapping.py/0
{ "file_path": "peft/src/peft/mapping.py", "repo_id": "peft", "token_count": 2265 }
330
from llama_index.core.llms.base import BaseLLM from llama_index.llms.ai21 import AI21 def test_text_inference_embedding_class(): names_of_base_classes = [b.__name__ for b in AI21.__mro__] assert BaseLLM.__name__ in names_of_base_classes
llama_index/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py", "repo_id": "llama_index", "token_count": 96 }
1,299
"""Test utils.""" from typing import Optional, Type, Union import pytest from _pytest.capture import CaptureFixture from llama_index.legacy.utils import ( _ANSI_COLORS, _LLAMA_INDEX_COLORS, ErrorToRetry, _get_colored_text, get_color_mapping, get_tokenizer, iter_batch, print_text, r...
llama_index/llama-index-legacy/tests/test_utils.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/test_utils.py", "repo_id": "llama_index", "token_count": 2236 }
1,761
# 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/tests/models/table_transformer/test_modeling_table_transformer.py/0
{ "file_path": "transformers/tests/models/table_transformer/test_modeling_table_transformer.py", "repo_id": "transformers", "token_count": 10595 }
751
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "chat_models/ollama", }); export * from "@langchain/community/chat_models/ollama";
langchainjs/langchain/src/chat_models/ollama.ts/0
{ "file_path": "langchainjs/langchain/src/chat_models/ollama.ts", "repo_id": "langchainjs", "token_count": 74 }
900
<jupyter_start><jupyter_text>KoboldAI API[KoboldAI](https://github.com/KoboldAI/KoboldAI-Client) is a "a browser-based front-end for AI-assisted writing with multiple local & remote AI models...". It has a public and local API that is able to be used in langchain.This example goes over how to use LangChain with that AP...
langchain/docs/docs/integrations/llms/koboldai.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/koboldai.ipynb", "repo_id": "langchain", "token_count": 292 }
129
ann_accuracy: collections: - server: cache_config.cpu_cache_capacity: 16 engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: false gpu_resource_config.cache_capacity: 4 gpu_resource_config.search_resources: ...
milvus/tests/benchmark/milvus_benchmark/suites/cpu_accuracy_ann_hnsw.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/cpu_accuracy_ann_hnsw.yaml", "repo_id": "milvus", "token_count": 701 }
1,951
# 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/informer/test_modeling_informer.py/0
{ "file_path": "transformers/tests/models/informer/test_modeling_informer.py", "repo_id": "transformers", "token_count": 10012 }
750
apiVersion: chaos-mesh.org/v1alpha1 kind: PodChaos metadata: name: test-datacoord-pod-failure namespace: chaos-testing spec: selector: namespaces: - chaos-testing labelSelectors: app.kubernetes.io/instance: milvus-chaos component: datacoord mode: fixed value: "1" action: pod-failur...
milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_datacoord_pod_failure.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_datacoord_pod_failure.yaml", "repo_id": "milvus", "token_count": 144 }
1,896
""" Create Conv2d Factory Method Hacked together by / Copyright 2020 Ross Wightman """ from .mixed_conv2d import MixedConv2d from .cond_conv2d import CondConv2d from .conv2d_same import create_conv2d_pad def create_conv2d(in_channels, out_channels, kernel_size, **kwargs): """ Select a 2d convolution implementat...
pytorch-image-models/timm/layers/create_conv2d.py/0
{ "file_path": "pytorch-image-models/timm/layers/create_conv2d.py", "repo_id": "pytorch-image-models", "token_count": 652 }
374
"""Test EdenAi API wrapper. In order to run this test, you need to have an EdenAI api key. You can get it by registering for free at https://app.edenai.run/user/register. A test key can be found at https://app.edenai.run/admin/account/settings by clicking on the 'sandbox' toggle. (calls will be free, and will return d...
langchain/libs/community/tests/integration_tests/llms/test_edenai.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_edenai.py", "repo_id": "langchain", "token_count": 556 }
335
import json from collections import defaultdict from html.parser import HTMLParser from typing import Any, DefaultDict, Dict, List, Optional, cast from langchain.callbacks.manager import ( CallbackManagerForLLMRun, ) from langchain.schema import ( ChatGeneration, ChatResult, ) from langchain_community.chat...
langchain/libs/experimental/langchain_experimental/llms/anthropic_functions.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/llms/anthropic_functions.py", "repo_id": "langchain", "token_count": 3458 }
422
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/llms/llama-index-llms-ollama/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-ollama/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,271
from typing import Any, Optional, Sequence from llama_index.core.base.response.schema import NodeWithScore, Response from llama_index.core.evaluation import BaseEvaluator from llama_index.core.evaluation.base import EvaluationResult from llama_index.core.prompts.mixin import PromptDictType from llama_index.core.schema...
llama_index/llama-index-core/tests/evaluation/test_base.py/0
{ "file_path": "llama_index/llama-index-core/tests/evaluation/test_base.py", "repo_id": "llama_index", "token_count": 858 }
1,259
import { Document } from "@langchain/core/documents"; import { BufferLoader } from "./buffer.js"; import { formatDocumentsAsString } from "../../util/document.js"; /** * A class that extends the `BufferLoader` class. It represents a document * loader that loads documents from PDF files. * @example * ```typescript ...
langchainjs/langchain/src/document_loaders/fs/pdf.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/fs/pdf.ts", "repo_id": "langchainjs", "token_count": 1788 }
902
import argparse import sys import tensorrt as trt def convert_models(onnx_path: str, num_controlnet: int, output_path: str, fp16: bool = False, sd_xl: bool = False): """ Function to convert models in stable diffusion controlnet pipeline into TensorRT format Example: python convert_stable_diffusion_c...
diffusers/scripts/convert_stable_diffusion_controlnet_to_tensorrt.py/0
{ "file_path": "diffusers/scripts/convert_stable_diffusion_controlnet_to_tensorrt.py", "repo_id": "diffusers", "token_count": 1860 }
233
// Adapted from turboderp exllama: https://github.com/turboderp/exllama #ifndef _hip_compat_cuh #define _hip_compat_cuh // Workaround for a bug in hipamd, backported from upstream, this is fixed in ROCm 5.6. __device__ __forceinline__ __half __compat_hrcp(__half x) { return __half_raw{ static_cast<_Float1...
text-generation-inference/server/exllama_kernels/exllama_kernels/hip_compat.cuh/0
{ "file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/hip_compat.cuh", "repo_id": "text-generation-inference", "token_count": 1707 }
415
from llama_index.finetuning.embeddings import ( EmbeddingAdapterFinetuneEngine, SentenceTransformersFinetuneEngine, ) from llama_index.finetuning.types import BaseEmbeddingFinetuneEngine def test_class(): names_of_base_classes = [b.__name__ for b in EmbeddingAdapterFinetuneEngine.__mro__] assert BaseE...
llama_index/llama-index-finetuning/tests/embeddings/test_embeddings_classes.py/0
{ "file_path": "llama_index/llama-index-finetuning/tests/embeddings/test_embeddings_classes.py", "repo_id": "llama_index", "token_count": 204 }
1,164
import { Serializable } from "../load/serializable.js"; import type { Example } from "../prompts/base.js"; /** * Base class for example selectors. */ export abstract class BaseExampleSelector extends Serializable { lc_namespace = ["langchain_core", "example_selectors", "base"]; /** * Adds an example to the e...
langchainjs/langchain-core/src/example_selectors/base.ts/0
{ "file_path": "langchainjs/langchain-core/src/example_selectors/base.ts", "repo_id": "langchainjs", "token_count": 232 }
895
import { SupabaseVectorStore } from "@langchain/community/vectorstores/supabase"; import { OpenAIEmbeddings } from "@langchain/openai"; import { createClient } from "@supabase/supabase-js"; // First, follow set-up instructions at // https://js.langchain.com/docs/modules/indexes/vector_stores/integrations/supabase con...
langchainjs/examples/src/indexes/vector_stores/supabase_deletion.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/supabase_deletion.ts", "repo_id": "langchainjs", "token_count": 506 }
881
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-google/llama_index/readers/google/gmail/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-google/llama_index/readers/google/gmail/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,500
import pytest from llama_index.legacy.embeddings.llm_rails import LLMRailsEmbedding @pytest.fixture() def model_id() -> str: # Replace with model name return "your_model_id" @pytest.fixture() def api_key() -> str: # Replace with your api key return "your_api_key" def test_llm_rails_embedding_const...
llama_index/llama-index-legacy/tests/embeddings/test_llm_rails.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/embeddings/test_llm_rails.py", "repo_id": "llama_index", "token_count": 182 }
1,795
<jupyter_start><jupyter_text>OpenAI Agent Query PlanningIn this demo, we explore adding a `QueryPlanTool` to an `OpenAIAgent`. This effectively enables the agentto do advanced query planning, all through a single tool! The `QueryPlanTool` is designed to work well with the OpenAI Function API. The tool takes in a set of...
llama_index/docs/examples/agent/openai_agent_query_plan.ipynb/0
{ "file_path": "llama_index/docs/examples/agent/openai_agent_query_plan.ipynb", "repo_id": "llama_index", "token_count": 2379 }
1,170
<jupyter_start><jupyter_text>Simple Self RAG NotebookThis LlamaPack implements short form the [self-RAG paper by Akari et al.](https://arxiv.org/pdf/2310.11511.pdf).Novel framework called Self-Reflective Retrieval-Augmented Generation (SELF-RAG). Which aims to enhance the quality and factuality of large language models...
llama_index/llama-index-packs/llama-index-packs-self-rag/examples/self_rag.ipynb/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-self-rag/examples/self_rag.ipynb", "repo_id": "llama_index", "token_count": 2045 }
1,592
<jupyter_start><jupyter_text>Airbyte Typeform >[Airbyte](https://github.com/airbytehq/airbyte) is a data integration platform for ELT pipelines from APIs, databases & files to warehouses & lakes. It has the largest catalog of ELT connectors to data warehouses and databases.This loader exposes the Typeform connector as ...
langchain/docs/docs/integrations/document_loaders/airbyte_typeform.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/airbyte_typeform.ipynb", "repo_id": "langchain", "token_count": 946 }
96
package typeutil import ( "fmt" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) type kvPairsHelper[K comparable, V any] struct { kvPairs map[K]V } func (h *kvPairsHelper[K, V]) Get(k K) (V, error) { v, ok := h.kvPairs[k] if !ok { return v, fmt.Errorf("%v not found", k) } return v, nil } func NewK...
milvus/pkg/util/typeutil/kv_pair_helper.go/0
{ "file_path": "milvus/pkg/util/typeutil/kv_pair_helper.go", "repo_id": "milvus", "token_count": 255 }
1,926
terraform { required_providers { render = { source = "jackall3n/render" version = "~> 1.3.0" } } } variable "render_api_token" { sensitive = true } variable "render_user_email" { sensitive = true } provider "render" { api_key = var.render_api_token } data "render_owner" "render_owner"...
chroma/examples/deployments/render-terraform/chroma.tf/0
{ "file_path": "chroma/examples/deployments/render-terraform/chroma.tf", "repo_id": "chroma", "token_count": 937 }
39
from llama_index.packs.cogniswitch_agent.base import CogniswitchAgentPack __all__ = ["CogniswitchAgentPack"]
llama_index/llama-index-packs/llama-index-packs-cogniswitch-agent/llama_index/packs/cogniswitch_agent/__init__.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-cogniswitch-agent/llama_index/packs/cogniswitch_agent/__init__.py", "repo_id": "llama_index", "token_count": 37 }
1,778
# Multi-modal LlamaIndex offers capabilities to not only build language-based applications, but also **multi-modal** applications - combining language and images. ## Types of Multi-modal Use Cases This space is actively being explored right now, but there are some fascinating use cases popping up. ### RAG (Retrieva...
llama_index/docs/use_cases/multimodal.md/0
{ "file_path": "llama_index/docs/use_cases/multimodal.md", "repo_id": "llama_index", "token_count": 1243 }
1,111
# coding=utf-8 # Copyright 2023 The Intel Team Authors, 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/...
transformers/tests/models/tvp/test_image_processing_tvp.py/0
{ "file_path": "transformers/tests/models/tvp/test_image_processing_tvp.py", "repo_id": "transformers", "token_count": 5453 }
846
use crate::tokenizer::{NormalizedString, Normalizer, Result}; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type")] pub struct Prepend { pub prepend: String, } impl Prepend { pub fn new(prepend: String) -> Self { Self { prepend } } } impl Norm...
tokenizers/tokenizers/src/normalizers/prepend.rs/0
{ "file_path": "tokenizers/tokenizers/src/normalizers/prepend.rs", "repo_id": "tokenizers", "token_count": 856 }
432
# FILE: bandit.yaml exclude_dirs: [ 'chromadb/test', 'bin', 'build', 'build', '.git', '.venv', 'venv', 'env','.github','examples','clients/js','.vscode' ] tests: [ ] skips: [ ]
chroma/bandit.yaml/0
{ "file_path": "chroma/bandit.yaml", "repo_id": "chroma", "token_count": 75 }
10
# 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/stable_diffusion_k_diffusion/pipeline_stable_diffusion_k_diffusion.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_k_diffusion.py", "repo_id": "diffusers", "token_count": 14465 }
258
@@@@base_visitor @@root_base@@Visitor #### @@@@body@struct_name void visit(@@struct_name@@& @@parameter_name@@) override; #### @@@@main #pragma once // Generated File // DO NOT EDIT @@extra_inc@@ #include "@@base_visitor@@.h" namespace @@namespace@@ { class @@visitor_name@@ : public @@base_visitor@@ { public:...
milvus/tools/core_gen/templates/visitor_derived.h/0
{ "file_path": "milvus/tools/core_gen/templates/visitor_derived.h", "repo_id": "milvus", "token_count": 145 }
1,917
## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - ... - New functionality - ... ## Test plan *How are these changes tested?* - [ ] Tests pass locally with `pytest` for python, `yarn test` for js ## Documentation Changes *Are all docstrings for user-facing APIs upd...
chroma/pull_request_template.md/0
{ "file_path": "chroma/pull_request_template.md", "repo_id": "chroma", "token_count": 120 }
57
python_sources()
llama_index/llama-index-core/llama_index/core/node_parser/text/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/node_parser/text/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,232
from conans import ConanFile class MilvusConan(ConanFile): settings = "os", "compiler", "build_type", "arch" requires = ( "rocksdb/6.29.5@milvus/dev", "boost/1.82.0", "onetbb/2021.9.0", "nlohmann_json/3.11.2", "zstd/1.5.4", "lz4/1.9.4", "snappy/1.1.9", ...
milvus/internal/core/conanfile.py/0
{ "file_path": "milvus/internal/core/conanfile.py", "repo_id": "milvus", "token_count": 1865 }
1,861
<!--Copyright 2022 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 agreed...
transformers/docs/source/en/model_doc/levit.md/0
{ "file_path": "transformers/docs/source/en/model_doc/levit.md", "repo_id": "transformers", "token_count": 1801 }
445
# SSL ResNet **Residual Networks**, or **ResNets**, learn residual functions with reference to the layer inputs, instead of learning unreferenced functions. Instead of hoping each few stacked layers directly fit a desired underlying mapping, residual nets let these layers fit a residual mapping. They stack [residual b...
pytorch-image-models/docs/models/.templates/models/ssl-resnet.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/ssl-resnet.md", "repo_id": "pytorch-image-models", "token_count": 1616 }
361
<jupyter_start><jupyter_text>---sidebar_position: 2title: Multi-language anonymization---<jupyter_code># Multi-language data anonymization with Microsoft Presidio [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/doc...
langchain/docs/docs/guides/privacy/presidio_data_anonymization/multi_language.ipynb/0
{ "file_path": "langchain/docs/docs/guides/privacy/presidio_data_anonymization/multi_language.ipynb", "repo_id": "langchain", "token_count": 3724 }
88
--- sidebar_label: Minimax --- import CodeBlock from "@theme/CodeBlock"; # Minimax [Minimax](https://api.minimax.chat) is a Chinese startup that provides natural language processing models for companies and individuals. This example demonstrates using LangChain.js to interact with Minimax. ## Setup To use Minimax...
langchainjs/docs/core_docs/docs/integrations/chat/minimax.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat/minimax.mdx", "repo_id": "langchainjs", "token_count": 682 }
709
[tool.pytest.ini_options] markers = [ "base: marker for model tests using the basic setup", "cfg: marker for model tests checking the config", "torchscript: marker for model tests using torchscript", "features: marker for model tests checking feature extraction", "fxforward: marker for model tests u...
pytorch-image-models/pyproject.toml/0
{ "file_path": "pytorch-image-models/pyproject.toml", "repo_id": "pytorch-image-models", "token_count": 169 }
324
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-docstring-walker/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-docstring-walker/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,359
<!--Copyright 2022 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 agreed...
transformers/docs/source/ko/tasks/audio_classification.md/0
{ "file_path": "transformers/docs/source/ko/tasks/audio_classification.md", "repo_id": "transformers", "token_count": 8151 }
498
import { ChainValues } from "@langchain/core/utils/types"; import { CallbackManagerForChainRun } from "@langchain/core/callbacks/manager"; import { BaseChain, ChainInputs } from "./base.js"; import { SerializedBaseChain, SerializedSequentialChain, SerializedSimpleSequentialChain, } from "./serde.js"; import { int...
langchainjs/langchain/src/chains/sequential_chain.ts/0
{ "file_path": "langchainjs/langchain/src/chains/sequential_chain.ts", "repo_id": "langchainjs", "token_count": 4327 }
884
# coding=utf-8 # 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 requir...
transformers/tests/models/auto/test_modeling_auto.py/0
{ "file_path": "transformers/tests/models/auto/test_modeling_auto.py", "repo_id": "transformers", "token_count": 10171 }
703
# Kibela Reader This reader fetches article from your [Kibela](https://kibe.la/) notes using the GraphQL API. # Usage Here's an example of how to use it. You can get your access token from [here](https://my.kibe.la/settings/access_tokens). ```python import os from llama_hub.kibela import KibelaReader team = os.env...
llama_index/llama-index-integrations/readers/llama-index-readers-kibela/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-kibela/README.md", "repo_id": "llama_index", "token_count": 277 }
1,418
#include <torch/extension.h> #include <ATen/ATen.h> #include <vector> std::vector<at::Tensor> fast_hash_ver1_kernel( at::Tensor query_mask, at::Tensor query_vector, at::Tensor key_mask, at::Tensor key_vector, int num_hash_f, int hash_code_len, bool use_cuda ); at::Tensor lsh_cumulation_ver1_kernel( at...
transformers/src/transformers/kernels/yoso/fast_lsh_cumulation.h/0
{ "file_path": "transformers/src/transformers/kernels/yoso/fast_lsh_cumulation.h", "repo_id": "transformers", "token_count": 639 }
598
[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 = ["VectaraRagPack"] contains_example = false import_path = "llama_index.packs.vectara_rag" ...
llama_index/llama-index-packs/llama-index-packs-vectara-rag/pyproject.toml/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-vectara-rag/pyproject.toml", "repo_id": "llama_index", "token_count": 697 }
1,602
# FBNet **FBNet** is a type of convolutional neural architectures discovered through [DNAS](https://paperswithcode.com/method/dnas) neural architecture search. It utilises a basic type of image model block inspired by [MobileNetv2](https://paperswithcode.com/method/mobilenetv2) that utilises depthwise convolutions and...
pytorch-image-models/docs/models/.templates/models/fbnet.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/fbnet.md", "repo_id": "pytorch-image-models", "token_count": 896 }
345
#include <torch/extension.h> #include <ATen/ATen.h> #include "fast_lsh_cumulation.h" #include "common_cuda.h" #include <vector> std::vector<at::Tensor> fast_hash( at::Tensor query_mask, at::Tensor query_vector, at::Tensor key_mask, at::Tensor key_vector, int num_hash_f, int hash_code_len, bool use_cuda, ...
transformers/src/transformers/kernels/yoso/fast_lsh_cumulation_torch.cpp/0
{ "file_path": "transformers/src/transformers/kernels/yoso/fast_lsh_cumulation_torch.cpp", "repo_id": "transformers", "token_count": 1498 }
566
<jupyter_start><jupyter_text>Timescale Vector Store (PostgreSQL)This notebook shows how to use the Postgres vector store `TimescaleVector` to store and query vector embeddings. What is Timescale Vector?**[Timescale Vector](https://www.timescale.com/ai) is PostgreSQL++ for AI applications.**Timescale Vector enables you ...
llama_index/docs/examples/vector_stores/Timescalevector.ipynb/0
{ "file_path": "llama_index/docs/examples/vector_stores/Timescalevector.ipynb", "repo_id": "llama_index", "token_count": 8598 }
1,135
"""LLM Chains for evaluating question answering.""" from __future__ import annotations import re import string from typing import Any, List, Optional, Sequence, Tuple from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts import PromptTemplate from langchain_core.pydantic_v1 import E...
langchain/libs/langchain/langchain/evaluation/qa/eval_chain.py/0
{ "file_path": "langchain/libs/langchain/langchain/evaluation/qa/eval_chain.py", "repo_id": "langchain", "token_count": 4851 }
503
import math import torch import json from loguru import logger from functools import lru_cache from typing import Optional, List, Dict, Union from text_generation_server.pb.generate_pb2 import GrammarType from outlines.fsm.fsm import RegexFSM from outlines.fsm.json_schema import build_regex_from_object from functools...
text-generation-inference/server/text_generation_server/utils/logits_process.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/utils/logits_process.py", "repo_id": "text-generation-inference", "token_count": 9580 }
421
# 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 applicabl...
transformers/tests/trainer/test_data_collator.py/0
{ "file_path": "transformers/tests/trainer/test_data_collator.py", "repo_id": "transformers", "token_count": 19982 }
793