text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from llama_index.core.readers.base import BaseReader from llama_index.readers.bilibili import BilibiliTranscriptReader def test_class(): names_of_base_classes = [b.__name__ for b in BilibiliTranscriptReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-bilibili/tests/test_readers_bilibili.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-bilibili/tests/test_readers_bilibili.py", "repo_id": "llama_index", "token_count": 95 }
1,298
from llama_index.llms.clarifai.base import Clarifai __all__ = ["Clarifai"]
llama_index/llama-index-integrations/llms/llama-index-llms-clarifai/llama_index/llms/clarifai/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-clarifai/llama_index/llms/clarifai/__init__.py", "repo_id": "llama_index", "token_count": 31 }
1,217
import torch from diffusers import UnCLIPScheduler from .test_schedulers import SchedulerCommonTest # UnCLIPScheduler is a modified DDPMScheduler with a subset of the configuration. class UnCLIPSchedulerTest(SchedulerCommonTest): scheduler_classes = (UnCLIPScheduler,) def get_scheduler_config(self, **kwarg...
diffusers/tests/schedulers/test_scheduler_unclip.py/0
{ "file_path": "diffusers/tests/schedulers/test_scheduler_unclip.py", "repo_id": "diffusers", "token_count": 2227 }
276
# Conversation Summary Now let's take a look at using a slightly more complex type of memory - `ConversationSummaryMemory`. This type of memory creates a summary of the conversation over time. This can be useful for condensing information from the conversation over time. Conversation summary memory summarizes the conve...
langchain/docs/docs/modules/memory/types/summary.mdx/0
{ "file_path": "langchain/docs/docs/modules/memory/types/summary.mdx", "repo_id": "langchain", "token_count": 1750 }
204
# Copyright 2023 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 required by appl...
transformers/src/transformers/models/vipllava/convert_vipllava_weights_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/vipllava/convert_vipllava_weights_to_hf.py", "repo_id": "transformers", "token_count": 1889 }
682
from typing import Any, List from ai21.models import EmbedType from langchain_core.embeddings import Embeddings from langchain_ai21.ai21_base import AI21Base class AI21Embeddings(Embeddings, AI21Base): """AI21 Embeddings embedding model. To use, you should have the 'AI21_API_KEY' environment variable set ...
langchain/libs/partners/ai21/langchain_ai21/embeddings.py/0
{ "file_path": "langchain/libs/partners/ai21/langchain_ai21/embeddings.py", "repo_id": "langchain", "token_count": 513 }
646
"""Voyage embeddings file.""" from typing import Any, List, Optional from llama_index.legacy.bridge.pydantic import PrivateAttr from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.embeddings.base import BaseEmbedding DEFAULT_VOYAGE_BATCH_SIZE = 8 class VoyageEmbedding(BaseEmbeddin...
llama_index/llama-index-legacy/llama_index/legacy/embeddings/voyageai.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/embeddings/voyageai.py", "repo_id": "llama_index", "token_count": 1524 }
1,561
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
accelerate/docs/source/usage_guides/explore.md/0
{ "file_path": "accelerate/docs/source/usage_guides/explore.md", "repo_id": "accelerate", "token_count": 581 }
5
[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 = ["YoutubeTranscriptReader"] contains_example = false import_path = "llama_index.readers.you...
llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/pyproject.toml", "repo_id": "llama_index", "token_count": 681 }
1,462
from typing import Union import torch from PIL import Image from torchvision import transforms as tfms from tqdm.auto import tqdm from transformers import CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMScheduler, DiffusionPipeline, LMSDiscreteScheduler, PNDMScheduler, ...
diffusers/examples/community/magic_mix.py/0
{ "file_path": "diffusers/examples/community/magic_mix.py", "repo_id": "diffusers", "token_count": 2446 }
204
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,472
# 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/clap/processing_clap.py/0
{ "file_path": "transformers/src/transformers/models/clap/processing_clap.py", "repo_id": "transformers", "token_count": 2177 }
657
--- sidebar_position: 1 --- # Concepts 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 order. There are sever...
langchain/docs/docs/modules/agents/concepts.mdx/0
{ "file_path": "langchain/docs/docs/modules/agents/concepts.mdx", "repo_id": "langchain", "token_count": 1201 }
195
from llama_index.core.llama_pack import BaseLlamaPack from llama_index.packs.agents_llm_compiler import LLMCompilerAgentPack def test_class(): names_of_base_classes = [b.__name__ for b in LLMCompilerAgentPack.__mro__] assert BaseLlamaPack.__name__ in names_of_base_classes
llama_index/llama-index-packs/llama-index-packs-agents-llm-compiler/tests/test_packs_agents.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-agents-llm-compiler/tests/test_packs_agents.py", "repo_id": "llama_index", "token_count": 104 }
1,830
class GoogleGenerativeAIError(Exception): """ Custom exception class for errors associated with the `Google GenAI` API. """
langchain/libs/partners/google-genai/langchain_google_genai/_common.py/0
{ "file_path": "langchain/libs/partners/google-genai/langchain_google_genai/_common.py", "repo_id": "langchain", "token_count": 39 }
664
# 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/idefics/image_processing_idefics.py/0
{ "file_path": "transformers/src/transformers/models/idefics/image_processing_idefics.py", "repo_id": "transformers", "token_count": 3022 }
617
ann_accuracy: collections: - server: cache_config.cpu_cache_capacity: 16GB engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: true gpu_resource_config.cache_capacity: 4GB gpu_resource_config.search_resource...
milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_accuracy_ann_debug.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_accuracy_ann_debug.yaml", "repo_id": "milvus", "token_count": 368 }
2,144
from typing import Dict, Tuple, Union from langchain.chains.query_constructor.ir import ( Comparator, Comparison, Operation, Operator, StructuredQuery, Visitor, ) class ChromaTranslator(Visitor): """Translate `Chroma` internal query language elements to valid filters.""" allowed_oper...
langchain/libs/langchain/langchain/retrievers/self_query/chroma.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/self_query/chroma.py", "repo_id": "langchain", "token_count": 603 }
542
import pytest import logging import hypothesis.strategies as st import chromadb.test.property.strategies as strategies from chromadb.api import ClientAPI import chromadb.api.types as types from hypothesis.stateful import ( Bundle, RuleBasedStateMachine, rule, initialize, multiple, consumes, ...
chroma/chromadb/test/property/test_collections.py/0
{ "file_path": "chroma/chromadb/test/property/test_collections.py", "repo_id": "chroma", "token_count": 3741 }
27
apiVersion: v1 kind: Pod metadata: labels: app: milvus-e2e task: milvus-e2e-build namespace: milvus-ci spec: enableServiceLinks: false containers: - name: main image: milvusdb/krte:20211213-dcc15e9 env: - name: DOCKER_IN_DOCKER_ENABLED value: "true" - name: DOCKER_VOLUME_DIRECTOR...
milvus/ci/jenkins/pod/rte-build.yaml/0
{ "file_path": "milvus/ci/jenkins/pod/rte-build.yaml", "repo_id": "milvus", "token_count": 764 }
1,891
# coding=utf-8 # Copyright 2020, The RAG Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/src/transformers/models/rag/modeling_tf_rag.py/0
{ "file_path": "transformers/src/transformers/models/rag/modeling_tf_rag.py", "repo_id": "transformers", "token_count": 38065 }
685
# coding=utf-8 # Copyright 2022 Apple Inc. and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
transformers/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py/0
{ "file_path": "transformers/src/transformers/models/mobilenet_v1/modeling_mobilenet_v1.py", "repo_id": "transformers", "token_count": 8136 }
715
"""Combining documents by mapping a chain over them first, then combining results.""" from __future__ import annotations from typing import Any, Dict, List, Optional, Tuple, Type from langchain_core.callbacks import Callbacks from langchain_core.documents import Document from langchain_core.pydantic_v1 import BaseMo...
langchain/libs/langchain/langchain/chains/combine_documents/map_reduce.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/combine_documents/map_reduce.py", "repo_id": "langchain", "token_count": 5121 }
455
import os from langchain.utilities.redis import get_client from redis.client import Redis as RedisType CLIENT: RedisType | None = None def get_redis_client() -> RedisType: """Get a Redis client.""" global CLIENT if CLIENT is not None: return CLIENT url = os.environ.get("REDIS_URL") if ...
opengpts/backend/app/redis.py/0
{ "file_path": "opengpts/backend/app/redis.py", "repo_id": "opengpts", "token_count": 167 }
1,914
from __future__ import annotations import logging from typing import Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_community.tools.edenai.edenai_base_tool import EdenaiTool logger = logging.getLogger(__name__) class EdenAiObjectDetectionTool(EdenaiTool): """Tool that q...
langchain/libs/community/langchain_community/tools/edenai/image_objectdetection.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/edenai/image_objectdetection.py", "repo_id": "langchain", "token_count": 1049 }
305
#! /bin/bash REPOSITORY_ID="langchain" GRAPHDB_URI="http://localhost:7200/" echo -e "\nUsing GraphDB: ${GRAPHDB_URI}" function startGraphDB { echo -e "\nStarting GraphDB..." exec /opt/graphdb/dist/bin/graphdb } function waitGraphDBStart { echo -e "\nWaiting GraphDB to start..." for _ in $(seq 1 5); do CHEC...
langchain/docker/graphdb/graphdb_create.sh/0
{ "file_path": "langchain/docker/graphdb/graphdb_create.sh", "repo_id": "langchain", "token_count": 256 }
78
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/model_doc/bertweet.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/bertweet.md", "repo_id": "transformers", "token_count": 1155 }
545
<jupyter_start><jupyter_text>Dreambooth with OFTThis Notebook assumes that you already ran the train_dreambooth.py script to create your own adapter.<jupyter_code>from diffusers import DiffusionPipeline from diffusers.utils import check_min_version, get_logger from peft import PeftModel # Will error if the minimal ver...
peft/examples/oft_dreambooth/oft_dreambooth_inference.ipynb/0
{ "file_path": "peft/examples/oft_dreambooth/oft_dreambooth_inference.ipynb", "repo_id": "peft", "token_count": 376 }
343
# Student Works Since the launch of the Deep Reinforcement Learning Course, **many students have created amazing projects that you should check out and consider participating in**. If you've created an interesting project, don't hesitate to [add it to this list by opening a pull request on the GitHub repository](http...
deep-rl-class/units/en/unitbonus3/student-works.mdx/0
{ "file_path": "deep-rl-class/units/en/unitbonus3/student-works.mdx", "repo_id": "deep-rl-class", "token_count": 629 }
167
"""Test the FileSearch tool.""" from pathlib import Path from tempfile import TemporaryDirectory from langchain_community.tools.file_management.file_search import FileSearchTool from langchain_community.tools.file_management.utils import ( INVALID_PATH_TEMPLATE, ) def test_file_search_with_root_dir() -> None: ...
langchain/libs/community/tests/unit_tests/tools/file_management/test_file_search.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/tools/file_management/test_file_search.py", "repo_id": "langchain", "token_count": 669 }
391
"use client"; import React, { useEffect } from "react"; import { useLayoutEffect, useRef, useState } from "react"; export function LangServePlayground(props: { baseUrl: string; value: Record<string, unknown>; onChange: (value: Record<string, unknown>) => void; }) { const [open, setOpen] = useState(false); c...
langserve/libs/langserve-playground/src/index.tsx/0
{ "file_path": "langserve/libs/langserve-playground/src/index.tsx", "repo_id": "langserve", "token_count": 1350 }
1,068
import json from langchain.schema.messages import FunctionMessage from langchain.tools import BaseTool from langchain_core.language_models.base import LanguageModelLike from langchain_core.messages import SystemMessage from langgraph.checkpoint import BaseCheckpointSaver from langgraph.graph import END from langgraph....
opengpts/backend/app/agent_types/google_agent.py/0
{ "file_path": "opengpts/backend/app/agent_types/google_agent.py", "repo_id": "opengpts", "token_count": 1579 }
2,135
// 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/kv/etcd/metakv_factory.go/0
{ "file_path": "milvus/internal/kv/etcd/metakv_factory.go", "repo_id": "milvus", "token_count": 1070 }
1,938
# Copyright 2024 Salesforce.com, inc. # 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/LICENS...
diffusers/src/diffusers/pipelines/controlnet/pipeline_controlnet_blip_diffusion.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/controlnet/pipeline_controlnet_blip_diffusion.py", "repo_id": "diffusers", "token_count": 7632 }
252
# coding=utf-8 # Copyright 2024 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/examples/dreambooth/test_dreambooth.py/0
{ "file_path": "diffusers/examples/dreambooth/test_dreambooth.py", "repo_id": "diffusers", "token_count": 4466 }
206
<jupyter_start><jupyter_text>Simulated Environment: GymnasiumFor many applications of LLM agents, the environment is real (internet, database, REPL, etc). However, we can also define agents to interact in simulated environments like text-based games. This is an example of how to create a simple agent-environment intera...
langchain/cookbook/gymnasium_agent_simulation.ipynb/0
{ "file_path": "langchain/cookbook/gymnasium_agent_simulation.ipynb", "repo_id": "langchain", "token_count": 1600 }
77
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/internal/tokenization_utils.md/0
{ "file_path": "transformers/docs/source/en/internal/tokenization_utils.md", "repo_id": "transformers", "token_count": 428 }
481
from pirate_speak_configurable.chain import chain __all__ = ["chain"]
langchain/templates/pirate-speak-configurable/pirate_speak_configurable/__init__.py/0
{ "file_path": "langchain/templates/pirate-speak-configurable/pirate_speak_configurable/__init__.py", "repo_id": "langchain", "token_count": 21 }
706
# LlamaIndex Readers Integration: Psychic
llama_index/llama-index-integrations/readers/llama-index-readers-psychic/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-psychic/README.md", "repo_id": "llama_index", "token_count": 9 }
1,368
metrics: serviceMonitor: enabled: true cluster: enabled: false etcd: enabled: false minio: enabled: false tls: enabled: false pulsar: enabled: false extraConfigFiles: user.yaml: |+ etcd: use: embed: true data: dir: /var/lib/milvus/etcd common: storageType...
milvus/tests/scripts/values/ci/nightly-one-pod.yaml/0
{ "file_path": "milvus/tests/scripts/values/ci/nightly-one-pod.yaml", "repo_id": "milvus", "token_count": 150 }
1,988
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/util/proxyutil/proxy_client_manager_test.go/0
{ "file_path": "milvus/internal/util/proxyutil/proxy_client_manager_test.go", "repo_id": "milvus", "token_count": 5591 }
1,809
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querycoordv2/utils/types.go/0
{ "file_path": "milvus/internal/querycoordv2/utils/types.go", "repo_id": "milvus", "token_count": 1951 }
1,902
{ "name": "api_refs", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev -p 3001", "typedoc:build": "npx typedoc --options typedoc.json", "build:scripts": "node ./scripts/create-entrypoints.js && yarn typedoc:build && node ./scripts/update-typedoc-css.js", "build": "yarn clean &&...
langchainjs/docs/api_refs/package.json/0
{ "file_path": "langchainjs/docs/api_refs/package.json", "repo_id": "langchainjs", "token_count": 515 }
691
## go_client
milvus/tests/go_client/README.md/0
{ "file_path": "milvus/tests/go_client/README.md", "repo_id": "milvus", "token_count": 4 }
1,947
import { OpenAI } from "@langchain/openai"; import { EntityMemory, ENTITY_MEMORY_CONVERSATION_TEMPLATE, } from "langchain/memory"; import { LLMChain } from "langchain/chains"; const memory = new EntityMemory({ llm: new OpenAI({ temperature: 0 }), }); const model = new OpenAI({ temperature: 0.9 }); const chain = ...
langchainjs/examples/src/memory/entity_memory_inspection.ts/0
{ "file_path": "langchainjs/examples/src/memory/entity_memory_inspection.ts", "repo_id": "langchainjs", "token_count": 442 }
794
# Log10 This page covers how to use the [Log10](https://log10.io) within LangChain. ## What is Log10? Log10 is an [open-source](https://github.com/log10-io/log10) proxiless LLM data management and application development platform that lets you log, debug and tag your Langchain calls. ## Quick start 1. Create your ...
langchain/docs/docs/integrations/providers/log10.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/log10.mdx", "repo_id": "langchain", "token_count": 1154 }
141
# coding=utf-8 # Copyright 2023 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/align/configuration_align.py/0
{ "file_path": "transformers/src/transformers/models/align/configuration_align.py", "repo_id": "transformers", "token_count": 6879 }
601
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/pt/converting_tensorflow_models.md/0
{ "file_path": "transformers/docs/source/pt/converting_tensorflow_models.md", "repo_id": "transformers", "token_count": 2437 }
507
"""Google Universal Sentence Encoder Embedding Wrapper Module.""" 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 import CallbackManage...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-google/llama_index/embeddings/google/univ_sent_encoder.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-google/llama_index/embeddings/google/univ_sent_encoder.py", "repo_id": "llama_index", "token_count": 878 }
1,362
import { BufferMemory } from "langchain/memory"; import { FirestoreChatMessageHistory } from "@langchain/community/stores/message/firestore"; import { ChatOpenAI } from "@langchain/openai"; import { ConversationChain } from "langchain/chains"; import admin from "firebase-admin"; const memory = new BufferMemory({ cha...
langchainjs/examples/src/memory/firestore.ts/0
{ "file_path": "langchainjs/examples/src/memory/firestore.ts", "repo_id": "langchainjs", "token_count": 451 }
888
from argparse import Namespace, _SubParsersAction from .configuration import load_index def query_cli(args: Namespace) -> None: """Handle subcommand "query".""" index = load_index() query_engine = index.as_query_engine() print(query_engine.query(args.query)) def register_query_cli(subparsers: _SubP...
llama_index/experimental/cli/cli_query.py/0
{ "file_path": "llama_index/experimental/cli/cli_query.py", "repo_id": "llama_index", "token_count": 205 }
1,133
""" Lambda Layer Paper: `LambdaNetworks: Modeling Long-Range Interactions Without Attention` - https://arxiv.org/abs/2102.08602 @misc{2102.08602, Author = {Irwan Bello}, Title = {LambdaNetworks: Modeling Long-Range Interactions Without Attention}, Year = {2021}, } Status: This impl is a WIP. Code snippets in the...
pytorch-image-models/timm/layers/lambda_layer.py/0
{ "file_path": "pytorch-image-models/timm/layers/lambda_layer.py", "repo_id": "pytorch-image-models", "token_count": 2611 }
365
python_sources() python_tests( name="tests", )
llama_index/llama-index-core/tests/readers/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/readers/BUILD", "repo_id": "llama_index", "token_count": 22 }
1,167
# 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_regnet.py/0
{ "file_path": "transformers/tests/models/regnet/test_modeling_regnet.py", "repo_id": "transformers", "token_count": 4167 }
732
pipeline { options { timestamps() timeout(time: 30, unit: 'MINUTES') // timeout on this stage } agent { kubernetes { label "milvus-test" defaultContainer 'main' yamlFile "build/ci/jenkins/pod/chaos-test.yaml" customWorkspace '/home/je...
milvus/build/ci/jenkins/ChaosTest.groovy/0
{ "file_path": "milvus/build/ci/jenkins/ChaosTest.groovy", "repo_id": "milvus", "token_count": 9042 }
1,885
use std::sync::{Arc, RwLock}; use pyo3::exceptions; use pyo3::prelude::*; use pyo3::types::*; use serde::ser::SerializeStruct; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use tk::normalizer::SplitDelimiterBehavior; use tk::pre_tokenizers::bert::BertPreTokenizer; use tk::pre_tokenizers::byte_level::...
tokenizers/bindings/python/src/pre_tokenizers.rs/0
{ "file_path": "tokenizers/bindings/python/src/pre_tokenizers.rs", "repo_id": "tokenizers", "token_count": 13027 }
450
# Tutorials Below are links to tutorials and courses on LangChain.js. For written guides on common use cases for LangChain.js, check out the [use cases](/docs/use_cases) and [guides](/docs/guides/) sections. --- ## Deeplearning.ai We've partnered with [Deeplearning.ai](https://deeplearning.ai) and [Andrew Ng](https...
langchainjs/docs/core_docs/docs/additional_resources/tutorials/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/additional_resources/tutorials/index.mdx", "repo_id": "langchainjs", "token_count": 799 }
690
[tool.poetry] name = "rag-semi-structured" version = "0.1.0" description = "RAG on semi-structured " authors = [ "Lance Martin <lance@langchain.dev>", ] readme = "README.md" [tool.poetry.dependencies] python = ">=3.9,<3.11" langchain = "^0.1" tiktoken = ">=0.5.1" chromadb = ">=0.4.14" openai = "<2" unstructured = ...
langchain/templates/rag-semi-structured/pyproject.toml/0
{ "file_path": "langchain/templates/rag-semi-structured/pyproject.toml", "repo_id": "langchain", "token_count": 429 }
688
mod app; pub mod model; pub mod worker; pub use app::App; pub use worker::Worker;
candle/candle-wasm-examples/llama2-c/src/lib.rs/0
{ "file_path": "candle/candle-wasm-examples/llama2-c/src/lib.rs", "repo_id": "candle", "token_count": 29 }
83
import os from typing import Dict, List, Union import tensorflow as tf from keras_nlp.tokenizers import BytePairTokenizer from tensorflow_text import pad_model_inputs from ...modeling_tf_utils import keras from .tokenization_gpt2 import GPT2Tokenizer class TFGPT2Tokenizer(keras.layers.Layer): """ This is an...
transformers/src/transformers/models/gpt2/tokenization_gpt2_tf.py/0
{ "file_path": "transformers/src/transformers/models/gpt2/tokenization_gpt2_tf.py", "repo_id": "transformers", "token_count": 1565 }
612
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/util/importutil/parquet_column_reader.go/0
{ "file_path": "milvus/internal/util/importutil/parquet_column_reader.go", "repo_id": "milvus", "token_count": 4455 }
1,881
from langchain.evaluation import __all__ EXPECTED_ALL = [ "EvaluatorType", "ExactMatchStringEvaluator", "RegexMatchStringEvaluator", "PairwiseStringEvalChain", "LabeledPairwiseStringEvalChain", "QAEvalChain", "CotQAEvalChain", "ContextQAEvalChain", "StringEvaluator", "PairwiseSt...
langchain/libs/langchain/tests/unit_tests/evaluation/test_imports.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/evaluation/test_imports.py", "repo_id": "langchain", "token_count": 423 }
638
/* eslint-disable spaced-comment */ import { BasePromptTemplate, PromptTemplate } from "@langchain/core/prompts"; export const DEFAULT_SQL_DATABASE_PROMPT = /*#__PURE__*/ new PromptTemplate({ template: `Given an input question, first create a syntactically correct {dialect} query to run, then look at the results of ...
langchainjs/langchain/src/chains/sql_db/sql_db_prompt.ts/0
{ "file_path": "langchainjs/langchain/src/chains/sql_db/sql_db_prompt.ts", "repo_id": "langchainjs", "token_count": 2265 }
960
<jupyter_start><jupyter_text>Human input chat modelAlong with HumanInputLLM, LangChain also provides a pseudo chat model class that can be used for testing, debugging, or educational purposes. This allows you to mock out calls to the chat model and simulate how a human would respond if they received the messages.In thi...
langchain/cookbook/human_input_chat_model.ipynb/0
{ "file_path": "langchain/cookbook/human_input_chat_model.ipynb", "repo_id": "langchain", "token_count": 566 }
72
<!--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/ja/model_doc/chinese_clip.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/chinese_clip.md", "repo_id": "transformers", "token_count": 2245 }
547
""" 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.rdf_graph import RdfGraph from langchain_core.callbacks import CallbackManagerForChainRun from langchain_core.language_models import BaseLan...
langchain/libs/langchain/langchain/chains/graph_qa/sparql.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/graph_qa/sparql.py", "repo_id": "langchain", "token_count": 2273 }
468
[tool.ruff] # Never enforce `E501` (line length violations). ignore = ["C901", "E501", "E741", "F402", "F823" ] select = ["C", "E", "F", "I", "W"] line-length = 119 # Ignore import violations in all `__init__.py` files. [tool.ruff.per-file-ignores] "__init__.py" = ["E402", "F401", "F403", "F811"] "src/transformers/fil...
transformers/pyproject.toml/0
{ "file_path": "transformers/pyproject.toml", "repo_id": "transformers", "token_count": 406 }
625
from __future__ import annotations import re from typing import Dict, List, Optional from langchain_core.output_parsers import BaseOutputParser class RegexParser(BaseOutputParser): """Parse the output of an LLM call using a regex.""" @classmethod def is_lc_serializable(cls) -> bool: return True...
langchain/libs/langchain/langchain/output_parsers/regex.py/0
{ "file_path": "langchain/libs/langchain/langchain/output_parsers/regex.py", "repo_id": "langchain", "token_count": 518 }
527
# neo4j-parent This template allows you to balance precise embeddings and context retention by splitting documents into smaller chunks and retrieving their original or larger text information. Using a Neo4j vector index, the package queries child nodes using vector similarity search and retrieves the corresponding ...
langchain/templates/neo4j-parent/README.md/0
{ "file_path": "langchain/templates/neo4j-parent/README.md", "repo_id": "langchain", "token_count": 874 }
644
# Conclusion [[conclusion]] Congrats on finishing this unit! **That was the biggest one**, and there was a lot of information. And congrats on finishing the tutorial. You’ve just trained your first Deep RL agents and shared them with the community! 🥳 It's **normal if you still feel confused by some of these elements...
deep-rl-class/units/en/unit1/conclusion.mdx/0
{ "file_path": "deep-rl-class/units/en/unit1/conclusion.mdx", "repo_id": "deep-rl-class", "token_count": 349 }
162
python_tests()
llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-firestore/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-firestore/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,468
from langchain_community.embeddings.infinity import ( InfinityEmbeddings, TinyAsyncOpenAIInfinityEmbeddingClient, ) __all__ = ["InfinityEmbeddings", "TinyAsyncOpenAIInfinityEmbeddingClient"]
langchain/libs/langchain/langchain/embeddings/infinity.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/infinity.py", "repo_id": "langchain", "token_count": 67 }
546
use std::ffi::{c_char, c_void, CStr}; use crate::{ array::RustArray, index_reader::IndexReaderWrapper, util::{create_binding, free_binding}, util_c::tantivy_index_exist, }; #[no_mangle] pub extern "C" fn tantivy_load_index(path: *const c_char) -> *mut c_void { assert!(tantivy_index_exist(path)); ...
milvus/internal/core/thirdparty/tantivy/tantivy-binding/src/index_reader_c.rs/0
{ "file_path": "milvus/internal/core/thirdparty/tantivy/tantivy-binding/src/index_reader_c.rs", "repo_id": "milvus", "token_count": 2773 }
1,762
python_tests( name="tests", )
llama_index/llama-index-core/tests/utilities/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/utilities/BUILD", "repo_id": "llama_index", "token_count": 15 }
1,331
import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { MemoryVectorStore } from "langchain/vectorstores/memory"; import { TokenTextSplitter } from "langchain/text_splitter"; import { SearchApiLoader } from "langchain/document_loaders/web/searchapi"; import { ChatPromptTemplate } from "@langchain/cor...
langchainjs/examples/src/document_loaders/searchapi.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/searchapi.ts", "repo_id": "langchainjs", "token_count": 527 }
797
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
accelerate/docs/source/usage_guides/training_zoo.md/0
{ "file_path": "accelerate/docs/source/usage_guides/training_zoo.md", "repo_id": "accelerate", "token_count": 5980 }
6
:mod:`{{module}}`.{{objname}} {{ underline }}============== .. currentmodule:: {{ module }} .. autoclass:: {{ objname }} {% block attributes %} {% for item in attributes %} .. autoattribute:: {{ item }} {% endfor %} {% endblock %} .. example_links:: {{ objname }}
langchain/docs/api_reference/templates/enum.rst/0
{ "file_path": "langchain/docs/api_reference/templates/enum.rst", "repo_id": "langchain", "token_count": 104 }
85
python_sources()
llama_index/llama-index-core/llama_index/core/download/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/download/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,119
"""ReAct multimodal agent.""" import uuid from functools import partial from typing import Any, Dict, List, Optional, Protocol, Sequence, Tuple, cast from llama_index.core.agent.react.formatter import ReActChatFormatter from llama_index.core.agent.react.output_parser import ReActOutputParser from llama_index.core.age...
llama_index/llama-index-core/llama_index/core/agent/react_multimodal/step.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/agent/react_multimodal/step.py", "repo_id": "llama_index", "token_count": 8271 }
1,244
# coding=utf-8 # Copyright 2024, Haofan Wang, Qixun Wang, 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 re...
diffusers/scripts/convert_lora_safetensor_to_diffusers.py/0
{ "file_path": "diffusers/scripts/convert_lora_safetensor_to_diffusers.py", "repo_id": "diffusers", "token_count": 2129 }
223
import { LLMChain } from "langchain/chains"; import { OpenAI } from "@langchain/openai"; import { ConsoleCallbackHandler } from "@langchain/core/tracers/console"; import { PromptTemplate } from "@langchain/core/prompts"; export const run = async () => { const handler = new ConsoleCallbackHandler(); const llm = new...
langchainjs/examples/src/callbacks/console_handler.ts/0
{ "file_path": "langchainjs/examples/src/callbacks/console_handler.ts", "repo_id": "langchainjs", "token_count": 286 }
772
import { test, expect } from "@jest/globals"; import { DriaRetriever } from "../dria.js"; test.skip("DriaRetriever", async () => { // contract of TypeScript Handbook v4.9 uploaded to Dria // https://dria.co/knowledge/-B64DjhUtCwBdXSpsRytlRQCu-bie-vSTvTIT8Ap3g0 const contractId = "-B64DjhUtCwBdXSpsRytlRQCu-bie-vS...
langchainjs/libs/langchain-community/src/retrievers/tests/dria.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/retrievers/tests/dria.int.test.ts", "repo_id": "langchainjs", "token_count": 224 }
952
# 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/layoutlmv3/processing_layoutlmv3.py/0
{ "file_path": "transformers/src/transformers/models/layoutlmv3/processing_layoutlmv3.py", "repo_id": "transformers", "token_count": 3523 }
703
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/using-diffusers/sdxl.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/sdxl.md", "repo_id": "diffusers", "token_count": 7003 }
187
/* 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/parallel.ts/0
{ "file_path": "langchainjs/examples/src/use_cases/tool_use/parallel.ts", "repo_id": "langchainjs", "token_count": 954 }
828
Crates.io ---------------------------------------------------------------------------------------------------- 🤗 Tokenizers is available on `crates.io <https://crates.io/crates/tokenizers>`__. You just need to add it to your :obj:`Cargo.toml`:: tokenizers = "0.10"
tokenizers/docs/source/installation/rust.inc/0
{ "file_path": "tokenizers/docs/source/installation/rust.inc", "repo_id": "tokenizers", "token_count": 74 }
414
package parameterutil import ( "fmt" "strconv" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/util/merr" "github.com/milvus-io/milvus/pkg/util/typeutil" ) // GetMaxLength get max length of field. Maybe also helpful outside. func ...
milvus/pkg/util/parameterutil/get_max_len.go/0
{ "file_path": "milvus/pkg/util/parameterutil/get_max_len.go", "repo_id": "milvus", "token_count": 771 }
1,838
from unittest.mock import Mock from llama_index.legacy.chat_engine.condense_question import ( CondenseQuestionChatEngine, ) from llama_index.legacy.core.base_query_engine import BaseQueryEngine from llama_index.legacy.core.llms.types import ChatMessage, MessageRole from llama_index.legacy.core.response.schema impo...
llama_index/llama-index-legacy/tests/chat_engine/test_condense_question.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/chat_engine/test_condense_question.py", "repo_id": "llama_index", "token_count": 740 }
1,627
// Code generated by mockery v2.32.4. DO NOT EDIT. package mocks import ( context "context" commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" internalpb "github.com/milvus-io/milvus/internal/proto/internalpb" milvuspb "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" mock "github.com/stret...
milvus/internal/querycoordv2/mocks/mock_querynode.go/0
{ "file_path": "milvus/internal/querycoordv2/mocks/mock_querynode.go", "repo_id": "milvus", "token_count": 19694 }
1,897
import { z } from "zod"; import { ChatOpenAI } from "@langchain/openai"; import { createExtractionChainFromZod } from "langchain/chains"; const zodSchema = z.object({ "person-name": z.string().optional(), "person-age": z.number().optional(), "person-hair_color": z.string().optional(), "dog-name": z.string().op...
langchainjs/examples/src/chains/openai_functions_extraction.ts/0
{ "file_path": "langchainjs/examples/src/chains/openai_functions_extraction.ts", "repo_id": "langchainjs", "token_count": 395 }
801
"""Unit tests for agents.""" import json from itertools import cycle from typing import Any, Dict, List, Optional, Union, cast from langchain_core.agents import ( AgentAction, AgentActionMessageLog, AgentFinish, AgentStep, ) from langchain_core.language_models.llms import LLM from langchain_core.messa...
langchain/libs/langchain/tests/unit_tests/agents/test_agent.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/agents/test_agent.py", "repo_id": "langchain", "token_count": 21560 }
620
import { collections } from "$lib/server/database"; import { ObjectId } from "mongodb"; import { describe, expect, it } from "vitest"; import { insertLegacyConversation, insertSideBranchesConversation } from "./treeHelpers.spec"; import { addChildren } from "./addChildren"; import type { Message } from "$lib/types/Mes...
chat-ui/src/lib/utils/tree/addChildren.spec.ts/0
{ "file_path": "chat-ui/src/lib/utils/tree/addChildren.spec.ts", "repo_id": "chat-ui", "token_count": 1301 }
99
# LlamaIndex Graph Stores Integration: Neo4J
llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/README.md/0
{ "file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/README.md", "repo_id": "llama_index", "token_count": 12 }
1,283
# Momento Vector Index (MVI) [MVI](https://gomomento.com): the most productive, easiest to use, serverless vector index for your data. To get started with MVI, simply sign up for an account. There's no need to handle infrastructure, manage servers, or be concerned about scaling. MVI is a service that scales automatica...
langchainjs/docs/core_docs/docs/integrations/vectorstores/momento_vector_index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/momento_vector_index.mdx", "repo_id": "langchainjs", "token_count": 799 }
749
# Node Postprocessor Modules ## SimilarityPostprocessor Used to remove nodes that are below a similarity score threshold. ```python from llama_index.core.postprocessor import SimilarityPostprocessor postprocessor = SimilarityPostprocessor(similarity_cutoff=0.7) postprocessor.postprocess_nodes(nodes) ``` ## Keywor...
llama_index/docs/module_guides/querying/node_postprocessors/node_postprocessors.md/0
{ "file_path": "llama_index/docs/module_guides/querying/node_postprocessors/node_postprocessors.md", "repo_id": "llama_index", "token_count": 2815 }
1,124
"""Chain for interacting with SQL Database.""" from __future__ import annotations import warnings from typing import Any, Dict, List, Optional from langchain.callbacks.manager import CallbackManagerForChainRun from langchain.chains.base import Chain from langchain.chains.llm import LLMChain from langchain.chains.sql_...
langchain/libs/experimental/langchain_experimental/sql/base.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/sql/base.py", "repo_id": "langchain", "token_count": 5673 }
425
package model import ( "time" pb "github.com/milvus-io/milvus/internal/proto/etcdpb" "github.com/milvus-io/milvus/pkg/util" ) type Database struct { TenantID string ID int64 Name string State pb.DatabaseState CreatedTime uint64 } func NewDatabase(id int64, name string, sate pb.Datab...
milvus/internal/metastore/model/database.go/0
{ "file_path": "milvus/internal/metastore/model/database.go", "repo_id": "milvus", "token_count": 715 }
1,998
<jupyter_start><jupyter_text>---sidebar_position: 1title: Interface---<jupyter_code>To make it as easy as possible to create custom chains, we've implemented a ["Runnable"](https://api.python.langchain.com/en/stable/runnables/langchain_core.runnables.base.Runnable.html#langchain_core.runnables.base.Runnable) protocol. ...
langchain/docs/docs/expression_language/interface.ipynb/0
{ "file_path": "langchain/docs/docs/expression_language/interface.ipynb", "repo_id": "langchain", "token_count": 6992 }
89
import { AppProps } from "next/app"; import Head from "next/head"; import { MantineProvider, MantineThemeOverride } from "@mantine/core"; import React from "react"; import { IS_DEV } from "../utils/variables"; import * as snippet from "@segment/snippet"; import { useEffect } from "react"; import { Notifications } from ...
auto-evaluator/nextjs/pages/_app.tsx/0
{ "file_path": "auto-evaluator/nextjs/pages/_app.tsx", "repo_id": "auto-evaluator", "token_count": 1268 }
2
# coding=utf-8 # Copyright 2021 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/unispeech/test_modeling_unispeech.py/0
{ "file_path": "transformers/tests/models/unispeech/test_modeling_unispeech.py", "repo_id": "transformers", "token_count": 10418 }
754