text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
python_tests( interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-integrations/indices/llama-index-indices-managed-google/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-google/tests/BUILD", "repo_id": "llama_index", "token_count": 29 }
1,294
import platform from functools import lru_cache @lru_cache(maxsize=1) def get_runtime_environment() -> dict: """Get information about the LangChain runtime environment.""" # Lazy import to avoid circular imports from langchain import __version__ return { "library_version": __version__, ...
langchain/libs/langchain/langchain/env.py/0
{ "file_path": "langchain/libs/langchain/langchain/env.py", "repo_id": "langchain", "token_count": 166 }
536
import { PromptTemplate, FewShotPromptTemplate } from "@langchain/core/prompts"; import { LengthBasedExampleSelector } from "@langchain/core/example_selectors"; export async function run() { // Create a prompt template that will be used to format the examples. const examplePrompt = new PromptTemplate({ inputVa...
langchainjs/examples/src/prompts/length_based_example_selector.ts/0
{ "file_path": "langchainjs/examples/src/prompts/length_based_example_selector.ts", "repo_id": "langchainjs", "token_count": 667 }
813
# Resumer Screener Pack This LlamaPack loads a resume file, and review it against a user specified job description and screening criteria. ## CLI Usage You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package: ```bash llamaindex-cli download-llamapack ...
llama_index/llama-index-packs/llama-index-packs-resume-screener/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-resume-screener/README.md", "repo_id": "llama_index", "token_count": 657 }
1,725
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-cdk/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-cdk/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,307
python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/agent/runner/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/agent/runner/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,729
"""Managed index. A managed Index - where the index is accessible via some API that interfaces a managed service. """ import logging from typing import Any, Dict, Optional, Sequence, Type import requests from llama_index.legacy.core.base_retriever import BaseRetriever from llama_index.legacy.data_structs.data_stru...
llama_index/llama-index-legacy/llama_index/legacy/indices/managed/zilliz/base.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/managed/zilliz/base.py", "repo_id": "llama_index", "token_count": 7439 }
1,665
import os from typing import Any, Optional from llama_index.llms.openai_like import OpenAILike class TogetherLLM(OpenAILike): def __init__( self, model: str, api_key: Optional[str] = None, api_base: str = "https://api.together.xyz/v1", is_chat_model: bool = True, *...
llama_index/llama-index-integrations/llms/llama-index-llms-together/llama_index/llms/together/base.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-together/llama_index/llms/together/base.py", "repo_id": "llama_index", "token_count": 362 }
1,281
from typing import Dict, Type, Union from langchain.agents.agent import BaseSingleActionAgent from langchain.agents.agent_types import AgentType from langchain.agents.chat.base import ChatAgent from langchain.agents.conversational.base import ConversationalAgent from langchain.agents.conversational_chat.base import Co...
langchain/libs/langchain/langchain/agents/types.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/types.py", "repo_id": "langchain", "token_count": 472 }
447
python_sources()
llama_index/llama-index-integrations/tools/llama-index-tools-wolfram-alpha/llama_index/tools/wolfram_alpha/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-wolfram-alpha/llama_index/tools/wolfram_alpha/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,445
# Train your first Deep Reinforcement Learning Agent ๐Ÿค– [[hands-on]] <CourseFloatingBanner classNames="absolute z-10 right-0 top-0" notebooks={[ {label: "Google Colab", value: "https://colab.research.google.com/github/huggingface/deep-rl-class/blob/main/notebooks/unit1/unit1.ipynb"} ]} ...
deep-rl-class/units/en/unit1/hands-on.mdx/0
{ "file_path": "deep-rl-class/units/en/unit1/hands-on.mdx", "repo_id": "deep-rl-class", "token_count": 9469 }
155
import { AgentExecutor } from "langchain/agents"; import { ChatOpenAI } from "@langchain/openai"; import { Calculator } from "langchain/tools/calculator"; import { OpenAIFunctionsAgentOutputParser } from "langchain/agents/openai/output_parser"; import { convertToOpenAIFunction } from "@langchain/core/utils/function_cal...
langchainjs/examples/src/agents/openai_runnable_stream_log.ts/0
{ "file_path": "langchainjs/examples/src/agents/openai_runnable_stream_log.ts", "repo_id": "langchainjs", "token_count": 2714 }
768
from llama_index.core.readers.base import BaseReader from llama_index.readers.microsoft_onedrive import OneDriveReader def test_class(): names_of_base_classes = [b.__name__ for b in OneDriveReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-onedrive/tests/test_readers_microsoft_onedrive.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-onedrive/tests/test_readers_microsoft_onedrive.py", "repo_id": "llama_index", "token_count": 90 }
1,338
from langchain_core.pydantic_v1 import SecretStr from pytest import CaptureFixture from langchain_community.llms.pipelineai import PipelineAI def test_api_key_is_string() -> None: llm = PipelineAI(pipeline_api_key="secret-api-key") assert isinstance(llm.pipeline_api_key, SecretStr) def test_api_key_masked_...
langchain/libs/community/tests/unit_tests/llms/test_pipelineai.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/llms/test_pipelineai.py", "repo_id": "langchain", "token_count": 219 }
381
/* eslint-disable @typescript-eslint/no-explicit-any */ import { JsonRefs } from "./json-refs"; // jsonforms doesn't support schemas with root $ref // so we resolve root $ref and replace it with the actual schema export function simplifySchema(schema: any) { return JsonRefs.resolveRefs(schema) .then((r: any) => ...
opengpts/frontend/src/utils/simplifySchema.ts/0
{ "file_path": "opengpts/frontend/src/utils/simplifySchema.ts", "repo_id": "opengpts", "token_count": 375 }
1,925
python_sources()
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,252
# WordLift Reader The WordLift GraphQL Reader is a connector to fetch and transform data from a WordLift Knowledge Graph using your the WordLift Key. The connector provides a convenient way to load data from WordLift using a GraphQL query and transform it into a list of documents for further processing. ## Usage To ...
llama_index/llama-index-integrations/readers/llama-index-readers-wordlift/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-wordlift/README.md", "repo_id": "llama_index", "token_count": 843 }
1,450
version: '3' services: langchain: build: dockerfile: libs/langchain/dev.Dockerfile context: .. volumes: # Update this to wherever you want VS Code to mount the folder of your project - ..:/workspaces:cached networks: - langchain-network # environment: # MONGO_ROOT_USE...
langchain/.devcontainer/docker-compose.yaml/0
{ "file_path": "langchain/.devcontainer/docker-compose.yaml", "repo_id": "langchain", "token_count": 318 }
72
# OpenAI All functionality related to OpenAI >[OpenAI](https://en.wikipedia.org/wiki/OpenAI) is American artificial intelligence (AI) research laboratory > consisting of the non-profit `OpenAI Incorporated` > and its for-profit subsidiary corporation `OpenAI Limited Partnership`. > `OpenAI` conducts AI research wit...
langchain/docs/docs/integrations/platforms/openai.mdx/0
{ "file_path": "langchain/docs/docs/integrations/platforms/openai.mdx", "repo_id": "langchain", "token_count": 998 }
128
// 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/tests/integration/util_query.go/0
{ "file_path": "milvus/tests/integration/util_query.go", "repo_id": "milvus", "token_count": 2109 }
1,960
package typeutil import ( "testing" "github.com/stretchr/testify/suite" ) type MapUtilSuite struct { suite.Suite } func (suite *MapUtilSuite) TestMapEqual() { left := map[int64]int64{ 1: 10, 2: 20, } right := map[int64]int64{ 1: 10, 2: 200, } suite.False(MapEqual(left, right)) suite.False(MapEqual(...
milvus/pkg/util/typeutil/map_test.go/0
{ "file_path": "milvus/pkg/util/typeutil/map_test.go", "repo_id": "milvus", "token_count": 1584 }
1,844
from llama_index.core.postprocessor.types import BaseNodePostprocessor from llama_index.postprocessor.presidio import PresidioPIINodePostprocessor def test_class(): names_of_base_classes = [b.__name__ for b in PresidioPIINodePostprocessor.__mro__] assert BaseNodePostprocessor.__name__ in names_of_base_classes...
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-presidio/tests/test_postprocessor_presidio.py/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-presidio/tests/test_postprocessor_presidio.py", "repo_id": "llama_index", "token_count": 103 }
1,298
python_sources() python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/indices/empty/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/empty/BUILD", "repo_id": "llama_index", "token_count": 32 }
1,618
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/util/typeutil/set_test.go/0
{ "file_path": "milvus/pkg/util/typeutil/set_test.go", "repo_id": "milvus", "token_count": 653 }
1,918
# Copyright 2020 The HuggingFace Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
datasets/src/datasets/inspect.py/0
{ "file_path": "datasets/src/datasets/inspect.py", "repo_id": "datasets", "token_count": 9910 }
138
package main import ( "flag" "fmt" "sort" "strings" "github.com/golang/protobuf/proto" "go.uber.org/zap" etcdkv "github.com/milvus-io/milvus/internal/kv/etcd" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/util/etcd" "github.com/m...
milvus/cmd/tools/datameta/main.go/0
{ "file_path": "milvus/cmd/tools/datameta/main.go", "repo_id": "milvus", "token_count": 1689 }
1,721
<!--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/models/transformer2d.md/0
{ "file_path": "diffusers/docs/source/en/api/models/transformer2d.md", "repo_id": "diffusers", "token_count": 467 }
172
<!--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/segformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/segformer.md", "repo_id": "transformers", "token_count": 3177 }
454
from __future__ import absolute_import, division, print_function import argparse import glob import logging import os import random import time import numpy as np import torch from torch import nn from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset from torch.utils.data.distribute...
transformers/examples/research_projects/deebert/run_glue_deebert.py/0
{ "file_path": "transformers/examples/research_projects/deebert/run_glue_deebert.py", "repo_id": "transformers", "token_count": 13897 }
539
# 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.py/0
{ "file_path": "diffusers/src/diffusers/models/unets/unet_2d.py", "repo_id": "diffusers", "token_count": 7250 }
215
# Conversation summary memory 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 t...
langchainjs/docs/core_docs/docs/modules/memory/types/summary.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/memory/types/summary.mdx", "repo_id": "langchainjs", "token_count": 309 }
746
# Copyright 2021 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/gpt2/test_modeling_flax_gpt2.py/0
{ "file_path": "transformers/tests/models/gpt2/test_modeling_flax_gpt2.py", "repo_id": "transformers", "token_count": 7399 }
817
<jupyter_start><jupyter_text>OllamaLet's load the Ollama Embeddings class.<jupyter_code>from langchain_community.embeddings import OllamaEmbeddings embeddings = OllamaEmbeddings() text = "This is a test document."<jupyter_output><empty_output><jupyter_text>To generate embeddings, you can either query an invidivual text...
langchain/docs/docs/integrations/text_embedding/ollama.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/text_embedding/ollama.ipynb", "repo_id": "langchain", "token_count": 343 }
165
// 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/operator/FilterBits.h/0
{ "file_path": "milvus/internal/core/src/exec/operator/FilterBits.h", "repo_id": "milvus", "token_count": 635 }
1,870
"""Combining documents by mapping a chain over them first, then reranking results.""" from __future__ import annotations from typing import Any, Dict, List, Optional, Sequence, Tuple, Type, Union, cast from langchain_core.callbacks import Callbacks from langchain_core.documents import Document from langchain_core.py...
langchain/libs/langchain/langchain/chains/combine_documents/map_rerank.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/combine_documents/map_rerank.py", "repo_id": "langchain", "token_count": 3744 }
456
# coding=utf-8 # Copyright 2021 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...
transformers/tests/test_sequence_feature_extraction_common.py/0
{ "file_path": "transformers/tests/test_sequence_feature_extraction_common.py", "repo_id": "transformers", "token_count": 7929 }
757
from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, List, Tuple from uuid import uuid4 from llama_index.legacy.llm_predictor.vellum.types import ( VellumCompiledPrompt, VellumRegisteredPrompt, ) from llama_index.legacy.llm_predictor.vellum.utils import convert_to_kebab_case from ll...
llama_index/llama-index-legacy/llama_index/legacy/llm_predictor/vellum/prompt_registry.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llm_predictor/vellum/prompt_registry.py", "repo_id": "llama_index", "token_count": 4313 }
1,503
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/create_a_model.md/0
{ "file_path": "transformers/docs/source/en/create_a_model.md", "repo_id": "transformers", "token_count": 5484 }
434
--- sidebar_label: Azure OpenAI --- import CodeBlock from "@theme/CodeBlock"; # Azure ChatOpenAI [Azure OpenAI](https://azure.microsoft.com/products/ai-services/openai-service/) is a cloud service to help you quickly develop generative AI experiences with a diverse set of prebuilt and curated models from OpenAI, Met...
langchainjs/docs/core_docs/docs/integrations/chat/azure.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat/azure.mdx", "repo_id": "langchainjs", "token_count": 1241 }
773
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/unittest/test_azure_chunk_manager.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_azure_chunk_manager.cpp", "repo_id": "milvus", "token_count": 4358 }
1,901
# coding=utf-8 # 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 requir...
transformers/tests/models/albert/test_modeling_albert.py/0
{ "file_path": "transformers/tests/models/albert/test_modeling_albert.py", "repo_id": "transformers", "token_count": 6342 }
701
<jupyter_start><jupyter_text>Multi-modal outputs: Image & Text This notebook shows how non-text producing tools can be used to create multi-modal agents.This example is limited to text and image outputs and uses UUIDs to transfer content across tools and agents. This example uses Steamship to generate and store generat...
langchain/cookbook/multi_modal_output_agent.ipynb/0
{ "file_path": "langchain/cookbook/multi_modal_output_agent.ipynb", "repo_id": "langchain", "token_count": 740 }
80
<jupyter_start><jupyter_text>C TransformersThe [C Transformers](https://github.com/marella/ctransformers) library provides Python bindings for GGML models.This example goes over how to use LangChain to interact with `C Transformers` [models](https://github.com/marella/ctransformerssupported-models). **Install**<jupyter...
langchain/docs/docs/integrations/llms/ctransformers.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/ctransformers.ipynb", "repo_id": "langchain", "token_count": 446 }
117
import pytest from langchain_core.messages import ( AIMessage, ChatMessage, FunctionMessage, HumanMessage, SystemMessage, ) from langchain_community.chat_models.llama_edge import ( LlamaEdgeChatService, _convert_dict_to_message, _convert_message_to_dict, ) def test__convert_message_to...
langchain/libs/community/tests/unit_tests/chat_models/test_llama_edge.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/chat_models/test_llama_edge.py", "repo_id": "langchain", "token_count": 866 }
385
"""Callback handler for Context AI""" import os from typing import Any, Dict, List from uuid import UUID from langchain_core.callbacks import BaseCallbackHandler from langchain_core.messages import BaseMessage from langchain_core.outputs import LLMResult def import_context() -> Any: """Import the `getcontext` pa...
langchain/libs/community/langchain_community/callbacks/context_callback.py/0
{ "file_path": "langchain/libs/community/langchain_community/callbacks/context_callback.py", "repo_id": "langchain", "token_count": 2950 }
230
from llama_index.readers.imdb_review.base import IMDBReviews __all__ = ["IMDBReviews"]
llama_index/llama-index-integrations/readers/llama-index-readers-imdb-review/llama_index/readers/imdb_review/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-imdb-review/llama_index/readers/imdb_review/__init__.py", "repo_id": "llama_index", "token_count": 33 }
1,389
[tool.poetry] name = "nvidia-rag-canonical" version = "0.1.0" description = "RAG with NVIDIA" authors = ["Sagar Bogadi Manjunath <sbogadimanju@nvidia.com>"] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" pymilvus = ">=2.3.0" langchain-nvidia-aiplay = "^0.0.2" pypdf = ">=3.1"...
langchain/templates/nvidia-rag-canonical/pyproject.toml/0
{ "file_path": "langchain/templates/nvidia-rag-canonical/pyproject.toml", "repo_id": "langchain", "token_count": 296 }
673
# Text-generation-launcher arguments <!-- WRAP CODE BLOCKS --> ```shell Text Generation Launcher Usage: text-generation-launcher [OPTIONS] Options: ``` ## MODEL_ID ```shell --model-id <MODEL_ID> The name of the model to load. Can be a MODEL_ID as listed on <https://hf.co/models> like `gpt2` or `Open...
text-generation-inference/docs/source/basic_tutorials/launcher.md/0
{ "file_path": "text-generation-inference/docs/source/basic_tutorials/launcher.md", "repo_id": "text-generation-inference", "token_count": 6114 }
416
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-weaviate/llama_index/readers/weaviate/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-weaviate/llama_index/readers/weaviate/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,464
syntax = "proto3"; package chroma; option go_package = "github.com/chroma/chroma-coordinator/internal/proto/coordinatorpb"; message Status { string reason = 1; int32 code = 2; // TODO: What is the enum of this code? } message ChromaResponse { Status status = 1; } // Types here should mirror chromadb/types.py...
chroma/idl/chromadb/proto/chroma.proto/0
{ "file_path": "chroma/idl/chromadb/proto/chroma.proto", "repo_id": "chroma", "token_count": 1001 }
55
from typing import TYPE_CHECKING from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_flax_available, is_torch_available, is_transformers_available, ) _dummy_objects = {} _import_structure = {} try: if not (is_transfor...
diffusers/src/diffusers/pipelines/controlnet/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/controlnet/__init__.py", "repo_id": "diffusers", "token_count": 1294 }
236
<jupyter_start><jupyter_text>Upstash Redis>[Upstash](https://upstash.com/docs/introduction) is a provider of the serverless `Redis`, `Kafka`, and `QStash` APIs.This notebook goes over how to use `Upstash Redis` to store chat message history.<jupyter_code>from langchain_community.chat_message_histories.upstash_redis imp...
langchain/docs/docs/integrations/memory/upstash_redis_chat_message_history.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/memory/upstash_redis_chat_message_history.ipynb", "repo_id": "langchain", "token_count": 248 }
123
python_tests()
llama_index/llama-index-integrations/indices/llama-index-indices-managed-colbert/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-colbert/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,208
<jupyter_start><jupyter_text>Local Llama2 + VectorStoreIndexThis notebook walks through the proper setup to use llama-2 with LlamaIndex locally. Note that you need a decent GPU to run this notebook, ideally an A100 with at least 40GB of memory.Specifically, we look at using a vector store index. Setup<jupyter_code>%pi...
llama_index/docs/examples/vector_stores/SimpleIndexDemoLlama-Local.ipynb/0
{ "file_path": "llama_index/docs/examples/vector_stores/SimpleIndexDemoLlama-Local.ipynb", "repo_id": "llama_index", "token_count": 1546 }
1,092
# Use RunnableMaps import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx"; <IntegrationInstallTooltip></IntegrationInstallTooltip> ```bash npm2yarn npm install @langchain/anthropic @langchain/community ``` RunnableMaps allow you to execute multiple Runnables in parallel, and to retu...
langchainjs/docs/core_docs/docs/expression_language/how_to/map.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/expression_language/how_to/map.mdx", "repo_id": "langchainjs", "token_count": 399 }
717
// Code generated by mockery v2.32.4. DO NOT EDIT. package metacache import ( datapb "github.com/milvus-io/milvus/internal/proto/datapb" mock "github.com/stretchr/testify/mock" schemapb "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" storage "github.com/milvus-io/milvus/internal/storage" ) // MockMetaCa...
milvus/internal/datanode/metacache/mock_meta_cache.go/0
{ "file_path": "milvus/internal/datanode/metacache/mock_meta_cache.go", "repo_id": "milvus", "token_count": 6970 }
1,976
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
trl/tests/test_peft_models.py/0
{ "file_path": "trl/tests/test_peft_models.py", "repo_id": "trl", "token_count": 3832 }
872
# WholeSiteReader The WholeSiteReader is a sophisticated web scraping tool that employs a breadth-first search (BFS) algorithm. It's designed to methodically traverse and extract content from entire websites, focusing specifically on predefined URL paths. ## Features - **Breadth-First Search (BFS):** Traverses a web...
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/whole_site/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/whole_site/README.md", "repo_id": "llama_index", "token_count": 944 }
1,460
from typing import List import requests from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class LinearReader(BaseReader): """Linear reader. Reads data from Linear issues for the passed query. Args: api_key (str): Personal API token. """ def __...
llama_index/llama-index-integrations/readers/llama-index-readers-linear/llama_index/readers/linear/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-linear/llama_index/readers/linear/base.py", "repo_id": "llama_index", "token_count": 1337 }
1,471
apiVersion: chaos-mesh.org/v1alpha1 kind: PodChaos metadata: name: test-mixcoord-pod-failure namespace: chaos-testing spec: selector: namespaces: - chaos-testing labelSelectors: app.kubernetes.io/instance: milvus-chaos app.kubernetes.io/component: mixcoord mode: fixed value: "1" ac...
milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_mixcoord_pod_failure.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_mixcoord_pod_failure.yaml", "repo_id": "milvus", "token_count": 151 }
1,957
// https://github.com/karpathy/llama2.c #[cfg(feature = "accelerate")] extern crate accelerate_src; #[cfg(feature = "mkl")] extern crate intel_mkl_src; use candle_transformers::models::llama2_c as model; use candle_transformers::models::llama2_c_weights as weights; use candle_transformers::models::quantized_llama2_c...
candle/candle-examples/examples/llama2-c/main.rs/0
{ "file_path": "candle/candle-examples/examples/llama2-c/main.rs", "repo_id": "candle", "token_count": 5988 }
45
<jupyter_start><jupyter_code>from llama_hub.openalex import OpenAlexReader from llama_index.llms import OpenAI from llama_index.query_engine import CitationQueryEngine from llama_index import ( VectorStoreIndex, ServiceContext, ) from llama_index.response.notebook_utils import display_response # change this to ...
llama_index/llama-index-integrations/readers/llama-index-readers-openalex/examples/demo.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-openalex/examples/demo.ipynb", "repo_id": "llama_index", "token_count": 370 }
1,437
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/roc_bert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/roc_bert.md", "repo_id": "transformers", "token_count": 999 }
516
import base64 import torch from io import BytesIO from diffusers import StableDiffusionPipeline def model_fn(model_dir): # Load stable diffusion and move it to the GPU pipe = StableDiffusionPipeline.from_pretrained(model_dir, torch_dtype=torch.float16) pipe = pipe.to("cuda") return pipe def predict_fn(data,...
notebooks/sagemaker/23_stable_diffusion_inference/code/inference.py/0
{ "file_path": "notebooks/sagemaker/23_stable_diffusion_inference/code/inference.py", "repo_id": "notebooks", "token_count": 400 }
318
from typing import TYPE_CHECKING from ...utils import DIFFUSERS_SLOW_IMPORT, _LazyModule _import_structure = {"pipeline_dance_diffusion": ["DanceDiffusionPipeline"]} if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT: from .pipeline_dance_diffusion import DanceDiffusionPipeline else: import sys sys.modules[__na...
diffusers/src/diffusers/pipelines/dance_diffusion/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/dance_diffusion/__init__.py", "repo_id": "diffusers", "token_count": 189 }
230
"""Test ChatGoogleGenerativeAI function call.""" import json from langchain_core.messages import AIMessage from langchain_core.pydantic_v1 import BaseModel from langchain_core.tools import tool from langchain_google_genai.chat_models import ( ChatGoogleGenerativeAI, ) def test_function_call() -> None: func...
langchain/libs/partners/google-genai/tests/integration_tests/test_function_call.py/0
{ "file_path": "langchain/libs/partners/google-genai/tests/integration_tests/test_function_call.py", "repo_id": "langchain", "token_count": 1121 }
652
import pytest @pytest.fixture() def english_text() -> str: return """\ A Curious Beginning In a quaint little village, nestled deep within a lush, green valley, there lived a \ curious young girl named Lily! She had sparkling blue eyes that glimmered like the \ morning dewโ€”yes, like tiny sapphires embedded in he...
llama_index/llama-index-legacy/tests/text_splitter/conftest.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/text_splitter/conftest.py", "repo_id": "llama_index", "token_count": 1479 }
1,638
from __future__ import annotations import logging from enum import Enum from typing import TYPE_CHECKING, Any, Dict, List, Optional from langchain_core.chat_history import BaseChatMessageHistory from langchain_core.messages import ( AIMessage, BaseMessage, HumanMessage, SystemMessage, ) if TYPE_CHECK...
langchain/libs/community/langchain_community/chat_message_histories/zep.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_message_histories/zep.py", "repo_id": "langchain", "token_count": 3078 }
222
# Copyright 2023-present 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 law or...
peft/src/peft/utils/constants.py/0
{ "file_path": "peft/src/peft/utils/constants.py", "repo_id": "peft", "token_count": 2661 }
349
from rag_multi_index_fusion.chain import chain __all__ = ["chain"]
langchain/templates/rag-multi-index-fusion/rag_multi_index_fusion/__init__.py/0
{ "file_path": "langchain/templates/rag-multi-index-fusion/rag_multi_index_fusion/__init__.py", "repo_id": "langchain", "token_count": 23 }
695
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/add_tensorflow_model.md/0
{ "file_path": "transformers/docs/source/en/add_tensorflow_model.md", "repo_id": "transformers", "token_count": 5782 }
448
from typing import TYPE_CHECKING from ....utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_torch_available, is_transformers_available, ) _dummy_objects = {} _import_structure = {} try: if not (is_transformers_available() and i...
diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/__init__.py", "repo_id": "diffusers", "token_count": 817 }
234
#!/usr/bin/env bash eval $(minikube -p chroma-test docker-env) docker build -t chroma-coordinator:latest -f go/coordinator/Dockerfile . kubectl delete deployment coordinator -n chroma # Apply the kubernetes manifests kubectl apply -f k8s/deployment kubectl apply -f k8s/crd kubectl apply -f k8s/cr kubectl apply -f ...
chroma/bin/reset.sh/0
{ "file_path": "chroma/bin/reset.sh", "repo_id": "chroma", "token_count": 128 }
14
# Recursive Retriever Packs ## Embedded Tables Retriever Pack w/ Unstructured.io This LlamaPack provides an example of our embedded tables retriever. This specific template shows the e2e process of building this. It loads a document, builds a hierarchical node graph (with bigger parent nodes and smaller child nodes)...
llama_index/llama-index-packs/llama-index-packs-recursive-retriever/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-recursive-retriever/README.md", "repo_id": "llama_index", "token_count": 1262 }
1,586
# Subscribing to events import CodeBlock from "@theme/CodeBlock"; import DebuggingExample from "@examples/models/chat/chat_debugging.ts"; Especially when using an agent, there can be a lot of back-and-forth going on behind the scenes as a Chat Model processes a prompt. For agents, the response object contains an inte...
langchainjs/docs/core_docs/docs/modules/model_io/chat/subscribing_events.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/model_io/chat/subscribing_events.mdx", "repo_id": "langchainjs", "token_count": 263 }
816
from langchain_community.retrievers.google_cloud_documentai_warehouse import ( GoogleDocumentAIWarehouseRetriever, ) __all__ = ["GoogleDocumentAIWarehouseRetriever"]
langchain/libs/langchain/langchain/retrievers/google_cloud_documentai_warehouse.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/google_cloud_documentai_warehouse.py", "repo_id": "langchain", "token_count": 53 }
581
[tool.poetry] name = "neo4j-parent" version = "0.1.0" description = "Balance precise embeddings and context retention with Neo4j hybrid search" authors = [ "Tomaz Bratanic <tomaz.bratanic@neo4j.com>", ] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" tiktoken = "^0.5.1" o...
langchain/templates/neo4j-parent/pyproject.toml/0
{ "file_path": "langchain/templates/neo4j-parent/pyproject.toml", "repo_id": "langchain", "token_count": 316 }
664
<jupyter_start><jupyter_text>Pandas DataFrameThis notebook goes over how to load data from a [pandas](https://pandas.pydata.org/pandas-docs/stable/user_guide/index) DataFrame.<jupyter_code>%pip install --upgrade --quiet pandas import pandas as pd df = pd.read_csv("example_data/mlb_teams_2012.csv") df.head() from langc...
langchain/docs/docs/integrations/document_loaders/pandas_dataframe.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/pandas_dataframe.ipynb", "repo_id": "langchain", "token_count": 591 }
104
/** * A simple data structure that holds information about an attribute. It * is typically used to provide metadata about attributes in other classes * or data structures within the LangChain framework. */ export class AttributeInfo { constructor( public name: string, public type: string, public descr...
langchainjs/langchain/src/schema/query_constructor.ts/0
{ "file_path": "langchainjs/langchain/src/schema/query_constructor.ts", "repo_id": "langchainjs", "token_count": 85 }
934
# Weaviate >[Weaviate](https://weaviate.io/) is an open-source vector database. It allows you to store data objects and vector embeddings from >your favorite ML models, and scale seamlessly into billions of data objects. What is `Weaviate`? - Weaviate is an open-source โ€‹database of the type โ€‹vector search engine. - ...
langchain/docs/docs/integrations/providers/weaviate.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/weaviate.mdx", "repo_id": "langchain", "token_count": 539 }
163
# candle-metal-kernels This crate contains Metal kernels used from candle.
candle/candle-metal-kernels/README.md/0
{ "file_path": "candle/candle-metal-kernels/README.md", "repo_id": "candle", "token_count": 18 }
64
from langchain_community.llms.huggingface_pipeline import ( HuggingFacePipeline, ) __all__ = [ "HuggingFacePipeline", ]
langchain/libs/langchain/langchain/llms/huggingface_pipeline.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/huggingface_pipeline.py", "repo_id": "langchain", "token_count": 54 }
521
# Copyright (C) 2019-2022 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 law or ag...
milvus/build/docker/milvus/gpu/ubuntu20.04/Dockerfile.base/0
{ "file_path": "milvus/build/docker/milvus/gpu/ubuntu20.04/Dockerfile.base", "repo_id": "milvus", "token_count": 573 }
1,748
<!--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/bark.md/0
{ "file_path": "transformers/docs/source/en/model_doc/bark.md", "repo_id": "transformers", "token_count": 2760 }
501
/*! ************************************************************************************************** * Deformable DETR * Copyright (c) 2020 SenseTime. All Rights Reserved. * Licensed under the Apache License, Version 2.0 [see LICENSE for details] ***********************************************************************...
transformers/src/transformers/kernels/deformable_detr/cpu/ms_deform_attn_cpu.h/0
{ "file_path": "transformers/src/transformers/kernels/deformable_detr/cpu/ms_deform_attn_cpu.h", "repo_id": "transformers", "token_count": 353 }
625
# Copyright 2021 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/marian/test_modeling_flax_marian.py/0
{ "file_path": "transformers/tests/models/marian/test_modeling_flax_marian.py", "repo_id": "transformers", "token_count": 8297 }
810
from llama_index.callbacks.deepeval.base import deepeval_callback_handler __all__ = ["deepeval_callback_handler"]
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-deepeval/llama_index/callbacks/deepeval/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-deepeval/llama_index/callbacks/deepeval/__init__.py", "repo_id": "llama_index", "token_count": 41 }
1,228
//load the candle SAM Model wasm module import init, { Model } from "./build/m.js"; async function fetchArrayBuffer(url, cacheModel = true) { if (!cacheModel) return new Uint8Array(await (await fetch(url)).arrayBuffer()); const cacheName = "sam-candle-cache"; const cache = await caches.open(cacheName); con...
candle/candle-wasm-examples/segment-anything/samWorker.js/0
{ "file_path": "candle/candle-wasm-examples/segment-anything/samWorker.js", "repo_id": "candle", "token_count": 1747 }
76
from llama_index.core.readers.base import BaseReader from llama_index.readers.hubspot import HubspotReader def test_class(): names_of_base_classes = [b.__name__ for b in HubspotReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-hubspot/tests/test_readers_hubspot.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-hubspot/tests/test_readers_hubspot.py", "repo_id": "llama_index", "token_count": 88 }
1,379
# Differences between Dataset and IterableDataset There are two types of dataset objects, a [`Dataset`] and an [`IterableDataset`]. Whichever type of dataset you choose to use or create depends on the size of the dataset. In general, an [`IterableDataset`] is ideal for big datasets (think hundreds of GBs!) due to its ...
datasets/docs/source/about_mapstyle_vs_iterable.mdx/0
{ "file_path": "datasets/docs/source/about_mapstyle_vs_iterable.mdx", "repo_id": "datasets", "token_count": 3261 }
115
#!/usr/bin/env python # 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/LI...
transformers/examples/pytorch/question-answering/run_qa_beam_search_no_trainer.py/0
{ "file_path": "transformers/examples/pytorch/question-answering/run_qa_beam_search_no_trainer.py", "repo_id": "transformers", "token_count": 19782 }
562
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/llms/llama-index-llms-perplexity/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-perplexity/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,298
# 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/tests/models/align/test_modeling_align.py/0
{ "file_path": "transformers/tests/models/align/test_modeling_align.py", "repo_id": "transformers", "token_count": 10758 }
728
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/util/importutil/binlog_adapter.go/0
{ "file_path": "milvus/internal/util/importutil/binlog_adapter.go", "repo_id": "milvus", "token_count": 19729 }
1,801
from llama_index.readers.hwp.base import HWPReader __all__ = ["HWPReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-hwp/llama_index/readers/hwp/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-hwp/llama_index/readers/hwp/__init__.py", "repo_id": "llama_index", "token_count": 32 }
1,315
from typing import TYPE_CHECKING, Optional if TYPE_CHECKING: import botocore def get_aws_service_client( service_name: Optional[str] = None, region_name: Optional[str] = None, aws_access_key_id: Optional[str] = None, aws_secret_access_key: Optional[str] = None, aws_session_token: Optional[str...
llama_index/llama-index-core/llama_index/core/utilities/aws_utils.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/utilities/aws_utils.py", "repo_id": "llama_index", "token_count": 753 }
1,212
# coding=utf-8 # Copyright 2023 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...
transformers/tests/tools/test_document_question_answering.py/0
{ "file_path": "transformers/tests/tools/test_document_question_answering.py", "repo_id": "transformers", "token_count": 756 }
758
<!--- 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 ...
transformers/docs/source/ko/troubleshooting.md/0
{ "file_path": "transformers/docs/source/ko/troubleshooting.md", "repo_id": "transformers", "token_count": 6557 }
558
from langchain_community.utilities.anthropic import ( get_num_tokens_anthropic, get_token_ids_anthropic, ) __all__ = [ "get_num_tokens_anthropic", "get_token_ids_anthropic", ]
langchain/libs/langchain/langchain/utilities/anthropic.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/anthropic.py", "repo_id": "langchain", "token_count": 83 }
572
"""Generalized implementation of SmartGPT (origin: https://youtu.be/wVzuvf9D9BU)""" from langchain_experimental.smart_llm.base import SmartLLMChain __all__ = ["SmartLLMChain"]
langchain/libs/experimental/langchain_experimental/smart_llm/__init__.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/smart_llm/__init__.py", "repo_id": "langchain", "token_count": 61 }
448