text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from __future__ import annotations import uuid import warnings from itertools import repeat from typing import ( TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Type, Union, ) import numpy as np from langchain_core.documents import Document from langchain_core.embeddings...
langchain/libs/community/langchain_community/vectorstores/supabase.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/supabase.py", "repo_id": "langchain", "token_count": 7223 }
313
from typing import Any, Dict, List, Mapping, Optional import requests from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.pydantic_v1 import Extra, root_validator from langchain_core.utils import get_from_dict_or_env from langchain_comm...
langchain/libs/community/langchain_community/llms/mosaicml.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/mosaicml.py", "repo_id": "langchain", "token_count": 2811 }
271
[ { "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 1, "logprob": null, "text": "<s>" }, { "id": 4321, "logprob": -9.828125, "text": "Test" ...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_gptq/test_flash_llama_gptq_load.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_llama_gptq/test_flash_llama_gptq_load.json", "repo_id": "text-generation-inference", "token_count": 4903 }
393
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/es/quicktour.md/0
{ "file_path": "transformers/docs/source/es/quicktour.md", "repo_id": "transformers", "token_count": 6360 }
506
<!--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/optimization/tome.md/0
{ "file_path": "diffusers/docs/source/ko/optimization/tome.md", "repo_id": "diffusers", "token_count": 4366 }
193
# 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/wav2vec2_with_lm/processing_wav2vec2_with_lm.py/0
{ "file_path": "transformers/src/transformers/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.py", "repo_id": "transformers", "token_count": 12934 }
690
package notification import ( "context" "sort" "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel" "github.com/chroma/chroma-coordinator/internal/model" ) type DatabaseNotificationStore struct { metaDomain dbmodel.IMetaDomain txImpl dbmodel.ITransaction } var _ NotificationStore = &Databa...
chroma/go/coordinator/internal/notification/database_notification_store.go/0
{ "file_path": "chroma/go/coordinator/internal/notification/database_notification_store.go", "repo_id": "chroma", "token_count": 1027 }
52
from langchain_core.prompts import ChatPromptTemplate template = """When faced with a task, begin by identifying the participants who will contribute to solving the task. Then, initiate a multi-round collaboration process until a final solution is reached. The participants will give critical comments a...
langchain/templates/solo-performance-prompting-agent/solo_performance_prompting_agent/prompts.py/0
{ "file_path": "langchain/templates/solo-performance-prompting-agent/solo_performance_prompting_agent/prompts.py", "repo_id": "langchain", "token_count": 1778 }
684
"""Tools for making requests to an API endpoint."""
langchain/libs/langchain/langchain/tools/requests/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/requests/__init__.py", "repo_id": "langchain", "token_count": 12 }
609
from llama_index.core.llama_pack import BaseLlamaPack from llama_index.packs.deeplake_multimodal_retrieval import ( DeepLakeMultimodalRetrieverPack, ) def test_class(): names_of_base_classes = [ b.__name__ for b in DeepLakeMultimodalRetrieverPack.__mro__ ] assert BaseLlamaPack.__name__ in name...
llama_index/llama-index-packs/llama-index-packs-deeplake-multimodal-retrieval/tests/test_packs_deeplake_multimodal_retrieval.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-deeplake-multimodal-retrieval/tests/test_packs_deeplake_multimodal_retrieval.py", "repo_id": "llama_index", "token_count": 138 }
1,698
"""Loads word documents.""" import os import tempfile from abc import ABC from typing import List from urllib.parse import urlparse import requests from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.document_loaders.unstructured impo...
langchain/libs/community/langchain_community/document_loaders/word_document.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/word_document.py", "repo_id": "langchain", "token_count": 1847 }
265
python_tests()
llama_index/llama-index-integrations/llms/llama-index-llms-ollama/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-ollama/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,272
import logging from typing import Any, List, Optional, Sequence from llama_index.core.indices.base import BaseIndex from llama_index.core.indices.composability.graph import ComposableGraph from llama_index.core.indices.registry import INDEX_STRUCT_TYPE_TO_INDEX_CLASS from llama_index.core.storage.storage_context impor...
llama_index/llama-index-core/llama_index/core/indices/loading.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/loading.py", "repo_id": "llama_index", "token_count": 1378 }
1,264
package proxy import ( "context" "strconv" "testing" "time" "github.com/cockroachdb/errors" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/mi...
milvus/internal/proxy/task_hybrid_search_test.go/0
{ "file_path": "milvus/internal/proxy/task_hybrid_search_test.go", "repo_id": "milvus", "token_count": 4501 }
1,887
<!--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/custom_pipeline_overview.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/custom_pipeline_overview.md", "repo_id": "diffusers", "token_count": 3455 }
198
import pytest from llama_index.legacy.core.llms.types import ChatMessage from llama_index.legacy.llms.konko import Konko try: import konko except ImportError: konko = None # type: ignore @pytest.mark.skipif(konko is None, reason="konko not installed") def test_chat_model_basic_non_openai_model() -> None: ...
llama_index/llama-index-legacy/tests/llms/test_konko.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/llms/test_konko.py", "repo_id": "llama_index", "token_count": 551 }
1,559
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "callbacks", newEntrypointName: "callbacks/manager", newPackageName: "@langchain/core", }); export * from "@langchain/core/callbacks/manager";
langchainjs/langchain/src/callbacks/manager.ts/0
{ "file_path": "langchainjs/langchain/src/callbacks/manager.ts", "repo_id": "langchainjs", "token_count": 94 }
859
# langchain-nvidia-ai-endpoints The `langchain-nvidia-ai-endpoints` package contains LangChain integrations for chat models and embeddings powered by the [NVIDIA AI Foundation Model](https://www.nvidia.com/en-us/ai-data-science/foundation-models/) playground environment. > [NVIDIA AI Foundation Endpoints](https://ww...
langchain/libs/partners/nvidia-ai-endpoints/README.md/0
{ "file_path": "langchain/libs/partners/nvidia-ai-endpoints/README.md", "repo_id": "langchain", "token_count": 3627 }
620
# DPO Authors: Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D. Manning, and Chelsea Finn 2023 # 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. # ...
trl/trl/trainer/dpo_trainer.py/0
{ "file_path": "trl/trl/trainer/dpo_trainer.py", "repo_id": "trl", "token_count": 27730 }
875
{ "name": "@langchain/community", "version": "0.0.29", "description": "Third-party integrations for LangChain.js", "type": "module", "engines": { "node": ">=18" }, "main": "./index.js", "types": "./index.d.ts", "repository": { "type": "git", "url": "git@github.com:langchain-ai/langchainjs....
langchainjs/libs/langchain-community/package.json/0
{ "file_path": "langchainjs/libs/langchain-community/package.json", "repo_id": "langchainjs", "token_count": 45210 }
1,014
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
transformers/src/transformers/models/xlm_roberta/tokenization_xlm_roberta_fast.py/0
{ "file_path": "transformers/src/transformers/models/xlm_roberta/tokenization_xlm_roberta_fast.py", "repo_id": "transformers", "token_count": 4437 }
702
# neo4j-semantic-ollama This template is designed to implement an agent capable of interacting with a graph database like Neo4j through a semantic layer using Mixtral as a JSON-based agent. The semantic layer equips the agent with a suite of robust tools, allowing it to interact with the graph database based on the us...
langchain/templates/neo4j-semantic-ollama/README.md/0
{ "file_path": "langchain/templates/neo4j-semantic-ollama/README.md", "repo_id": "langchain", "token_count": 1257 }
658
import time import datetime import json import hashlib from .env import Env from .server import Server from .hardware import Hardware class Metric(object): def __init__(self): # format of report data self._version = '0.1' self._type = 'metric' self.run_id = None self.mode =...
milvus/tests/benchmark/milvus_benchmark/metrics/models/metric.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/metrics/models/metric.py", "repo_id": "milvus", "token_count": 733 }
1,991
from __future__ import annotations import functools from collections import defaultdict from typing import TYPE_CHECKING, Any, Callable, DefaultDict, Dict, List, TypeVar, Union from langsmith import run_helpers if TYPE_CHECKING: from openai import AsyncOpenAI, OpenAI from openai.types.chat.chat_completion_ch...
langsmith-sdk/python/langsmith/wrappers/_openai.py/0
{ "file_path": "langsmith-sdk/python/langsmith/wrappers/_openai.py", "repo_id": "langsmith-sdk", "token_count": 2545 }
1,049
<jupyter_start><jupyter_text>Retrieval-Augmented OpenAI Agent In this tutorial, we show you how to use our `FnRetrieverOpenAI` implementationto build an agent on top of OpenAI's function API and store/index an arbitrary number of tools. Our indexing/retrieval modules help to remove the complexity of having too many fun...
llama_index/docs/examples/agent/openai_agent_retrieval.ipynb/0
{ "file_path": "llama_index/docs/examples/agent/openai_agent_retrieval.ipynb", "repo_id": "llama_index", "token_count": 1133 }
1,123
"""Neo4j graph store index.""" import logging from typing import Any, Dict, List, Optional from llama_index.legacy.graph_stores.types import GraphStore logger = logging.getLogger(__name__) node_properties_query = """ CALL apoc.meta.data() YIELD label, other, elementType, type, property WHERE NOT type = "RELATIONSHI...
llama_index/llama-index-legacy/llama_index/legacy/graph_stores/neo4j.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/graph_stores/neo4j.py", "repo_id": "llama_index", "token_count": 4502 }
1,560
[tool.poetry] name = "llama2-functions" version = "0.1.0" description = "Extraction with a JSON-output LLaMA2 model" authors = [ "Lance Martin <lance@langchain.dev>", ] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" replicate = ">=0.15.4" [tool.poetry.group.dev.dependen...
langchain/templates/llama2-functions/pyproject.toml/0
{ "file_path": "langchain/templates/llama2-functions/pyproject.toml", "repo_id": "langchain", "token_count": 285 }
644
"""Polygon Toolkit"""
langchain/libs/community/langchain_community/agent_toolkits/polygon/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/polygon/__init__.py", "repo_id": "langchain", "token_count": 7 }
223
"""Gcs file and directory reader. A loader that fetches a file or iterates through a directory on Gcs. """ from typing import Dict, List, Optional, Union from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document from llama_index.readers.opendal.base import OpendalReader cla...
llama_index/llama-index-integrations/readers/llama-index-readers-opendal/llama_index/readers/opendal/gcs/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-opendal/llama_index/readers/opendal/gcs/base.py", "repo_id": "llama_index", "token_count": 812 }
1,531
"""Feishu docs reader.""" import json import os import time from typing import List import requests from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document # Copyright (2023) Bytedance Ltd. and/or its affiliates # # Licensed under the Apache License, Version 2.0 (the "License...
llama_index/llama-index-integrations/readers/llama-index-readers-feishu-docs/llama_index/readers/feishu_docs/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-feishu-docs/llama_index/readers/feishu_docs/base.py", "repo_id": "llama_index", "token_count": 1486 }
1,291
# Copyright 2021 The HuggingFace Team, the AllenNLP library authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
transformers/scripts/stale.py/0
{ "file_path": "transformers/scripts/stale.py", "repo_id": "transformers", "token_count": 1217 }
602
"""Agent components.""" from inspect import signature from typing import Any, Callable, Dict, Optional, Set, Tuple, cast from llama_index.core.base.query_pipeline.query import ( InputKeys, OutputKeys, QueryComponent, ) from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.c...
llama_index/llama-index-core/llama_index/core/query_pipeline/components/agent.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/query_pipeline/components/agent.py", "repo_id": "llama_index", "token_count": 4130 }
1,212
// 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/querynodev2/pipeline/insert_node.go/0
{ "file_path": "milvus/internal/querynodev2/pipeline/insert_node.go", "repo_id": "milvus", "token_count": 1608 }
1,872
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-slack/llama_index/readers/slack/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-slack/llama_index/readers/slack/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,440
from .base import ColbertIndex from .retriever import ColbertRetriever __all__ = ["ColbertIndex", "ColbertRetriever"]
llama_index/llama-index-legacy/llama_index/legacy/indices/managed/colbert_index/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/managed/colbert_index/__init__.py", "repo_id": "llama_index", "token_count": 36 }
1,601
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/utils/other.py/0
{ "file_path": "peft/src/peft/utils/other.py", "repo_id": "peft", "token_count": 9551 }
338
# Simple Website Loader This loader is a simple web scraper that fetches the text from static websites by converting the HTML to text. ## Usage To use this loader, you need to pass in an array of URLs. ```python from llama_index import download_loader SimpleWebPageReader = download_loader("SimpleWebPageReader") l...
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/simple_web/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/simple_web/README.md", "repo_id": "llama_index", "token_count": 603 }
1,541
import requests requests.packages.urllib3.disable_warnings() # noqa url = "https://api.github.com/repos/milvus-io/milvus/actions/workflows" payload = {} token = "" # your token headers = { "Authorization": f"token {token}", } response = requests.request("GET", url, headers=headers, data=payload) def analysis_w...
milvus/tests/python_client/chaos/scripts/workflow_analyse.py/0
{ "file_path": "milvus/tests/python_client/chaos/scripts/workflow_analyse.py", "repo_id": "milvus", "token_count": 737 }
1,995
[tool.poetry] name = "xml-agent" version = "0.1.0" description = "Agent that uses XML syntax to communicate its decisions of what actions to take" authors = [ "Lance Martin <lance@langchain.dev>", ] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" anthropic = ">=0.5.0" lan...
langchain/templates/xml-agent/pyproject.toml/0
{ "file_path": "langchain/templates/xml-agent/pyproject.toml", "repo_id": "langchain", "token_count": 300 }
716
<jupyter_start><jupyter_text>SQLite>[SQLite](https://en.wikipedia.org/wiki/SQLite) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the most widely ...
langchain/docs/docs/integrations/memory/sqlite.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/memory/sqlite.ipynb", "repo_id": "langchain", "token_count": 852 }
136
--- hide_table_of_contents: true --- # TokenTextSplitter Finally, `TokenTextSplitter` splits a raw text string by first converting the text into BPE tokens, then split these tokens into chunks and convert the tokens within a single chunk back into text. ```typescript import { Document } from "langchain/document"; im...
langchainjs/docs/core_docs/docs/modules/data_connection/document_transformers/token_splitter.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/document_transformers/token_splitter.mdx", "repo_id": "langchainjs", "token_count": 170 }
740
import asyncio import logging import queue from abc import ABC, abstractmethod from dataclasses import dataclass, field from enum import Enum from threading import Event from typing import AsyncGenerator, Generator, List, Optional, Union from llama_index.legacy.core.llms.types import ( ChatMessage, ChatRespons...
llama_index/llama-index-legacy/llama_index/legacy/chat_engine/types.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/chat_engine/types.py", "repo_id": "llama_index", "token_count": 4449 }
1,582
/* eslint-disable no-process-env */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { test } from "@jest/globals"; import { compile } from "html-to-text"; import { RecursiveUrlLoader } from "../web/recursive_url.js"; describe("RecursiveUrlLoader", () => { test("loading valid url", async () => { ...
langchainjs/langchain/src/document_loaders/tests/recursive_url.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/tests/recursive_url.int.test.ts", "repo_id": "langchainjs", "token_count": 976 }
945
"""Jira Tool."""
langchain/libs/community/langchain_community/tools/jira/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/jira/__init__.py", "repo_id": "langchain", "token_count": 7 }
307
from datetime import datetime from typing import Any, Dict, List, Optional from langchain_core.agents import AgentAction, AgentFinish from langchain_core.callbacks import BaseCallbackHandler from langchain_core.outputs import LLMResult from langchain_community.callbacks.utils import import_pandas class ArizeCallbac...
langchain/libs/community/langchain_community/callbacks/arize_callback.py/0
{ "file_path": "langchain/libs/community/langchain_community/callbacks/arize_callback.py", "repo_id": "langchain", "token_count": 3930 }
218
from typing import Optional, Sequence, Any, Tuple, cast, Generator, Union, Dict, List from chromadb.segment import MetadataReader from chromadb.ingest import Consumer from chromadb.config import System from chromadb.types import Segment, InclusionExclusionOperator from chromadb.db.impl.sqlite import SqliteDB from overr...
chroma/chromadb/segment/impl/metadata/sqlite.py/0
{ "file_path": "chroma/chromadb/segment/impl/metadata/sqlite.py", "repo_id": "chroma", "token_count": 14052 }
19
from langchain_community.tools.steam.tool import SteamWebAPIQueryRun __all__ = ["SteamWebAPIQueryRun"]
langchain/libs/langchain/langchain/tools/steam/tool.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/steam/tool.py", "repo_id": "langchain", "token_count": 31 }
588
from llama_index.core.llms.base import BaseLLM from llama_index.llms.palm import PaLM def test_embedding_class(): names_of_base_classes = [b.__name__ for b in PaLM.__mro__] assert BaseLLM.__name__ in names_of_base_classes
llama_index/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py", "repo_id": "llama_index", "token_count": 91 }
1,313
"""Test PromptLayer OpenAIChat API wrapper.""" from pathlib import Path import pytest from langchain_community.llms.loading import load_llm from langchain_community.llms.promptlayer_openai import PromptLayerOpenAIChat def test_promptlayer_openai_chat_call() -> None: """Test valid call to promptlayer openai."""...
langchain/libs/community/tests/integration_tests/llms/test_propmptlayer_openai_chat.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_propmptlayer_openai_chat.py", "repo_id": "langchain", "token_count": 523 }
341
"""**OutputParser** classes parse the output of an LLM call. **Class hierarchy:** .. code-block:: BaseLLMOutputParser --> BaseOutputParser --> <name>OutputParser # GuardrailsOutputParser **Main helpers:** .. code-block:: Serializable, Generation, PromptValue """ # noqa: E501
langchain/libs/community/langchain_community/output_parsers/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/output_parsers/__init__.py", "repo_id": "langchain", "token_count": 90 }
288
python_tests()
llama_index/llama-index-packs/llama-index-packs-sub-question-weaviate/tests/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-sub-question-weaviate/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,610
/* eslint-disable no-process-env */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { test, expect } from "@jest/globals"; import { promisify } from "util"; import { randomUUID } from "crypto"; import { ZepRetriever } from "../zep.js"; import { ZepMemory } from "../../memory/zep.js"; const baseUR...
langchainjs/libs/langchain-community/src/retrievers/tests/zep.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/retrievers/tests/zep.int.test.ts", "repo_id": "langchainjs", "token_count": 528 }
979
from langchain_community.llms.anthropic import Anthropic __all__ = ["Anthropic"]
langchain/libs/langchain/langchain/llms/anthropic.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/anthropic.py", "repo_id": "langchain", "token_count": 26 }
535
// 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/rootcoord/garbage_collector_test.go/0
{ "file_path": "milvus/internal/rootcoord/garbage_collector_test.go", "repo_id": "milvus", "token_count": 6804 }
1,882
import { test, expect } from "@jest/globals"; import { SystemMessage } from "@langchain/core/messages"; import { PromptLayerOpenAI } from "../openai.js"; import { PromptLayerOpenAIChat } from "../openai-chat.js"; import { PromptLayerChatOpenAI } from "../../chat_models/openai.js"; test("Test PromptLayerOpenAI returns...
langchainjs/langchain/src/llms/tests/prompt_layer.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/llms/tests/prompt_layer.int.test.ts", "repo_id": "langchainjs", "token_count": 934 }
904
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..utils import DummyObject, requires_backends class MidiProcessor(metaclass=DummyObject): _backends = ["note_seq"] def __init__(self, *args, **kwargs): requires_backends(self, ["note_seq"]) @classmethod def from...
diffusers/src/diffusers/utils/dummy_note_seq_objects.py/0
{ "file_path": "diffusers/src/diffusers/utils/dummy_note_seq_objects.py", "repo_id": "diffusers", "token_count": 201 }
254
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/pkg/util/paramtable/grpc_param_test.go/0
{ "file_path": "milvus/pkg/util/paramtable/grpc_param_test.go", "repo_id": "milvus", "token_count": 2620 }
2,118
"""**Document Loaders** are classes to load Documents. **Document Loaders** are usually used to load a lot of Documents in a single run. **Class hierarchy:** .. code-block:: BaseLoader --> <name>Loader # Examples: TextLoader, UnstructuredFileLoader **Main helpers:** .. code-block:: Document, <name>Text...
langchain/libs/community/langchain_community/document_loaders/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/__init__.py", "repo_id": "langchain", "token_count": 5363 }
248
from langchain_community.vectorstores.redis.base import ( Redis, RedisVectorStoreRetriever, check_index_exists, ) __all__ = [ "check_index_exists", "Redis", "RedisVectorStoreRetriever", ]
langchain/libs/langchain/langchain/vectorstores/redis/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/redis/base.py", "repo_id": "langchain", "token_count": 90 }
578
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
transformers/examples/research_projects/distillation/scripts/extract.py/0
{ "file_path": "transformers/examples/research_projects/distillation/scripts/extract.py", "repo_id": "transformers", "token_count": 2038 }
574
import { test } from "@jest/globals"; import { GooglePaLM } from "../googlepalm.js"; test.skip("Test Google Palm", async () => { const model = new GooglePaLM(); const res = await model.call("what is 1 + 1?"); console.log({ res }); expect(res).toBeTruthy(); }); test.skip("Test Google Palm generation", async ()...
langchainjs/libs/langchain-community/src/llms/tests/googlepalm.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/llms/tests/googlepalm.int.test.ts", "repo_id": "langchainjs", "token_count": 324 }
1,062
// 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/cmd/roles/roles.go/0
{ "file_path": "milvus/cmd/roles/roles.go", "repo_id": "milvus", "token_count": 4901 }
1,700
# 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/utils/check_config_docstrings.py/0
{ "file_path": "transformers/utils/check_config_docstrings.py", "repo_id": "transformers", "token_count": 1277 }
775
"""Test MRKL functionality.""" from typing import Tuple import pytest from langchain_core.agents import AgentAction from langchain_core.exceptions import OutputParserException from langchain_core.prompts import PromptTemplate from langchain_core.tools import Tool from langchain.agents.mrkl.base import ZeroShotAgent ...
langchain/libs/langchain/tests/unit_tests/agents/test_mrkl.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/agents/test_mrkl.py", "repo_id": "langchain", "token_count": 2191 }
647
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors, Facebook AI Research authors and The 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 L...
transformers/src/transformers/modeling_utils.py/0
{ "file_path": "transformers/src/transformers/modeling_utils.py", "repo_id": "transformers", "token_count": 102145 }
629
import type { ToolInterface } from "@langchain/core/tools"; import { BasePromptTemplate } from "@langchain/core/prompts"; import type { BaseLanguageModel, BaseLanguageModelInterface, } from "@langchain/core/language_models/base"; import { RunnablePassthrough, RunnableSequence, } from "@langchain/core/runnables"...
langchainjs/langchain/src/agents/react/index.ts/0
{ "file_path": "langchainjs/langchain/src/agents/react/index.ts", "repo_id": "langchainjs", "token_count": 1079 }
894
# Setup [[setup]] After all this information, it's time to get started. We're going to do two things: 1. **Create your Hugging Face account** if it's not already done 2. **Sign up to Discord and introduce yourself** (don't be shy 🤗) ### Let's create my Hugging Face account (If it's not already done) create an acco...
deep-rl-class/units/en/unit0/setup.mdx/0
{ "file_path": "deep-rl-class/units/en/unit0/setup.mdx", "repo_id": "deep-rl-class", "token_count": 389 }
165
import time from functools import partial from huggingface_hub import HfApi, hf_hub_url from huggingface_hub.hf_api import RepoFile from packaging import version from requests import ConnectionError, HTTPError from .. import config from . import logging logger = logging.get_logger(__name__) # Retry `preupload_lfs_...
datasets/src/datasets/utils/hub.py/0
{ "file_path": "datasets/src/datasets/utils/hub.py", "repo_id": "datasets", "token_count": 1118 }
143
import { test } from "@jest/globals"; import { GooglePaLM } from "../googlepalm.js"; test("Google Palm - `temperature` must be in range [0.0,1.0]", async () => { expect( () => new GooglePaLM({ temperature: -1.0, }) ).toThrow(); expect( () => new GooglePaLM({ temperature:...
langchainjs/libs/langchain-community/src/llms/tests/googlepalm.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/llms/tests/googlepalm.test.ts", "repo_id": "langchainjs", "token_count": 718 }
1,028
# 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/seamless_m4t/test_feature_extraction_seamless_m4t.py/0
{ "file_path": "transformers/tests/models/seamless_m4t/test_feature_extraction_seamless_m4t.py", "repo_id": "transformers", "token_count": 5810 }
821
use candle::Result; /// This is a wrapper around a tokenizer to ensure that tokens can be returned to the user in a /// streaming way rather than having to wait for the full decoding. pub struct TokenOutputStream { tokenizer: tokenizers::Tokenizer, tokens: Vec<u32>, prev_index: usize, current_index: us...
candle/candle-examples/src/token_output_stream.rs/0
{ "file_path": "candle/candle-examples/src/token_output_stream.rs", "repo_id": "candle", "token_count": 1294 }
52
// 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/expr/ITypeExpr.h/0
{ "file_path": "milvus/internal/core/src/expr/ITypeExpr.h", "repo_id": "milvus", "token_count": 7435 }
1,737
"""Simple reader that reads weather data from OpenWeatherMap API""" from __future__ import annotations from datetime import datetime from typing import Iterator, List, Optional, Sequence from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_comm...
langchain/libs/community/langchain_community/document_loaders/weather.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/weather.py", "repo_id": "langchain", "token_count": 601 }
252
# coding=utf-8 # Copyright 2021 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_utils.py/0
{ "file_path": "transformers/tests/utils/test_image_utils.py", "repo_id": "transformers", "token_count": 13075 }
842
import re from typing import Any, List, Optional, Sequence, Tuple from langchain_core._api import deprecated from langchain_core.agents import AgentAction from langchain_core.callbacks import BaseCallbackManager from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts import BasePromptT...
langchain/libs/langchain/langchain/agents/structured_chat/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/structured_chat/base.py", "repo_id": "langchain", "token_count": 4258 }
471
import tokenizers from argparse import ArgumentParser import sentencepiece as spm from collections import Counter import json import os import datetime try: from termcolor import colored has_color = True except Exception: has_color = False def main(): parser = ArgumentParser("SentencePiece parity ch...
tokenizers/bindings/python/scripts/spm_parity_check.py/0
{ "file_path": "tokenizers/bindings/python/scripts/spm_parity_check.py", "repo_id": "tokenizers", "token_count": 4295 }
449
python_sources()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-supabase/llama_index/vector_stores/supabase/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-supabase/llama_index/vector_stores/supabase/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,678
<jupyter_start><jupyter_text>Multi-Player Dungeons & DragonsThis notebook shows how the `DialogueAgent` and `DialogueSimulator` class make it easy to extend the [Two-Player Dungeons & Dragons example](https://python.langchain.com/en/latest/use_cases/agent_simulations/two_player_dnd.html) to multiple players.The main di...
langchain/cookbook/multi_player_dnd.ipynb/0
{ "file_path": "langchain/cookbook/multi_player_dnd.ipynb", "repo_id": "langchain", "token_count": 3986 }
79
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
accelerate/docs/source/usage_guides/megatron_lm.md/0
{ "file_path": "accelerate/docs/source/usage_guides/megatron_lm.md", "repo_id": "accelerate", "token_count": 9556 }
4
python_sources()
llama_index/llama-index-packs/llama-index-packs-vectara-rag/llama_index/packs/vectara_rag/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-vectara-rag/llama_index/packs/vectara_rag/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,705
from dataclasses import dataclass from typing import Optional, Tuple import torch from torch import nn from transformers import RobertaPreTrainedModel, XLMRobertaConfig, XLMRobertaModel from transformers.utils import ModelOutput @dataclass class TransformationModelOutput(ModelOutput): """ Base class for text...
diffusers/src/diffusers/pipelines/deprecated/alt_diffusion/modeling_roberta_series.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deprecated/alt_diffusion/modeling_roberta_series.py", "repo_id": "diffusers", "token_count": 2332 }
247
{ "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start" }, "dependencies": { "@emotion/react": "^11.10.6", "@emotion/server": "^11.10.0", "@json2csv/plainjs": "^6.1.3", "@mantine/core": "^6.0.4", "@mantine/dropzone": "^6.0.6", "@mantine...
auto-evaluator/nextjs/package.json/0
{ "file_path": "auto-evaluator/nextjs/package.json", "repo_id": "auto-evaluator", "token_count": 687 }
2
# 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...
trl/trl/models/modeling_value_head.py/0
{ "file_path": "trl/trl/models/modeling_value_head.py", "repo_id": "trl", "token_count": 7975 }
864
from langchain_community.agent_toolkits.sql.base import create_sql_agent __all__ = ["create_sql_agent"]
langchain/libs/langchain/langchain/agents/agent_toolkits/sql/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/sql/base.py", "repo_id": "langchain", "token_count": 35 }
448
search_performance: collections: - milvus: db_config.primary_path: /test/milvus/db_data_011/cluster/sift_50m_128_l2_sq8 cache_config.cpu_cache_capacity: 64GB engine_config.use_blas_threshold: 0 engine_config.gpu_search_threshold: 200 gpu_resource_config.enable: true ...
milvus/tests/benchmark/milvus_benchmark/suites/debug_gpu_search.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/debug_gpu_search.yaml", "repo_id": "milvus", "token_count": 449 }
1,872
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/zh/multilingual.md/0
{ "file_path": "transformers/docs/source/zh/multilingual.md", "repo_id": "transformers", "token_count": 4319 }
538
from langchain_community.vectorstores.zilliz import Zilliz __all__ = ["Zilliz"]
langchain/libs/langchain/langchain/vectorstores/zilliz.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/zilliz.py", "repo_id": "langchain", "token_count": 28 }
611
CREATE TABLE table3 ( name TEXT PRIMARY KEY );
chroma/chromadb/test/db/migrations/00003-migration-3.sqlite.sql/0
{ "file_path": "chroma/chromadb/test/db/migrations/00003-migration-3.sqlite.sql", "repo_id": "chroma", "token_count": 19 }
23
import argparse import sys sys.path.append(".") from base_classes import LCMLoRATextToImageBenchmark # noqa: E402 if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--ckpt", type=str, default="stabilityai/stable-diffusion-xl-base-1.0", ) pars...
diffusers/benchmarks/benchmark_t2i_lcm_lora.py/0
{ "file_path": "diffusers/benchmarks/benchmark_t2i_lcm_lora.py", "repo_id": "diffusers", "token_count": 273 }
175
<!--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/training/lcm_distill.md/0
{ "file_path": "diffusers/docs/source/en/training/lcm_distill.md", "repo_id": "diffusers", "token_count": 4582 }
187
<jupyter_start><jupyter_text>TextGen[GitHub:oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui) A gradio web UI for running Large Language Models like LLaMA, llama.cpp, GPT-J, Pythia, OPT, and GALACTICA.This example goes over how to use LangChain to interact with LLM models via the `tex...
langchain/docs/docs/integrations/llms/textgen.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/textgen.ipynb", "repo_id": "langchain", "token_count": 750 }
122
import asyncio import threading from collections import defaultdict from functools import partial from itertools import groupby from typing import ( Any, Awaitable, Callable, DefaultDict, Dict, List, Mapping, Optional, Sequence, Type, TypeVar, Union, ) from langchain_cor...
langchain/libs/core/langchain_core/beta/runnables/context.py/0
{ "file_path": "langchain/libs/core/langchain_core/beta/runnables/context.py", "repo_id": "langchain", "token_count": 4803 }
420
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lancedb/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lancedb/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,520
from llama_index.legacy.storage.index_store.firestore_indexstore import FirestoreKVStore from llama_index.legacy.storage.index_store.keyval_index_store import KVIndexStore from llama_index.legacy.storage.index_store.mongo_index_store import MongoIndexStore from llama_index.legacy.storage.index_store.redis_index_store i...
llama_index/llama-index-legacy/llama_index/legacy/storage/index_store/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/index_store/__init__.py", "repo_id": "llama_index", "token_count": 191 }
1,644
# Airbyte Shopify Loader The Airbyte Shopify Loader allows you to access different Shopify objects. ## Installation - Install llama_hub: `pip install llama_hub` - Install the shopify source: `pip install airbyte-source-shopify` ## Usage Here's an example usage of the AirbyteShopifyReader. ```python from llama_hub...
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-shopify/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-shopify/README.md", "repo_id": "llama_index", "token_count": 882 }
1,327
""" This is an API to support the LLM QA chain auto-evaluator. """ import io import os from dotenv import load_dotenv import sentry_sdk import json import time import pypdf import random import logging import itertools import faiss import pandas as pd from typing import Dict, List from json import JSONDecodeError fro...
auto-evaluator/api/evaluator_app.py/0
{ "file_path": "auto-evaluator/api/evaluator_app.py", "repo_id": "auto-evaluator", "token_count": 7044 }
1
use pyo3::exceptions; use pyo3::prelude::*; use pyo3::types::*; use std::marker::PhantomData; use std::sync::{Arc, Mutex}; mod iterators; mod normalization; mod pretokenization; mod regex; pub use iterators::*; pub use normalization::*; pub use pretokenization::*; pub use regex::*; // PyChar // This type is a tempor...
tokenizers/bindings/python/src/utils/mod.rs/0
{ "file_path": "tokenizers/bindings/python/src/utils/mod.rs", "repo_id": "tokenizers", "token_count": 1057 }
466
package proxy import ( "context" "strings" "testing" "github.com/cockroachdb/errors" "github.com/stretchr/testify/assert" "google.golang.org/grpc/metadata" "github.com/milvus-io/milvus/internal/mocks" "github.com/milvus-io/milvus/pkg/util" "github.com/milvus-io/milvus/pkg/util/crypto" "github.com/milvus-io...
milvus/internal/proxy/authentication_interceptor_test.go/0
{ "file_path": "milvus/internal/proxy/authentication_interceptor_test.go", "repo_id": "milvus", "token_count": 1628 }
1,812
python_sources()
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-fastembed/llama_index/embeddings/fastembed/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-fastembed/llama_index/embeddings/fastembed/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,228
# Usage Pattern The usage pattern guide covers setup + usage of the `QueryPipeline` more in-depth. ## Setting up a Pipeline Here we walk through a few different ways of setting up a query pipeline. ### Defining a Sequential Chain Some simple pipelines are purely linear in nature - the output of the previous module...
llama_index/docs/module_guides/querying/pipeline/usage_pattern.md/0
{ "file_path": "llama_index/docs/module_guides/querying/pipeline/usage_pattern.md", "repo_id": "llama_index", "token_count": 2051 }
1,181