text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
import datetime 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 from pymilvus import utility rounds = 100 per_nb = 100000 default_field_name = ct.defau...
milvus/tests/python_client/load/test_workload.py/0
{ "file_path": "milvus/tests/python_client/load/test_workload.py", "repo_id": "milvus", "token_count": 1931 }
1,908
import asyncio import json import logging from abc import abstractmethod from threading import Thread from typing import Any, Dict, List, Optional, Tuple, Type, Union, cast, get_args from llama_index.agent.openai_legacy.utils import get_function_by_name from llama_index.core.agent.types import BaseAgent from llama_ind...
llama_index/llama-index-integrations/agent/llama-index-agent-openai-legacy/llama_index/agent/openai_legacy/openai_agent.py/0
{ "file_path": "llama_index/llama-index-integrations/agent/llama-index-agent-openai-legacy/llama_index/agent/openai_legacy/openai_agent.py", "repo_id": "llama_index", "token_count": 10040 }
1,258
// 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/indexnode/indexnode_mock.go/0
{ "file_path": "milvus/internal/indexnode/indexnode_mock.go", "repo_id": "milvus", "token_count": 3199 }
1,803
# C Transformers This page covers how to use the [C Transformers](https://github.com/marella/ctransformers) library within LangChain. It is broken into two parts: installation and setup, and then references to specific C Transformers wrappers. ## Installation and Setup - Install the Python package with `pip install ...
langchain/docs/docs/integrations/providers/ctransformers.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/ctransformers.mdx", "repo_id": "langchain", "token_count": 558 }
130
<jupyter_start><jupyter_text>Run TemplateIn `server.py`, set -```add_routes(app, chain_rag_conv, path="/rag-multi-modal-mv-local")```<jupyter_code>from langserve.client import RemoteRunnable rag_app = RemoteRunnable("http://localhost:8001/rag-multi-modal-mv-local") rag_app.invoke(" < keywords here > ")<jupyter_output>...
langchain/templates/rag-multi-modal-mv-local/rag-multi-modal-mv-local.ipynb/0
{ "file_path": "langchain/templates/rag-multi-modal-mv-local/rag-multi-modal-mv-local.ipynb", "repo_id": "langchain", "token_count": 131 }
680
// Code generated from Plan.g4 by ANTLR 4.9. DO NOT EDIT. package planparserv2 // Plan import "github.com/antlr/antlr4/runtime/Go/antlr" // A complete Visitor for a parse tree produced by PlanParser. type PlanVisitor interface { antlr.ParseTreeVisitor // Visit a parse tree produced by PlanParser#JSONIdentifier. V...
milvus/internal/parser/planparserv2/generated/plan_visitor.go/0
{ "file_path": "milvus/internal/parser/planparserv2/generated/plan_visitor.go", "repo_id": "milvus", "token_count": 1005 }
1,837
# CIP 6: OpenTelemetry Monitoring ## **Status** Current status: `Under Discussion` ## **Motivation** Chroma currently has very little observability, only offering basic logging. Using Chroma in a high-performance production context requires the ability to understand how Chroma is behaving and responding to requests...
chroma/docs/CIP_6_OpenTelemetry_Monitoring.md/0
{ "file_path": "chroma/docs/CIP_6_OpenTelemetry_Monitoring.md", "repo_id": "chroma", "token_count": 618 }
36
import type { IndexFlatL2 } from "faiss-node"; import type { NameRegistry, Parser } from "pickleparser"; import * as uuid from "uuid"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { SaveableVectorStore } from "@langchain/core/vectorstores"; import { Document } from "@langchain/core/docu...
langchainjs/libs/langchain-community/src/vectorstores/faiss.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/faiss.ts", "repo_id": "langchainjs", "token_count": 5678 }
978
CREATE TABLE table2 ( name TEXT PRIMARY KEY );
chroma/chromadb/test/db/migrations/00002-migration-2.psql.sql/0
{ "file_path": "chroma/chromadb/test/db/migrations/00002-migration-2.psql.sql", "repo_id": "chroma", "token_count": 19 }
20
"""__ModuleName__ vector stores.""" from __future__ import annotations import asyncio from functools import partial from typing import ( TYPE_CHECKING, Any, Callable, Iterable, List, Optional, Tuple, Type, TypeVar, ) from langchain_core.embeddings import Embeddings from langchain_c...
langchain/libs/cli/langchain_cli/integration_template/integration_template/vectorstores.py/0
{ "file_path": "langchain/libs/cli/langchain_cli/integration_template/integration_template/vectorstores.py", "repo_id": "langchain", "token_count": 2362 }
217
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-github/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-github/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,369
from abc import ABC, abstractmethod from typing import Optional, Union from .. import Dataset, DatasetDict, Features, IterableDataset, IterableDatasetDict, NamedSplit from ..utils.typing import NestedDataStructureLike, PathLike class AbstractDatasetReader(ABC): def __init__( self, path_or_paths: ...
datasets/src/datasets/io/abc.py/0
{ "file_path": "datasets/src/datasets/io/abc.py", "repo_id": "datasets", "token_count": 721 }
141
""" CrossViT Model @inproceedings{ chen2021crossvit, title={{CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification}}, author={Chun-Fu (Richard) Chen and Quanfu Fan and Rameswar Panda}, booktitle={International Conference on Computer Vision (ICCV)}, year={2021} } Paper l...
pytorch-image-models/timm/models/crossvit.py/0
{ "file_path": "pytorch-image-models/timm/models/crossvit.py", "repo_id": "pytorch-image-models", "token_count": 12463 }
362
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/src/segcore/ScalarIndex.cpp/0
{ "file_path": "milvus/internal/core/src/segcore/ScalarIndex.cpp", "repo_id": "milvus", "token_count": 1532 }
1,656
from rag_chroma_private.chain import chain __all__ = ["chain"]
langchain/templates/rag-chroma-private/rag_chroma_private/__init__.py/0
{ "file_path": "langchain/templates/rag-chroma-private/rag_chroma_private/__init__.py", "repo_id": "langchain", "token_count": 21 }
669
use yew_agent::PublicWorker; fn main() { console_error_panic_hook::set_once(); candle_wasm_example_yolo::Worker::register(); }
candle/candle-wasm-examples/yolo/src/bin/worker.rs/0
{ "file_path": "candle/candle-wasm-examples/yolo/src/bin/worker.rs", "repo_id": "candle", "token_count": 53 }
90
from __future__ import annotations import logging import warnings from dataclasses import asdict, dataclass from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstores impor...
langchain/libs/community/langchain_community/vectorstores/zep.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/zep.py", "repo_id": "langchain", "token_count": 10557 }
332
<!--- 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 ...
transformers/examples/flax/speech-recognition/README.md/0
{ "file_path": "transformers/examples/flax/speech-recognition/README.md", "repo_id": "transformers", "token_count": 1039 }
507
"""**Embedding models** are wrappers around embedding models from different APIs and services. **Embedding models** can be LLMs or not. **Class hierarchy:** .. code-block:: Embeddings --> <name>Embeddings # Examples: OpenAIEmbeddings, HuggingFaceEmbeddings """ import logging import warnings from typing impo...
langchain/libs/langchain/langchain/embeddings/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/__init__.py", "repo_id": "langchain", "token_count": 1433 }
495
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-lilac/llama_index/readers/lilac/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-lilac/llama_index/readers/lilac/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,469
"""Retriever OpenAI agent.""" from typing import Any, cast from llama_index.legacy.agent.legacy.openai_agent import ( OpenAIAgent, ) from llama_index.legacy.objects.base import ObjectRetriever from llama_index.legacy.tools.types import BaseTool class FnRetrieverOpenAIAgent(OpenAIAgent): """Function Retrieve...
llama_index/llama-index-legacy/llama_index/legacy/agent/legacy/retriever_openai_agent.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/agent/legacy/retriever_openai_agent.py", "repo_id": "llama_index", "token_count": 331 }
1,576
# Introduction [[introduction]] One of the most critical tasks in Deep Reinforcement Learning is to **find a good set of training hyperparameters**. <img src="https://raw.githubusercontent.com/optuna/optuna/master/docs/image/optuna-logo.png" alt="Optuna Logo"/> [Optuna](https://optuna.org/) is a library that helps y...
deep-rl-class/units/en/unitbonus2/introduction.mdx/0
{ "file_path": "deep-rl-class/units/en/unitbonus2/introduction.mdx", "repo_id": "deep-rl-class", "token_count": 156 }
176
export { type TypedPromptInputValues, BaseStringPromptTemplate, type BasePromptTemplateInput, BasePromptTemplate, } from "@langchain/core/prompts"; export { StringPromptValue } from "@langchain/core/prompt_values"; export { BaseExampleSelector } from "@langchain/core/example_selectors";
langchainjs/langchain/src/prompts/base.ts/0
{ "file_path": "langchainjs/langchain/src/prompts/base.ts", "repo_id": "langchainjs", "token_count": 92 }
925
""" Pyramid Vision Transformer v2 @misc{wang2021pvtv2, title={PVTv2: Improved Baselines with Pyramid Vision Transformer}, author={Wenhai Wang and Enze Xie and Xiang Li and Deng-Ping Fan and Kaitao Song and Ding Liang and Tong Lu and Ping Luo and Ling Shao}, year={2021}, eprint={2106.137...
pytorch-image-models/timm/models/pvt_v2.py/0
{ "file_path": "pytorch-image-models/timm/models/pvt_v2.py", "repo_id": "pytorch-image-models", "token_count": 9047 }
401
<jupyter_start><jupyter_text>GPT4-V Experiments with General, Specific questions and Chain Of Thought (COT) Prompting Technique. GPT-4V has amazed us with its ability to analyze images and even generate website code from visuals.This tutorial notebook investigates GPT-4V's proficiency in interpreting bar charts, scatte...
llama_index/docs/examples/multi_modal/gpt4v_experiments_cot.ipynb/0
{ "file_path": "llama_index/docs/examples/multi_modal/gpt4v_experiments_cot.ipynb", "repo_id": "llama_index", "token_count": 5951 }
1,073
from typing import Any, Dict, Tuple import numpy as np class MockFaissIndex: """Mock Faiss index.""" def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize params.""" self._index: Dict[int, np.ndarray] = {} @property def ntotal(self) -> int: """Get ntotal.""" ...
llama_index/llama-index-legacy/tests/indices/vector_store/mock_faiss.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/vector_store/mock_faiss.py", "repo_id": "llama_index", "token_count": 512 }
1,533
import { ChatOpenAI } from "@langchain/openai"; import type { ChatPromptTemplate } from "@langchain/core/prompts"; import { createOpenAIFunctionsAgent, AgentExecutor } from "langchain/agents"; import { pull } from "langchain/hub"; import { z } from "zod"; import { DynamicTool, DynamicStructuredTool } from "@langchain/...
langchainjs/examples/src/agents/custom_tool.ts/0
{ "file_path": "langchainjs/examples/src/agents/custom_tool.ts", "repo_id": "langchainjs", "token_count": 1734 }
779
root ::= "[" items "]" EOF items ::= item ("," ws* item)* item ::= string string ::= "\"" word (ws+ word)* "\"" ws* word ::= [a-zA-Z]+ ws ::= " " EOF ::= "\n"
langchain/libs/langchain/langchain/llms/grammars/list.gbnf/0
{ "file_path": "langchain/libs/langchain/langchain/llms/grammars/list.gbnf", "repo_id": "langchain", "token_count": 81 }
539
python_tests()
llama_index/llama-index-integrations/llms/llama-index-llms-langchain/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-langchain/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,224
#[macro_use] extern crate criterion; mod common; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::Path; use criterion::Criterion; use tokenizers::models::bpe::{BpeTrainerBuilder, BPE}; use tokenizers::models::TrainerWrapper; use tokenizers::pre_tokenizers::byte_level::ByteLevel; use tokenizers::p...
tokenizers/tokenizers/benches/bpe_benchmark.rs/0
{ "file_path": "tokenizers/tokenizers/benches/bpe_benchmark.rs", "repo_id": "tokenizers", "token_count": 1621 }
471
<jupyter_start><jupyter_text>Fake EmbeddingsLangChain also provides a fake embedding class. You can use this to test your pipelines.<jupyter_code>from langchain_community.embeddings import FakeEmbeddings embeddings = FakeEmbeddings(size=1352) query_result = embeddings.embed_query("foo") doc_results = embeddings.embed_d...
langchain/docs/docs/integrations/text_embedding/fake.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/text_embedding/fake.ipynb", "repo_id": "langchain", "token_count": 120 }
175
<jupyter_start><jupyter_text>Connery Action ToolUsing this tool, you can integrate individual Connery Action into your LangChain agent.If you want to use more than one Connery Action in your agent,check out the [Connery Toolkit](/docs/integrations/toolkits/connery) documentation. What is Connery?Connery is an open-sour...
langchain/docs/docs/integrations/tools/connery.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/connery.ipynb", "repo_id": "langchain", "token_count": 1193 }
172
"""Init file.""" from llama_index.core.data_structs.data_structs import ( IndexDict, IndexGraph, IndexList, KeywordTable, Node, ) from llama_index.core.data_structs.table import StructDatapoint __all__ = [ "IndexGraph", "KeywordTable", "IndexList", "IndexDict", "StructDatapoint...
llama_index/llama-index-core/llama_index/core/data_structs/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/data_structs/__init__.py", "repo_id": "llama_index", "token_count": 145 }
1,251
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
accelerate/tests/test_big_modeling.py/0
{ "file_path": "accelerate/tests/test_big_modeling.py", "repo_id": "accelerate", "token_count": 19558 }
17
# 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/examples/community/sd_text2img_k_diffusion.py/0
{ "file_path": "diffusers/examples/community/sd_text2img_k_diffusion.py", "repo_id": "diffusers", "token_count": 9724 }
207
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/core/src/exec/expression/BinaryRangeExpr.h/0
{ "file_path": "milvus/internal/core/src/exec/expression/BinaryRangeExpr.h", "repo_id": "milvus", "token_count": 4543 }
1,867
import requests from pytest import MonkeyPatch from langchain_community.llms.ollama import Ollama def mock_response_stream(): # type: ignore[no-untyped-def] mock_response = [b'{ "response": "Response chunk 1" }'] class MockRaw: def read(self, chunk_size): # type: ignore[no-untyped-def] ...
langchain/libs/community/tests/unit_tests/llms/test_ollama.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/llms/test_ollama.py", "repo_id": "langchain", "token_count": 2894 }
388
# 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/data/metrics/squad_metrics.py/0
{ "file_path": "transformers/src/transformers/data/metrics/squad_metrics.py", "repo_id": "transformers", "token_count": 13819 }
592
[package] name = "tantivy-binding" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] tantivy = "0.21.0" futures = "0.3.21" libc = "0.2" scopeguard = "1.2" [build-dependencies] cbindgen = "0.26.0" [lib] crate-type = ["st...
milvus/internal/core/thirdparty/tantivy/tantivy-binding/Cargo.toml/0
{ "file_path": "milvus/internal/core/thirdparty/tantivy/tantivy-binding/Cargo.toml", "repo_id": "milvus", "token_count": 147 }
1,761
{ "en-ru": { "src": [ "Welsh AMs worried about 'looking like muppets'", "There is consternation among some AMs at a suggestion their title should change to MWPs (Member of the Welsh Parliament).", "It has arisen because of plans to change the name of the assembly to the Welsh Parliament.", ...
transformers/examples/legacy/seq2seq/test_data/fsmt/fsmt_val_data.json/0
{ "file_path": "transformers/examples/legacy/seq2seq/test_data/fsmt/fsmt_val_data.json", "repo_id": "transformers", "token_count": 4034 }
583
from langchain_community.llms.petals import Petals __all__ = ["Petals"]
langchain/libs/langchain/langchain/llms/petals.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/petals.py", "repo_id": "langchain", "token_count": 25 }
542
// 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/binlog_writer.go/0
{ "file_path": "milvus/internal/storage/binlog_writer.go", "repo_id": "milvus", "token_count": 3207 }
1,926
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "chat_models/iflytek_xinghuo", }); export * from "@langchain/community/chat_models/iflytek_xinghuo";
langchainjs/langchain/src/chat_models/iflytek_xinghuo/index.ts/0
{ "file_path": "langchainjs/langchain/src/chat_models/iflytek_xinghuo/index.ts", "repo_id": "langchainjs", "token_count": 87 }
861
from llama_index.embeddings.ollama.base import OllamaEmbedding __all__ = ["OllamaEmbedding"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-ollama/llama_index/embeddings/ollama/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-ollama/llama_index/embeddings/ollama/__init__.py", "repo_id": "llama_index", "token_count": 36 }
1,236
/* eslint-disable import/first */ /* eslint-disable arrow-body-style */ import { z } from "zod"; import { DynamicStructuredTool } from "@langchain/core/tools"; const addTool = new DynamicStructuredTool({ name: "add", description: "Add two integers together.", schema: z.object({ firstInt: z.number(), sec...
langchainjs/examples/src/use_cases/tool_use/agents.ts/0
{ "file_path": "langchainjs/examples/src/use_cases/tool_use/agents.ts", "repo_id": "langchainjs", "token_count": 661 }
847
from pathlib import Path import pytest from langchain_community.document_loaders import CSVLoader, DirectoryLoader, TextLoader from langchain_community.document_loaders.helpers import detect_file_encodings @pytest.mark.requires("chardet") def test_loader_detect_encoding_text() -> None: """Test text loader.""" ...
langchain/libs/community/tests/unit_tests/document_loaders/test_detect_encoding.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_detect_encoding.py", "repo_id": "langchain", "token_count": 1025 }
371
from typing import Callable, Dict, Iterator, List, Optional from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.utilities.tensorflow_datasets import TensorflowDatasets class TensorflowDatasetLoader(BaseLoader): """Load from `Ten...
langchain/libs/community/langchain_community/document_loaders/tensorflow_datasets.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/tensorflow_datasets.py", "repo_id": "langchain", "token_count": 1359 }
263
from llama_index.core.readers.base import BaseReader from llama_index.readers.rayyan import RayyanReader def test_class(): names_of_base_classes = [b.__name__ for b in RayyanReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-rayyan/tests/test_readers_rayyan.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-rayyan/tests/test_readers_rayyan.py", "repo_id": "llama_index", "token_count": 88 }
1,410
from llama_index.packs.amazon_product_extraction.base import ( AmazonProductExtractionPack, ) __all__ = ["AmazonProductExtractionPack"]
llama_index/llama-index-packs/llama-index-packs-amazon-product-extraction/llama_index/packs/amazon_product_extraction/__init__.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-amazon-product-extraction/llama_index/packs/amazon_product_extraction/__init__.py", "repo_id": "llama_index", "token_count": 44 }
1,831
<jupyter_start><jupyter_text>If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets. Uncomment the following cell and run it.<jupyter_code>#! pip install datasets transformers<jupyter_output><empty_output><jupyter_text>If you're opening this notebook locally, make su...
notebooks/examples/text_classification.ipynb/0
{ "file_path": "notebooks/examples/text_classification.ipynb", "repo_id": "notebooks", "token_count": 7676 }
311
# 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/poolformer/test_modeling_poolformer.py/0
{ "file_path": "transformers/tests/models/poolformer/test_modeling_poolformer.py", "repo_id": "transformers", "token_count": 3675 }
832
from abc import ABC, abstractmethod from typing import Dict, List, Optional, Tuple import fsspec DEFAULT_COLLECTION = "data" DEFAULT_BATCH_SIZE = 1 class BaseKVStore(ABC): """Base key-value store.""" @abstractmethod def put(self, key: str, val: dict, collection: str = DEFAULT_COLLECTION) -> None: ...
llama_index/llama-index-core/llama_index/core/storage/kvstore/types.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/storage/kvstore/types.py", "repo_id": "llama_index", "token_count": 1071 }
1,210
import { Embeddings, EmbeddingsParams } from "@langchain/core/embeddings"; import { OllamaInput, OllamaRequestParams } from "../utils/ollama.js"; type CamelCasedRequestOptions = Omit< OllamaInput, "baseUrl" | "model" | "format" >; /** * Interface for OllamaEmbeddings parameters. Extends EmbeddingsParams and * d...
langchainjs/libs/langchain-community/src/embeddings/ollama.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/embeddings/ollama.ts", "repo_id": "langchainjs", "token_count": 1727 }
981
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/api/schedulers/multistep_dpm_solver_inverse.md/0
{ "file_path": "diffusers/docs/source/en/api/schedulers/multistep_dpm_solver_inverse.md", "repo_id": "diffusers", "token_count": 547 }
188
"use node"; import { ConvexVectorStore } from "@langchain/community/vectorstores/convex"; import { OpenAIEmbeddings } from "@langchain/openai"; import { action } from "./_generated/server.js"; export const ingest = action({ args: {}, handler: async (ctx) => { await ConvexVectorStore.fromTexts( ["Hello w...
langchainjs/examples/src/indexes/vector_stores/convex/fromTexts.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/convex/fromTexts.ts", "repo_id": "langchainjs", "token_count": 179 }
815
"""Tool for the Google Trends""" from typing import Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.tools import BaseTool from langchain_community.utilities.google_jobs import GoogleJobsAPIWrapper class GoogleJobsQueryRun(BaseTool): """Tool that queries the Google Jo...
langchain/libs/community/langchain_community/tools/google_jobs/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/google_jobs/tool.py", "repo_id": "langchain", "token_count": 293 }
292
import datetime from pathlib import Path from unittest import TestCase import numpy as np import pandas as pd import pyarrow as pa import pytest from datasets import Audio, Features, Image, IterableDataset from datasets.formatting import NumpyFormatter, PandasFormatter, PythonFormatter, query_table from datasets.form...
datasets/tests/test_formatting.py/0
{ "file_path": "datasets/tests/test_formatting.py", "repo_id": "datasets", "token_count": 19116 }
148
import torch import torch.distributed from opentelemetry import trace from transformers import AutoConfig, AutoTokenizer from transformers.models.llama import LlamaTokenizer from typing import Optional from text_generation_server.models import FlashCausalLM from text_generation_server.models.custom_modeling.flash_lla...
text-generation-inference/server/text_generation_server/models/flash_llama.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/flash_llama.py", "repo_id": "text-generation-inference", "token_count": 1942 }
416
from llama_index.readers.awadb.base import AwadbReader __all__ = ["AwadbReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-awadb/llama_index/readers/awadb/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-awadb/llama_index/readers/awadb/__init__.py", "repo_id": "llama_index", "token_count": 32 }
1,408
from typing import Dict import numpy as np from ..utils import add_end_docstrings, is_tf_available, is_torch_available, logging from .base import GenericTensor, Pipeline, PipelineException, build_pipeline_init_args if is_tf_available(): import tensorflow as tf from ..tf_utils import stable_softmax if is_...
transformers/src/transformers/pipelines/fill_mask.py/0
{ "file_path": "transformers/src/transformers/pipelines/fill_mask.py", "repo_id": "transformers", "token_count": 4992 }
682
import { Document } from "@langchain/core/documents"; import { BaseStore } from "@langchain/core/stores"; /** * Class that provides a layer of abstraction over the base storage, * allowing for the encoding and decoding of keys and values. It extends * the BaseStore class. */ // eslint-disable-next-line @typescript...
langchainjs/langchain/src/storage/encoder_backed.ts/0
{ "file_path": "langchainjs/langchain/src/storage/encoder_backed.ts", "repo_id": "langchainjs", "token_count": 1108 }
910
[tool.poetry] name = "basic_critique_revise" version = "0.0.1" description = "Iteratively generate schema candidates and revise based on errors" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" openai = "<2" [tool.poetry.group.dev.dependencies] langchain-cli = ">...
langchain/templates/basic-critique-revise/pyproject.toml/0
{ "file_path": "langchain/templates/basic-critique-revise/pyproject.toml", "repo_id": "langchain", "token_count": 278 }
636
from langchain.schema.output_parser import __all__ EXPECTED_ALL = [ "BaseCumulativeTransformOutputParser", "BaseGenerationOutputParser", "BaseLLMOutputParser", "BaseOutputParser", "BaseTransformOutputParser", "NoOpOutputParser", "OutputParserException", "StrOutputParser", "T", ] d...
langchain/libs/langchain/tests/unit_tests/schema/test_output_parser.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/schema/test_output_parser.py", "repo_id": "langchain", "token_count": 148 }
617
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..utils import DummyObject, requires_backends class FlaxControlNetModel(metaclass=DummyObject): _backends = ["flax"] def __init__(self, *args, **kwargs): requires_backends(self, ["flax"]) @classmethod def from_c...
diffusers/src/diffusers/utils/dummy_flax_objects.py/0
{ "file_path": "diffusers/src/diffusers/utils/dummy_flax_objects.py", "repo_id": "diffusers", "token_count": 2343 }
243
from langchain_community.vectorstores.milvus import Milvus __all__ = ["Milvus"]
langchain/libs/langchain/langchain/vectorstores/milvus.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/milvus.py", "repo_id": "langchain", "token_count": 28 }
606
Welcome to LlamaIndex 🦙 ! ########################## LlamaIndex is a data framework for `LLM <https://en.wikipedia.org/wiki/Large_language_model>`_-based applications which benefit from context augmentation. Such LLM systems have been termed as RAG systems, standing for "Retrieval-Augemented Generation". LlamaIndex p...
llama_index/docs/index.rst/0
{ "file_path": "llama_index/docs/index.rst", "repo_id": "llama_index", "token_count": 2237 }
1,173
# coding=utf-8 # Copyright 2021 HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
transformers/tests/models/vision_encoder_decoder/test_modeling_flax_vision_encoder_decoder.py/0
{ "file_path": "transformers/tests/models/vision_encoder_decoder/test_modeling_flax_vision_encoder_decoder.py", "repo_id": "transformers", "token_count": 9435 }
755
import { XataVectorSearch } from "@langchain/community/vectorstores/xata"; import { OpenAIEmbeddings, OpenAI } from "@langchain/openai"; import { BaseClient } from "@xata.io/client"; import { VectorDBQAChain } from "langchain/chains"; import { Document } from "@langchain/core/documents"; // First, follow set-up instru...
langchainjs/examples/src/indexes/vector_stores/xata.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/xata.ts", "repo_id": "langchainjs", "token_count": 659 }
811
# 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/models/attention_flax.py/0
{ "file_path": "diffusers/src/diffusers/models/attention_flax.py", "repo_id": "diffusers", "token_count": 9031 }
233
"""Load summarizing chains.""" from typing import Any, Mapping, Optional, Protocol from langchain_core.callbacks import Callbacks from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts import BasePromptTemplate from langchain.chains.combine_documents.base import BaseCombineDocumentsC...
langchain/libs/langchain/langchain/chains/summarize/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/summarize/__init__.py", "repo_id": "langchain", "token_count": 2349 }
470
# flake8: noqa REQUEST_TEMPLATE = """You are a helpful AI Assistant. Please provide JSON arguments to agentFunc() based on the user's instructions. API_SCHEMA: ```typescript {schema} ``` USER_INSTRUCTIONS: "{instructions}" Your arguments must be plain json provided in a markdown block: ARGS: ```json {{valid json co...
langchain/libs/langchain/langchain/chains/api/openapi/prompts.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/api/openapi/prompts.py", "repo_id": "langchain", "token_count": 497 }
476
# Adversarial Inception v3 **Inception v3** is a convolutional neural network architecture from the Inception family that makes several improvements including using [Label Smoothing](https://paperswithcode.com/method/label-smoothing), Factorized 7 x 7 convolutions, and the use of an [auxiliary classifer](https://paper...
pytorch-image-models/docs/models/.templates/models/adversarial-inception-v3.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/adversarial-inception-v3.md", "repo_id": "pytorch-image-models", "token_count": 1432 }
314
python_sources()
llama_index/llama-index-integrations/output_parsers/llama-index-output-parsers-guardrails/llama_index/output_parsers/guardrails/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/output_parsers/llama-index-output-parsers-guardrails/llama_index/output_parsers/guardrails/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,385
<!--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/deit.md/0
{ "file_path": "transformers/docs/source/en/model_doc/deit.md", "repo_id": "transformers", "token_count": 1955 }
481
"""Run tests for all models Tests that run on CI should have a specific marker, e.g. @pytest.mark.base. This marker is used to parallelize the CI runs, with one runner for each marker. If new tests are added, ensure that they use one of the existing markers (documented in pyproject.toml > pytest > markers) or that a ...
pytorch-image-models/tests/test_models.py/0
{ "file_path": "pytorch-image-models/tests/test_models.py", "repo_id": "pytorch-image-models", "token_count": 9191 }
346
from contextlib import contextmanager from typing import TYPE_CHECKING, Callable, Iterator from llama_index.legacy.llms.huggingface import HuggingFaceLLM from llama_index.legacy.llms.llama_cpp import LlamaCPP from llama_index.legacy.llms.llm import LLM if TYPE_CHECKING: from lmformatenforcer import CharacterLevel...
llama_index/llama-index-legacy/llama_index/legacy/prompts/lmformatenforcer_utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/prompts/lmformatenforcer_utils.py", "repo_id": "llama_index", "token_count": 850 }
1,602
# LlamaIndex Multi-Modal-Llms Integration: Gemini
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-gemini/README.md/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-gemini/README.md", "repo_id": "llama_index", "token_count": 16 }
1,323
[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 = ["BagelVectorStore"] contains_example = false import_path = "llama_index.vector_stores.bage...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/pyproject.toml", "repo_id": "llama_index", "token_count": 638 }
1,511
<!--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/en/model_doc/blip.md/0
{ "file_path": "transformers/docs/source/en/model_doc/blip.md", "repo_id": "transformers", "token_count": 1242 }
503
"""Simple graph store index.""" import logging from typing import Any, Dict, List, Optional import redis from llama_index.core.graph_stores.types import GraphStore logger = logging.getLogger(__name__) class FalkorDBGraphStore(GraphStore): """FalkorDB Graph Store. In this graph store, triplets are stored w...
llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-falkordb/llama_index/graph_stores/falkordb/base.py/0
{ "file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-falkordb/llama_index/graph_stores/falkordb/base.py", "repo_id": "llama_index", "token_count": 2847 }
1,291
python_sources()
llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-postgres/llama_index/storage/index_store/postgres/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-postgres/llama_index/storage/index_store/postgres/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,464
from llama_index.storage.kvstore.mongodb.base import MongoDBKVStore __all__ = ["MongoDBKVStore"]
llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-mongodb/llama_index/storage/kvstore/mongodb/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-mongodb/llama_index/storage/kvstore/mongodb/__init__.py", "repo_id": "llama_index", "token_count": 38 }
1,469
# What is Reinforcement Learning? [[what-is-reinforcement-learning]] To understand Reinforcement Learning, let’s start with the big picture. ## The big picture [[the-big-picture]] The idea behind Reinforcement Learning is that an agent (an AI) will learn from the environment by **interacting with it** (through trial...
deep-rl-class/units/en/unit1/what-is-rl.mdx/0
{ "file_path": "deep-rl-class/units/en/unit1/what-is-rl.mdx", "repo_id": "deep-rl-class", "token_count": 624 }
151
from langchain_astradb.vectorstores.astradb import AstraDBVectorStore __all__ = [ "AstraDBVectorStore", ]
langchain/libs/partners/astradb/langchain_astradb/vectorstores/__init__.py/0
{ "file_path": "langchain/libs/partners/astradb/langchain_astradb/vectorstores/__init__.py", "repo_id": "langchain", "token_count": 41 }
681
# coding=utf-8 # Copyright 2018 The Microsoft Research Asia LayoutLM Team Authors, The Hugging Face 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/license...
transformers/tests/models/layoutlm/test_tokenization_layoutlm.py/0
{ "file_path": "transformers/tests/models/layoutlm/test_tokenization_layoutlm.py", "repo_id": "transformers", "token_count": 1057 }
807
import { Neo4jGraph } from "@langchain/community/graphs/neo4j_graph"; import { OpenAI } from "@langchain/openai"; import { GraphCypherQAChain } from "langchain/chains/graph_qa/cypher"; import { PromptTemplate } from "@langchain/core/prompts"; /** * This example uses Neo4j database, which is native graph database. * ...
langchainjs/examples/src/chains/graph_db_custom_prompt.ts/0
{ "file_path": "langchainjs/examples/src/chains/graph_db_custom_prompt.ts", "repo_id": "langchainjs", "token_count": 634 }
760
# # Ensemble Adversarial Inception ResNet v2 **Inception-ResNet-v2** is a convolutional neural architecture that builds on the Inception family of architectures but incorporates [residual connections](https://paperswithcode.com/method/residual-connection) (replacing the filter concatenation stage of the Inception arch...
pytorch-image-models/docs/models/.templates/models/ensemble-adversarial.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/ensemble-adversarial.md", "repo_id": "pytorch-image-models", "token_count": 1379 }
346
from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple import torch from .configuration_utils import PretrainedConfig @dataclass class Cache: """ Base, abstract class for all caches. The actual data structure is specific to each subclass. """ def update( self,...
transformers/src/transformers/cache_utils.py/0
{ "file_path": "transformers/src/transformers/cache_utils.py", "repo_id": "transformers", "token_count": 8237 }
616
# 🦜️🔗 LangChain.js ⚡ Building applications with LLMs through composability ⚡ [![CI](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml/badge.svg)](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml) ![npm](https://img.shields.io/npm/dw/langchain) [![License: MIT](https://img.shie...
langchainjs/langchain/README.md/0
{ "file_path": "langchainjs/langchain/README.md", "repo_id": "langchainjs", "token_count": 2118 }
911
from typing import List, Optional from langchain_core.outputs.chat_generation import ChatGeneration from langchain_core.pydantic_v1 import BaseModel class ChatResult(BaseModel): """Class that contains all results for a single chat model call.""" generations: List[ChatGeneration] """List of the chat gene...
langchain/libs/core/langchain_core/outputs/chat_result.py/0
{ "file_path": "langchain/libs/core/langchain_core/outputs/chat_result.py", "repo_id": "langchain", "token_count": 147 }
426
import logging from typing import Any, Dict, List, Optional, Sequence from llama_index.core.bridge.pydantic import Field from llama_index.core.llms import LLM, ChatMessage, ChatResponse, OpenAI from llama_index.core.postprocessor.types import BaseNodePostprocessor from llama_index.core.prompts import BasePromptTemplat...
llama_index/llama-index-core/llama_index/core/postprocessor/rankGPT_rerank.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/postprocessor/rankGPT_rerank.py", "repo_id": "llama_index", "token_count": 2668 }
1,205
"""Util that sends calendar events in Office 365. Free, but setup is required. See link below. https://learn.microsoft.com/en-us/graph/auth/ """ from datetime import datetime as dt from typing import List, Optional, Type from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.pydantic_v1 i...
langchain/libs/community/langchain_community/tools/office365/send_event.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/office365/send_event.py", "repo_id": "langchain", "token_count": 1126 }
303
# LlamaIndex Graph Stores Integration: Falkordb
llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-falkordb/README.md/0
{ "file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-falkordb/README.md", "repo_id": "llama_index", "token_count": 12 }
1,204
--- sidebar_position: 4 sidebar_class_name: hidden --- # Agents The core idea of agents is to use a language model to choose a sequence of actions to take. In chains, a sequence of actions is hardcoded (in code). In agents, a language model is used as a reasoning engine to determine which actions to take and in which...
langchainjs/docs/core_docs/docs/modules/agents/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/agents/index.mdx", "repo_id": "langchainjs", "token_count": 506 }
724
import * as uuid from "uuid"; import flatten from "flat"; import { GoogleAuth, GoogleAuthOptions } from "google-auth-library"; import { VectorStore } from "@langchain/core/vectorstores"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { Document, DocumentInput } from "@langchain/core/docum...
langchainjs/libs/langchain-community/src/vectorstores/googlevertexai.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/googlevertexai.ts", "repo_id": "langchainjs", "token_count": 7524 }
966
import { z } from "zod"; import { OpenAI, ChatOpenAI } from "@langchain/openai"; import { StructuredOutputParser } from "langchain/output_parsers"; import { PromptTemplate } from "@langchain/core/prompts"; const prompt = PromptTemplate.fromTemplate( `Return a JSON object containing the following value wrapped in an ...
langchainjs/examples/src/guides/fallbacks/better_model.ts/0
{ "file_path": "langchainjs/examples/src/guides/fallbacks/better_model.ts", "repo_id": "langchainjs", "token_count": 619 }
810
# 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/models/unets/unet_2d_blocks_flax.py/0
{ "file_path": "diffusers/src/diffusers/models/unets/unet_2d_blocks_flax.py", "repo_id": "diffusers", "token_count": 6961 }
247
"""Logic for selecting examples to include in prompts.""" from langchain_core.example_selectors.length_based import ( LengthBasedExampleSelector, ) from langchain_core.example_selectors.semantic_similarity import ( MaxMarginalRelevanceExampleSelector, SemanticSimilarityExampleSelector, ) from langchain.pro...
langchain/libs/langchain/langchain/prompts/example_selector/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/prompts/example_selector/__init__.py", "repo_id": "langchain", "token_count": 184 }
576
<jupyter_start><jupyter_text>Connect to RAG AppAssuming you are already running this server:```bashlangserve start```<jupyter_code>from langserve.client import RemoteRunnable rag_redis = RemoteRunnable("http://localhost:8000/rag-redis") print(rag_redis.invoke("What was Nike's revenue in 2023?")) print(rag_redis.invok...
langchain/templates/rag-redis/rag_redis.ipynb/0
{ "file_path": "langchain/templates/rag-redis/rag_redis.ipynb", "repo_id": "langchain", "token_count": 179 }
726
# 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/pop2piano/feature_extraction_pop2piano.py/0
{ "file_path": "transformers/src/transformers/models/pop2piano/feature_extraction_pop2piano.py", "repo_id": "transformers", "token_count": 8827 }
709