text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
package utils import ( "errors" "github.com/spaolacci/murmur3" ) type Hasher = func(member string, key string) uint64 type Member = string type Members = []Member type Key = string // assign assigns a key to a member using the rendezvous hashing algorithm. func Assign(key Key, members Members, hasher Hasher) (Mem...
chroma/go/coordinator/internal/utils/rendezvous_hash.go/0
{ "file_path": "chroma/go/coordinator/internal/utils/rendezvous_hash.go", "repo_id": "chroma", "token_count": 517 }
51
from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding def test_azure_openai_embedding_class(): names_of_base_classes = [b.__name__ for b in AzureOpenAIEmbedding.__mro__] assert BaseEmbedding.__name__ in names_of_base_classes
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/tests/test_embeddings_azure_openai.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/tests/test_embeddings_azure_openai.py", "repo_id": "llama_index", "token_count": 116 }
1,253
# coding=utf-8 # Copyright 2022 The Microsoft, The Google 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/lic...
transformers/examples/research_projects/tapex/wikisql_utils.py/0
{ "file_path": "transformers/examples/research_projects/tapex/wikisql_utils.py", "repo_id": "transformers", "token_count": 3100 }
578
""" We provide two strategies for generating thoughts in the Tree of Thoughts (ToT) framework to avoid repetition: These strategies ensure that the language model generates diverse and non-repeating thoughts, which are crucial for problem-solving tasks that require exploration. """ from abc import abstractmethod from ...
langchain/libs/experimental/langchain_experimental/tot/thought_generation.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/tot/thought_generation.py", "repo_id": "langchain", "token_count": 1177 }
451
terraform { backend "gcs" { bucket = "YOUR BUCKET" prefix = "YOUR PREFIX" } }
chat-langchain/terraform/backend.tf/0
{ "file_path": "chat-langchain/terraform/backend.tf", "repo_id": "chat-langchain", "token_count": 43 }
9
# 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/benchmark/test_benchmark_tf.py/0
{ "file_path": "transformers/tests/benchmark/test_benchmark_tf.py", "repo_id": "transformers", "token_count": 4131 }
714
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-typesense/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-typesense/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,545
3.0 (quilt)
milvus/build/deb/debian/source/format/0
{ "file_path": "milvus/build/deb/debian/source/format", "repo_id": "milvus", "token_count": 8 }
1,746
[ { "server": "idc-sh003", "suite_params": [ { "suite": "2_insert_search_sift50m_2048.yaml", "image_type": "cpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/nlist.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/nlist.json", "repo_id": "milvus", "token_count": 144 }
1,997
package typeutil import ( "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/pkg/common" ) func TestNewKvPairs(t *testing.T) { kvPairs := []*commonpb.KeyValuePair{ {Key: common.DimKey, Value: "128"}, } h := NewKvPairs(kvPairs) ...
milvus/pkg/util/typeutil/kv_pair_helper_test.go/0
{ "file_path": "milvus/pkg/util/typeutil/kv_pair_helper_test.go", "repo_id": "milvus", "token_count": 212 }
1,917
from chromadb.db.base import SqlDB, ParameterValue, get_sql from chromadb.ingest import ( Producer, Consumer, encode_vector, decode_vector, ConsumerCallbackFn, ) from chromadb.types import ( SubmitEmbeddingRecord, EmbeddingRecord, SeqId, ScalarEncoding, Operation, ) from chromadb...
chroma/chromadb/db/mixins/embeddings_queue.py/0
{ "file_path": "chroma/chromadb/db/mixins/embeddings_queue.py", "repo_id": "chroma", "token_count": 6695 }
15
<jupyter_start><jupyter_text>Real-time Automated Feedback[](https://colab.research.google.com/github/langchain-ai/langsmith-cookbook/blob/main/feedback-examples/realtime-algorithmic-feedback/realtime_feedback.ipynb)This tutorial shows how to attach a reference-free evaluator as a callback to your chain to automatically...
langsmith-cookbook/feedback-examples/realtime-algorithmic-feedback/realtime_feedback.ipynb/0
{ "file_path": "langsmith-cookbook/feedback-examples/realtime-algorithmic-feedback/realtime_feedback.ipynb", "repo_id": "langsmith-cookbook", "token_count": 1576 }
1,020
<jupyter_start><jupyter_text>Azure AI Data>[Azure AI Studio](https://ai.azure.com/) provides the capability to upload data assets to cloud storage and register existing data assets from the following sources:>>- `Microsoft OneLake`>- `Azure Blob Storage`>- `Azure Data Lake gen 2`The benefit of this approach over `Azure...
langchain/docs/docs/integrations/document_loaders/azure_ai_data.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/azure_ai_data.ipynb", "repo_id": "langchain", "token_count": 527 }
98
from llama_index.core.question_gen.llm_generators import LLMQuestionGenerator from llama_index.core.question_gen.types import SubQuestion from llama_index.core.schema import QueryBundle from llama_index.core.service_context import ServiceContext from llama_index.core.tools.types import ToolMetadata def test_llm_quest...
llama_index/llama-index-core/tests/question_gen/test_llm_generators.py/0
{ "file_path": "llama_index/llama-index-core/tests/question_gen/test_llm_generators.py", "repo_id": "llama_index", "token_count": 282 }
1,214
# Generated content DO NOT EDIT from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence from os import PathLike from candle.typing import _ArrayLike, Device, Scalar, Index, Shape class bf16(DType): pass @staticmethod def cat(tensors: List[Tensor], dim: int) -> Tensor: """ Concatenat...
candle/candle-pyo3/py_src/candle/__init__.pyi/0
{ "file_path": "candle/candle-pyo3/py_src/candle/__init__.pyi", "repo_id": "candle", "token_count": 5785 }
60
use rand::Rng; pub(super) fn generate_random_data(n: usize, d: usize) -> Vec<f32> { let mut rng: rand::prelude::ThreadRng = rand::thread_rng(); let mut data = vec![0.0f32; n * d]; // Generate random data for i in 0..n { for j in 0..d { data[i * d + j] = rng.gen(); } } ...
chroma/rust/worker/src/index/utils.rs/0
{ "file_path": "chroma/rust/worker/src/index/utils.rs", "repo_id": "chroma", "token_count": 168 }
61
// 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/internal/core/src/segcore/load_index_c.cpp/0
{ "file_path": "milvus/internal/core/src/segcore/load_index_c.cpp", "repo_id": "milvus", "token_count": 8502 }
1,739
import { zodToJsonSchema, JsonSchema7ObjectType } from "zod-to-json-schema"; import { StructuredToolInterface } from "@langchain/core/tools"; /** * Render the tool name and description in plain text. * * Output will be in the format of: * ``` * search: This tool is used for search * calculator: This tool is used...
langchainjs/langchain/src/tools/render.ts/0
{ "file_path": "langchainjs/langchain/src/tools/render.ts", "repo_id": "langchainjs", "token_count": 418 }
956
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { ChainValues } from "@langchain/core/utils/types"; import { CallbackManagerForChainRun } from "@langchain/core/callbacks/manager"; import { BaseChain, ChainInputs } from "../base.js"; import { LLMChain } from "../llm_chain.j...
langchainjs/langchain/src/chains/constitutional_ai/constitutional_chain.ts/0
{ "file_path": "langchainjs/langchain/src/chains/constitutional_ai/constitutional_chain.ts", "repo_id": "langchainjs", "token_count": 2064 }
903
from llama_index.core.vector_stores.types import BasePydanticVectorStore from llama_index.vector_stores.faiss import FaissVectorStore def test_class(): names_of_base_classes = [b.__name__ for b in FaissVectorStore.__mro__] assert BasePydanticVectorStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-faiss/tests/test_vector_stores_faiss.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-faiss/tests/test_vector_stores_faiss.py", "repo_id": "llama_index", "token_count": 100 }
1,607
## Appendix A. Basic Components #### A.1 System Component Milvus has 9 different components and can be abstracted into basic Components. ```go type Component interface { Init() error Start() error Stop() error GetComponentStates(ctx context.Context) (*milvuspb.ComponentStates, error) GetStatisticsChannel(ctx co...
milvus/docs/developer_guides/appendix_a_basic_components.md/0
{ "file_path": "milvus/docs/developer_guides/appendix_a_basic_components.md", "repo_id": "milvus", "token_count": 5696 }
1,770
<jupyter_start><jupyter_text>Tree Summarize If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>!pip install llama-index<jupyter_output><empty_output><jupyter_text>Download Data<jupyter_code>!mkdir -p 'data/paul_graham/' !wget 'https://raw.githubusercontent.com/run-ll...
llama_index/docs/examples/response_synthesizers/tree_summarize.ipynb/0
{ "file_path": "llama_index/docs/examples/response_synthesizers/tree_summarize.ipynb", "repo_id": "llama_index", "token_count": 451 }
1,161
import type { StructuredToolInterface } from "@langchain/core/tools"; import type { BaseChatModel, BaseChatModelCallOptions, } from "@langchain/core/language_models/chat_models"; import { ChatPromptTemplate } from "@langchain/core/prompts"; import { RunnablePassthrough, RunnableSequence, } from "@langchain/core...
langchainjs/langchain/src/agents/openai_tools/index.ts/0
{ "file_path": "langchainjs/langchain/src/agents/openai_tools/index.ts", "repo_id": "langchainjs", "token_count": 1287 }
943
"""Dataset generation from documents.""" from __future__ import annotations import asyncio import re from typing import List, Optional from llama_index.core import Document, ServiceContext, SummaryIndex from llama_index.core.async_utils import DEFAULT_NUM_WORKERS, run_jobs from llama_index.core.base.response.schema i...
llama_index/llama-index-core/llama_index/core/llama_dataset/generator.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/llama_dataset/generator.py", "repo_id": "llama_index", "token_count": 4696 }
1,186
// 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/mq/msgstream/mqwrapper/nmq/nmq_consumer_test.go/0
{ "file_path": "milvus/pkg/mq/msgstream/mqwrapper/nmq/nmq_consumer_test.go", "repo_id": "milvus", "token_count": 5035 }
1,957
from llama_index.core.readers.base import BaseReader from llama_index.readers.obsidian import ObsidianReader def test_class(): names_of_base_classes = [b.__name__ for b in ObsidianReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-obsidian/tests/test_readers_obsidian.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-obsidian/tests/test_readers_obsidian.py", "repo_id": "llama_index", "token_count": 88 }
1,394
import json import re from abc import abstractmethod from typing import Dict, NamedTuple from langchain.schema import BaseOutputParser class AutoGPTAction(NamedTuple): """Action returned by AutoGPTOutputParser.""" name: str args: Dict class BaseAutoGPTOutputParser(BaseOutputParser): """Base Output...
langchain/libs/experimental/langchain_experimental/autonomous_agents/autogpt/output_parser.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/autonomous_agents/autogpt/output_parser.py", "repo_id": "langchain", "token_count": 825 }
443
export interface Timestamps { createdAt: Date; updatedAt: Date; }
chat-ui/src/lib/types/Timestamps.ts/0
{ "file_path": "chat-ui/src/lib/types/Timestamps.ts", "repo_id": "chat-ui", "token_count": 23 }
96
# LlamaIndex Vector_Stores Integration: Elasticsearch
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-elasticsearch/README.md/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-elasticsearch/README.md", "repo_id": "llama_index", "token_count": 13 }
1,604
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { ChainValues } from "@langchain/core/utils/types"; import { Tool, DynamicStructuredTool } from "@langchain/core/tools"; import { CallbackManagerForChainRun } from "@langchain/core/callbacks/manager"; import { BaseChain, Chai...
langchainjs/langchain/src/experimental/plan_and_execute/agent_executor.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/plan_and_execute/agent_executor.ts", "repo_id": "langchainjs", "token_count": 2513 }
925
<jupyter_start><jupyter_text>Local Embeddings with HuggingFaceLlamaIndex has support for HuggingFace embedding models, including BGE, Instructor, and more.Furthermore, we provide utilties to create and use ONNX models using the [Optimum library](https://huggingface.co/docs/transformers/serializationexporting-a-transfor...
llama_index/docs/examples/embeddings/huggingface.ipynb/0
{ "file_path": "llama_index/docs/examples/embeddings/huggingface.ipynb", "repo_id": "llama_index", "token_count": 1672 }
1,053
<!--Copyright 2021 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/ja/model_doc/bartpho.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/bartpho.md", "repo_id": "transformers", "token_count": 1761 }
513
# timm <img class="float-left !m-0 !border-0 !dark:border-0 !shadow-none !max-w-lg w-[150px]" src="https://huggingface.co/front/thumbnails/docs/timm.png"/> `timm` is a library containing SOTA computer vision models, layers, utilities, optimizers, schedulers, data-loaders, augmentations, and training/evaluation script...
pytorch-image-models/hfdocs/source/index.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/index.mdx", "repo_id": "pytorch-image-models", "token_count": 560 }
334
from enum import Enum from typing import Any, AsyncGenerator, Generator, Optional from llama_index.legacy.bridge.pydantic import BaseModel, Field from llama_index.legacy.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS class MessageRole(str, Enum): """Message role.""" SYSTEM = "system" USER ...
llama_index/llama-index-legacy/llama_index/legacy/core/llms/types.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/core/llms/types.py", "repo_id": "llama_index", "token_count": 1388 }
1,585
"""Mock embedding model.""" from typing import Any, List from llama_index.core.base.embeddings.base import BaseEmbedding class MockEmbedding(BaseEmbedding): """Mock embedding. Used for token prediction. Args: embed_dim (int): embedding dimension """ embed_dim: int def __init__(s...
llama_index/llama-index-core/llama_index/core/embeddings/mock_embed_model.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/embeddings/mock_embed_model.py", "repo_id": "llama_index", "token_count": 439 }
1,253
"""Tool mapping.""" from typing import Any, Dict, Optional, Sequence from llama_index.legacy.objects.base_node_mapping import ( DEFAULT_PERSIST_DIR, DEFAULT_PERSIST_FNAME, BaseObjectNodeMapping, ) from llama_index.legacy.schema import BaseNode, TextNode from llama_index.legacy.tools.query_engine import Qu...
llama_index/llama-index-legacy/llama_index/legacy/objects/tool_node_mapping.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/objects/tool_node_mapping.py", "repo_id": "llama_index", "token_count": 1928 }
1,586
# Router Also named `webserver` throughout the docs. This router is handling most of the logic to handle the "batches" tell when to pass new `prefill` requests and pausing `decode` requests, which ones etc... It uses gRPC to communicate with the shards which can therefore be kept much simpler and focus on having the...
text-generation-inference/router/README.md/0
{ "file_path": "text-generation-inference/router/README.md", "repo_id": "text-generation-inference", "token_count": 1177 }
403
"""Embedding adapter model.""" import logging from typing import Any, List, Optional, Type, cast from llama_index.legacy.bridge.pydantic import PrivateAttr from llama_index.legacy.callbacks import CallbackManager from llama_index.legacy.constants import DEFAULT_EMBED_BATCH_SIZE from llama_index.legacy.core.embeddings...
llama_index/llama-index-legacy/llama_index/legacy/embeddings/adapter.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/embeddings/adapter.py", "repo_id": "llama_index", "token_count": 1695 }
1,699
from ssl import ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY import threading import numpy as np import pandas as pd import random import pytest from pymilvus import Index, DataType from pymilvus.exceptions import MilvusException from base.client_base import TestcaseBase from utils.util_log import test_log as log from comm...
milvus/tests/python_client/testcases/test_insert.py/0
{ "file_path": "milvus/tests/python_client/testcases/test_insert.py", "repo_id": "milvus", "token_count": 47941 }
1,975
python_tests()
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,219
export function isUrl(url: string): boolean { try { new URL(url); return true; } catch (error) { return false; } }
langchainjs/libs/create-langchain-integration/helpers/is-url.ts/0
{ "file_path": "langchainjs/libs/create-langchain-integration/helpers/is-url.ts", "repo_id": "langchainjs", "token_count": 52 }
969
# coding=utf-8 # Copyright 2023 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...
transformers/tests/models/pix2struct/test_image_processing_pix2struct.py/0
{ "file_path": "transformers/tests/models/pix2struct/test_image_processing_pix2struct.py", "repo_id": "transformers", "token_count": 6116 }
831
<!--Copyright 2021 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/debugging.md/0
{ "file_path": "transformers/docs/source/ko/debugging.md", "repo_id": "transformers", "token_count": 9860 }
552
<jupyter_start><jupyter_text>DreamBooth Hackathon 🏆 Welcome to the DreamBooth Hackathon! In this competition, you'll **personalise a Stable Diffusion model by fine-tuning it on a handful of your own images.** To do so, we'll use a technique called [_DreamBooth_](https://arxiv.org/abs/2208.12242), which allows one to i...
diffusion-models-class/hackathon/dreambooth.ipynb/0
{ "file_path": "diffusion-models-class/hackathon/dreambooth.ipynb", "repo_id": "diffusion-models-class", "token_count": 9167 }
303
import { EnhancedGenerateContentResponse, Content, Part, } from "@google/generative-ai"; import { AIMessage, AIMessageChunk, BaseMessage, ChatMessage, MessageContent, isBaseMessage, } from "@langchain/core/messages"; import { ChatGeneration, ChatGenerationChunk, ChatResult, } from "@langchain/co...
langchainjs/libs/langchain-google-genai/src/utils.ts/0
{ "file_path": "langchainjs/libs/langchain-google-genai/src/utils.ts", "repo_id": "langchainjs", "token_count": 2077 }
980
<jupyter_start><jupyter_text>Google DriveThis notebook walks through connecting a LangChain to the `Google Drive API`. Prerequisites1. Create a Google Cloud project or use an existing project1. Enable the [Google Drive API](https://console.cloud.google.com/flows/enableapi?apiid=drive.googleapis.com)1. [Authorize creden...
langchain/docs/docs/integrations/tools/google_drive.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/google_drive.ipynb", "repo_id": "langchain", "token_count": 1230 }
183
from __future__ import annotations import enum import threading from abc import abstractmethod from typing import ( Any, AsyncIterator, Callable, Dict, Iterator, List, Optional, Sequence, Tuple, Type, Union, cast, ) from weakref import WeakValueDictionary from langchain...
langchain/libs/core/langchain_core/runnables/configurable.py/0
{ "file_path": "langchain/libs/core/langchain_core/runnables/configurable.py", "repo_id": "langchain", "token_count": 8410 }
429
# order by contributions reviewers: - FluorineDog - DragonDriver - fishpenguin - czs007 - xiaocai2333 - godchen0212 - bigsheeper approvers: - maintainers
milvus/internal/core/OWNERS/0
{ "file_path": "milvus/internal/core/OWNERS", "repo_id": "milvus", "token_count": 66 }
1,650
from langchain_community.document_loaders.chromium import AsyncChromiumLoader __all__ = ["AsyncChromiumLoader"]
langchain/libs/langchain/langchain/document_loaders/chromium.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/chromium.py", "repo_id": "langchain", "token_count": 34 }
503
"""Base retriever.""" from abc import abstractmethod from typing import Any, Dict, List, Optional from llama_index.legacy.bridge.pydantic import Field from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.callbacks.schema import CBEventType, EventPayload from llama_index.legacy.core.ba...
llama_index/llama-index-legacy/llama_index/legacy/core/base_retriever.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/core/base_retriever.py", "repo_id": "llama_index", "token_count": 5618 }
1,584
package indexparamcheck type flatChecker struct { floatVectorBaseChecker } func (c flatChecker) StaticCheck(m map[string]string) error { return c.staticCheck(m) } func newFlatChecker() IndexChecker { return &flatChecker{} }
milvus/pkg/util/indexparamcheck/flat_checker.go/0
{ "file_path": "milvus/pkg/util/indexparamcheck/flat_checker.go", "repo_id": "milvus", "token_count": 79 }
1,912
# coding=utf-8 # Copyright 2022 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/xlm_roberta_xl/configuration_xlm_roberta_xl.py/0
{ "file_path": "transformers/src/transformers/models/xlm_roberta_xl/configuration_xlm_roberta_xl.py", "repo_id": "transformers", "token_count": 2935 }
680
from langchain_community.embeddings.edenai import EdenAiEmbeddings __all__ = ["EdenAiEmbeddings"]
langchain/libs/langchain/langchain/embeddings/edenai.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/edenai.py", "repo_id": "langchain", "token_count": 35 }
506
# coding=utf-8 # Copyright (c) 2020, VinAI Research and the HuggingFace Inc. team. # Copyright 2018 The Open AI Team 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 th...
transformers/src/transformers/models/bertweet/tokenization_bertweet.py/0
{ "file_path": "transformers/src/transformers/models/bertweet/tokenization_bertweet.py", "repo_id": "transformers", "token_count": 12290 }
609
# Débruitage inverse des modèles de diffusion implicites (DDIM) <CourseFloatingBanner unit={4} classNames="absolute z-10 right-0 top-0" notebooks={[ {label: "Débruitage inverse des modèles de diffusion implicites (DDIM)", value: "https://colab.research.google.com/github/huggingface/diffusion-models-class/blob/mai...
diffusion-models-class/units/fr/unit4/2.mdx/0
{ "file_path": "diffusion-models-class/units/fr/unit4/2.mdx", "repo_id": "diffusion-models-class", "token_count": 9611 }
287
<jupyter_start><jupyter_text>Guidance for Sub-Question Query Engine In this notebook, we showcase how to use [**guidance**](https://github.com/microsoft/guidance) to improve the robustness of our sub-question query engine. The sub-question query engine is designed to accept swappable question generators that implemen...
llama_index/docs/examples/output_parsing/guidance_sub_question.ipynb/0
{ "file_path": "llama_index/docs/examples/output_parsing/guidance_sub_question.ipynb", "repo_id": "llama_index", "token_count": 1576 }
1,099
"""Gmail toolkit."""
langchain/libs/community/langchain_community/agent_toolkits/gmail/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/gmail/__init__.py", "repo_id": "langchain", "token_count": 8 }
222
package datacoord import ( "context" "testing" "github.com/cockroachdb/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "github.com/milvus-io/milvus/internal/mocks" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/types" "github.com/milv...
milvus/internal/datacoord/session_manager_test.go/0
{ "file_path": "milvus/internal/datacoord/session_manager_test.go", "repo_id": "milvus", "token_count": 1247 }
1,770
# JSON files The JSON loader use [JSON pointer](https://github.com/janl/node-jsonpointer) to target keys in your JSON files you want to target. ### No JSON pointer example The most simple way of using it, is to specify no JSON pointer. The loader will load all strings it finds in the JSON object. Example JSON file:...
langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/json.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/json.mdx", "repo_id": "langchainjs", "token_count": 801 }
757
# DropCollection release resources ## Before this enhancement **When dropping a collection** 1. DataNode releases the flowgraph of this collection and drops all the data in a buffer. 2. DataCoord has no idea whether a collection is dropped or not. - DataCoord will make DataNode watch DmChannels of dropped collec...
milvus/docs/design_docs/20211224-drop_collection_release_resources.md/0
{ "file_path": "milvus/docs/design_docs/20211224-drop_collection_release_resources.md", "repo_id": "milvus", "token_count": 847 }
1,852
from typing import Optional from urllib.parse import urlparse import pytest from hypothesis import given, strategies as st from chromadb.api.fastapi import FastAPI def hostname_strategy() -> st.SearchStrategy[str]: label = st.text( alphabet=st.characters(min_codepoint=97, max_codepoint=122), min...
chroma/chromadb/test/property/test_client_url.py/0
{ "file_path": "chroma/chromadb/test/property/test_client_url.py", "repo_id": "chroma", "token_count": 1760 }
22
"""The Chain runs self-critique based on the Constitutional AI method proposed by \ (Bai et al., 2022)."""
langchain/libs/langchain/langchain/chains/constitutional_ai/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/constitutional_ai/__init__.py", "repo_id": "langchain", "token_count": 28 }
478
poetry_requirements( name="poetry", )
llama_index/llama-index-packs/llama-index-packs-cogniswitch-agent/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-cogniswitch-agent/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,777
""" Checkpoint Saver Track top-n training checkpoints and maintain recovery checkpoints on specified intervals. Hacked together by / Copyright 2020 Ross Wightman """ import glob import operator import os import logging import torch from .model import unwrap_model, get_state_dict _logger = logging.getLogger(__nam...
pytorch-image-models/timm/utils/checkpoint_saver.py/0
{ "file_path": "pytorch-image-models/timm/utils/checkpoint_saver.py", "repo_id": "pytorch-image-models", "token_count": 2818 }
413
<!--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 applicable law or agreed...
diffusers/docs/source/en/using-diffusers/write_own_pipeline.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/write_own_pipeline.md", "repo_id": "diffusers", "token_count": 4162 }
176
"""VectorStore wrapper around a Postgres-TimescaleVector database.""" from __future__ import annotations import enum import logging import uuid from datetime import timedelta from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union, )...
langchain/libs/community/langchain_community/vectorstores/timescalevector.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/timescalevector.py", "repo_id": "langchain", "token_count": 13739 }
315
# 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/loaders/lora.py/0
{ "file_path": "diffusers/src/diffusers/loaders/lora.py", "repo_id": "diffusers", "token_count": 28473 }
221
from typing import Dict, List, Optional, Tuple, Union from tokenizers import AddedToken, EncodeInput, Encoding, InputSequence, Tokenizer from tokenizers.decoders import Decoder from tokenizers.models import Model from tokenizers.normalizers import Normalizer from tokenizers.pre_tokenizers import PreTokenizer from toke...
tokenizers/bindings/python/py_src/tokenizers/implementations/base_tokenizer.py/0
{ "file_path": "tokenizers/bindings/python/py_src/tokenizers/implementations/base_tokenizer.py", "repo_id": "tokenizers", "token_count": 6036 }
435
from langchain_community.retrievers.svm import SVMRetriever __all__ = ["SVMRetriever"]
langchain/libs/langchain/langchain/retrievers/svm.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/svm.py", "repo_id": "langchain", "token_count": 32 }
543
#!/usr/bin/env groovy def app="meta-migration" def date="" def gitShortCommit="" pipeline { agent { kubernetes { defaultContainer 'main' yamlFile "ci/jenkins/pod/meta-migration.yaml" customWorkspace '/home/jenkins/agent/workspace' } } options { ti...
milvus/ci/jenkins/PublishMigrationImage.groovy/0
{ "file_path": "milvus/ci/jenkins/PublishMigrationImage.groovy", "repo_id": "milvus", "token_count": 1597 }
1,707
## 🌲 Tree Index Currently the tree index refers to the `TreeIndex` class. It organizes external data into a tree structure that can be queried. ### Index Construction The `TreeIndex` first takes in a set of text documents as input. It then builds up a tree-index in a bottom-up fashion; each parent node is able to s...
llama_index/llama-index-core/llama_index/core/indices/tree/README.md/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/tree/README.md", "repo_id": "llama_index", "token_count": 693 }
1,222
import re # regular expressions to match the different syntax of YouTube links YOUTUBE_URL_PATTERNS = [ r"^https?://(?:www\.)?youtube\.com/watch\?v=([\w-]+)", r"^https?://(?:www\.)?youtube\.com/embed/([\w-]+)", r"^https?://youtu\.be/([\w-]+)", # youtu.be does not use www ] def is_youtube_video(url: str)...
llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/llama_index/readers/youtube_transcript/utils.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/llama_index/readers/youtube_transcript/utils.py", "repo_id": "llama_index", "token_count": 225 }
1,452
// 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/internal/core/unittest/test_string_index.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_string_index.cpp", "repo_id": "milvus", "token_count": 7063 }
1,906
"""Multidoc Autoretriever.""" from typing import Any, Dict, List, Optional, cast from llama_index.core import VectorStoreIndex from llama_index.core.indices.query.schema import QueryBundle from llama_index.core.llama_pack.base import BaseLlamaPack from llama_index.core.query_engine import RetrieverQueryEngine from ll...
llama_index/llama-index-packs/llama-index-packs-multidoc-autoretrieval/llama_index/packs/multidoc_autoretrieval/base.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-multidoc-autoretrieval/llama_index/packs/multidoc_autoretrieval/base.py", "repo_id": "llama_index", "token_count": 2682 }
1,681
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/utilities/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/utilities/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,651
# Evaluating Evaluation and benchmarking are crucial concepts in LLM development. To improve the performance of an LLM app (RAG, agents), you must have a way to measure it. LlamaIndex offers key modules to measure the quality of generated results. We also offer key modules to measure retrieval quality. You can learn ...
llama_index/docs/understanding/evaluating/evaluating.md/0
{ "file_path": "llama_index/docs/understanding/evaluating/evaluating.md", "repo_id": "llama_index", "token_count": 777 }
1,109
// 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/config/event.go/0
{ "file_path": "milvus/pkg/config/event.go", "repo_id": "milvus", "token_count": 590 }
1,890
<jupyter_start><jupyter_text>Connery ToolkitUsing this toolkit, you can integrate Connery Actions into your LangChain agent.If you want to use only one particular Connery Action in your agent,check out the [Connery Action Tool](/docs/integrations/tools/connery) documentation. What is Connery?Connery is an open-source p...
langchain/docs/docs/integrations/toolkits/connery.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/toolkits/connery.ipynb", "repo_id": "langchain", "token_count": 1144 }
174
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/tools/llama-index-tools-openai/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-openai/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,448
# coding=utf-8 # Copyright 2023 The Kakao Enterprise 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/...
transformers/src/transformers/models/vits/modeling_vits.py/0
{ "file_path": "transformers/src/transformers/models/vits/modeling_vits.py", "repo_id": "transformers", "token_count": 28934 }
765
<!--Copyright 2023 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...
peft/docs/source/developer_guides/custom_models.md/0
{ "file_path": "peft/docs/source/developer_guides/custom_models.md", "repo_id": "peft", "token_count": 3721 }
334
from typing import Any, Dict, List, Optional from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import ( BaseModel, Extra, Field, SecretStr, root_validator, ) from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env from langchain_community.utiliti...
langchain/libs/community/langchain_community/embeddings/edenai.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/edenai.py", "repo_id": "langchain", "token_count": 1551 }
251
<jupyter_start><jupyter_text>GPT4All[GitHub:nomic-ai/gpt4all](https://github.com/nomic-ai/gpt4all) an ecosystem of open-source chatbots trained on a massive collections of clean assistant data including code, stories and dialogue.This example goes over how to use LangChain to interact with `GPT4All` models.<jupyter_cod...
langchain/docs/docs/integrations/llms/gpt4all.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/gpt4all.ipynb", "repo_id": "langchain", "token_count": 654 }
128
from llama_index.embeddings.gradient.base import GradientEmbedding __all__ = ["GradientEmbedding"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gradient/llama_index/embeddings/gradient/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gradient/llama_index/embeddings/gradient/__init__.py", "repo_id": "llama_index", "token_count": 33 }
1,260
python_tests( name="tests", ) python_sources()
llama_index/llama-index-core/tests/vector_stores/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/vector_stores/BUILD", "repo_id": "llama_index", "token_count": 22 }
1,248
from llama_index.core.tools.tool_spec.base import BaseToolSpec from llama_index.tools.multion import MultionToolSpec def test_class(): names_of_base_classes = [b.__name__ for b in MultionToolSpec.__mro__] assert BaseToolSpec.__name__ in names_of_base_classes
llama_index/llama-index-integrations/tools/llama-index-tools-multion/tests/test_tools_multion.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-multion/tests/test_tools_multion.py", "repo_id": "llama_index", "token_count": 94 }
1,430
# coding=utf-8 # Copyright 2020 The HuggingFace Inc. team, Microsoft Corporation. # # 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...
transformers/tests/models/mpnet/test_modeling_mpnet.py/0
{ "file_path": "transformers/tests/models/mpnet/test_modeling_mpnet.py", "repo_id": "transformers", "token_count": 4626 }
799
from typing import List import pytest from langchain_core.tools import BaseTool, tool from langchain.tools.render import ( render_text_description, render_text_description_and_args, ) @tool def search(query: str) -> str: """Lookup things online.""" return "foo" @tool def calculator(expression: str...
langchain/libs/langchain/tests/unit_tests/tools/test_render.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/tools/test_render.py", "repo_id": "langchain", "token_count": 396 }
656
from langchain_community.retrievers.kendra import ( AdditionalResultAttribute, AdditionalResultAttributeValue, AmazonKendraRetriever, DocumentAttribute, DocumentAttributeValue, DocumentAttributeValueType, Highlight, QueryResult, QueryResultItem, ResultItem, RetrieveResult, ...
langchain/libs/langchain/langchain/retrievers/kendra.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/kendra.py", "repo_id": "langchain", "token_count": 292 }
557
//! 2D UNet Building Blocks //! use super::attention::{ AttentionBlock, AttentionBlockConfig, SpatialTransformer, SpatialTransformerConfig, }; use super::resnet::{ResnetBlock2D, ResnetBlock2DConfig}; use crate::models::with_tracing::{conv2d, Conv2d}; use candle::{Module, Result, Tensor, D}; use candle_nn as nn; #[...
candle/candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs/0
{ "file_path": "candle/candle-transformers/src/models/stable_diffusion/unet_2d_blocks.rs", "repo_id": "candle", "token_count": 13815 }
77
""" Conv2d w/ Same Padding Hacked together by / Copyright 2020 Ross Wightman """ import torch import torch.nn as nn import torch.nn.functional as F from typing import Tuple, Optional from .config import is_exportable, is_scriptable from .padding import pad_same, pad_same_arg, get_padding_value _USE_EXPORT_CONV = Fa...
pytorch-image-models/timm/layers/conv2d_same.py/0
{ "file_path": "pytorch-image-models/timm/layers/conv2d_same.py", "repo_id": "pytorch-image-models", "token_count": 1560 }
331
python_sources()
llama_index/llama-index-core/llama_index/core/llama_dataset/legacy/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/llama_dataset/legacy/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,136
python_tests()
llama_index/llama-index-integrations/llms/llama-index-llms-mistralai/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-mistralai/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,232
import importlib.util import pytest from llama_index.core.node_parser.file.html import HTMLNodeParser from llama_index.core.schema import Document @pytest.mark.xfail( raises=ImportError, reason="Requires beautifulsoup4.", condition=importlib.util.find_spec("beautifulsoup4") is None, ) def test_no_splits(...
llama_index/llama-index-core/tests/node_parser/test_html.py/0
{ "file_path": "llama_index/llama-index-core/tests/node_parser/test_html.py", "repo_id": "llama_index", "token_count": 1748 }
1,320
import * as fs from "fs"; import { OpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { ContextualCompressionRetriever } from "langchain/retrievers/contextual_compress...
langchainjs/examples/src/retrievers/contextual_compression.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/contextual_compression.ts", "repo_id": "langchainjs", "token_count": 588 }
882
import * as uuid from "uuid"; import { SearchClient, SearchIndexClient, AzureKeyCredential, IndexingResult, SearchIndex, SearchIndexingBufferedSender, VectorFilterMode, } from "@azure/search-documents"; import { MaxMarginalRelevanceSearchOptions, VectorStore, } from "@langchain/core/vectorstores"; imp...
langchainjs/libs/langchain-community/src/vectorstores/azure_aisearch.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/azure_aisearch.ts", "repo_id": "langchainjs", "token_count": 8869 }
1,001
"""Test ChatGoogleVertexAI chat model.""" import json from typing import Optional, cast import pytest from langchain_core.messages import ( AIMessage, AIMessageChunk, HumanMessage, SystemMessage, ) from langchain_core.outputs import ChatGeneration, LLMResult from langchain_core.pydantic_v1 import Base...
langchain/libs/partners/google-vertexai/tests/integration_tests/test_chat_models.py/0
{ "file_path": "langchain/libs/partners/google-vertexai/tests/integration_tests/test_chat_models.py", "repo_id": "langchain", "token_count": 3496 }
628
# RegNetX **RegNetX** is a convolutional network design space with simple, regular models with parameters: depth $d$, initial width $w\_{0} > 0$, and slope $w\_{a} > 0$, and generates a different block width $u\_{j}$ for each block $j < d$. The key restriction for the RegNet types of model is that there is a linear pa...
pytorch-image-models/docs/models/regnetx.md/0
{ "file_path": "pytorch-image-models/docs/models/regnetx.md", "repo_id": "pytorch-image-models", "token_count": 6551 }
352
<jupyter_start><jupyter_text>Google Cloud Document AI Document AI is a document understanding platform from Google Cloud to transform unstructured data from documents into structured data, making it easier to understand, analyze, and consume.Learn more:- [Document AI overview](https://cloud.google.com/document-ai/docs/...
langchain/docs/docs/integrations/document_transformers/docai.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_transformers/docai.ipynb", "repo_id": "langchain", "token_count": 1195 }
125
// 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/datacoord/metrics_info_test.go/0
{ "file_path": "milvus/internal/datacoord/metrics_info_test.go", "repo_id": "milvus", "token_count": 2491 }
1,794