text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
<jupyter_start><jupyter_text>Multi Document Agents PackThis LlamaPack provides an example of our multi-document agents.<jupyter_code>!pip install llama-index llama-hub import nest_asyncio nest_asyncio.apply()<jupyter_output><empty_output><jupyter_text>Setup Data<jupyter_code>from pathlib import Path import requests fr...
llama_index/llama-index-packs/llama-index-packs-multi-document-agents/examples/multi_document_agents.ipynb/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-multi-document-agents/examples/multi_document_agents.ipynb", "repo_id": "llama_index", "token_count": 1050 }
1,710
.. _Ref-Evaluation: Evaluation ==== We have modules for both LLM-based evaluation and retrieval-based evaluation. .. automodule:: llama_index.core.evaluation :members: :inherited-members:
llama_index/docs/api_reference/evaluation.rst/0
{ "file_path": "llama_index/docs/api_reference/evaluation.rst", "repo_id": "llama_index", "token_count": 66 }
1,090
<!--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/vit_mae.md/0
{ "file_path": "transformers/docs/source/en/model_doc/vit_mae.md", "repo_id": "transformers", "token_count": 1492 }
517
python_sources() python_test_utils( name="test_utils", ) python_tests( name="tests", )
llama_index/llama-index-core/tests/indices/struct_store/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/indices/struct_store/BUILD", "repo_id": "llama_index", "token_count": 42 }
1,222
# coding=utf-8 # 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 requir...
transformers/tests/models/ernie/test_modeling_ernie.py/0
{ "file_path": "transformers/tests/models/ernie/test_modeling_ernie.py", "repo_id": "transformers", "token_count": 10885 }
744
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/unittest/test_regex_query.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_regex_query.cpp", "repo_id": "milvus", "token_count": 6929 }
1,784
// 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.h/0
{ "file_path": "milvus/internal/core/src/storage/AliyunSTSClient.h", "repo_id": "milvus", "token_count": 982 }
1,941
pub mod bert; pub mod bigcode; pub mod blip; pub mod blip_text; pub mod chatglm; pub mod convmixer; pub mod convnext; pub mod dinov2; pub mod distilbert; pub mod efficientnet; pub mod falcon; pub mod jina_bert; pub mod llama; pub mod llama2_c; pub mod llama2_c_weights; pub mod mamba; pub mod marian; pub mod mistral; pu...
candle/candle-transformers/src/models/mod.rs/0
{ "file_path": "candle/candle-transformers/src/models/mod.rs", "repo_id": "candle", "token_count": 353 }
72
# Quickstart In this quickstart we'll show you how to: - Get setup with LangChain, LangSmith and LangServe - Use the most basic and common components of LangChain: prompt templates, models, and output parsers - Use LangChain Expression Language, the protocol that LangChain is built on and which facilitates component c...
langchain/docs/docs/get_started/quickstart.mdx/0
{ "file_path": "langchain/docs/docs/get_started/quickstart.mdx", "repo_id": "langchain", "token_count": 6270 }
92
<jupyter_start><jupyter_text>Hugging Face prompt injection identificationThis notebook shows how to prevent prompt injection attacks using the text classification model from `HuggingFace`.By default, it uses a *[laiyer/deberta-v3-base-prompt-injection](https://huggingface.co/laiyer/deberta-v3-base-prompt-injection)* mo...
langchain/docs/docs/guides/safety/hugging_face_prompt_injection.ipynb/0
{ "file_path": "langchain/docs/docs/guides/safety/hugging_face_prompt_injection.ipynb", "repo_id": "langchain", "token_count": 1054 }
94
python_sources()
llama_index/llama-index-integrations/tools/llama-index-tools-graphql/llama_index/tools/graphql/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-graphql/llama_index/tools/graphql/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,487
from langchain_community.tools.interaction.tool import StdInInquireTool __all__ = ["StdInInquireTool"]
langchain/libs/langchain/langchain/tools/interaction/tool.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/interaction/tool.py", "repo_id": "langchain", "token_count": 34 }
550
"""Init params."""
llama_index/llama-index-core/tests/tools/tool_spec/__init__.py/0
{ "file_path": "llama_index/llama-index-core/tests/tools/tool_spec/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,171
# html-to-text When ingesting HTML documents for later retrieval, we are often interested only in the actual content of the webpage rather than semantics. Stripping HTML tags from documents with the HtmlToTextTransformer can result in more content-rich chunks, making retrieval more effective. ## Setup You'll need to...
langchainjs/docs/core_docs/docs/integrations/document_transformers/html-to-text.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_transformers/html-to-text.mdx", "repo_id": "langchainjs", "token_count": 395 }
717
dependencies = ['torch'] import timm globals().update(timm.models._registry._model_entrypoints)
pytorch-image-models/hubconf.py/0
{ "file_path": "pytorch-image-models/hubconf.py", "repo_id": "pytorch-image-models", "token_count": 32 }
384
#include <torch/extension.h> #include <ATen/ATen.h> #include <vector> #define min(a, b) ((a)<(b)?(a):(b)) #define max(a, b) ((a)>(b)?(a):(b)) std::vector<at::Tensor> index_max_kernel( at::Tensor index_vals, at::Tensor indices, int A_num_block, int B_num_block ); at::Tensor mm_to_sparse_kernel( at::Tensor d...
transformers/src/transformers/kernels/mra/cuda_launch.h/0
{ "file_path": "transformers/src/transformers/kernels/mra/cuda_launch.h", "repo_id": "transformers", "token_count": 312 }
600
# Vanna AI LLamaPack Vanna AI is an open-source RAG framework for SQL generation. It works in two steps: 1. Train a RAG model on your data 2. Ask questions (use reference corpus to generate SQL queries that can run on your db). Check out the [Github project](https://github.com/vanna-ai/vanna) and the [docs](https://...
llama_index/llama-index-packs/llama-index-packs-vanna/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-vanna/README.md", "repo_id": "llama_index", "token_count": 508 }
1,703
import { ChatPromptTemplate, MessagesPlaceholder, } from "@langchain/core/prompts"; import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { AgentExecutor, createOpenAIToolsAgent } from "langchain/agents"; import { SqlToolkit } from "langchain/agents/toolkits/sql"; import { SqlDatabase } from "lan...
langchainjs/examples/src/use_cases/sql/agents/high_cardinality_columns.ts/0
{ "file_path": "langchainjs/examples/src/use_cases/sql/agents/high_cardinality_columns.ts", "repo_id": "langchainjs", "token_count": 1206 }
853
""" Question answering over an RDF or OWL graph using SPARQL. """ from __future__ import annotations from typing import Any, Dict, List, Optional from langchain_community.graphs import NeptuneRdfGraph from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts.base import BasePromptTempla...
langchain/libs/langchain/langchain/chains/graph_qa/neptune_sparql.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/graph_qa/neptune_sparql.py", "repo_id": "langchain", "token_count": 2627 }
484
#!/usr/bin/env python3 """ Checkpoint Cleaning Script Takes training checkpoints with GPU tensors, optimizer state, extra dict keys, etc. and outputs a CPU tensor checkpoint with only the `state_dict` along with SHA256 calculation for model zoo compatibility. Hacked together by / Copyright 2020 Ross Wightman (https:...
pytorch-image-models/clean_checkpoint.py/0
{ "file_path": "pytorch-image-models/clean_checkpoint.py", "repo_id": "pytorch-image-models", "token_count": 1771 }
353
import { AttributeInfo } from "langchain/schema/query_constructor"; import { OpenAIEmbeddings, OpenAI } from "@langchain/openai"; import { SelfQueryRetriever } from "langchain/retrievers/self_query"; import { ChromaTranslator } from "langchain/retrievers/self_query/chroma"; import { Chroma } from "@langchain/community/...
langchainjs/examples/src/retrievers/chroma_self_query.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/chroma_self_query.ts", "repo_id": "langchainjs", "token_count": 1363 }
911
from llama_index.finetuning.cross_encoders import CrossEncoderFinetuneEngine from llama_index.finetuning.types import BaseCrossEncoderFinetuningEngine def test_class(): names_of_base_classes = [b.__name__ for b in CrossEncoderFinetuneEngine.__mro__] assert BaseCrossEncoderFinetuningEngine.__name__ in names_of...
llama_index/llama-index-finetuning/tests/cross_encoders/test_cross_encoder_classes.py/0
{ "file_path": "llama_index/llama-index-finetuning/tests/cross_encoders/test_cross_encoder_classes.py", "repo_id": "llama_index", "token_count": 111 }
1,204
--- sidebar_class_name: node-only hide_table_of_contents: true --- # Notion API This guide will take you through the steps required to load documents from Notion pages and databases using the Notion API. ## Overview Notion is a versatile productivity platform that consolidates note-taking, task management, and data...
langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/notionapi.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/notionapi.mdx", "repo_id": "langchainjs", "token_count": 656 }
705
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/src/transformers/models/deformable_detr/load_custom.py/0
{ "file_path": "transformers/src/transformers/models/deformable_detr/load_custom.py", "repo_id": "transformers", "token_count": 637 }
643
import itertools import re from typing import Any, Callable, Generator, Iterable, List, Optional, Tuple from urllib.parse import urlparse from langchain_core.documents import Document from langchain_community.document_loaders.web_base import WebBaseLoader def _default_parsing_function(content: Any) -> str: retu...
langchain/libs/community/langchain_community/document_loaders/sitemap.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/sitemap.py", "repo_id": "langchain", "token_count": 3671 }
244
<jupyter_start><jupyter_text>GraphQL>[GraphQL](https://graphql.org/) is a query language for APIs and a runtime for executing those queries against your data. `GraphQL` provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more,...
langchain/docs/docs/integrations/tools/graphql.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/graphql.ipynb", "repo_id": "langchain", "token_count": 1091 }
181
// 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/storage/index_data_codec_test.go/0
{ "file_path": "milvus/internal/storage/index_data_codec_test.go", "repo_id": "milvus", "token_count": 2105 }
1,928
<jupyter_start><jupyter_text>Microsoft ExcelThe `UnstructuredExcelLoader` is used to load `Microsoft Excel` files. The loader works with both `.xlsx` and `.xls` files. The page content will be the raw text of the Excel file. If you use the loader in `"elements"` mode, an HTML representation of the Excel file will be av...
langchain/docs/docs/integrations/document_loaders/microsoft_excel.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/microsoft_excel.ipynb", "repo_id": "langchain", "token_count": 184 }
102
# coding=utf-8 # 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 requir...
transformers/tests/models/xglm/test_tokenization_xglm.py/0
{ "file_path": "transformers/tests/models/xglm/test_tokenization_xglm.py", "repo_id": "transformers", "token_count": 4199 }
759
[package] name = "candle-pyo3" version.workspace = true edition.workspace = true description.workspace = true repository.workspace = true keywords.workspace = true categories.workspace = true license.workspace = true readme = "README.md" [lib] name = "candle" crate-type = ["cdylib"] [dependencies] accelerate-src = { ...
candle/candle-pyo3/Cargo.toml/0
{ "file_path": "candle/candle-pyo3/Cargo.toml", "repo_id": "candle", "token_count": 315 }
71
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/regnet/test_modeling_tf_regnet.py/0
{ "file_path": "transformers/tests/models/regnet/test_modeling_tf_regnet.py", "repo_id": "transformers", "token_count": 4911 }
835
# LlamaIndex Readers Integration: Qdrant
llama_index/llama-index-integrations/readers/llama-index-readers-qdrant/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-qdrant/README.md", "repo_id": "llama_index", "token_count": 11 }
1,419
package meta import ( "github.com/blang/semver/v4" "github.com/golang/protobuf/proto" "github.com/milvus-io/milvus/cmd/tools/migration/versions" "github.com/milvus-io/milvus/internal/metastore/kv/datacoord" "github.com/milvus-io/milvus/internal/metastore/kv/querycoord" "github.com/milvus-io/milvus/internal/meta...
milvus/cmd/tools/migration/meta/meta220.go/0
{ "file_path": "milvus/cmd/tools/migration/meta/meta220.go", "repo_id": "milvus", "token_count": 3503 }
1,713
import random import logging import time # import traceback from multiprocessing import Process from pymilvus import Milvus, DataType import utils as util import config from milvus_benchmark.runners import utils logger = logging.getLogger("milvus_benchmark.client") # yaml file and code file comparison table of Index...
milvus/tests/benchmark/milvus_benchmark/client.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/client.py", "repo_id": "milvus", "token_count": 9662 }
2,076
# 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 # # http://www.a...
transformers/tests/models/megatron_bert/test_modeling_megatron_bert.py/0
{ "file_path": "transformers/tests/models/megatron_bert/test_modeling_megatron_bert.py", "repo_id": "transformers", "token_count": 7272 }
773
"""Combine many documents together by recursively reducing them.""" from __future__ import annotations from typing import Any, Callable, List, Optional, Protocol, Tuple from langchain_core.callbacks import Callbacks from langchain_core.documents import Document from langchain_core.pydantic_v1 import Extra from lang...
langchain/libs/langchain/langchain/chains/combine_documents/reduce.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/combine_documents/reduce.py", "repo_id": "langchain", "token_count": 5762 }
500
from typing import Callable, Dict from llama_index.tools.function_tool import FunctionTool from task import Task class Phone: def __init__(self) -> None: self.number = "" self.entered = False def dial_digit(self, number: str) -> None: """Dial a digit on the phone.""" assert ...
llama_index/benchmarks/agent/button_tasks.py/0
{ "file_path": "llama_index/benchmarks/agent/button_tasks.py", "repo_id": "llama_index", "token_count": 760 }
1,075
from langchain_core.outputs import LLMResult from langchain_google_vertexai import HarmBlockThreshold, HarmCategory, VertexAI SAFETY_SETTINGS = { HarmCategory.HARM_CATEGORY_UNSPECIFIED: HarmBlockThreshold.BLOCK_NONE, HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE, HarmCategory...
langchain/libs/partners/google-vertexai/tests/integration_tests/test_llms_safety.py/0
{ "file_path": "langchain/libs/partners/google-vertexai/tests/integration_tests/test_llms_safety.py", "repo_id": "langchain", "token_count": 1446 }
668
# coding=utf-8 # Copyright 2022 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/pipelines/stable_diffusion_adapter/test_stable_diffusion_adapter.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_adapter/test_stable_diffusion_adapter.py", "repo_id": "diffusers", "token_count": 18685 }
274
"""Init readers schema.""" # TODO: deprecate this file, only keep for backwards compatibility from llama_index.legacy.readers.schema.base import Document, ImageDocument __all__ = ["Document", "ImageDocument"]
llama_index/llama-index-legacy/llama_index/legacy/readers/schema/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/schema/__init__.py", "repo_id": "llama_index", "token_count": 59 }
1,596
from langchain_community.tools.edenai.text_moderation import EdenAiTextModerationTool __all__ = ["EdenAiTextModerationTool"]
langchain/libs/langchain/langchain/tools/edenai/text_moderation.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/edenai/text_moderation.py", "repo_id": "langchain", "token_count": 43 }
557
python_sources()
llama_index/llama-index-finetuning/llama_index/finetuning/rerankers/BUILD/0
{ "file_path": "llama_index/llama-index-finetuning/llama_index/finetuning/rerankers/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,174
from langchain_core.prompts.prompt import PromptTemplate # There are a few different templates to choose from # These are just different ways to generate hypothetical documents web_search_template = """Please write a passage to answer the question Question: {question} Passage:""" sci_fact_template = """Please write a...
langchain/templates/hyde/hyde/prompts.py/0
{ "file_path": "langchain/templates/hyde/hyde/prompts.py", "repo_id": "langchain", "token_count": 199 }
639
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/query_engine/flare/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/query_engine/flare/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,753
# for backward compatibility from llama_index.core.postprocessor import ( AutoPrevNextNodePostprocessor, CohereRerank, EmbeddingRecencyPostprocessor, FixedRecencyPostprocessor, KeywordNodePostprocessor, LLMRerank, LongContextReorder, LongLLMLinguaPostprocessor, MetadataReplacementPos...
llama_index/llama-index-core/llama_index/core/indices/postprocessor.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/postprocessor.py", "repo_id": "llama_index", "token_count": 488 }
1,219
import { Document, DocumentInterface } from "@langchain/core/documents"; import { chunkArray } from "@langchain/core/utils/chunk_array"; import { CheerioWebBaseLoader, WebBaseLoaderParams } from "./cheerio.js"; /** * Interface representing the parameters for initializing a SitemapLoader. * @interface SitemapLoaderPa...
langchainjs/langchain/src/document_loaders/web/sitemap.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/web/sitemap.ts", "repo_id": "langchainjs", "token_count": 1644 }
900
""" Optimizer Factory w/ Custom Weight Decay Hacked together by / Copyright 2021 Ross Wightman """ import logging from itertools import islice from typing import Optional, Callable, Tuple import torch import torch.nn as nn import torch.optim as optim from timm.models import group_parameters from .adabelief import Ad...
pytorch-image-models/timm/optim/optim_factory.py/0
{ "file_path": "pytorch-image-models/timm/optim/optim_factory.py", "repo_id": "pytorch-image-models", "token_count": 6927 }
411
search_performance: collections: - milvus: db_config.primary_path: /test/milvus/db_data_011/sift_1b_128_l2_sq8 cache_config.cpu_cache_capacity: 150GB engine_config.use_blas_threshold: 0 engine_config.gpu_search_threshold: 200 gpu_resource_config.enable: true g...
milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search_debug.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search_debug.yaml", "repo_id": "milvus", "token_count": 405 }
1,872
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all # coding=utf-8 # Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not u...
peft/src/peft/utils/peft_types.py/0
{ "file_path": "peft/src/peft/utils/peft_types.py", "repo_id": "peft", "token_count": 851 }
328
from pymilvus import connections import sys sys.path.append("..") sys.path.append("../..") from common.milvus_sys import MilvusSys from utils import * def task_1(data_size, host): """ task_1: before upgrade: create collection and insert data with flush, create index, load and search after upgr...
milvus/tests/python_client/deploy/scripts/action_before_upgrade.py/0
{ "file_path": "milvus/tests/python_client/deploy/scripts/action_before_upgrade.py", "repo_id": "milvus", "token_count": 1239 }
2,038
# Summarization (Seq2Seq model) training examples The following example showcases how to finetune a sequence-to-sequence model for summarization using the JAX/Flax backend. JAX/Flax allows you to trace pure functions and compile them into efficient, fused accelerator code on both GPU and TPU. Models written in JAX/Fl...
transformers/examples/flax/summarization/README.md/0
{ "file_path": "transformers/examples/flax/summarization/README.md", "repo_id": "transformers", "token_count": 544 }
568
# PGVector This page covers how to use the Postgres [PGVector](https://github.com/pgvector/pgvector) ecosystem within LangChain It is broken into two parts: installation and setup, and then references to specific PGVector wrappers. ## Installation - Install the Python package with `pip install pgvector` ## Setup 1....
langchain/docs/docs/integrations/providers/pgvector.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/pgvector.mdx", "repo_id": "langchain", "token_count": 254 }
155
import { BaseStore } from "@langchain/core/stores"; /** * In-memory implementation of the BaseStore using a dictionary. Used for * storing key-value pairs in memory. * @example * ```typescript * const store = new InMemoryStore<BaseMessage>(); * await store.mset( * Array.from({ length: 5 }).map((_, index) => [...
langchainjs/langchain/src/storage/in_memory.ts/0
{ "file_path": "langchainjs/langchain/src/storage/in_memory.ts", "repo_id": "langchainjs", "token_count": 794 }
989
import candle from candle import Tensor from candle.testing import assert_equal, assert_almost_equal import pytest @pytest.mark.parametrize("dtype", [candle.f32, candle.f64, candle.f16, candle.u32, candle.u8, candle.i64]) def test_assert_equal_asserts_correctly(dtype: candle.DType): a = Tensor([1, 2, 3]).to(dtype...
candle/candle-pyo3/tests/bindings/test_testing.py/0
{ "file_path": "candle/candle-pyo3/tests/bindings/test_testing.py", "repo_id": "candle", "token_count": 476 }
68
export { deepCompareStrict, Validator } from "./@cfworker/json-schema/index.js";
langchainjs/langchain-core/src/utils/json_schema.ts/0
{ "file_path": "langchainjs/langchain-core/src/utils/json_schema.ts", "repo_id": "langchainjs", "token_count": 27 }
887
"""Open Weather Map tool spec.""" from typing import Any, List from llama_index.core.schema import Document from llama_index.core.tools.tool_spec.base import BaseToolSpec class OpenWeatherMapToolSpec(BaseToolSpec): """Open Weather tool spec.""" spec_functions = ["weather_at_location", "forecast_tommorrow_a...
llama_index/llama-index-integrations/tools/llama-index-tools-weather/llama_index/tools/weather/base.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-weather/llama_index/tools/weather/base.py", "repo_id": "llama_index", "token_count": 2014 }
1,503
import torch def main(): if torch.cuda.is_available(): num_gpus = torch.cuda.device_count() else: num_gpus = 0 print(f"Successfully ran on {num_gpus} GPUs") if __name__ == "__main__": main()
accelerate/src/accelerate/test_utils/scripts/test_cli.py/0
{ "file_path": "accelerate/src/accelerate/test_utils/scripts/test_cli.py", "repo_id": "accelerate", "token_count": 102 }
13
// 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/task/action.go/0
{ "file_path": "milvus/internal/querycoordv2/task/action.go", "repo_id": "milvus", "token_count": 1556 }
1,836
// 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/funcutil/func_test.go/0
{ "file_path": "milvus/pkg/util/funcutil/func_test.go", "repo_id": "milvus", "token_count": 6118 }
1,909
"""Google PaLM embeddings file.""" from typing import Any, List, Optional from llama_index.core.base.embeddings.base import ( DEFAULT_EMBED_BATCH_SIZE, BaseEmbedding, ) from llama_index.core.bridge.pydantic import PrivateAttr from llama_index.core.callbacks.base import CallbackManager import google.generativ...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-google/llama_index/embeddings/google/palm.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-google/llama_index/embeddings/google/palm.py", "repo_id": "llama_index", "token_count": 1053 }
1,181
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/speech_to_text.md/0
{ "file_path": "transformers/docs/source/en/model_doc/speech_to_text.md", "repo_id": "transformers", "token_count": 1920 }
487
"""Response schema.""" from dataclasses import dataclass, field from typing import Any, Dict, List, Optional, Union from llama_index.legacy.bridge.pydantic import BaseModel from llama_index.legacy.schema import NodeWithScore from llama_index.legacy.types import TokenGen from llama_index.legacy.utils import truncate_t...
llama_index/llama-index-legacy/llama_index/legacy/core/response/schema.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/core/response/schema.py", "repo_id": "llama_index", "token_count": 1959 }
1,646
import { BaseRetriever, type BaseRetrieverInput, } from "@langchain/core/retrievers"; import type { CallbackManagerForRetrieverRun } from "@langchain/core/callbacks/manager"; import { Document } from "@langchain/core/documents"; /** * interface BaseRetrieverInput { * callbacks?: Callbacks; * tags?: string[]...
langchainjs/examples/src/retrievers/custom.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/custom.ts", "repo_id": "langchainjs", "token_count": 461 }
861
from langchain_community.llms.openllm import OpenLLM __all__ = ["OpenLLM"]
langchain/libs/langchain/langchain/llms/openllm.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/openllm.py", "repo_id": "langchain", "token_count": 28 }
516
/* eslint-disable no-process-env */ import { Document } from "@langchain/core/documents"; import { FakeEmbeddings } from "@langchain/core/utils/testing"; import { Neo4jVectorStore } from "../neo4j_vector.js"; const OS_TOKEN_COUNT = 1536; const texts = ["foo", "bar", "baz", "This is the end of the world!"]; class Fak...
langchainjs/libs/langchain-community/src/vectorstores/tests/neo4j_vector.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/neo4j_vector.int.test.ts", "repo_id": "langchainjs", "token_count": 5725 }
984
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/rootcoord/root_coord_test.go/0
{ "file_path": "milvus/internal/rootcoord/root_coord_test.go", "repo_id": "milvus", "token_count": 32204 }
1,884
python_sources()
llama_index/llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,483
# Remembrall This page covers how to use the [Remembrall](https://remembrall.dev) ecosystem within LangChain. ## What is Remembrall? Remembrall gives your language model long-term memory, retrieval augmented generation, and complete observability with just a few lines of code. ![Screenshot of the Remembrall dashboa...
langchain/docs/docs/integrations/memory/remembrall.md/0
{ "file_path": "langchain/docs/docs/integrations/memory/remembrall.md", "repo_id": "langchain", "token_count": 1052 }
126
<jupyter_start><jupyter_text>Les pouvoirs spéciaux des *tokenizers* rapides (PyTorch) Installez les bibliothèques 🤗 *Transformers* et 🤗 *Datasets* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece] from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrain...
notebooks/course/fr/chapter6/section3_pt.ipynb/0
{ "file_path": "notebooks/course/fr/chapter6/section3_pt.ipynb", "repo_id": "notebooks", "token_count": 1610 }
270
# 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/t5/convert_t5x_checkpoint_to_flax.py/0
{ "file_path": "transformers/src/transformers/models/t5/convert_t5x_checkpoint_to_flax.py", "repo_id": "transformers", "token_count": 5106 }
728
// 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/datanode/syncmgr/storage_v2_serializer.go/0
{ "file_path": "milvus/internal/datanode/syncmgr/storage_v2_serializer.go", "repo_id": "milvus", "token_count": 2949 }
1,845
"""Test johnsnowlabs embeddings.""" from langchain_community.embeddings.johnsnowlabs import JohnSnowLabsEmbeddings def test_johnsnowlabs_embed_document() -> None: """Test johnsnowlabs embeddings.""" documents = ["foo bar", "bar foo"] embedding = JohnSnowLabsEmbeddings() output = embedding.embed_docum...
langchain/libs/community/tests/integration_tests/embeddings/test_johnsnowlabs.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_johnsnowlabs.py", "repo_id": "langchain", "token_count": 227 }
329
"""Test document loader integrations."""
langchain/libs/community/tests/integration_tests/document_loaders/__init__.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/__init__.py", "repo_id": "langchain", "token_count": 9 }
321
import { VectorStore } from "@langchain/core/vectorstores"; /** * Represents logical AND operator. */ export type AND = "and"; /** * Represents logical OR operator. */ export type OR = "or"; /** * Represents logical NOT operator. */ export type NOT = "not"; /** * Represents a logical operator which can be AND,...
langchainjs/langchain/src/chains/query_constructor/ir.ts/0
{ "file_path": "langchainjs/langchain/src/chains/query_constructor/ir.ts", "repo_id": "langchainjs", "token_count": 1244 }
892
# 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 applicabl...
accelerate/tests/test_quantization.py/0
{ "file_path": "accelerate/tests/test_quantization.py", "repo_id": "accelerate", "token_count": 17682 }
22
"""Test math utility functions.""" from typing import List import numpy as np import pytest from langchain_community.utils.math import cosine_similarity, cosine_similarity_top_k @pytest.fixture def X() -> List[List[float]]: return [[1.0, 2.0, 3.0], [0.0, 1.0, 0.0], [1.0, 2.0, 0.0]] @pytest.fixture def Y() -> ...
langchain/libs/community/tests/unit_tests/utils/test_math.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/utils/test_math.py", "repo_id": "langchain", "token_count": 1138 }
384
<jupyter_start><jupyter_text>File Based Node ParsersThe `SimpleFileNodeParser` and `FlatReader` are designed to allow opening a variety of file types and automatically selecting the best `NodeParser` to process the files. The `FlatReader` loads the file in a raw text format and attaches the file information to the meta...
llama_index/docs/examples/node_postprocessor/FileNodeProcessors.ipynb/0
{ "file_path": "llama_index/docs/examples/node_postprocessor/FileNodeProcessors.ipynb", "repo_id": "llama_index", "token_count": 2787 }
1,075
import { z } from "zod"; import { zodToJsonSchema, JsonSchema7ObjectType } from "zod-to-json-schema"; import { BaseChatModel } from "@langchain/core/language_models/chat_models"; import { BaseFunctionCallOptions } from "@langchain/core/language_models/base"; import { PromptTemplate } from "@langchain/core/prompts"; imp...
langchainjs/langchain/src/chains/openai_functions/tagging.ts/0
{ "file_path": "langchainjs/langchain/src/chains/openai_functions/tagging.ts", "repo_id": "langchainjs", "token_count": 988 }
892
label: 'How-to' position: 3
langchainjs/docs/core_docs/docs/modules/agents/how_to/_category_.yml/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/agents/how_to/_category_.yml", "repo_id": "langchainjs", "token_count": 12 }
800
# Violation of Expectations Chain This page demonstrates how to use the `ViolationOfExpectationsChain`. This chain extracts insights from chat conversations by comparing the differences between an LLM's prediction of the next message in a conversation and the user's mental state against the actual next message, and is...
langchainjs/docs/core_docs/docs/use_cases/agent_simulations/violation_of_expectations_chain.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/use_cases/agent_simulations/violation_of_expectations_chain.mdx", "repo_id": "langchainjs", "token_count": 949 }
741
from llama_index.tools.cogniswitch.base import CogniswitchToolSpec __all__ = [ "CogniswitchToolSpec", ]
llama_index/llama-index-integrations/tools/llama-index-tools-cogniswitch/llama_index/tools/cogniswitch/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-cogniswitch/llama_index/tools/cogniswitch/__init__.py", "repo_id": "llama_index", "token_count": 42 }
1,564
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [], "seed": null, "tokens": [ { "id": 187, "logprob": -0.37890625, "special": false, "text": "\n" }, { "id": 187, "logprob":...
text-generation-inference/integration-tests/models/__snapshots__/test_mamba/test_mamba.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_mamba/test_mamba.json", "repo_id": "text-generation-inference", "token_count": 860 }
427
python_tests()
llama_index/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,285
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/rootcoord/drop_partition_task.go/0
{ "file_path": "milvus/internal/rootcoord/drop_partition_task.go", "repo_id": "milvus", "token_count": 1469 }
1,852
import { OpenAI } from "@langchain/openai"; import { CacheClient, Configurations, CredentialProvider, } from "@gomomento/sdk"; import { MomentoCache } from "@langchain/community/caches/momento"; // See https://github.com/momentohq/client-sdk-javascript for connection options const client = new CacheClient({ co...
langchainjs/examples/src/cache/momento.ts/0
{ "file_path": "langchainjs/examples/src/cache/momento.ts", "repo_id": "langchainjs", "token_count": 201 }
842
python_sources()
llama_index/llama-index-core/llama_index/core/utilities/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/utilities/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,254
# 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/dpt/convert_dpt_beit_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/dpt/convert_dpt_beit_to_hf.py", "repo_id": "transformers", "token_count": 5894 }
627
# flake8: noqa from langchain_core.prompts import PromptTemplate 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...
langchain/libs/langchain/langchain/evaluation/qa/eval_prompt.py/0
{ "file_path": "langchain/libs/langchain/langchain/evaluation/qa/eval_prompt.py", "repo_id": "langchain", "token_count": 983 }
504
use crate::tokenizer::{NormalizedString, Normalizer, Result}; pub use spm_precompiled::Precompiled; use std::cmp::Ordering; use unicode_segmentation::UnicodeSegmentation; fn replace(transformations: &mut Vec<(char, isize)>, old_part: &str, new_part: &str) { let old_count = old_part.chars().count() as isize; le...
tokenizers/tokenizers/src/normalizers/precompiled.rs/0
{ "file_path": "tokenizers/tokenizers/src/normalizers/precompiled.rs", "repo_id": "tokenizers", "token_count": 1432 }
420
[package] name = "candle-transformers" version.workspace = true edition.workspace = true description.workspace = true repository.workspace = true keywords.workspace = true categories.workspace = true license.workspace = true readme = "README.md" [dependencies] accelerate-src = { workspace = true, optional = true } byt...
candle/candle-transformers/Cargo.toml/0
{ "file_path": "candle/candle-transformers/Cargo.toml", "repo_id": "candle", "token_count": 360 }
76
# 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/feature_extraction_sequence_utils.py/0
{ "file_path": "transformers/src/transformers/feature_extraction_sequence_utils.py", "repo_id": "transformers", "token_count": 7735 }
560
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-hwp/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-hwp/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,366
import { test, expect, jest } from "@jest/globals"; import { LLM } from "@langchain/core/language_models/llms"; import { PromptTemplate } from "@langchain/core/prompts"; import { FakeEmbeddings } from "@langchain/core/utils/testing"; import { ChainTool } from "../chain.js"; import { LLMChain } from "../../chains/llm_c...
langchainjs/langchain/src/tools/tests/chain.test.ts/0
{ "file_path": "langchainjs/langchain/src/tools/tests/chain.test.ts", "repo_id": "langchainjs", "token_count": 1473 }
957
/* eslint-disable */ /** * Generated utilities for implementing server-side Convex query and mutation functions. * * THIS CODE IS AUTOMATICALLY GENERATED. * * Generated by convex@1.3.1. * To regenerate, run `npx convex dev`. * @module */ import { ActionBuilder, HttpActionBuilder, MutationBuilder, Query...
langchainjs/libs/langchain-community/src/vectorstores/tests/convex/convex/_generated/server.d.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/convex/convex/_generated/server.d.ts", "repo_id": "langchainjs", "token_count": 1486 }
1,086
# CSV > A [comma-separated values (CSV)](https://en.wikipedia.org/wiki/Comma-separated_values) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. Load CSV data with a single row per document. ## ...
langchainjs/docs/core_docs/docs/modules/data_connection/document_loaders/csv.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/document_loaders/csv.mdx", "repo_id": "langchainjs", "token_count": 656 }
807
apiVersion: v1 kind: Service metadata: name: coordinator-lb namespace: chroma spec: ports: - name: grpc port: 50051 targetPort: 50051 selector: app: coordinator type: LoadBalancer
chroma/k8s/test/coordinator_service.yaml/0
{ "file_path": "chroma/k8s/test/coordinator_service.yaml", "repo_id": "chroma", "token_count": 81 }
59
python_tests()
llama_index/llama-index-integrations/llms/llama-index-llms-anyscale/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-anyscale/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,301
cff-version: 1.2.0 title: 'TRL: Transformer Reinforcement Learning' message: >- If you use this software, please cite it using the metadata from this file. type: software authors: - given-names: Leandro family-names: von Werra - given-names: Younes family-names: Belkada - given-names: Lewis family...
trl/CITATION.cff/0
{ "file_path": "trl/CITATION.cff", "repo_id": "trl", "token_count": 313 }
860
python_tests( name="tests", )
llama_index/llama-index-core/tests/program/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/program/BUILD", "repo_id": "llama_index", "token_count": 15 }
1,272
Source: milvus Section: devel Priority: optional Maintainer: Yunmei Li <yunmei.li@zilliz.com> Build-Depends: debhelper (>= 10), gcc (>= 7.5), g++ (>= 7.5) Standards-Version: 4.1.2 Homepage: https://github.com/milvus-io/milvus Package: milvus Architecture: any-amd64 Depends: ${shlibs:Depends}, ${misc:Depends} Descript...
milvus/build/deb/debian/control/0
{ "file_path": "milvus/build/deb/debian/control", "repo_id": "milvus", "token_count": 186 }
1,622