text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
--- sidebar_position: 0 --- # Integrations import DocCardList from "@theme/DocCardList"; <DocCardList />
langchainjs/docs/core_docs/docs/ecosystem/integrations/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/ecosystem/integrations/index.mdx", "repo_id": "langchainjs", "token_count": 37 }
715
from __future__ import annotations import json from typing import Any, Dict, List, Literal, Optional, Sequence, Union from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever class VespaRetriever(BaseRetriev...
langchain/libs/community/langchain_community/retrievers/vespa_retriever.py/0
{ "file_path": "langchain/libs/community/langchain_community/retrievers/vespa_retriever.py", "repo_id": "langchain", "token_count": 2061 }
278
# 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/encoder_decoder/modeling_flax_encoder_decoder.py/0
{ "file_path": "transformers/src/transformers/models/encoder_decoder/modeling_flax_encoder_decoder.py", "repo_id": "transformers", "token_count": 18505 }
598
import { TogetherAI } from "@langchain/community/llms/togetherai"; import { ChatPromptTemplate } from "@langchain/core/prompts"; const model = new TogetherAI({ modelName: "mistralai/Mixtral-8x7B-Instruct-v0.1", streaming: true, }); const prompt = ChatPromptTemplate.fromMessages([ ["ai", "You are a helpful assist...
langchainjs/examples/src/models/llm/togetherai_stream.ts/0
{ "file_path": "langchainjs/examples/src/models/llm/togetherai_stream.ts", "repo_id": "langchainjs", "token_count": 468 }
845
from pathlib import Path from typing import List from llama_index.core.indices.composability.graph import ComposableGraph from llama_index.core.indices.list.base import SummaryIndex from llama_index.core.indices.loading import load_graph_from_storage from llama_index.core.indices.vector_store.base import VectorStoreIn...
llama_index/llama-index-core/tests/indices/test_loading_graph.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/test_loading_graph.py", "repo_id": "llama_index", "token_count": 805 }
1,233
{ "$schema": "https://railway.app/railway.schema.json", "build": { "builder": "NIXPACKS" }, "deploy": { "startCommand": "uvicorn evaluator_app:app --host 0.0.0.0 --port $PORT", "restartPolicyType": "ON_FAILURE", "restartPolicyMaxRetries": 10 } }
auto-evaluator/api/railway.json/0
{ "file_path": "auto-evaluator/api/railway.json", "repo_id": "auto-evaluator", "token_count": 140 }
1
import time import pytest from base.client_base import TestcaseBase from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel from utils.util_log import test_log as log class TestDataPersistence(TestcaseBase): """ Test case of end to end""" def teardo...
milvus/tests/python_client/chaos/testcases/test_data_persistence.py/0
{ "file_path": "milvus/tests/python_client/chaos/testcases/test_data_persistence.py", "repo_id": "milvus", "token_count": 2240 }
1,997
"""base multi modal retriever.""" from abc import abstractmethod from typing import List from llama_index.core.base.base_retriever import BaseRetriever from llama_index.core.image_retriever import BaseImageRetriever from llama_index.core.indices.query.schema import QueryType from llama_index.core.schema import NodeWit...
llama_index/llama-index-core/llama_index/core/base/base_multi_modal_retriever.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/base/base_multi_modal_retriever.py", "repo_id": "llama_index", "token_count": 697 }
1,162
[build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] [tool.codespell] check-filenames = true check-hidden = true skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb" [tool.llamahub] classes = ["ChainOfTablePack", "MixSelfConsistencyPack"] contains_example = false import_path = "llam...
llama_index/llama-index-packs/llama-index-packs-tables/pyproject.toml/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-tables/pyproject.toml", "repo_id": "llama_index", "token_count": 678 }
1,823
""" Code to remove duplicate initializers to reduce ONNX model size. """ import os import numpy import onnx def _is_equal_tensor_proto(a, b): name_a = a.name name_b = b.name a.name = "" b.name = "" res = a == b a.name = name_a b.name = name_b return res def _node_replace_input_...
transformers/examples/research_projects/onnx/summarization/bart_onnx/reduce_onnx_size.py/0
{ "file_path": "transformers/examples/research_projects/onnx/summarization/bart_onnx/reduce_onnx_size.py", "repo_id": "transformers", "token_count": 1732 }
530
# Results CSV files containing an ImageNet-1K and out-of-distribution (OOD) test set validation results for all models with pretrained weights is located in the repository [results folder](https://github.com/rwightman/pytorch-image-models/tree/master/results). ## Self-trained Weights The table below includes ImageNe...
pytorch-image-models/docs/results.md/0
{ "file_path": "pytorch-image-models/docs/results.md", "repo_id": "pytorch-image-models", "token_count": 2259 }
374
from llama_index.readers.file.markdown.base import MarkdownReader __all__ = ["MarkdownReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/markdown/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/markdown/__init__.py", "repo_id": "llama_index", "token_count": 31 }
1,402
# Metric Card for Mahalanobis Distance ## Metric Description Mahalonobis distance is the distance between a point and a distribution (as opposed to the distance between two points), making it the multivariate equivalent of the Euclidean distance. It is often used in multivariate anomaly detection, classification on h...
datasets/metrics/mahalanobis/README.md/0
{ "file_path": "datasets/metrics/mahalanobis/README.md", "repo_id": "datasets", "token_count": 738 }
130
# candle-starcoder: code generation model [StarCoder/BigCode](https://huggingface.co/bigcode/starcoderbase-1b) is a LLM model specialized to code generation. The initial model was trained on 80 programming languages. ## Running some example ```bash cargo run --example bigcode --release -- --prompt "fn fact(n: u64) -...
candle/candle-examples/examples/bigcode/README.md/0
{ "file_path": "candle/candle-examples/examples/bigcode/README.md", "repo_id": "candle", "token_count": 180 }
40
"""OpenAPI spec agent.""" from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, List, Optional from langchain_core.callbacks import BaseCallbackManager from langchain_core.language_models import BaseLanguageModel from langchain_community.agent_toolkits.openapi.prompt import ( OPENAPI_PR...
langchain/libs/community/langchain_community/agent_toolkits/openapi/base.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/openapi/base.py", "repo_id": "langchain", "token_count": 1076 }
222
# coding=utf-8 # Copyright 2024 Optuna, Hugging Face # # 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 o...
diffusers/src/diffusers/utils/logging.py/0
{ "file_path": "diffusers/src/diffusers/utils/logging.py", "repo_id": "diffusers", "token_count": 3613 }
245
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-airtable/llama_index/readers/airtable/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airtable/llama_index/readers/airtable/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,287
--- sidebar_position: 3 keywords: [similaritySearchWithScore] --- # Vector stores :::info Head to [Integrations](/docs/integrations/vectorstores) for documentation on built-in integrations with vectorstore providers. ::: One of the most common ways to store and search over unstructured data is to embed it and store ...
langchainjs/docs/core_docs/docs/modules/data_connection/vectorstores/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/vectorstores/index.mdx", "repo_id": "langchainjs", "token_count": 1916 }
744
""" Selective Kernel Convolution/Attention Paper: Selective Kernel Networks (https://arxiv.org/abs/1903.06586) Hacked together by / Copyright 2020 Ross Wightman """ import torch from torch import nn as nn from .conv_bn_act import ConvNormActAa from .helpers import make_divisible from .trace_utils import _assert de...
pytorch-image-models/timm/layers/selective_kernel.py/0
{ "file_path": "pytorch-image-models/timm/layers/selective_kernel.py", "repo_id": "pytorch-image-models", "token_count": 2318 }
367
--- sidebar_label: Anthropic Functions --- # Anthropic Functions LangChain offers an experimental wrapper around Anthropic that gives it the same API as OpenAI Functions. ## Setup First, you'll need to install the popular [`fast-xml-parser`](https://www.npmjs.com/package/fast-xml-parser) package as a peer dependenc...
langchainjs/docs/core_docs/docs/integrations/chat/anthropic_functions.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat/anthropic_functions.mdx", "repo_id": "langchainjs", "token_count": 376 }
697
# Telemetry This directory holds all the telemetry for Chroma. - `product/` contains anonymized product telemetry which we, Chroma, collect so we can understand usage patterns. For more information, see https://docs.trychroma.com/telemetry. - `opentelemetry/` contains all of the config for Chroma's [OpenTelemetry](...
chroma/chromadb/telemetry/README.md/0
{ "file_path": "chroma/chromadb/telemetry/README.md", "repo_id": "chroma", "token_count": 154 }
20
# coding=utf-8 # Copyright 2021 Google T5 Authors and 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 requ...
transformers/tests/models/t5/test_modeling_flax_t5.py/0
{ "file_path": "transformers/tests/models/t5/test_modeling_flax_t5.py", "repo_id": "transformers", "token_count": 23884 }
844
"""Integration test for Stack Exchange.""" from langchain_community.utilities import StackExchangeAPIWrapper def test_call() -> None: """Test that call runs.""" stackexchange = StackExchangeAPIWrapper() output = stackexchange.run("zsh: command not found: python") assert output != "hello" def test_fa...
langchain/libs/community/tests/integration_tests/utilities/test_stackexchange.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/utilities/test_stackexchange.py", "repo_id": "langchain", "token_count": 267 }
376
import { resolve, dirname } from "node:path"; import { fileURLToPath } from "node:url"; /** * @param {string} relativePath * @returns {string} */ function abs(relativePath) { return resolve(dirname(fileURLToPath(import.meta.url)), relativePath); } export const config = { internals: [ /node\:/, /@langch...
langchainjs/libs/langchain-community/langchain.config.js/0
{ "file_path": "langchainjs/libs/langchain-community/langchain.config.js", "repo_id": "langchainjs", "token_count": 5630 }
1,047
"""Chain that just formats a prompt and calls an LLM.""" from __future__ import annotations import warnings from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, cast from langchain_core.callbacks import ( AsyncCallbackManager, AsyncCallbackManagerForChainRun, CallbackManager, Callback...
langchain/libs/langchain/langchain/chains/llm.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/llm.py", "repo_id": "langchain", "token_count": 6492 }
485
# coding=utf-8 # Copyright 2023 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/align/convert_align_tf_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/align/convert_align_tf_to_hf.py", "repo_id": "transformers", "token_count": 7038 }
579
from langchain_community.llms.pai_eas_endpoint import PaiEasEndpoint __all__ = ["PaiEasEndpoint"]
langchain/libs/langchain/langchain/llms/pai_eas_endpoint.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/pai_eas_endpoint.py", "repo_id": "langchain", "token_count": 36 }
550
<!--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/ja/perplexity.md/0
{ "file_path": "transformers/docs/source/ja/perplexity.md", "repo_id": "transformers", "token_count": 4040 }
487
<!--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/task_summary.md/0
{ "file_path": "transformers/docs/source/en/task_summary.md", "repo_id": "transformers", "token_count": 5682 }
473
import argparse import logging import sys from unittest.mock import patch import run_glue_with_pabee from transformers.testing_utils import TestCasePlus logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger() def get_setup_file(): parser = argparse.ArgumentParser() parser.add_argument("-f")...
transformers/examples/research_projects/bert-loses-patience/test_run_glue_with_pabee.py/0
{ "file_path": "transformers/examples/research_projects/bert-loses-patience/test_run_glue_with_pabee.py", "repo_id": "transformers", "token_count": 672 }
568
import { PromptTemplate } from "@langchain/core/prompts"; const QA_TEMPLATE = `You are a teacher grading a quiz. You are given a question, the student's answer, and the true answer, and are asked to score the student answer as either CORRECT or INCORRECT. Example Format: QUESTION: question here STUDENT ANSWER: studen...
langchainjs/langchain/src/evaluation/qa/prompt.ts/0
{ "file_path": "langchainjs/langchain/src/evaluation/qa/prompt.ts", "repo_id": "langchainjs", "token_count": 531 }
920
from typing import List import pytest from llama_index.legacy.readers.schema.base import Document from llama_index.legacy.schema import BaseNode from llama_index.legacy.storage.docstore.redis_docstore import RedisDocumentStore from llama_index.legacy.storage.kvstore.redis_kvstore import RedisKVStore try: from red...
llama_index/llama-index-legacy/tests/storage/docstore/test_redis_docstore.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/storage/docstore/test_redis_docstore.py", "repo_id": "llama_index", "token_count": 1144 }
1,567
from typing import Optional, Sequence, Any, Tuple, cast, Dict, Union, Set from uuid import UUID from overrides import override from pypika import Table, Column from itertools import groupby from chromadb.config import DEFAULT_DATABASE, DEFAULT_TENANT, System from chromadb.db.base import ( Cursor, SqlDB, Pa...
chroma/chromadb/db/mixins/sysdb.py/0
{ "file_path": "chroma/chromadb/db/mixins/sysdb.py", "repo_id": "chroma", "token_count": 14433 }
14
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-airtable/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airtable/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,374
# coding=utf-8 # Copyright 2023 The Salesforce Team Authors and 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/licens...
transformers/src/transformers/models/blip/modeling_tf_blip.py/0
{ "file_path": "transformers/src/transformers/models/blip/modeling_tf_blip.py", "repo_id": "transformers", "token_count": 30642 }
574
""" VoVNet (V1 & V2) Papers: * `An Energy and GPU-Computation Efficient Backbone Network` - https://arxiv.org/abs/1904.09730 * `CenterMask : Real-Time Anchor-Free Instance Segmentation` - https://arxiv.org/abs/1911.06667 Looked at https://github.com/youngwanLEE/vovnet-detectron2 & https://github.com/stigma0617/VoVNe...
pytorch-image-models/timm/models/vovnet.py/0
{ "file_path": "pytorch-image-models/timm/models/vovnet.py", "repo_id": "pytorch-image-models", "token_count": 7769 }
370
import { describe, expect, it } from "vitest"; import { isMessageId } from "./isMessageId"; describe("isMessageId", () => { it("should return true for a valid message id", () => { expect(isMessageId(crypto.randomUUID())).toBe(true); }); it("should return false for an invalid message id", () => { expect(isMessag...
chat-ui/src/lib/utils/tree/isMessageId.spec.ts/0
{ "file_path": "chat-ui/src/lib/utils/tree/isMessageId.spec.ts", "repo_id": "chat-ui", "token_count": 163 }
100
from langchain_community.utilities import __all__ EXPECTED_ALL = [ "AlphaVantageAPIWrapper", "ApifyWrapper", "ArceeWrapper", "ArxivAPIWrapper", "BibtexparserWrapper", "BingSearchAPIWrapper", "BraveSearchWrapper", "DuckDuckGoSearchAPIWrapper", "GoldenQueryAPIWrapper", "GoogleFina...
langchain/libs/community/tests/unit_tests/utilities/test_imports.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/utilities/test_imports.py", "repo_id": "langchain", "token_count": 626 }
387
#include "q_matrix.cuh" #include "matrix_view.cuh" #include "util.cuh" #include "quant/qdq_2.cuh" #include "quant/qdq_3.cuh" #include "quant/qdq_4.cuh" #include "quant/qdq_5.cuh" #include "quant/qdq_6.cuh" #include "quant/qdq_8.cuh" #define BLOCK_KN_SIZE 128 #define THREADS_X 32 #define THREADS_Y 32 // Shuffle quan...
text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_matrix.cu/0
{ "file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_matrix.cu", "repo_id": "text-generation-inference", "token_count": 10524 }
436
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-database/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-database/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,305
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import type { ToolInterface } from "@langchain/core/tools"; import { ChatPromptTemplate, HumanMessagePromptTemplate, SystemMessagePromptTemplate, } from "@langchain/core/prompts"; import type { AgentStep } from "@langchain/cor...
langchainjs/langchain/src/agents/chat/index.ts/0
{ "file_path": "langchainjs/langchain/src/agents/chat/index.ts", "repo_id": "langchainjs", "token_count": 1865 }
912
# Copyright 2024 Kakao Brain and 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 requi...
diffusers/src/diffusers/pipelines/unclip/pipeline_unclip_image_variation.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/unclip/pipeline_unclip_image_variation.py", "repo_id": "diffusers", "token_count": 8369 }
258
# 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 applicabl...
transformers/tests/models/vit/test_modeling_flax_vit.py/0
{ "file_path": "transformers/tests/models/vit/test_modeling_flax_vit.py", "repo_id": "transformers", "token_count": 3243 }
821
from typing import Dict, Type from llama_index.legacy.vector_stores.chroma import ChromaVectorStore from llama_index.legacy.vector_stores.lantern import LanternVectorStore from llama_index.legacy.vector_stores.pinecone import PineconeVectorStore from llama_index.legacy.vector_stores.postgres import PGVectorStore from ...
llama_index/llama-index-legacy/llama_index/legacy/vector_stores/loading.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/loading.py", "repo_id": "llama_index", "token_count": 881 }
1,611
from langchain_community.document_loaders.evernote import EverNoteLoader __all__ = ["EverNoteLoader"]
langchain/libs/langchain/langchain/document_loaders/evernote.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/evernote.py", "repo_id": "langchain", "token_count": 30 }
480
--- sidebar_class_name: hidden --- # OpenAI Assistant :::info The [OpenAI Assistant API](https://platform.openai.com/docs/assistants/overview) is still in beta. ::: OpenAI released a new API for a conversational agent like system called Assistant. You can interact with OpenAI Assistants using OpenAI tools or custom...
langchainjs/docs/core_docs/docs/modules/agents/agent_types/openai_assistant.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/agents/agent_types/openai_assistant.mdx", "repo_id": "langchainjs", "token_count": 4265 }
724
# Overview Welcome to the 🤗 Datasets tutorials! These beginner-friendly tutorials will guide you through the fundamentals of working with 🤗 Datasets. You'll load and prepare a dataset for training with your machine learning framework of choice. Along the way, you'll learn how to load different dataset configurations...
datasets/docs/source/tutorial.md/0
{ "file_path": "datasets/docs/source/tutorial.md", "repo_id": "datasets", "token_count": 311 }
113
"""Agent for working with xorbits objects.""" from typing import Any, Dict, List, Optional from langchain.agents.agent import AgentExecutor from langchain.agents.mrkl.base import ZeroShotAgent from langchain.callbacks.base import BaseCallbackManager from langchain.chains.llm import LLMChain from langchain_core.languag...
langchain/libs/experimental/langchain_experimental/agents/agent_toolkits/xorbits/base.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/agents/agent_toolkits/xorbits/base.py", "repo_id": "langchain", "token_count": 1310 }
436
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/util/interceptor/cluster_interceptor.go/0
{ "file_path": "milvus/pkg/util/interceptor/cluster_interceptor.go", "repo_id": "milvus", "token_count": 1185 }
2,059
# 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/pipelines/test_pipelines_text2text_generation.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_text2text_generation.py", "repo_id": "transformers", "token_count": 2111 }
750
# Loading Data The key to data ingestion in LlamaIndex is loading and transformations. Once you have loaded Documents, you can process them via transformations and output Nodes. Once you have [learned about the basics of loading data](/understanding/loading/loading.html) in our Understanding section, you can read on ...
llama_index/docs/module_guides/loading/loading.md/0
{ "file_path": "llama_index/docs/module_guides/loading/loading.md", "repo_id": "llama_index", "token_count": 372 }
1,145
# Jina This page covers how to use the Jina Embeddings within LangChain. It is broken into two parts: installation and setup, and then references to specific Jina wrappers. ## Installation and Setup - Get a Jina AI API token from [here](https://jina.ai/embeddings/) and set it as an environment variable (`JINA_API_TOK...
langchain/docs/docs/integrations/providers/jina.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/jina.mdx", "repo_id": "langchain", "token_count": 263 }
143
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/proxy/meta_cache_adapter.go/0
{ "file_path": "milvus/internal/proxy/meta_cache_adapter.go", "repo_id": "milvus", "token_count": 986 }
1,961
# coding=utf-8 # Copyright 2020 The HuggingFace Datasets Authors. # # 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 app...
datasets/metrics/mauve/mauve.py/0
{ "file_path": "datasets/metrics/mauve/mauve.py", "repo_id": "datasets", "token_count": 2588 }
132
from llama_index.core.readers.base import BaseReader from llama_index.readers.mangoapps_guides import MangoppsGuidesReader def test_class(): names_of_base_classes = [b.__name__ for b in MangoppsGuidesReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-mangoapps-guides/tests/test_readers_mangoapps_guides.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mangoapps-guides/tests/test_readers_mangoapps_guides.py", "repo_id": "llama_index", "token_count": 98 }
1,379
<jupyter_start><jupyter_text>Bing Search>[Microsoft Bing](https://www.bing.com/), commonly referred to as `Bing` or `Bing Search`, is a web search engine owned and operated by `Microsoft`. This notebook goes over how to use the bing search component.First, you need to set up the proper API keys and environment variable...
langchain/docs/docs/integrations/tools/bing_search.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/bing_search.ipynb", "repo_id": "langchain", "token_count": 405 }
178
import { test } from "@jest/globals"; import { IMSDBLoader } from "../web/imsdb.js"; test("Test IMSDB loader", async () => { const loader = new IMSDBLoader( "https://imsdb.com/scripts/BlacKkKlansman.html" ); await loader.load(); });
langchainjs/langchain/src/document_loaders/tests/imsdb.test.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/tests/imsdb.test.ts", "repo_id": "langchainjs", "token_count": 94 }
921
import { test, jest, expect } from "@jest/globals"; import LambdaClient from "@aws-sdk/client-lambda"; import { AWSLambda } from "../aws_lambda.js"; jest.mock("@aws-sdk/client-lambda", () => ({ LambdaClient: jest.fn().mockImplementation(() => ({ send: jest.fn().mockImplementation(() => Promise.resolve({ ...
langchainjs/libs/langchain-community/src/tools/tests/aws_lambda.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/tools/tests/aws_lambda.test.ts", "repo_id": "langchainjs", "token_count": 425 }
988
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-boarddocs/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-boarddocs/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,344
import { test, expect } from "@jest/globals"; import { OutputParserException, CommaSeparatedListOutputParser, CustomListOutputParser, } from "@langchain/core/output_parsers"; test("CommaSeparatedListOutputParser", async () => { const parser = new CommaSeparatedListOutputParser(); expect(await parser.parse(...
langchainjs/langchain/src/output_parsers/tests/list.test.ts/0
{ "file_path": "langchainjs/langchain/src/output_parsers/tests/list.test.ts", "repo_id": "langchainjs", "token_count": 472 }
899
from typing import Any, Dict, List from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, root_validator class GPT4AllEmbeddings(BaseModel, Embeddings): """GPT4All embedding models. To use, you should have the gpt4all python package installed Example: ...
langchain/libs/community/langchain_community/embeddings/gpt4all.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/gpt4all.py", "repo_id": "langchain", "token_count": 728 }
256
"""Init params."""
llama_index/llama-index-legacy/llama_index/legacy/readers/make_com/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/make_com/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,594
from __future__ import annotations from abc import ABC from enum import Enum from typing import Any, Dict, List, Mapping, Optional from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.pydantic_v1 import BaseModel, Extra, root_validator ...
langchain/libs/community/langchain_community/llms/oci_generative_ai.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/oci_generative_ai.py", "repo_id": "langchain", "token_count": 4229 }
266
// 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/mq/mqimpl/rocksmq/server/rmq_id.go/0
{ "file_path": "milvus/internal/mq/mqimpl/rocksmq/server/rmq_id.go", "repo_id": "milvus", "token_count": 630 }
1,804
#ifndef _qdq_2_cuh #define _qdq_2_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_2BIT == 1 // Permutation: // // ffddbb99 77553311 eeccaa88 66442200 __forceinline__ __device__ void shuffle_2bit_16 ( uint32_t* q, int stride ) { uint32_t qa = q[0]; uint32_t qb = 0; #pragma unrol...
text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_2.cuh/0
{ "file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_2.cuh", "repo_id": "text-generation-inference", "token_count": 1588 }
409
<jupyter_start><jupyter_text>Pandas DataframeThis notebook shows how to use agents to interact with a `Pandas DataFrame`. It is mostly optimized for question answering.**NOTE: this agent calls the `Python` agent under the hood, which executes LLM generated Python code - this can be bad if the LLM generated Python code ...
langchain/docs/docs/integrations/toolkits/pandas.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/toolkits/pandas.ipynb", "repo_id": "langchain", "token_count": 1132 }
182
# LlamaIndex Llms Integration: Anyscale
llama_index/llama-index-integrations/llms/llama-index-llms-anyscale/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-anyscale/README.md", "repo_id": "llama_index", "token_count": 12 }
1,290
from typing import Any, Callable, Dict, Optional, Tuple import httpx from openai.lib.azure import AsyncAzureOpenAI from openai.lib.azure import AzureOpenAI as SyncAzureOpenAI from llama_index.legacy.bridge.pydantic import Field, PrivateAttr from llama_index.legacy.callbacks import CallbackManager from llama_index.leg...
llama_index/llama-index-legacy/llama_index/legacy/multi_modal_llms/azure_openai.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/multi_modal_llms/azure_openai.py", "repo_id": "llama_index", "token_count": 2660 }
1,577
import os from importlib.util import find_spec from typing import List import pytest from llama_index.legacy.schema import TextNode from llama_index.legacy.vector_stores import UpstashVectorStore from llama_index.legacy.vector_stores.types import VectorStoreQuery try: find_spec("upstash-vector") if os.environ...
llama_index/llama-index-legacy/tests/vector_stores/test_upstash.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/vector_stores/test_upstash.py", "repo_id": "llama_index", "token_count": 851 }
1,766
<jupyter_start><jupyter_text>SnowflakeThis notebooks goes over how to load documents from Snowflake<jupyter_code>%pip install --upgrade --quiet snowflake-connector-python import settings as s from langchain_community.document_loaders import SnowflakeLoader QUERY = "select text, survey_id from CLOUD_DATA_SOLUTIONS.HAPP...
langchain/docs/docs/integrations/document_loaders/snowflake.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/snowflake.ipynb", "repo_id": "langchain", "token_count": 530 }
110
// 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/local_worker_test.go/0
{ "file_path": "milvus/internal/querynodev2/local_worker_test.go", "repo_id": "milvus", "token_count": 1889 }
1,765
/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { BPE, Unigram, WordPiece } from '../../' const MOCKS_DIR = __dirname + '/__mocks__' describe('WordPiece', () => { describe('fromFile', () => { it('throws if called with only one argument', ...
tokenizers/bindings/node/lib/bindings/models.test.ts/0
{ "file_path": "tokenizers/bindings/node/lib/bindings/models.test.ts", "repo_id": "tokenizers", "token_count": 818 }
412
<!--- 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/examples/tensorflow/language-modeling/README.md/0
{ "file_path": "transformers/examples/tensorflow/language-modeling/README.md", "repo_id": "transformers", "token_count": 842 }
583
package metastore import ( "context" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus/internal/metastore/model" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/proto/querypb" "github...
milvus/internal/metastore/catalog.go/0
{ "file_path": "milvus/internal/metastore/catalog.go", "repo_id": "milvus", "token_count": 2530 }
1,995
<!--- 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/en/performance.md/0
{ "file_path": "transformers/docs/source/en/performance.md", "repo_id": "transformers", "token_count": 966 }
495
import unittest import pytest from langchain_community.document_loaders.parsers.language.ruby import RubySegmenter @pytest.mark.requires("tree_sitter", "tree_sitter_languages") class TestRubySegmenter(unittest.TestCase): def setUp(self) -> None: self.example_code = """def foo i = 0 end module M def...
langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_ruby.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_ruby.py", "repo_id": "langchain", "token_count": 574 }
397
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py", "repo_id": "diffusers", "token_count": 12786 }
260
from typing import Union COMPLETE_MODELS = {"j2-light": 8191, "j2-mid": 8191, "j2-ultra": 8191} def ai21_model_to_context_size(model: str) -> Union[int, None]: """Calculate the maximum number of tokens possible to generate for a model. Args: model: The modelname we want to know the context size for....
llama_index/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/utils.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/utils.py", "repo_id": "llama_index", "token_count": 211 }
1,274
from langchain_community.document_loaders.recursive_url_loader import ( RecursiveUrlLoader, ) __all__ = ["RecursiveUrlLoader"]
langchain/libs/langchain/langchain/document_loaders/recursive_url_loader.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/recursive_url_loader.py", "repo_id": "langchain", "token_count": 43 }
514
# EfficientNet (Knapsack Pruned) **EfficientNet** is a convolutional neural network architecture and scaling method that uniformly scales all dimensions of depth/width/resolution using a *compound coefficient*. Unlike conventional practice that arbitrary scales these factors, the EfficientNet scaling method uniformly...
pytorch-image-models/docs/models/.templates/models/efficientnet-pruned.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/efficientnet-pruned.md", "repo_id": "pytorch-image-models", "token_count": 1945 }
359
import { NIBittensorChatModel } from "langchain/experimental/chat_models/bittensor"; import { HumanMessage } from "@langchain/core/messages"; const chat = new NIBittensorChatModel(); const message = new HumanMessage("What is bittensor?"); const res = await chat.call([message]); console.log({ res }); /* { res: "\...
langchainjs/examples/src/models/chat/integration_bittensor.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/integration_bittensor.ts", "repo_id": "langchainjs", "token_count": 114 }
834
--- hide_table_of_contents: true --- import CodeBlock from "@theme/CodeBlock"; # PlanetScale Chat Memory Because PlanetScale works via a REST API, you can use this with [Vercel Edge](https://vercel.com/docs/concepts/functions/edge-functions/edge-runtime), [Cloudflare Workers](https://developers.cloudflare.com/worker...
langchainjs/docs/core_docs/docs/integrations/chat_memory/planetscale.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat_memory/planetscale.mdx", "repo_id": "langchainjs", "token_count": 512 }
725
# 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/maskformer/convert_maskformer_resnet_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/maskformer/convert_maskformer_resnet_to_pytorch.py", "repo_id": "transformers", "token_count": 9461 }
629
"""Test document summary index.""" from typing import List import pytest from llama_index.core.indices.document_summary.base import DocumentSummaryIndex from llama_index.core.schema import Document def test_build_index( docs: List[Document], index: DocumentSummaryIndex, ) -> None: """Test build tree.""" ...
llama_index/llama-index-core/tests/indices/document_summary/test_index.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/document_summary/test_index.py", "repo_id": "llama_index", "token_count": 787 }
1,228
// 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/util/streamrpc/in_memory_streamer_test.go/0
{ "file_path": "milvus/internal/util/streamrpc/in_memory_streamer_test.go", "repo_id": "milvus", "token_count": 791 }
1,803
python_sources()
llama_index/llama-index-core/llama_index/core/postprocessor/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/postprocessor/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,204
"""Simple vector store index.""" import json import logging import os from dataclasses import dataclass, field from typing import Any, Callable, Dict, List, Mapping, Optional, cast import fsspec from dataclasses_json import DataClassJsonMixin from llama_index.core.indices.query.embedding_utils import ( get_top_k_...
llama_index/llama-index-core/llama_index/core/vector_stores/simple.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/vector_stores/simple.py", "repo_id": "llama_index", "token_count": 5221 }
1,255
"""Test __ModuleName__LLM llm.""" from __module_name__.llms import __ModuleName__LLM def test_stream() -> None: """Test streaming tokens from OpenAI.""" llm = __ModuleName__LLM() for token in llm.stream("I'm Pickle Rick"): assert isinstance(token, str) async def test_astream() -> None: """T...
langchain/libs/cli/langchain_cli/integration_template/tests/integration_tests/test_llms.py/0
{ "file_path": "langchain/libs/cli/langchain_cli/integration_template/tests/integration_tests/test_llms.py", "repo_id": "langchain", "token_count": 657 }
203
package io import ( "path" "testing" "github.com/samber/lo" "github.com/stretchr/testify/suite" "golang.org/x/net/context" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/util/conc" ) const binlogIOTestDir = "/tmp/milvus_test/binlog_io" func TestBinlogIO(t *testing.T) { suit...
milvus/internal/datanode/io/binlog_io_test.go/0
{ "file_path": "milvus/internal/datanode/io/binlog_io_test.go", "repo_id": "milvus", "token_count": 713 }
1,786
from llama_index.core.readers.base import BaseReader from llama_index.readers.lilac import LilacReader def test_class(): names_of_base_classes = [b.__name__ for b in LilacReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-lilac/tests/test_readers_lilac_reader.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-lilac/tests/test_readers_lilac_reader.py", "repo_id": "llama_index", "token_count": 89 }
1,470
List Retriever ======================= .. automodule:: llama_index.core.indices.list.retrievers :members: :inherited-members: .. :exclude-members: index_struct, query, set_llm_predictor, set_prompt_helper
llama_index/docs/api_reference/query/retrievers/list.rst/0
{ "file_path": "llama_index/docs/api_reference/query/retrievers/list.rst", "repo_id": "llama_index", "token_count": 80 }
1,081
# Additional Readings These are **optional readings** if you want to go deeper. ## Introduction to Policy Optimization - [Part 3: Intro to Policy Optimization - Spinning Up documentation](https://spinningup.openai.com/en/latest/spinningup/rl_intro3.html) ## Policy Gradient - [https://johnwlambert.github.io/polic...
deep-rl-class/units/en/unit4/additional-readings.mdx/0
{ "file_path": "deep-rl-class/units/en/unit4/additional-readings.mdx", "repo_id": "deep-rl-class", "token_count": 281 }
159
from enum import Enum from typing import Dict, List, Optional from langchain_core.callbacks import ( AsyncCallbackManagerForRetrieverRun, CallbackManagerForRetrieverRun, ) from langchain_core.documents import Document from langchain_core.pydantic_v1 import Field, root_validator from langchain_core.retrievers i...
langchain/libs/langchain/langchain/retrievers/multi_vector.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/multi_vector.py", "repo_id": "langchain", "token_count": 1567 }
559
# 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/models/bert/modeling_bert.py/0
{ "file_path": "transformers/src/transformers/models/bert/modeling_bert.py", "repo_id": "transformers", "token_count": 35978 }
568
from enum import Enum from typing import List, Union import numpy as np Matrix = Union[List[List[float]], List[np.ndarray], np.ndarray] class DistanceStrategy(str, Enum): """Enumerator of the Distance strategies for calculating distances between vectors.""" EUCLIDEAN_DISTANCE = "EUCLIDEAN_DISTANCE" ...
langchain/libs/partners/pinecone/langchain_pinecone/_utilities.py/0
{ "file_path": "langchain/libs/partners/pinecone/langchain_pinecone/_utilities.py", "repo_id": "langchain", "token_count": 1267 }
656
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/trainer_seq2seq.py/0
{ "file_path": "transformers/src/transformers/trainer_seq2seq.py", "repo_id": "transformers", "token_count": 6769 }
693
from typing import List, Literal from langchain_core.messages.base import BaseMessage, BaseMessageChunk class SystemMessage(BaseMessage): """Message for priming AI behavior, usually passed in as the first of a sequence of input messages. """ type: Literal["system"] = "system" @classmethod d...
langchain/libs/core/langchain_core/messages/system.py/0
{ "file_path": "langchain/libs/core/langchain_core/messages/system.py", "repo_id": "langchain", "token_count": 342 }
402
import pytest from datasets.splits import SplitDict, SplitInfo from datasets.utils.py_utils import asdict @pytest.mark.parametrize( "split_dict", [ SplitDict(), SplitDict({"train": SplitInfo(name="train", num_bytes=1337, num_examples=42, dataset_name="my_dataset")}), SplitDict({"train...
datasets/tests/test_splits.py/0
{ "file_path": "datasets/tests/test_splits.py", "repo_id": "datasets", "token_count": 622 }
152
"""Init file.""" from llama_index.readers.file.xml.base import ( XMLReader, ) __all__ = ["XMLReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/xml/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/xml/__init__.py", "repo_id": "llama_index", "token_count": 44 }
1,495
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/nystromformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/nystromformer.md", "repo_id": "transformers", "token_count": 907 }
513