text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from __future__ import annotations from abc import ABC, abstractmethod from typing import List, Sequence, Union from langchain_core.messages import ( AIMessage, BaseMessage, HumanMessage, get_buffer_string, ) from langchain_core.runnables import run_in_executor class BaseChatMessageHistory(ABC): ...
langchain/libs/core/langchain_core/chat_history.py/0
{ "file_path": "langchain/libs/core/langchain_core/chat_history.py", "repo_id": "langchain", "token_count": 2338 }
429
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querycoordv2/utils/meta_test.go/0
{ "file_path": "milvus/internal/querycoordv2/utils/meta_test.go", "repo_id": "milvus", "token_count": 3024 }
2,038
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/myscale", }); export * from "@langchain/community/vectorstores/myscale";
langchainjs/langchain/src/vectorstores/myscale.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/myscale.ts", "repo_id": "langchainjs", "token_count": 74 }
951
from llama_index.llms.everlyai.base import EverlyAI __all__ = ["EverlyAI"]
llama_index/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/__init__.py", "repo_id": "llama_index", "token_count": 30 }
1,307
python_sources()
llama_index/llama-index-core/llama_index/core/indices/struct_store/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/struct_store/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,125
python_tests()
llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-redis/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-redis/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,465
// 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/segments/load_index_info.go/0
{ "file_path": "milvus/internal/querynodev2/segments/load_index_info.go", "repo_id": "milvus", "token_count": 2888 }
1,910
# 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/configuration_gpt2.py/0
{ "file_path": "transformers/src/transformers/models/gpt2/configuration_gpt2.py", "repo_id": "transformers", "token_count": 5141 }
693
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querycoordv2/mocks/querynode.go/0
{ "file_path": "milvus/internal/querycoordv2/mocks/querynode.go", "repo_id": "milvus", "token_count": 2218 }
1,863
from typing import Any import pytest from langchain_community.vectorstores.redis import ( RedisNum as Num, ) from langchain_community.vectorstores.redis import ( RedisTag as Tag, ) from langchain_community.vectorstores.redis import ( RedisText as Text, ) # Test cases for various tag scenarios @pytest.ma...
langchain/libs/community/tests/unit_tests/vectorstores/redis/test_filters.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/vectorstores/redis/test_filters.py", "repo_id": "langchain", "token_count": 2813 }
417
# Zep Reader The Zep Reader returns a set of texts corresponding to a text query or embeddings retrieved from a Zep Collection. The Reader is initialized with a Zep API URL and optionally an API key. The Reader can then be used to load data from a Zep Document Collection. ## About Zep Zep is a long-term memory store...
llama_index/llama-index-integrations/readers/llama-index-readers-zep/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-zep/README.md", "repo_id": "llama_index", "token_count": 944 }
1,453
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-clickhouse/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-clickhouse/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,453
{ "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "data": { "values": "<DVC_METRIC_DATA>" }, "title": "<DVC_METRIC_TITLE>", "mark": { "type": "line" }, "encoding": { "x": { "field": "<DVC_METRIC_X>", "type": "quantitative", ...
datasets/.dvc/plots/smooth.json/0
{ "file_path": "datasets/.dvc/plots/smooth.json", "repo_id": "datasets", "token_count": 569 }
108
from ...utils import is_flax_available, is_torch_available if is_torch_available(): from .unet_1d import UNet1DModel from .unet_2d import UNet2DModel from .unet_2d_condition import UNet2DConditionModel from .unet_3d_condition import UNet3DConditionModel from .unet_i2vgen_xl import I2VGenXLUNet ...
diffusers/src/diffusers/models/unets/__init__.py/0
{ "file_path": "diffusers/src/diffusers/models/unets/__init__.py", "repo_id": "diffusers", "token_count": 245 }
239
from rag_opensearch.chain import chain __all__ = ["chain"]
langchain/templates/rag-opensearch/rag_opensearch/__init__.py/0
{ "file_path": "langchain/templates/rag-opensearch/rag_opensearch/__init__.py", "repo_id": "langchain", "token_count": 20 }
740
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/transfo-xl.md/0
{ "file_path": "transformers/docs/source/en/model_doc/transfo-xl.md", "repo_id": "transformers", "token_count": 1988 }
457
#!/bin/bash source ~/.bashrc echo "running docker-entrypoint.sh" conda activate container echo $KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS echo "printed TPU info" export XRT_TPU_CONFIG="tpu_worker;0;${KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS:7}" exec "$@"#!/bin/bash
transformers/docker/transformers-pytorch-tpu/docker-entrypoint.sh/0
{ "file_path": "transformers/docker/transformers-pytorch-tpu/docker-entrypoint.sh", "repo_id": "transformers", "token_count": 112 }
445
# coding=utf-8 # Copyright 2018 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/roberta/convert_roberta_original_pytorch_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/roberta/convert_roberta_original_pytorch_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 3215 }
735
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/indices/common/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/common/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,515
from langchain_community.vectorstores.llm_rails import LLMRails # # For this test to run properly, please setup as follows: # 1. Create a LLMRails account: sign up at https://console.llmrails.com/signup # 2. Create an API_KEY for this corpus with permissions for query and indexing # 3. Create a datastorea and get its ...
langchain/libs/community/tests/integration_tests/vectorstores/test_llm_rails.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_llm_rails.py", "repo_id": "langchain", "token_count": 413 }
358
# Open Weather Map Tool This tool connects to the [OpenWeatherMap](https://openweathermap.org/api)'s OneCall API, using the `pyowm` Python package. You must initialize the tool with your OpenWeatherMap API token The tool has access to the following functions: - the current weather - the the weather tomorrow ## Usag...
llama_index/llama-index-integrations/tools/llama-index-tools-weather/README.md/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-weather/README.md", "repo_id": "llama_index", "token_count": 254 }
1,585
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/led/test_tokenization_led.py/0
{ "file_path": "transformers/tests/models/led/test_tokenization_led.py", "repo_id": "transformers", "token_count": 3789 }
767
{ "compilerOptions": { "target": "ES2018", "strict": true, "moduleResolution": "node", "module": "CommonJS", "noUnusedLocals": true, "noUnusedParameters": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true }, "include": ["."], "exclude": ["node_modules"] }
tokenizers/bindings/node/tsconfig.json/0
{ "file_path": "tokenizers/bindings/node/tsconfig.json", "repo_id": "tokenizers", "token_count": 129 }
418
from langchain_community.tools.edenai.audio_speech_to_text import EdenAiSpeechToTextTool __all__ = ["EdenAiSpeechToTextTool"]
langchain/libs/langchain/langchain/tools/edenai/audio_speech_to_text.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/edenai/audio_speech_to_text.py", "repo_id": "langchain", "token_count": 45 }
547
.. _Ref-Embeddings: BaseEmbedding =============== .. autopydantic_model:: llama_index.core.base.embeddings.base.BaseEmbedding :members:
llama_index/docs/api_reference/embeddings.rst/0
{ "file_path": "llama_index/docs/api_reference/embeddings.rst", "repo_id": "llama_index", "token_count": 52 }
1,110
import concurrent.futures import json import os import time from collections import defaultdict from typing import List from llama_index.core.readers.base import BaseReader from llama_index.readers.sec_filings.sec_filings import SECExtractor class SECFilingsLoader(BaseReader): """ SEC Filings loader Get ...
llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/base.py", "repo_id": "llama_index", "token_count": 1992 }
1,549
# candle-marian-mt `marian-mt` is a neural machine translation model. In this example it is used to translate text from French to English. See the associated [model card](https://huggingface.co/Helsinki-NLP/opus-mt-tc-big-fr-en) for details on the model itself. ## Running an example ```bash cargo run --example maria...
candle/candle-examples/examples/marian-mt/README.md/0
{ "file_path": "candle/candle-examples/examples/marian-mt/README.md", "repo_id": "candle", "token_count": 497 }
45
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ko/transformers_agents.md/0
{ "file_path": "transformers/docs/source/ko/transformers_agents.md", "repo_id": "transformers", "token_count": 12340 }
565
""" Cross-Covariance Image Transformer (XCiT) in PyTorch Paper: - https://arxiv.org/abs/2106.09681 Same as the official implementation, with some minor adaptations, original copyright below - https://github.com/facebookresearch/xcit/blob/master/xcit.py Modifications and additions for timm hacked together by ...
pytorch-image-models/timm/models/xcit.py/0
{ "file_path": "pytorch-image-models/timm/models/xcit.py", "repo_id": "pytorch-image-models", "token_count": 18692 }
409
"""All integration tests (tests that call out to an external API)."""
langchain/libs/langchain/tests/integration_tests/__init__.py/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/__init__.py", "repo_id": "langchain", "token_count": 16 }
590
# Indexing With your data loaded, you now have a list of Document objects (or a list of Nodes). It's time to build an `Index` over these objects so you can start querying them. ## What is an Index? In LlamaIndex terms, an `Index` is a data structure composed of `Document` objects, designed to enable querying by an L...
llama_index/docs/understanding/indexing/indexing.md/0
{ "file_path": "llama_index/docs/understanding/indexing/indexing.md", "repo_id": "llama_index", "token_count": 1062 }
1,102
// 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/storage/AliyunSTSClient.cpp/0
{ "file_path": "milvus/internal/core/src/storage/AliyunSTSClient.cpp", "repo_id": "milvus", "token_count": 3836 }
1,662
import { OpenAI } from "@langchain/openai"; import { SqlDatabase } from "langchain/sql_db"; import { createSqlAgent, SqlToolkit } from "langchain/agents/toolkits/sql"; import { DataSource } from "typeorm"; /** This example uses Chinook database, which is a sample database available for SQL Server, Oracle, MySQL, etc. ...
langchainjs/examples/src/agents/sql.ts/0
{ "file_path": "langchainjs/examples/src/agents/sql.ts", "repo_id": "langchainjs", "token_count": 391 }
769
<jupyter_start><jupyter_text>Subtitle>[The SubRip file format](https://en.wikipedia.org/wiki/SubRipSubRip_file_format) is described on the `Matroska` multimedia container format website as "perhaps the most basic of all subtitle formats." `SubRip (SubRip Text)` files are named with the extension `.srt`, and contain for...
langchain/docs/docs/integrations/document_loaders/subtitle.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/subtitle.ipynb", "repo_id": "langchain", "token_count": 366 }
120
<jupyter_start><jupyter_text>Types of `MessagePromptTemplate`LangChain provides different types of `MessagePromptTemplate`. The most commonly used are `AIMessagePromptTemplate`, `SystemMessagePromptTemplate` and `HumanMessagePromptTemplate`, which create an AI message, system message and human message respectively.Howe...
langchain/docs/docs/modules/model_io/prompts/message_prompts.ipynb/0
{ "file_path": "langchain/docs/docs/modules/model_io/prompts/message_prompts.ipynb", "repo_id": "langchain", "token_count": 586 }
208
{ "collection_name": "book", "consistency_level": 1, "db_name": "string", "schema": { "autoID": false, "description": "Test book search", "fields": [ { "name": "book_id", "description": "book id", "is_primary_key": true, "autoID": false, "data_type": 5 ...
milvus/tests/scripts/restful-data/create-collection.json/0
{ "file_path": "milvus/tests/scripts/restful-data/create-collection.json", "repo_id": "milvus", "token_count": 356 }
2,193
"""Kaltura eSearch API Reader.""" import json import logging from typing import Any, Dict, List, Optional import requests from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document logger = logging.getLogger(__name__) class KalturaESearchReader(BaseReader): """Kaltura eSe...
llama_index/llama-index-integrations/readers/llama-index-readers-kaltura/llama_index/readers/kaltura_esearch/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-kaltura/llama_index/readers/kaltura_esearch/base.py", "repo_id": "llama_index", "token_count": 5459 }
1,325
from llama_index.readers.asana.base import AsanaReader __all__ = ["AsanaReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-asana/llama_index/readers/asana/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-asana/llama_index/readers/asana/__init__.py", "repo_id": "llama_index", "token_count": 29 }
1,339
<!--- 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 ...
transformers/docs/source/ko/performance.md/0
{ "file_path": "transformers/docs/source/ko/performance.md", "repo_id": "transformers", "token_count": 3692 }
554
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 License. # You may obtain a cop...
transformers/examples/research_projects/movement-pruning/emmental/modeling_bert_masked.py/0
{ "file_path": "transformers/examples/research_projects/movement-pruning/emmental/modeling_bert_masked.py", "repo_id": "transformers", "token_count": 20046 }
548
<jupyter_start><jupyter_text>OpenSearch> [OpenSearch](https://opensearch.org/) is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications licensed under Apache 2.0. `OpenSearch` is a distributed search and analytics engine based on `Apache Lucene`.This noteb...
langchain/docs/docs/integrations/vectorstores/opensearch.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/opensearch.ipynb", "repo_id": "langchain", "token_count": 2395 }
190
from typing import Any, Dict, List, Optional, Sequence, Tuple from llama_index.core.base.response.schema import RESPONSE_TYPE, Response from llama_index.core.callbacks.base import CallbackManager from llama_index.core.callbacks.schema import CBEventType, EventPayload from llama_index.core.indices.multi_modal import Mu...
llama_index/llama-index-core/llama_index/core/query_engine/multi_modal.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/query_engine/multi_modal.py", "repo_id": "llama_index", "token_count": 4366 }
1,288
import os import warnings from datetime import datetime from enum import Enum from typing import Any, Dict, List, Optional, Tuple, Union from uuid import UUID from langchain_core.agents import AgentAction, AgentFinish from langchain_core.callbacks import BaseCallbackHandler from langchain_core.messages import BaseMess...
langchain/libs/community/langchain_community/callbacks/labelstudio_callback.py/0
{ "file_path": "langchain/libs/community/langchain_community/callbacks/labelstudio_callback.py", "repo_id": "langchain", "token_count": 6859 }
216
# coding=utf-8 # Copyright 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...
transformers/src/transformers/models/convbert/configuration_convbert.py/0
{ "file_path": "transformers/src/transformers/models/convbert/configuration_convbert.py", "repo_id": "transformers", "token_count": 2852 }
662
"""OpenWeatherMap API toolkit.""" from langchain_community.tools.openweathermap.tool import OpenWeatherMapQueryRun __all__ = [ "OpenWeatherMapQueryRun", ]
langchain/libs/community/langchain_community/tools/openweathermap/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/openweathermap/__init__.py", "repo_id": "langchain", "token_count": 51 }
311
COHERE_API_KEY=ADD_YOURS_HERE GOOGLE_PALM_API_KEY=ADD_YOURS_HERE GOOGLE_CALENDAR_PRIVATE_KEY=ADD_YOURS_HERE GOOGLE_CALENDAR_CLIENT_EMAIL=ADD_YOURS_HERE GOOGLE_CALENDAR_CALENDAR_ID=ADD_YOURS_HERE HUGGINGFACEHUB_API_KEY=ADD_YOURS_HERE OPENAI_API_KEY=ADD_YOURS_HERE # if AZURE_OPENAI_API_KEY is set, it OPENAI_API_KEY will ...
langchainjs/langchain/.env.example/0
{ "file_path": "langchainjs/langchain/.env.example", "repo_id": "langchainjs", "token_count": 1834 }
889
"""Base interface for large language models to expose.""" from __future__ import annotations import asyncio import functools import inspect import json import logging import warnings from abc import ABC, abstractmethod from pathlib import Path from typing import ( Any, AsyncIterator, Callable, Dict, ...
langchain/libs/core/langchain_core/language_models/llms.py/0
{ "file_path": "langchain/libs/core/langchain_core/language_models/llms.py", "repo_id": "langchain", "token_count": 21319 }
431
{ "name": "tokenizers-win32-arm64-msvc", "version": "0.13.4-rc1", "os": [ "win32" ], "cpu": [ "arm64" ], "main": "tokenizers.win32-arm64-msvc.node", "files": [ "tokenizers.win32-arm64-msvc.node" ], "description": "Tokenizers platform specific bindings", "keywords": [ "napi-rs", ...
tokenizers/bindings/node/npm/win32-arm64-msvc/package.json/0
{ "file_path": "tokenizers/bindings/node/npm/win32-arm64-msvc/package.json", "repo_id": "tokenizers", "token_count": 277 }
456
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/tools/llama-index-tools-playgrounds/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-playgrounds/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,495
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
peft/docs/source/conceptual_guides/ia3.md/0
{ "file_path": "peft/docs/source/conceptual_guides/ia3.md", "repo_id": "peft", "token_count": 1030 }
293
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/program/llama-index-program-evaporate/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/program/llama-index-program-evaporate/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,320
import { test } from "@jest/globals"; import { ChatPromptTemplate } from "@langchain/core/prompts"; import { FakeRetriever } from "@langchain/core/utils/testing"; import { Document } from "@langchain/core/documents"; import { createRetrievalChain } from "../retrieval.js"; import { FakeListLLM } from "../../llms/fake.js...
langchainjs/langchain/src/chains/tests/retrieval_chain.test.ts/0
{ "file_path": "langchainjs/langchain/src/chains/tests/retrieval_chain.test.ts", "repo_id": "langchainjs", "token_count": 426 }
912
#!/usr/bin/env python # coding=utf-8 # Copyright 2020 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/LI...
transformers/examples/tensorflow/text-classification/run_glue.py/0
{ "file_path": "transformers/examples/tensorflow/text-classification/run_glue.py", "repo_id": "transformers", "token_count": 11371 }
563
from typing import List from unittest.mock import patch from llama_index.core.indices.keyword_table.simple_base import ( SimpleKeywordTableIndex, ) from llama_index.core.schema import Document, QueryBundle from llama_index.core.service_context import ServiceContext from tests.mock_utils.mock_utils import mock_extr...
llama_index/llama-index-core/tests/indices/keyword_table/test_retrievers.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/keyword_table/test_retrievers.py", "repo_id": "llama_index", "token_count": 401 }
1,229
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/de/add_new_model.md/0
{ "file_path": "transformers/docs/source/de/add_new_model.md", "repo_id": "transformers", "token_count": 24185 }
446
from pathlib import Path from typing import Any, Dict, Optional, Set, TypedDict from tomlkit import load def get_package_root(cwd: Optional[Path] = None) -> Path: # traverse path for routes to host (any directory holding a pyproject.toml file) package_root = Path.cwd() if cwd is None else cwd visited: Se...
langchain/libs/cli/langchain_cli/utils/packages.py/0
{ "file_path": "langchain/libs/cli/langchain_cli/utils/packages.py", "repo_id": "langchain", "token_count": 580 }
221
<jupyter_start><jupyter_text>Multi-agent decentralized speaker selectionThis notebook showcases how to implement a multi-agent simulation without a fixed schedule for who speaks when. Instead the agents decide for themselves who speaks. We can implement this by having each agent bid to speak. Whichever agent's bid is t...
langchain/cookbook/multiagent_bidding.ipynb/0
{ "file_path": "langchain/cookbook/multiagent_bidding.ipynb", "repo_id": "langchain", "token_count": 5162 }
78
from enum import Enum from typing import Any, List, Optional from llama_index.legacy.bridge.pydantic import Field from llama_index.legacy.callbacks import CallbackManager from llama_index.legacy.core.embeddings.base import ( DEFAULT_EMBED_BATCH_SIZE, BaseEmbedding, ) # Enums for validation and type safety cl...
llama_index/llama-index-legacy/llama_index/legacy/embeddings/cohereai.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/embeddings/cohereai.py", "repo_id": "llama_index", "token_count": 2834 }
1,700
<jupyter_start><jupyter_code># Setup OpenAI Agent from llama_index.agent import OpenAIAgent import openai openai.api_key = "sk-your-key" # Import and initialize our tool spec from llama_index.tools.wikipedia.base import WikipediaToolSpec from llama_index.tools.tool_spec.load_and_search.base import LoadAndSearchToolSpe...
llama_index/llama-index-integrations/tools/llama-index-tools-wikipedia/examples/wikipedia.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-wikipedia/examples/wikipedia.ipynb", "repo_id": "llama_index", "token_count": 324 }
1,444
export const VIEW_EVENTS_PROMPT = ` Date format: YYYY-MM-DDThh:mm:ss+00:00 Based on this event description: 'View my events on Thursday', output a json of the following parameters: Today's datetime on UTC time 2023-05-02T10:00:00+00:00, it's Tuesday and timezone of the user is -5, take into account the timezone of the...
langchainjs/libs/langchain-community/src/tools/google_calendar/prompts/view-events-prompt.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/tools/google_calendar/prompts/view-events-prompt.ts", "repo_id": "langchainjs", "token_count": 429 }
1,075
from langchain_community.tools.amadeus.closest_airport import ( AmadeusClosestAirport, ClosestAirportSchema, ) __all__ = ["ClosestAirportSchema", "AmadeusClosestAirport"]
langchain/libs/langchain/langchain/tools/amadeus/closest_airport.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/amadeus/closest_airport.py", "repo_id": "langchain", "token_count": 73 }
570
from llama_index.core.llama_pack import BaseLlamaPack from llama_index.packs.rag_evaluator import RagEvaluatorPack def test_class(): names_of_base_classes = [b.__name__ for b in RagEvaluatorPack.__mro__] assert BaseLlamaPack.__name__ in names_of_base_classes
llama_index/llama-index-packs/llama-index-packs-rag-evaluator/tests/test_packs_rag_evaluator.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-rag-evaluator/tests/test_packs_rag_evaluator.py", "repo_id": "llama_index", "token_count": 102 }
1,720
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-docugami/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-docugami/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,308
from typing import List, Sequence from llama_index.core.base.llms.types import ChatMessage, LLMMetadata, MessageRole from llama_index.core.constants import AI21_J2_CONTEXT_WINDOW, COHERE_CONTEXT_WINDOW from llama_index.llms.anyscale.utils import anyscale_modelname_to_contextsize from llama_index.llms.openai.utils impo...
llama_index/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/utils.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/utils.py", "repo_id": "llama_index", "token_count": 2475 }
1,262
"""SQLAlchemy wrapper around a database.""" from __future__ import annotations from typing import Any, Dict, Iterable, List, Literal, Optional, Sequence, Union import sqlalchemy from langchain_core._api import deprecated from langchain_core.utils import get_from_env from sqlalchemy import ( Executable, MetaDa...
langchain/libs/community/langchain_community/utilities/sql_database.py/0
{ "file_path": "langchain/libs/community/langchain_community/utilities/sql_database.py", "repo_id": "langchain", "token_count": 10204 }
304
from langchain.callbacks.manager import __all__ EXPECTED_ALL = [ "BaseRunManager", "RunManager", "ParentRunManager", "AsyncRunManager", "AsyncParentRunManager", "CallbackManagerForLLMRun", "AsyncCallbackManagerForLLMRun", "CallbackManagerForChainRun", "AsyncCallbackManagerForChainRu...
langchain/libs/langchain/tests/unit_tests/callbacks/test_manager.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/callbacks/test_manager.py", "repo_id": "langchain", "token_count": 366 }
594
import sys import operator from common import common_type as ct sys.path.append("..") from utils.util_log import test_log as log def ip_check(ip): if ip == "localhost": return True if not isinstance(ip, str): log.error("[IP_CHECK] IP(%s) is not a string." % ip) return False retu...
milvus/tests/python_client/check/param_check.py/0
{ "file_path": "milvus/tests/python_client/check/param_check.py", "repo_id": "milvus", "token_count": 3473 }
2,034
--- default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - id: check-byte-order-marker - id: check-merge-conflict - id: check-symlinks - id: check-toml exclude: llama-index-core/llama_index/core/_static ...
llama_index/.pre-commit-config.yaml/0
{ "file_path": "llama_index/.pre-commit-config.yaml", "repo_id": "llama_index", "token_count": 1628 }
1,029
--- hide_table_of_contents: true --- # EPUB files This example goes over how to load data from EPUB files. By default, one document will be created for each chapter in the EPUB file, you can change this behavior by setting the `splitChapters` option to `false`. # Setup ```bash npm2yarn npm install epub2 html-to-tex...
langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/epub.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/epub.mdx", "repo_id": "langchainjs", "token_count": 277 }
702
import { similarity as ml_distance_similarity } from "ml-distance"; import { VectorStore } from "@langchain/core/vectorstores"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { Document } from "@langchain/core/documents"; /** * Interface representing a vector in memory. It includes the ...
langchainjs/langchain/src/vectorstores/memory.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/memory.ts", "repo_id": "langchainjs", "token_count": 2170 }
922
package writebuffer import ( "context" "testing" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvu...
milvus/internal/datanode/writebuffer/write_buffer_test.go/0
{ "file_path": "milvus/internal/datanode/writebuffer/write_buffer_test.go", "repo_id": "milvus", "token_count": 4542 }
1,712
accuracy: collections: - server: db_config.primary_path: /test/milvus/db_data_011/sift_10m_128_l2_rhnsw_pq cache_config.cpu_cache_capacity: 8GB engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: false gpu_r...
milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_accuracy_rhnsw.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_accuracy_rhnsw.yaml", "repo_id": "milvus", "token_count": 627 }
2,142
{ "compilerOptions": { "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, "module": "esnext", "moduleResolution": "bundler", "re...
weblangchain/nextjs/tsconfig.json/0
{ "file_path": "weblangchain/nextjs/tsconfig.json", "repo_id": "weblangchain", "token_count": 303 }
2,151
from langchain_community.document_loaders.onenote import ( OneNoteLoader, ) __all__ = ["OneNoteLoader"]
langchain/libs/langchain/langchain/document_loaders/onenote.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/onenote.py", "repo_id": "langchain", "token_count": 37 }
486
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/yoso/convert_yoso_pytorch_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/yoso/convert_yoso_pytorch_to_pytorch.py", "repo_id": "transformers", "token_count": 1660 }
704
<jupyter_start><jupyter_text>MultiQueryRetrieverDistance-based vector database retrieval embeds (represents) queries in high-dimensional space and finds similar embedded documents based on "distance". But, retrieval may produce different results with subtle changes in query wording or if the embeddings do not capture t...
langchain/docs/docs/modules/data_connection/retrievers/MultiQueryRetriever.ipynb/0
{ "file_path": "langchain/docs/docs/modules/data_connection/retrievers/MultiQueryRetriever.ipynb", "repo_id": "langchain", "token_count": 1368 }
192
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 License. # You may obtain a cop...
transformers/src/transformers/modeling_tf_pytorch_utils.py/0
{ "file_path": "transformers/src/transformers/modeling_tf_pytorch_utils.py", "repo_id": "transformers", "token_count": 10674 }
567
import { MessageContent } from "../messages/index.js"; import type { TemplateFormat } from "./template.js"; /** * Represents a serialized version of a prompt template. This type is used * to create dynamic prompts for language models. It contains an optional * `_type` field which, if present, is set to 'prompt'. It...
langchainjs/langchain-core/src/prompts/serde.ts/0
{ "file_path": "langchainjs/langchain-core/src/prompts/serde.ts", "repo_id": "langchainjs", "token_count": 511 }
900
"""Pre-Activation ResNet v2 with GroupNorm and Weight Standardization. A PyTorch implementation of ResNetV2 adapted from the Google Big-Transfer (BiT) source code at https://github.com/google-research/big_transfer to match timm interfaces. The BiT weights have been included here as pretrained models from their origina...
pytorch-image-models/timm/models/resnetv2.py/0
{ "file_path": "pytorch-image-models/timm/models/resnetv2.py", "repo_id": "pytorch-image-models", "token_count": 14679 }
402
# Argilla ![Argilla - Open-source data platform for LLMs](https://argilla.io/og.png) >[Argilla](https://argilla.io/) is an open-source data curation platform for LLMs. > Using Argilla, everyone can build robust language models through faster data curation > using both human and machine feedback. We provide support f...
langchain/docs/docs/integrations/providers/argilla.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/argilla.mdx", "repo_id": "langchain", "token_count": 303 }
133
<jupyter_start><jupyter_text>Tencent Cloud VectorDB >[Tencent Cloud VectorDB](https://cloud.tencent.com/document/product/1709) is a fully managed, self-developed, enterprise-level distributed database service designed for storing, retrieving, and analyzing multi-dimensional vector data. The database supports multiple i...
llama_index/docs/examples/vector_stores/TencentVectorDBIndexDemo.ipynb/0
{ "file_path": "llama_index/docs/examples/vector_stores/TencentVectorDBIndexDemo.ipynb", "repo_id": "llama_index", "token_count": 3545 }
1,114
import type { TiktokenModel } from "js-tiktoken/lite"; import { type OpenAIClientOptions as AzureOpenAIClientOptions, OpenAIClient as AzureOpenAIClient, AzureKeyCredential, Completions, Choice, OpenAIKeyCredential, } from "@azure/openai"; import { calculateMaxTokens } from "@langchain/core/language_models/b...
langchainjs/libs/langchain-azure-openai/src/llms.ts/0
{ "file_path": "langchainjs/libs/langchain-azure-openai/src/llms.ts", "repo_id": "langchainjs", "token_count": 5337 }
1,042
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # Copyright 2021 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 # # ...
transformers/tests/models/qdqbert/test_modeling_qdqbert.py/0
{ "file_path": "transformers/tests/models/qdqbert/test_modeling_qdqbert.py", "repo_id": "transformers", "token_count": 10437 }
746
[tool.poetry] name = "elastic-query-generator" version = "0.0.1" description = "Interact with Elasticsearch analytics databases using natural language" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" elasticsearch = "^8.10.1" openai = "<2" [tool.poetry.group.dev...
langchain/templates/elastic-query-generator/pyproject.toml/0
{ "file_path": "langchain/templates/elastic-query-generator/pyproject.toml", "repo_id": "langchain", "token_count": 264 }
689
[tool.poetry] name = "text-generation" version = "0.6.1" description = "Hugging Face Text Generation Python Client" license = "Apache-2.0" authors = ["Olivier Dehaene <olivier@huggingface.co>"] maintainers = ["Olivier Dehaene <olivier@huggingface.co>"] readme = "README.md" homepage = "https://github.com/huggingface/tex...
text-generation-inference/clients/python/pyproject.toml/0
{ "file_path": "text-generation-inference/clients/python/pyproject.toml", "repo_id": "text-generation-inference", "token_count": 336 }
414
from .module import Module from .container import Sequential, ModuleList, ModuleDict from .sparse import Embedding from .normalization import LayerNorm from .linear import Linear
candle/candle-pyo3/py_src/candle/nn/__init__.py/0
{ "file_path": "candle/candle-pyo3/py_src/candle/nn/__init__.py", "repo_id": "candle", "token_count": 43 }
65
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datacoord/allocator.go/0
{ "file_path": "milvus/internal/datacoord/allocator.go", "repo_id": "milvus", "token_count": 894 }
1,788
"""Correctness evaluation.""" import asyncio from typing import Any, Callable, Optional, Sequence, Tuple, Union from llama_index.core.evaluation.base import BaseEvaluator, EvaluationResult from llama_index.core.evaluation.eval_utils import default_parser from llama_index.core.llms.llm import LLM from llama_index.core....
llama_index/llama-index-core/llama_index/core/evaluation/correctness.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/evaluation/correctness.py", "repo_id": "llama_index", "token_count": 1851 }
1,122
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "retrievers/vectara_summary", }); export * from "@langchain/community/retrievers/vectara_summary";
langchainjs/langchain/src/retrievers/vectara_summary.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/vectara_summary.ts", "repo_id": "langchainjs", "token_count": 80 }
985
# PDF files This example goes over how to load data from PDF files. By default, one document will be created for each page in the PDF file, you can change this behavior by setting the `splitPages` option to `false`. ## Setup ```bash npm2yarn npm install pdf-parse ``` ## Usage, one document per page ```typescript i...
langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/pdf.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/pdf.mdx", "repo_id": "langchainjs", "token_count": 756 }
727
package utils import ( "io" "os" "os/signal" "syscall" "github.com/rs/zerolog/log" ) func WaitUntilSignal(closers ...io.Closer) { c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt, syscall.SIGTERM) sig := <-c log.Info(). Str("signal", sig.String()). Msg("Received signal, exiting") code := 0 ...
chroma/go/coordinator/internal/utils/signal.go/0
{ "file_path": "chroma/go/coordinator/internal/utils/signal.go", "repo_id": "chroma", "token_count": 253 }
52
# coding=utf-8 # Copyright 2023 Adept AI and the HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
transformers/src/transformers/models/fuyu/configuration_fuyu.py/0
{ "file_path": "transformers/src/transformers/models/fuyu/configuration_fuyu.py", "repo_id": "transformers", "token_count": 4239 }
607
import gc import threading import time import psutil import torch class PeakCPUMemory: def __init__(self): self.process = psutil.Process() self.peak_monitoring = False def peak_monitor(self): self.cpu_memory_peak = -1 while True: self.cpu_memory_peak = max(self.p...
accelerate/benchmarks/measures_util.py/0
{ "file_path": "accelerate/benchmarks/measures_util.py", "repo_id": "accelerate", "token_count": 989 }
0
import inspect from typing import List, Union import numpy as np from ..tokenization_utils import TruncationStrategy from ..utils import add_end_docstrings, logging from .base import ArgumentHandler, ChunkPipeline, build_pipeline_init_args logger = logging.get_logger(__name__) class ZeroShotClassificationArgument...
transformers/src/transformers/pipelines/zero_shot_classification.py/0
{ "file_path": "transformers/src/transformers/pipelines/zero_shot_classification.py", "repo_id": "transformers", "token_count": 5051 }
750
import pytest @pytest.fixture(scope="module") def flash_mistral_handle(launcher): with launcher("mistralai/Mistral-7B-Instruct-v0.1") as handle: yield handle @pytest.fixture(scope="module") async def flash_mistral(flash_mistral_handle): await flash_mistral_handle.health(300) return flash_mistral...
text-generation-inference/integration-tests/models/test_flash_mistral.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_flash_mistral.py", "repo_id": "text-generation-inference", "token_count": 738 }
369
## [Deprecated] Multi Token Textual Inversion **IMPORTART: This research project is deprecated. Multi Token Textual Inversion is now supported natively in [the official textual inversion example](https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion#running-locally-with-pytorch).** The author ...
diffusers/examples/research_projects/multi_token_textual_inversion/README.md/0
{ "file_path": "diffusers/examples/research_projects/multi_token_textual_inversion/README.md", "repo_id": "diffusers", "token_count": 1842 }
216
export interface GoogleVertexAIBasePrediction { // eslint-disable-next-line @typescript-eslint/no-explicit-any safetyAttributes?: any; } export interface GoogleVertexAILLMPredictions< PredictionType extends GoogleVertexAIBasePrediction > { predictions: PredictionType[]; }
langchainjs/libs/langchain-google-common/src/utils/palm.ts/0
{ "file_path": "langchainjs/libs/langchain-google-common/src/utils/palm.ts", "repo_id": "langchainjs", "token_count": 87 }
1,096
python_sources()
llama_index/llama-index-core/llama_index/core/agent/legacy/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/agent/legacy/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,109
# coding=utf-8 # Copyright 2020 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 License. # You may obtain a copy of the License at # # http://www.a...
transformers/src/transformers/models/encoder_decoder/configuration_encoder_decoder.py/0
{ "file_path": "transformers/src/transformers/models/encoder_decoder/configuration_encoder_decoder.py", "repo_id": "transformers", "token_count": 1491 }
629
# DeepInfra >[DeepInfra](https://deepinfra.com/docs) allows us to run the > [latest machine learning models](https://deepinfra.com/models) with ease. > DeepInfra takes care of all the heavy lifting related to running, scaling and monitoring > the models. Users can focus on your application and integrate the models ...
langchain/docs/docs/integrations/providers/deepinfra.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/deepinfra.mdx", "repo_id": "langchain", "token_count": 542 }
142