text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
# MediaWikiDump >[MediaWiki XML Dumps](https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps) contain the content of a wiki > (wiki pages with all their revisions), without the site-related data. A XML dump does not create a full backup > of the wiki database, the dump does not contain user accounts, images, edi...
langchain/docs/docs/integrations/providers/mediawikidump.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/mediawikidump.mdx", "repo_id": "langchain", "token_count": 303 }
140
# Stack Exchange >[Stack Exchange](https://en.wikipedia.org/wiki/Stack_Exchange) is a network of question-and-answer (Q&A) websites on topics in diverse fields, each site covering a specific topic, where questions, answers, and users are subject to a reputation award process. This page covers how to use the `Stack ...
langchain/docs/docs/integrations/providers/stackexchange.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/stackexchange.mdx", "repo_id": "langchain", "token_count": 286 }
157
// 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_segcore.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_segcore.cpp", "repo_id": "milvus", "token_count": 2673 }
1,785
<jupyter_start><jupyter_text>Causal program-aided language (CPAL) chainThe CPAL chain builds on the recent PAL to stop LLM hallucination. The problem with the PAL approach is that it hallucinates on a math problem with a nested chain of dependence. The innovation here is that this new CPAL approach includes causal stru...
langchain/cookbook/causal_program_aided_language_model.ipynb/0
{ "file_path": "langchain/cookbook/causal_program_aided_language_model.ipynb", "repo_id": "langchain", "token_count": 2146 }
74
import { PlusIcon } from "@heroicons/react/24/outline"; import { ChatListProps } from "../hooks/useChatList"; import { ConfigListProps } from "../hooks/useConfigList"; import { cn } from "../utils/cn"; export function ChatList(props: { chats: ChatListProps["chats"]; currentChat: ChatListProps["currentChat"]; en...
opengpts/frontend/src/components/ChatList.tsx/0
{ "file_path": "opengpts/frontend/src/components/ChatList.tsx", "repo_id": "opengpts", "token_count": 1831 }
1,915
import { MemoryVectorStore } from "langchain/vectorstores/memory"; import { OpenAIEmbeddings } from "@langchain/openai"; import { ScoreThresholdRetriever } from "langchain/retrievers/score_threshold"; const vectorStore = await MemoryVectorStore.fromTexts( [ "Buildings are made out of brick", "Buildings are m...
langchainjs/examples/src/retrievers/similarity_score_threshold.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/similarity_score_threshold.ts", "repo_id": "langchainjs", "token_count": 587 }
841
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/storage/index_store/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/index_store/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,716
// 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/eventlog/logger_test.go/0
{ "file_path": "milvus/pkg/eventlog/logger_test.go", "repo_id": "milvus", "token_count": 845 }
1,808
import copy import logging import time from operator import methodcaller from yaml import full_load, dump import threading from milvus_benchmark import utils from milvus_benchmark.runners import utils as runner_utils from milvus_benchmark.chaos import utils as chaos_utils from milvus_benchmark.runners.base import BaseR...
milvus/tests/benchmark/milvus_benchmark/runners/chaos.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/runners/chaos.py", "repo_id": "milvus", "token_count": 2250 }
2,079
from __future__ import annotations import logging import uuid from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Type from sqlalchemy import REAL, Column, String, Table, create_engine, insert, text from sqlalchemy.dialects.postgresql import ARRAY, JSON, TEXT try: from sqlalchemy.o...
langchain/libs/community/langchain_community/vectorstores/analyticdb.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/analyticdb.py", "repo_id": "langchain", "token_count": 7350 }
322
# Hybrid Search in Weaviate This template shows you how to use the hybrid search feature in Weaviate. Hybrid search combines multiple search algorithms to improve the accuracy and relevance of search results. Weaviate uses both sparse and dense vectors to represent the meaning and context of search queries and docume...
langchain/templates/hybrid-search-weaviate/README.md/0
{ "file_path": "langchain/templates/hybrid-search-weaviate/README.md", "repo_id": "langchain", "token_count": 721 }
663
export * from "./deep-compare-strict.js"; export * from "./dereference.js"; export * from "./format.js"; export * from "./pointer.js"; export * from "./types.js"; export * from "./ucs2-length.js"; export * from "./validate.js"; export * from "./validator.js";
langchainjs/langchain-core/src/utils/@cfworker/json-schema/src/index.ts/0
{ "file_path": "langchainjs/langchain-core/src/utils/@cfworker/json-schema/src/index.ts", "repo_id": "langchainjs", "token_count": 94 }
843
"""Fetch information about any current git repo.""" import functools import logging import subprocess from typing import List, Optional, TypeVar from typing_extensions import TypedDict logger = logging.getLogger(__name__) T = TypeVar("T") def exec_git(command: List[str]) -> Optional[str]: try: return ...
langsmith-sdk/python/langsmith/env/_git.py/0
{ "file_path": "langsmith-sdk/python/langsmith/env/_git.py", "repo_id": "langsmith-sdk", "token_count": 651 }
1,105
// 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/query/visitors/ExtractInfoExprVisitor.cpp/0
{ "file_path": "milvus/internal/core/src/query/visitors/ExtractInfoExprVisitor.cpp", "repo_id": "milvus", "token_count": 811 }
1,932
poetry_requirements( name="poetry", )
llama_index/llama-index-packs/llama-index-packs-tables/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-tables/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,734
import { ZepVectorStore } from "@langchain/community/vectorstores/zep"; import { FakeEmbeddings } from "@langchain/core/utils/testing"; import { randomUUID } from "crypto"; import { Document } from "@langchain/core/documents"; const docs = [ new Document({ metadata: { album: "Led Zeppelin IV", year: 1971 }, ...
langchainjs/examples/src/indexes/vector_stores/zep/zep_with_metadata.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/zep/zep_with_metadata.ts", "repo_id": "langchainjs", "token_count": 1334 }
792
from langchain_community.document_loaders.figma import FigmaFileLoader ACCESS_TOKEN = "" IDS = "" KEY = "" def test_figma_file_loader() -> None: """Test Figma file loader.""" loader = FigmaFileLoader(ACCESS_TOKEN, IDS, KEY) docs = loader.load() assert len(docs) == 1
langchain/libs/community/tests/integration_tests/document_loaders/test_figma.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_figma.py", "repo_id": "langchain", "token_count": 106 }
341
from langchain_community.llms.cohere import ( Cohere, ) __all__ = [ "Cohere", ]
langchain/libs/langchain/langchain/llms/cohere.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/cohere.py", "repo_id": "langchain", "token_count": 40 }
537
from langchain_community.embeddings.minimax import ( MiniMaxEmbeddings, ) __all__ = ["MiniMaxEmbeddings"]
langchain/libs/langchain/langchain/embeddings/minimax.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/minimax.py", "repo_id": "langchain", "token_count": 41 }
499
import asyncio import json from typing import Any, Dict, List, Optional import yaml from llama_index.core import Document, ServiceContext, VectorStoreIndex from llama_index.core.async_utils import run_jobs from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.core.base.response.schema import...
llama_index/llama-index-packs/llama-index-packs-dense-x-retrieval/llama_index/packs/dense_x_retrieval/base.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-dense-x-retrieval/llama_index/packs/dense_x_retrieval/base.py", "repo_id": "llama_index", "token_count": 2926 }
1,651
import { CohereEmbeddings } from "@langchain/cohere"; import { VercelPostgres } from "@langchain/community/vectorstores/vercel_postgres"; // Config is only required if you want to override default values. const config = { // tableName: "testvercelvectorstorelangchain", // postgresConnectionOptions: { // connec...
langchainjs/examples/src/indexes/vector_stores/vercel_postgres/example.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/vercel_postgres/example.ts", "repo_id": "langchainjs", "token_count": 1036 }
792
from abc import ABC, abstractmethod from typing import List class CodeSegmenter(ABC): """Abstract class for the code segmenter.""" def __init__(self, code: str): self.code = code def is_valid(self) -> bool: return True @abstractmethod def simplify_code(self) -> str: rais...
langchain/libs/community/langchain_community/document_loaders/parsers/language/code_segmenter.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/parsers/language/code_segmenter.py", "repo_id": "langchain", "token_count": 183 }
244
# Tests the CustomResourceMemberlist provider import threading from chromadb.test.conftest import skip_if_not_cluster from kubernetes import client, config from chromadb.config import System, Settings from chromadb.segment.distributed import Memberlist from chromadb.segment.impl.distributed.segment_directory import ( ...
chroma/chromadb/test/segment/distributed/test_memberlist_provider.py/0
{ "file_path": "chroma/chromadb/test/segment/distributed/test_memberlist_provider.py", "repo_id": "chroma", "token_count": 1192 }
23
"""Steam Toolkit.""" from typing import List from langchain_community.agent_toolkits.base import BaseToolkit from langchain_community.tools import BaseTool from langchain_community.tools.steam.prompt import ( STEAM_GET_GAMES_DETAILS, STEAM_GET_RECOMMENDED_GAMES, ) from langchain_community.tools.steam.tool impo...
langchain/libs/community/langchain_community/agent_toolkits/steam/toolkit.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/steam/toolkit.py", "repo_id": "langchain", "token_count": 677 }
217
package datacoord import ( "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus/internal/util/sessionutil" ) func Test_IndexEngineVersionManager_GetMergedIndexVersion(t *testing.T) { m := newIndexEngineVersionManager() // empty assert.Zero(t, m.GetCurrentIndexEngineVersion()) // star...
milvus/internal/datacoord/index_engine_version_manager_test.go/0
{ "file_path": "milvus/internal/datacoord/index_engine_version_manager_test.go", "repo_id": "milvus", "token_count": 639 }
1,962
from typing import Any, Optional, Sequence from langchain_core.documents import BaseDocumentTransformer, Document from langchain_community.utilities.vertexai import get_client_info class GoogleTranslateTransformer(BaseDocumentTransformer): """Translate text documents using Google Cloud Translation.""" def ...
langchain/libs/community/langchain_community/document_transformers/google_translate.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_transformers/google_translate.py", "repo_id": "langchain", "token_count": 1857 }
264
import { z } from "zod"; import { OpenAI } from "@langchain/openai"; import { RunnableSequence } from "@langchain/core/runnables"; import { StructuredOutputParser } from "langchain/output_parsers"; import { PromptTemplate } from "@langchain/core/prompts"; // We can use zod to define a schema for the output using the `...
langchainjs/examples/src/prompts/structured_parser_zod_sequence.ts/0
{ "file_path": "langchainjs/examples/src/prompts/structured_parser_zod_sequence.ts", "repo_id": "langchainjs", "token_count": 757 }
881
<jupyter_start><jupyter_code># %pip install-r requirements.txt<jupyter_output><empty_output><jupyter_text>**Note**: This demo is adapted from the LXMERT Demo present here: https://github.com/huggingface/transformers/tree/main/examples/research_projects/lxmert<jupyter_code>from IPython.display import Image, display impo...
transformers/examples/research_projects/visual_bert/demo.ipynb/0
{ "file_path": "transformers/examples/research_projects/visual_bert/demo.ipynb", "repo_id": "transformers", "token_count": 1630 }
539
import type { BackendModel } from "$lib/server/models"; export type Model = Pick< BackendModel, | "id" | "name" | "displayName" | "websiteUrl" | "datasetName" | "promptExamples" | "parameters" | "description" | "modelUrl" | "datasetUrl" | "preprompt" | "multimodal" | "unlisted" >;
chat-ui/src/lib/types/Model.ts/0
{ "file_path": "chat-ui/src/lib/types/Model.ts", "repo_id": "chat-ui", "token_count": 130 }
95
# Glossary [[glossary]] This is a community-created glossary. Contributions are welcomed! ### Strategies to find the optimal policy - **Policy-based methods.** The policy is usually trained with a neural network to select what action to take given a state. In this case it is the neural network which outputs the act...
deep-rl-class/units/en/unit2/glossary.mdx/0
{ "file_path": "deep-rl-class/units/en/unit2/glossary.mdx", "repo_id": "deep-rl-class", "token_count": 760 }
159
import math from dataclasses import dataclass from typing import List, Optional, Tuple, Union import torch from ..configuration_utils import ConfigMixin, register_to_config from ..utils import BaseOutput from .scheduling_utils import SchedulerMixin def gumbel_noise(t, generator=None): device = generator.device ...
diffusers/src/diffusers/schedulers/scheduling_amused.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_amused.py", "repo_id": "diffusers", "token_count": 2780 }
274
"""Test USearch functionality.""" import pytest from langchain_core.documents import Document from langchain_community.vectorstores.usearch import USearch from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings def test_usearch_from_texts() -> None: """Test end to end construction and sea...
langchain/libs/community/tests/integration_tests/vectorstores/test_usearch.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_usearch.py", "repo_id": "langchain", "token_count": 784 }
379
import inspect from typing import Callable, List, Optional, Union import numpy as np import PIL.Image import torch from transformers import CLIPImageProcessor, CLIPTokenizer from ....configuration_utils import FrozenDict from ....schedulers import DDIMScheduler, LMSDiscreteScheduler, PNDMScheduler from ....utils impo...
diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_onnx_stable_diffusion_inpaint_legacy.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_onnx_stable_diffusion_inpaint_legacy.py", "repo_id": "diffusers", "token_count": 12042 }
254
# coding=utf-8 # Copyright 2021 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/layoutlmv2/tokenization_layoutlmv2_fast.py/0
{ "file_path": "transformers/src/transformers/models/layoutlmv2/tokenization_layoutlmv2_fast.py", "repo_id": "transformers", "token_count": 17706 }
687
# coding=utf-8 # Copyright 2021 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/trocr/convert_trocr_unilm_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/trocr/convert_trocr_unilm_to_pytorch.py", "repo_id": "transformers", "token_count": 4295 }
740
# coding=utf-8 # Copyright 2022 Microsoft Research 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/L...
transformers/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py/0
{ "file_path": "transformers/src/transformers/models/layoutlmv3/configuration_layoutlmv3.py", "repo_id": "transformers", "token_count": 5486 }
656
# Apify Loaders ## Apify Actor Loader [Apify](https://apify.com/) is a cloud platform for web scraping and data extraction, which provides an [ecosystem](https://apify.com/store) of more than a thousand ready-made apps called _Actors_ for various scraping, crawling, and extraction use cases. This loader runs a speci...
llama_index/llama-index-integrations/readers/llama-index-readers-apify/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-apify/README.md", "repo_id": "llama_index", "token_count": 1094 }
1,460
// 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/core/src/storage/FileManager.h/0
{ "file_path": "milvus/internal/core/src/storage/FileManager.h", "repo_id": "milvus", "token_count": 2277 }
1,891
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/util/ratelimitutil/limiter.go/0
{ "file_path": "milvus/pkg/util/ratelimitutil/limiter.go", "repo_id": "milvus", "token_count": 1453 }
1,923
from llama_index.legacy.ingestion.cache import IngestionCache from llama_index.legacy.ingestion.pipeline import ( DocstoreStrategy, IngestionPipeline, arun_transformations, run_transformations, ) __all__ = [ "DocstoreStrategy", "IngestionCache", "IngestionPipeline", "run_transformations...
llama_index/llama-index-legacy/llama_index/legacy/ingestion/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/ingestion/__init__.py", "repo_id": "llama_index", "token_count": 142 }
1,573
// 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/core/src/storage/BinlogReader.h/0
{ "file_path": "milvus/internal/core/src/storage/BinlogReader.h", "repo_id": "milvus", "token_count": 500 }
1,754
# A Q-Learning example [[q-learning-example]] To better understand Q-Learning, let's take a simple example: <img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit3/Maze-Example-2.jpg" alt="Maze-Example"/> - You're a mouse in this tiny maze. You always **start at the s...
deep-rl-class/units/en/unit2/q-learning-example.mdx/0
{ "file_path": "deep-rl-class/units/en/unit2/q-learning-example.mdx", "repo_id": "deep-rl-class", "token_count": 1402 }
177
from typing import Any, Mapping, Optional from llama_index.readers.airbyte_cdk.base import AirbyteCDKReader, RecordHandler class AirbyteGongReader(AirbyteCDKReader): """AirbyteGongReader reader. Retrieve documents from Gong Args: config: The config object for the gong source. """ def _...
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-gong/llama_index/readers/airbyte_gong/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-gong/llama_index/readers/airbyte_gong/base.py", "repo_id": "llama_index", "token_count": 280 }
1,279
# 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/launch.py/0
{ "file_path": "accelerate/src/accelerate/utils/launch.py", "repo_id": "accelerate", "token_count": 10860 }
13
from llama_index.core.readers.base import BaseReader from llama_index.readers.gpt_repo import GPTRepoReader def test_class(): names_of_base_classes = [b.__name__ for b in GPTRepoReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-gpt-repo/tests/test_readers_gpt_repo.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-gpt-repo/tests/test_readers_gpt_repo.py", "repo_id": "llama_index", "token_count": 95 }
1,503
{ "imports": { "langchain": "npm:/langchain@0.1.9", "langchain/": "npm:/langchain@0.1.9/", "langsmith": "npm:/langsmith@0.0.63", "langsmith/": "npm:/langsmith@0.0.63/", "@langchain/core": "npm:/@langchain/core@0.1.18", "@langchain/core/": "npm:/@langchain/core@0.1.18/", "@langchain/openai"...
langsmith-cookbook/typescript-testing-examples/vision-evals/deno.json/0
{ "file_path": "langsmith-cookbook/typescript-testing-examples/vision-evals/deno.json", "repo_id": "langsmith-cookbook", "token_count": 267 }
1,064
# coding=utf-8 # Copyright 2022 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/utils/test_image_processing_utils.py/0
{ "file_path": "transformers/tests/utils/test_image_processing_utils.py", "repo_id": "transformers", "token_count": 1072 }
852
.main { display: flex; flex-direction: column; justify-content: space-around; align-items: center; padding: 6rem; min-height: 100vh; }
langchain-template-supabase/src/styles/Home.module.css/0
{ "file_path": "langchain-template-supabase/src/styles/Home.module.css", "repo_id": "langchain-template-supabase", "token_count": 55 }
70
const assert = require("assert"); const { OpenAI } = require("langchain/llms/openai"); const { LLMChain } = require("langchain/chains"); const { ChatPromptTemplate } = require("langchain/prompts"); const { loadPrompt } = require("langchain/prompts/load"); const { MemoryVectorStore } = require("langchain/vectorstores/me...
langchainjs/environment_tests/test-exports-bun/src/require.cjs/0
{ "file_path": "langchainjs/environment_tests/test-exports-bun/src/require.cjs", "repo_id": "langchainjs", "token_count": 522 }
760
import json from typing import List, Optional, TYPE_CHECKING import pandas as pd from llama_index.core.bridge.pydantic import BaseModel from llama_index.core.download.module import LLAMA_HUB_URL from llama_index.core.download.utils import get_file_content from llama_index.core.indices.base import BaseIndex from llama_...
llama_index/llama-index-packs/llama-index-packs-llama-dataset-metadata/llama_index/packs/llama_dataset_metadata/base.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-llama-dataset-metadata/llama_index/packs/llama_dataset_metadata/base.py", "repo_id": "llama_index", "token_count": 3722 }
1,795
from langchain_community.tools.edenai.ocr_invoiceparser import EdenAiParsingInvoiceTool __all__ = ["EdenAiParsingInvoiceTool"]
langchain/libs/langchain/langchain/tools/edenai/ocr_invoiceparser.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/edenai/ocr_invoiceparser.py", "repo_id": "langchain", "token_count": 45 }
553
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/util/interceptor/server_id_interceptor_test.go/0
{ "file_path": "milvus/pkg/util/interceptor/server_id_interceptor_test.go", "repo_id": "milvus", "token_count": 1855 }
1,909
# 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/phobert/tokenization_phobert.py/0
{ "file_path": "transformers/src/transformers/models/phobert/tokenization_phobert.py", "repo_id": "transformers", "token_count": 6273 }
655
from langchain_community.document_loaders.assemblyai import ( AssemblyAIAudioTranscriptLoader, TranscriptFormat, ) __all__ = ["TranscriptFormat", "AssemblyAIAudioTranscriptLoader"]
langchain/libs/langchain/langchain/document_loaders/assemblyai.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/assemblyai.py", "repo_id": "langchain", "token_count": 59 }
478
import { loadEvaluator } from "langchain/evaluation"; import { PromptTemplate } from "@langchain/core/prompts"; const promptTemplate = PromptTemplate.fromTemplate( `Given the input context, which do you prefer: A or B? Evaluate based on the following criteria: {criteria} Reason step by step and finally, respond with...
langchainjs/examples/src/guides/evaluation/comparision_evaluator/pairwise_string_custom_prompt.ts/0
{ "file_path": "langchainjs/examples/src/guides/evaluation/comparision_evaluator/pairwise_string_custom_prompt.ts", "repo_id": "langchainjs", "token_count": 384 }
837
<!--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...
transformers/docs/source/en/tasks/mask_generation.md/0
{ "file_path": "transformers/docs/source/en/tasks/mask_generation.md", "repo_id": "transformers", "token_count": 2851 }
525
# 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/lxmert/test_modeling_tf_lxmert.py/0
{ "file_path": "transformers/tests/models/lxmert/test_modeling_tf_lxmert.py", "repo_id": "transformers", "token_count": 10963 }
769
"""Retriever wrapper for Google Vertex AI Search.""" from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core.pydantic_v1 import BaseMo...
langchain/libs/community/langchain_community/retrievers/google_vertex_ai_search.py/0
{ "file_path": "langchain/libs/community/langchain_community/retrievers/google_vertex_ai_search.py", "repo_id": "langchain", "token_count": 7691 }
276
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 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/L...
transformers/src/transformers/utils/__init__.py/0
{ "file_path": "transformers/src/transformers/utils/__init__.py", "repo_id": "transformers", "token_count": 3246 }
734
import argparse import copy import itertools import logging import math import os import random import shutil from pathlib import Path import numpy as np import torch import torch.nn.functional as F import torch.utils.checkpoint import torchvision.transforms.v2 as transforms_v2 import transformers from accelerate impo...
diffusers/examples/research_projects/realfill/train_realfill.py/0
{ "file_path": "diffusers/examples/research_projects/realfill/train_realfill.py", "repo_id": "diffusers", "token_count": 16390 }
228
# Create Collection `Milvus 2.0` uses `Collection` to represent a set of data, like `Table` in a traditional database. User can create or drop `Collection`. This article introduces the execution path of `CreateCollection`, at the end of this article, you should know which components are involved in `CreateCollection`...
milvus/docs/design_docs/20211217-milvus_create_collection.md/0
{ "file_path": "milvus/docs/design_docs/20211217-milvus_create_collection.md", "repo_id": "milvus", "token_count": 1509 }
1,642
<!--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/ko/using-diffusers/loading_overview.md/0
{ "file_path": "diffusers/docs/source/ko/using-diffusers/loading_overview.md", "repo_id": "diffusers", "token_count": 1157 }
192
# Logging As reinforcement learning algorithms are historically challenging to debug, it's important to pay careful attention to logging. By default, the TRL [`PPOTrainer`] saves a lot of relevant information to `wandb` or `tensorboard`. Upon initialization, pass one of these two options to the [`PPOConfig`]: ``` con...
trl/docs/source/logging.mdx/0
{ "file_path": "trl/docs/source/logging.mdx", "repo_id": "trl", "token_count": 1961 }
807
""" Nvidia NovoGrad Optimizer. Original impl by Nvidia from Jasper example: - https://github.com/NVIDIA/DeepLearningExamples/blob/master/PyTorch/SpeechRecognition/Jasper Paper: `Stochastic Gradient Methods with Layer-wise Adaptive Moments for Training of Deep Networks` - https://arxiv.org/abs/1905.11286 """ im...
pytorch-image-models/timm/optim/nvnovograd.py/0
{ "file_path": "pytorch-image-models/timm/optim/nvnovograd.py", "repo_id": "pytorch-image-models", "token_count": 2415 }
362
# coding=utf-8 # Copyright 2023 Microsoft Research & University of Wisconsin-Madison 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/llava/configuration_llava.py/0
{ "file_path": "transformers/src/transformers/models/llava/configuration_llava.py", "repo_id": "transformers", "token_count": 2085 }
624
<jupyter_start><jupyter_text>Contextual compressionOne challenge with retrieval is that usually you don't know the specific queries your document storage system will face when you ingest data into the system. This means that the information most relevant to a query may be buried in a document with a lot of irrelevant t...
langchain/docs/docs/modules/data_connection/retrievers/contextual_compression.ipynb/0
{ "file_path": "langchain/docs/docs/modules/data_connection/retrievers/contextual_compression.ipynb", "repo_id": "langchain", "token_count": 2870 }
190
<jupyter_start><jupyter_text>Fine-tuning for Video Classification with 🤗 TransformersThis notebook shows how to fine-tune a pre-trained Vision model for Video Classification on a custom dataset. The idea is to add a randomly initialized classification head on top of a pre-trained encoder and fine-tune the model altoge...
notebooks/examples/video_classification.ipynb/0
{ "file_path": "notebooks/examples/video_classification.ipynb", "repo_id": "notebooks", "token_count": 8881 }
324
// 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/condition.go/0
{ "file_path": "milvus/internal/proxy/condition.go", "repo_id": "milvus", "token_count": 521 }
1,877
<!--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/en/model_doc/vilt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/vilt.md", "repo_id": "transformers", "token_count": 1225 }
504
import os import pathlib import time import pytest from langchain_community.document_loaders import EverNoteLoader @pytest.mark.requires("lxml", "html2text") class TestEverNoteLoader: @staticmethod def example_notebook_path(notebook_name: str) -> str: current_dir = pathlib.Path(__file__).parent ...
langchain/libs/community/tests/unit_tests/document_loaders/test_evernote_loader.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_evernote_loader.py", "repo_id": "langchain", "token_count": 2581 }
369
""" A dataset reader that reads single tarfile based datasets This reader can read datasets consisting if a single tarfile containing images. I am planning to deprecated it in favour of ParerImageInTar. Hacked together by / Copyright 2020 Ross Wightman """ import os import tarfile from timm.utils.misc import natural...
pytorch-image-models/timm/data/readers/reader_image_tar.py/0
{ "file_path": "pytorch-image-models/timm/data/readers/reader_image_tar.py", "repo_id": "pytorch-image-models", "token_count": 1071 }
384
# Added Tokens <tokenizerslangcontent> <python> ## AddedToken [[autodoc]] tokenizers.AddedToken - content - lstrip - normalized - rstrip - single_word </python> <rust> The Rust API Reference is available directly on the [Docs.rs](https://docs.rs/tokenizers/latest/tokenizers/) website. </rust> <nod...
tokenizers/docs/source-doc-builder/api/added-tokens.mdx/0
{ "file_path": "tokenizers/docs/source-doc-builder/api/added-tokens.mdx", "repo_id": "tokenizers", "token_count": 134 }
421
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/usearch", }); export * from "@langchain/community/vectorstores/usearch";
langchainjs/langchain/src/vectorstores/usearch.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/usearch.ts", "repo_id": "langchainjs", "token_count": 72 }
968
// 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/Reduce.cpp/0
{ "file_path": "milvus/internal/core/src/segcore/Reduce.cpp", "repo_id": "milvus", "token_count": 11786 }
1,746
from llama_index.core.readers.base import BaseReader from llama_index.readers.pandas_ai import PandasAIReader def test_class(): names_of_base_classes = [b.__name__ for b in PandasAIReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-pandas-ai/tests/test_readers_pandas_ai.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-pandas-ai/tests/test_readers_pandas_ai.py", "repo_id": "llama_index", "token_count": 95 }
1,423
#!/usr/bin/env python3 import argparse import math import os from copy import deepcopy import torch from audio_diffusion.models import DiffusionAttnUnet1D from diffusion import sampling from torch import nn from diffusers import DanceDiffusionPipeline, IPNDMScheduler, UNet1DModel MODELS_MAP = { "gwf-440k": { ...
diffusers/scripts/convert_dance_diffusion_to_diffusers.py/0
{ "file_path": "diffusers/scripts/convert_dance_diffusion_to_diffusers.py", "repo_id": "diffusers", "token_count": 4561 }
225
# 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/src/transformers/models/seamless_m4t/tokenization_seamless_m4t_fast.py/0
{ "file_path": "transformers/src/transformers/models/seamless_m4t/tokenization_seamless_m4t_fast.py", "repo_id": "transformers", "token_count": 8728 }
692
"""A Tracer Implementation that records activity to Weights & Biases.""" from __future__ import annotations import json from typing import ( TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple, TypedDict, Union, ) from langchain_core.tracers.base import BaseTracer from langch...
langchain/libs/community/langchain_community/callbacks/tracers/wandb.py/0
{ "file_path": "langchain/libs/community/langchain_community/callbacks/tracers/wandb.py", "repo_id": "langchain", "token_count": 9064 }
232
from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorstores import Chroma from langchain.retrievers.merger_retriever import MergerRetriever def test_merger_retriever_get_relevant_docs() -> None: """Test get_relevant_docs.""" texts_group_a = [ "This is a document ...
langchain/libs/langchain/tests/integration_tests/retrievers/test_merger_retriever.py/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/retrievers/test_merger_retriever.py", "repo_id": "langchain", "token_count": 489 }
618
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/tools/llama-index-tools-metaphor/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-metaphor/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,485
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,251
from langchain_community.embeddings.llamacpp import LlamaCppEmbeddings __all__ = ["LlamaCppEmbeddings"]
langchain/libs/langchain/langchain/embeddings/llamacpp.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/llamacpp.py", "repo_id": "langchain", "token_count": 38 }
502
import contextlib import json import re from typing import Any, List with contextlib.suppress(ImportError): import yaml from llama_index.legacy.output_parsers.base import OutputParserException def _marshal_llm_to_json(output: str) -> str: """ Extract a substring containing valid JSON or array from a str...
llama_index/llama-index-legacy/llama_index/legacy/output_parsers/utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/output_parsers/utils.py", "repo_id": "llama_index", "token_count": 1489 }
1,587
from typing import Any, Optional, Sequence, Tuple, Type from types import TracebackType from typing_extensions import Protocol, Self, Literal from abc import ABC, abstractmethod from threading import local from overrides import override, EnforceOverrides import pypika import pypika.queries from chromadb.config import S...
chroma/chromadb/db/base.py/0
{ "file_path": "chroma/chromadb/db/base.py", "repo_id": "chroma", "token_count": 2138 }
13
<jupyter_start><jupyter_text>Pre-Training a 🤗 Transformers model on TPU with **Flax/JAX**In this notebook, we will see how to pretrain one of the [🤗 Transformers](https://github.com/huggingface/transformers) models on TPU using [**Flax**](https://flax.readthedocs.io/en/latest/index.html). The popular masked language ...
notebooks/examples/masked_language_modeling_flax.ipynb/0
{ "file_path": "notebooks/examples/masked_language_modeling_flax.ipynb", "repo_id": "notebooks", "token_count": 10194 }
308
import argparse import os from collections import Counter from dataclasses import dataclass from typing import Dict, Optional import safetensors import torch from diffusers import UNet2DConditionModel from transformers import CLIPTextModel from peft import LoraConfig, get_peft_model, get_peft_model_state_dict, set_pe...
peft/examples/lora_dreambooth/convert_kohya_ss_sd_lora_to_peft.py/0
{ "file_path": "peft/examples/lora_dreambooth/convert_kohya_ss_sd_lora_to_peft.py", "repo_id": "peft", "token_count": 2947 }
313
// 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/allocator/id_allocator_test.go/0
{ "file_path": "milvus/internal/allocator/id_allocator_test.go", "repo_id": "milvus", "token_count": 821 }
1,913
[tool.poetry] name = "rag-aws-kendra" version = "0.0.1" description = "RAG using AWS-Kendra and anthropic" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" tiktoken = ">=0.5.1" boto3 = ">=1.28.57" awscli = ">=1.29.57" [tool.poetry.group.dev.dependencies] langchai...
langchain/templates/rag-aws-kendra/pyproject.toml/0
{ "file_path": "langchain/templates/rag-aws-kendra/pyproject.toml", "repo_id": "langchain", "token_count": 307 }
667
"""Chain that hits a URL and then uses an LLM to parse results.""" from __future__ import annotations from typing import Any, Dict, List, Optional from langchain_community.utilities.requests import TextRequestsWrapper from langchain_core.callbacks import CallbackManagerForChainRun from langchain_core.pydantic_v1 impo...
langchain/libs/langchain/langchain/chains/llm_requests.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/llm_requests.py", "repo_id": "langchain", "token_count": 1264 }
486
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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...
transformers/src/transformers/models/gpt2/modeling_gpt2.py/0
{ "file_path": "transformers/src/transformers/models/gpt2/modeling_gpt2.py", "repo_id": "transformers", "token_count": 33597 }
646
"""Init params."""
llama_index/llama-index-legacy/tests/indices/empty/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/empty/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,550
"""Init file.""" from llama_index.readers.readwise.base import ( ReadwiseReader, ) __all__ = ["ReadwiseReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-readwise/llama_index/readers/readwise/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-readwise/llama_index/readers/readwise/__init__.py", "repo_id": "llama_index", "token_count": 43 }
1,422
# LlamaIndex Llms Integration: Openai
llama_index/llama-index-integrations/llms/llama-index-llms-openai/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openai/README.md", "repo_id": "llama_index", "token_count": 11 }
1,233
<jupyter_start><jupyter_text>Instruct Embeddings on Hugging Face>[Hugging Face sentence-transformers](https://huggingface.co/sentence-transformers) is a Python framework for state-of-the-art sentence, text and image embeddings.>One of the instruct embedding models is used in the `HuggingFaceInstructEmbeddings` class.<j...
langchain/docs/docs/integrations/text_embedding/instruct_embeddings.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/text_embedding/instruct_embeddings.ipynb", "repo_id": "langchain", "token_count": 183 }
176
# coding=utf-8 # Copyright 2022 Microsoft Research 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/L...
transformers/src/transformers/models/swin2sr/modeling_swin2sr.py/0
{ "file_path": "transformers/src/transformers/models/swin2sr/modeling_swin2sr.py", "repo_id": "transformers", "token_count": 21694 }
673
# coding=utf-8 # Copyright 2024 The HuggingFace Inc. team. # Copyright (c) 2022, NVIDIA CORPORATION. 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.a...
diffusers/src/diffusers/pipelines/pipeline_flax_utils.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/pipeline_flax_utils.py", "repo_id": "diffusers", "token_count": 12211 }
230
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/util/etcd/etcd_util.go/0
{ "file_path": "milvus/pkg/util/etcd/etcd_util.go", "repo_id": "milvus", "token_count": 2648 }
1,900
[ {"input": "happy", "output": "sad"}, {"input": "tall", "output": "short"} ]
langchain/libs/core/tests/unit_tests/examples/examples.json/0
{ "file_path": "langchain/libs/core/tests/unit_tests/examples/examples.json", "repo_id": "langchain", "token_count": 37 }
403
from langchain_community.document_loaders.csv_loader import ( CSVLoader, UnstructuredCSVLoader, ) __all__ = ["CSVLoader", "UnstructuredCSVLoader"]
langchain/libs/langchain/langchain/document_loaders/csv_loader.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/csv_loader.py", "repo_id": "langchain", "token_count": 56 }
525
<jupyter_start><jupyter_text>Fine-tune FLAN-T5 using `bitsandbytes`, `peft` & `transformers` 🤗 In this notebook we will see how to properly use `peft` , `transformers` & `bitsandbytes` to fine-tune `flan-t5-large` in a google colab!We will finetune the model on [`financial_phrasebank`](https://huggingface.co/datasets...
peft/examples/int8_training/Finetune_flan_t5_large_bnb_peft.ipynb/0
{ "file_path": "peft/examples/int8_training/Finetune_flan_t5_large_bnb_peft.ipynb", "repo_id": "peft", "token_count": 4274 }
317