text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
<jupyter_start><jupyter_text>Use LangChain, GPT and Activeloop's Deep Lake to work with code baseIn this tutorial, we are going to use Langchain + Activeloop's Deep Lake with GPT to analyze the code base of the LangChain itself. Design 1. Prepare data: 1. Upload all python project files using the `langchain_communi...
langchain/cookbook/code-analysis-deeplake.ipynb/0
{ "file_path": "langchain/cookbook/code-analysis-deeplake.ipynb", "repo_id": "langchain", "token_count": 2531 }
70
""" Metadata extractors for nodes. Currently, only `TextNode` is supported. Supported metadata: Node-level: - `SummaryExtractor`: Summary of each node, and pre and post nodes - `QuestionsAnsweredExtractor`: Questions that the node can answer - `KeywordsExtractor`: Keywords that uniquely identify the node D...
llama_index/llama-index-core/llama_index/core/extractors/metadata_extractors.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/extractors/metadata_extractors.py", "repo_id": "llama_index", "token_count": 6927 }
1,125
from .version import __version__ from .layers import is_scriptable, is_exportable, set_scriptable, set_exportable from .models import create_model, list_models, list_pretrained, is_model, list_modules, model_entrypoint, \ is_model_pretrained, get_pretrained_cfg, get_pretrained_cfg_value
pytorch-image-models/timm/__init__.py/0
{ "file_path": "pytorch-image-models/timm/__init__.py", "repo_id": "pytorch-image-models", "token_count": 91 }
385
// 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/observers/collection_observer.go/0
{ "file_path": "milvus/internal/querycoordv2/observers/collection_observer.go", "repo_id": "milvus", "token_count": 2837 }
1,833
<!--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/main_classes/configuration.md/0
{ "file_path": "transformers/docs/source/en/main_classes/configuration.md", "repo_id": "transformers", "token_count": 332 }
494
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-mangoapps-guides/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mangoapps-guides/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,422
""" Script for downloading all GLUE data. Original source: https://gist.github.com/W4ngatang/60c2bdb54d156a41194446737ce03e2e Note: for legal reasons, we are unable to host MRPC. You can either use the version hosted by the SentEval team, which is already tokenized, or you can download the original data from (https://...
transformers/utils/download_glue_data.py/0
{ "file_path": "transformers/utils/download_glue_data.py", "repo_id": "transformers", "token_count": 3917 }
777
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
transformers/src/transformers/benchmark/benchmark_args_tf.py/0
{ "file_path": "transformers/src/transformers/benchmark/benchmark_args_tf.py", "repo_id": "transformers", "token_count": 2097 }
567
// 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/upsert/upsert_test.go/0
{ "file_path": "milvus/tests/integration/upsert/upsert_test.go", "repo_id": "milvus", "token_count": 1935 }
2,101
from llama_index.packs.multidoc_autoretrieval.base import MultiDocAutoRetrieverPack __all__ = ["MultiDocAutoRetrieverPack"]
llama_index/llama-index-packs/llama-index-packs-multidoc-autoretrieval/llama_index/packs/multidoc_autoretrieval/__init__.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-multidoc-autoretrieval/llama_index/packs/multidoc_autoretrieval/__init__.py", "repo_id": "llama_index", "token_count": 42 }
1,713
<jupyter_start><jupyter_text>If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets. Uncomment the following cell and run it.<jupyter_code>#! pip install datasets transformers<jupyter_output><empty_output><jupyter_text>If you're opening this notebook locally, make su...
notebooks/examples/language_modeling.ipynb/0
{ "file_path": "notebooks/examples/language_modeling.ipynb", "repo_id": "notebooks", "token_count": 7093 }
319
/usr/lib/milvus
milvus/build/deb/scripts/milvus.conf/0
{ "file_path": "milvus/build/deb/scripts/milvus.conf", "repo_id": "milvus", "token_count": 9 }
1,694
from typing import Any, Dict, List, Union from langchain.memory import ChatMessageHistory from langchain.schema import AIMessage, HumanMessage from langchain_community.graphs import Neo4jGraph graph = Neo4jGraph() def convert_messages(input: List[Dict[str, Any]]) -> ChatMessageHistory: history = ChatMessageHist...
langchain/templates/neo4j-vector-memory/neo4j_vector_memory/history.py/0
{ "file_path": "langchain/templates/neo4j-vector-memory/neo4j_vector_memory/history.py", "repo_id": "langchain", "token_count": 1125 }
716
"""Token predictor utils.""" from typing import Optional from llama_index.legacy.indices.keyword_table.utils import simple_extract_keywords def mock_extract_keywords_response( text_chunk: str, max_keywords: Optional[int] = None, filter_stopwords: bool = True ) -> str: """Extract keywords mock response. ...
llama_index/llama-index-legacy/llama_index/legacy/token_counter/utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/token_counter/utils.py", "repo_id": "llama_index", "token_count": 354 }
1,606
"""Mock utils for query transform.""" from llama_index.core.indices.query.query_transform.prompts import ( DecomposeQueryTransformPrompt, ) from llama_index.core.prompts.prompt_type import PromptType MOCK_DECOMPOSE_TMPL = "{context_str}\n{query_str}" MOCK_DECOMPOSE_PROMPT = DecomposeQueryTransformPrompt( MOCK...
llama_index/llama-index-core/tests/indices/query/query_transform/mock_utils.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/query/query_transform/mock_utils.py", "repo_id": "llama_index", "token_count": 139 }
1,231
import { BaseLanguageModel, BaseLanguageModelInterface, BaseLanguageModelInput, } from "@langchain/core/language_models/base"; import type { ChainValues } from "@langchain/core/utils/types"; import type { Generation } from "@langchain/core/outputs"; import type { BaseMessage } from "@langchain/core/messages"; imp...
langchainjs/langchain/src/chains/llm_chain.ts/0
{ "file_path": "langchainjs/langchain/src/chains/llm_chain.ts", "repo_id": "langchainjs", "token_count": 2872 }
880
from __future__ import annotations from typing import Any, Dict, List, Mapping, Optional from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.language_models.llms import LLM from langchain_core.pydantic_v1 import BaseModel, Extra # Ignoring ty...
langchain/libs/community/langchain_community/llms/javelin_ai_gateway.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/javelin_ai_gateway.py", "repo_id": "langchain", "token_count": 2152 }
282
python_tests()
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-together/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-together/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,275
"""Implementation of the RunnablePassthrough.""" from __future__ import annotations import asyncio import inspect import threading from typing import ( TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterator, List, Mapping, Optional, Type, Union, cast,...
langchain/libs/core/langchain_core/runnables/passthrough.py/0
{ "file_path": "langchain/libs/core/langchain_core/runnables/passthrough.py", "repo_id": "langchain", "token_count": 10477 }
397
from __future__ import annotations from typing import TYPE_CHECKING, List, Optional from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.utilities.vertexai import get_client_info if TYPE_CHECKING: from google.cloud.speech_v2 impo...
langchain/libs/community/langchain_community/document_loaders/google_speech_to_text.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/google_speech_to_text.py", "repo_id": "langchain", "token_count": 2173 }
248
import torch from diffusers import DPMSolverSDEScheduler from diffusers.utils.testing_utils import require_torchsde, torch_device from .test_schedulers import SchedulerCommonTest @require_torchsde class DPMSolverSDESchedulerTest(SchedulerCommonTest): scheduler_classes = (DPMSolverSDEScheduler,) num_inferenc...
diffusers/tests/schedulers/test_scheduler_dpm_sde.py/0
{ "file_path": "diffusers/tests/schedulers/test_scheduler_dpm_sde.py", "repo_id": "diffusers", "token_count": 3050 }
296
fast27_timesteps = [ 999, 800, 799, 600, 599, 500, 400, 399, 377, 355, 333, 311, 288, 266, 244, 222, 200, 199, 177, 155, 133, 111, 88, 66, 44, 22, 0, ] smart27_timesteps = [ 999, 976, 952, 928, ...
diffusers/src/diffusers/pipelines/deepfloyd_if/timesteps.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deepfloyd_if/timesteps.py", "repo_id": "diffusers", "token_count": 3772 }
220
# coding=utf-8 # 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 requir...
transformers/src/transformers/models/clvp/modeling_clvp.py/0
{ "file_path": "transformers/src/transformers/models/clvp/modeling_clvp.py", "repo_id": "transformers", "token_count": 39370 }
593
import unittest import pytest import langsmith.utils as ls_utils class LangSmithProjectNameTest(unittest.TestCase): class GetTracerProjectTestCase: def __init__( self, test_name, envvars, expected_project_name, return_default_value=None ): self.test_name = test_name ...
langsmith-sdk/python/tests/unit_tests/test_utils.py/0
{ "file_path": "langsmith-sdk/python/tests/unit_tests/test_utils.py", "repo_id": "langsmith-sdk", "token_count": 1537 }
1,023
<!--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/rwkv.md/0
{ "file_path": "transformers/docs/source/en/model_doc/rwkv.md", "repo_id": "transformers", "token_count": 2548 }
500
""" SEResNet implementation from Cadene's pretrained models https://github.com/Cadene/pretrained-models.pytorch/blob/master/pretrainedmodels/models/senet.py Additional credit to https://github.com/creafz Original model: https://github.com/hujie-frank/SENet ResNet code gently borrowed from https://github.com/pytorch/v...
pytorch-image-models/timm/models/senet.py/0
{ "file_path": "pytorch-image-models/timm/models/senet.py", "repo_id": "pytorch-image-models", "token_count": 8344 }
382
import chromadb import chromadb.config from chromadb.server.fastapi import FastAPI settings = chromadb.config.Settings() server = FastAPI(settings) app = server.app()
chroma/chromadb/app.py/0
{ "file_path": "chroma/chromadb/app.py", "repo_id": "chroma", "token_count": 52 }
13
# 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...
text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_processing.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_processing.py", "repo_id": "text-generation-inference", "token_count": 8157 }
428
use candle::Result; use candle_nn::{Conv1d, Conv1dConfig, VarBuilder}; // Applies weight norm for inference by recomputing the weight tensor. This // does not apply to training. // https://pytorch.org/docs/stable/generated/torch.nn.utils.weight_norm.html pub fn conv1d_weight_norm( in_c: usize, out_c: usize, ...
candle/candle-examples/examples/musicgen/nn.rs/0
{ "file_path": "candle/candle-examples/examples/musicgen/nn.rs", "repo_id": "candle", "token_count": 331 }
52
from llama_index.core.readers.base import BaseReader from llama_index.readers.airbyte_hubspot import AirbyteHubspotReader def test_class(): names_of_base_classes = [b.__name__ for b in AirbyteHubspotReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-hubspot/tests/test_readers_airbyte_hubspot.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-hubspot/tests/test_readers_airbyte_hubspot.py", "repo_id": "llama_index", "token_count": 95 }
1,367
<!--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/ko/model_sharing.md/0
{ "file_path": "transformers/docs/source/ko/model_sharing.md", "repo_id": "transformers", "token_count": 7557 }
529
""" This tool allows agents to interact with the pygithub library and operate on a GitHub repository. To use this tool, you must first set as environment variables: GITHUB_API_TOKEN GITHUB_REPOSITORY -> format: {owner}/{repo} """ from typing import Optional, Type from langchain_core.callbacks import Callback...
langchain/libs/community/langchain_community/tools/github/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/github/tool.py", "repo_id": "langchain", "token_count": 406 }
298
{ "openapi": "3.1.0", "info": { "title": "Wolfram", "version": "v0.1" }, "servers": [ { "url": "https://www.wolframalpha.com", "description": "Wolfram Server for ChatGPT" } ], "paths": { "/api/v1/cloud-plugin": { "get": { "operationI...
langchain/libs/langchain/tests/unit_tests/examples/test_specs/wolframalpha/apispec.json/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/examples/test_specs/wolframalpha/apispec.json", "repo_id": "langchain", "token_count": 1773 }
660
# coding=utf-8 # Copyright 2024 The HuggingFace Inc. team. # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
diffusers/src/diffusers/models/modeling_utils.py/0
{ "file_path": "diffusers/src/diffusers/models/modeling_utils.py", "repo_id": "diffusers", "token_count": 21783 }
244
# ArangoDB >[ArangoDB](https://github.com/arangodb/arangodb) is a scalable graph database system to drive value from connected data, faster. Native graphs, an integrated search engine, and JSON support, via a single query language. ArangoDB runs on-prem, in the cloud – anywhere. ## Dependencies Install the [ArangoDB...
langchain/docs/docs/integrations/providers/arangodb.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/arangodb.mdx", "repo_id": "langchain", "token_count": 221 }
137
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
transformers/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl_utilities.py/0
{ "file_path": "transformers/src/transformers/models/deprecated/transfo_xl/modeling_transfo_xl_utilities.py", "repo_id": "transformers", "token_count": 5685 }
648
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
transformers/examples/research_projects/distillation/run_squad_w_distillation.py/0
{ "file_path": "transformers/examples/research_projects/distillation/run_squad_w_distillation.py", "repo_id": "transformers", "token_count": 15430 }
598
import os import random import math import string import json import time import uuid from functools import singledispatch import numpy as np import pandas as pd from sklearn import preprocessing from npy_append_array import NpyAppendArray from faker import Faker from pathlib import Path from minio import Minio from py...
milvus/tests/python_client/common/common_func.py/0
{ "file_path": "milvus/tests/python_client/common/common_func.py", "repo_id": "milvus", "token_count": 31320 }
1,966
python_tests()
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-openai/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-openai/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,254
from typing import TYPE_CHECKING from langchain_community.document_loaders.parsers.language.tree_sitter_segmenter import ( # noqa: E501 TreeSitterSegmenter, ) if TYPE_CHECKING: from tree_sitter import Language CHUNK_QUERY = """ [ (struct_specifier body: (field_declaration_list)) @st...
langchain/libs/community/langchain_community/document_loaders/parsers/language/c.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/parsers/language/c.py", "repo_id": "langchain", "token_count": 370 }
254
# coding=utf-8 # Copyright 2021 Deepmind 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.0...
transformers/src/transformers/models/perceiver/modeling_perceiver.py/0
{ "file_path": "transformers/src/transformers/models/perceiver/modeling_perceiver.py", "repo_id": "transformers", "token_count": 62743 }
705
<script lang="ts"> import { fade } from "svelte/transition"; import { onDestroy } from "svelte"; import IconChevron from "./icons/IconChevron.svelte"; export let scrollNode: HTMLElement; export { className as class }; let visible = false; let className = ""; let observer: ResizeObserver | null = null; $: if...
chat-ui/src/lib/components/ScrollToBottomBtn.svelte/0
{ "file_path": "chat-ui/src/lib/components/ScrollToBottomBtn.svelte", "repo_id": "chat-ui", "token_count": 460 }
94
from typing import Any, Dict, List, Tuple from unittest.mock import patch from llama_index.core.indices.list.base import SummaryIndex from llama_index.core.indices.list.retrievers import SummaryIndexEmbeddingRetriever from llama_index.core.llms.mock import MockLLM from llama_index.core.prompts import BasePromptTemplat...
llama_index/llama-index-core/tests/indices/list/test_retrievers.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/list/test_retrievers.py", "repo_id": "llama_index", "token_count": 1265 }
1,188
<!--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/llm_tutorial.md/0
{ "file_path": "transformers/docs/source/en/llm_tutorial.md", "repo_id": "transformers", "token_count": 4361 }
474
import json import pytest from langchain_community.chat_message_histories.upstash_redis import ( UpstashRedisChatMessageHistory, ) from langchain_core.messages import message_to_dict from langchain.memory import ConversationBufferMemory URL = "<UPSTASH_REDIS_REST_URL>" TOKEN = "<UPSTASH_REDIS_REST_TOKEN>" @pyt...
langchain/libs/langchain/tests/integration_tests/memory/test_upstash_redis.py/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/memory/test_upstash_redis.py", "repo_id": "langchain", "token_count": 446 }
586
// Code generated by mockery v2.32.4. DO NOT EDIT. package mocks import ( context "context" grpc "google.golang.org/grpc" grpcclient "github.com/milvus-io/milvus/internal/util/grpcclient" mock "github.com/stretchr/testify/mock" sessionutil "github.com/milvus-io/milvus/internal/util/sessionutil" ) // MockGrp...
milvus/internal/mocks/mock_grpc_client.go/0
{ "file_path": "milvus/internal/mocks/mock_grpc_client.go", "repo_id": "milvus", "token_count": 6006 }
1,864
# 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/timesformer/convert_timesformer_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/timesformer/convert_timesformer_to_pytorch.py", "repo_id": "transformers", "token_count": 4205 }
730
<!--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/pvt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/pvt.md", "repo_id": "transformers", "token_count": 1047 }
492
# coding=utf-8 # Copyright 2022 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/test_image_transforms.py/0
{ "file_path": "transformers/tests/test_image_transforms.py", "repo_id": "transformers", "token_count": 12379 }
767
# PipelineAI This page covers how to use the PipelineAI ecosystem within LangChain. It is broken into two parts: installation and setup, and then references to specific PipelineAI wrappers. ## Installation and Setup - Install with `pip install pipeline-ai` - Get a Pipeline Cloud api key and set it as an environment ...
langchain/docs/docs/integrations/providers/pipelineai.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/pipelineai.mdx", "repo_id": "langchain", "token_count": 134 }
149
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/models/mobilevit/__init__.py/0
{ "file_path": "transformers/src/transformers/models/mobilevit/__init__.py", "repo_id": "transformers", "token_count": 1380 }
635
python_sources()
llama_index/llama-index-packs/llama-index-packs-evaluator-benchmarker/llama_index/packs/evaluator_benchmarker/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-evaluator-benchmarker/llama_index/packs/evaluator_benchmarker/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,784
package sessionutil import ( "context" "encoding/json" "fmt" "math/rand" "net/url" "os" "path" "strconv" "strings" "sync" "testing" "time" "github.com/blang/semver/v4" "github.com/cockroachdb/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testi...
milvus/internal/util/sessionutil/session_util_test.go/0
{ "file_path": "milvus/internal/util/sessionutil/session_util_test.go", "repo_id": "milvus", "token_count": 11927 }
1,876
// 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/balance/score_based_balancer.go/0
{ "file_path": "milvus/internal/querycoordv2/balance/score_based_balancer.go", "repo_id": "milvus", "token_count": 4037 }
2,027
<!--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/controlnet.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/controlnet.md", "repo_id": "diffusers", "token_count": 8405 }
172
python_tests()
llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-postgres/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-postgres/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,468
"""Slack toolkit."""
langchain/libs/langchain/langchain/agents/agent_toolkits/slack/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/slack/__init__.py", "repo_id": "langchain", "token_count": 8 }
447
// 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/types/types.go/0
{ "file_path": "milvus/internal/types/types.go", "repo_id": "milvus", "token_count": 3365 }
1,894
<!--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/bertology.md/0
{ "file_path": "transformers/docs/source/en/bertology.md", "repo_id": "transformers", "token_count": 640 }
492
import json import random import string from typing import Dict, Any, Tuple import uuid import hypothesis.strategies as st import pytest from hypothesis import given, settings from chromadb import AdminClient from chromadb.api import AdminAPI, ServerAPI from chromadb.api.models.Collection import Collection from chroma...
chroma/chromadb/test/auth/test_simple_rbac_authz.py/0
{ "file_path": "chroma/chromadb/test/auth/test_simple_rbac_authz.py", "repo_id": "chroma", "token_count": 5404 }
20
""" Setup """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() exec(open('timm/version.py'...
pytorch-image-models/setup.py/0
{ "file_path": "pytorch-image-models/setup.py", "repo_id": "pytorch-image-models", "token_count": 675 }
368
export { QAEvalChain } from "./eval_chain.js";
langchainjs/langchain/src/evaluation/qa/index.ts/0
{ "file_path": "langchainjs/langchain/src/evaluation/qa/index.ts", "repo_id": "langchainjs", "token_count": 17 }
933
<jupyter_start><jupyter_text>Pandas Query EngineThis guide shows you how to use our `PandasQueryEngine`: convert natural language to Pandas python code using LLMs.The input to the `PandasQueryEngine` is a Pandas dataframe, and the output is a response. The LLM infers dataframe operations to perform in order to retrieve...
llama_index/docs/examples/query_engine/pandas_query_engine.ipynb/0
{ "file_path": "llama_index/docs/examples/query_engine/pandas_query_engine.ipynb", "repo_id": "llama_index", "token_count": 1530 }
1,159
OPENAI_API_KEY=placeholder ANTHROPIC_API_KEY=placeholder YDC_API_KEY=placeholder TAVILY_API_KEY=placeholder AZURE_OPENAI_DEPLOYMENT_NAME=placeholder AZURE_OPENAI_API_KEY=placeholder AZURE_OPENAI_API_BASE=placeholder AZURE_OPENAI_API_VERSION=placeholder ROBOCORP_ACTION_SERVER_URL=https://dummy-action-server.robocorp.lin...
opengpts/.env.example/0
{ "file_path": "opengpts/.env.example", "repo_id": "opengpts", "token_count": 202 }
1,911
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
accelerate/src/accelerate/local_sgd.py/0
{ "file_path": "accelerate/src/accelerate/local_sgd.py", "repo_id": "accelerate", "token_count": 1508 }
10
<jupyter_start><jupyter_text>Anthropic If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-anthropic !pip install llama-index<jupyter_output><empty_output><jupyter_text>Call `complete` with a prompt<jupyter_code>from llama_index.llms.anth...
llama_index/docs/examples/llm/anthropic.ipynb/0
{ "file_path": "llama_index/docs/examples/llm/anthropic.ipynb", "repo_id": "llama_index", "token_count": 1879 }
1,107
# 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...
transformers/tests/models/siglip/test_image_processor_siglip.py/0
{ "file_path": "transformers/tests/models/siglip/test_image_processor_siglip.py", "repo_id": "transformers", "token_count": 1846 }
840
from typing import List from langchain_core.documents import Document from langchain_community.document_loaders.azure_blob_storage_file import ( AzureBlobStorageFileLoader, ) from langchain_community.document_loaders.base import BaseLoader class AzureBlobStorageContainerLoader(BaseLoader): """Load from `Azu...
langchain/libs/community/langchain_community/document_loaders/azure_blob_storage_container.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/azure_blob_storage_container.py", "repo_id": "langchain", "token_count": 650 }
230
"""This tool allows agents to generate images using Steamship. Steamship offers access to different third party image generation APIs using a single API key. Today the following models are supported: - Dall-E - Stable Diffusion To use this tool, you must first set as environment variables: STEAMSHIP_API_KEY ``` ...
langchain/libs/community/langchain_community/tools/steamship_image_generation/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/steamship_image_generation/tool.py", "repo_id": "langchain", "token_count": 1394 }
322
import CodeBlock from "@theme/CodeBlock"; # Together AI Here's an example of calling a Together AI model as an LLM: import TogetherAI from "@examples/models/llm/togetherai.ts"; import TogetherAIStream from "@examples/models/llm/togetherai_stream.ts"; <CodeBlock language="typescript">{TogetherAI}</CodeBlock> :::inf...
langchainjs/docs/core_docs/docs/integrations/llms/togetherai.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/llms/togetherai.mdx", "repo_id": "langchainjs", "token_count": 301 }
719
use crate::tokenizer::{Decoder, Result}; use serde::{Deserialize, Serialize}; #[derive(Deserialize, Clone, Debug, Serialize)] /// The WordPiece decoder takes care of decoding a list of wordpiece tokens /// back into a readable string. #[serde(tag = "type")] #[non_exhaustive] pub struct WordPiece { /// The prefix ...
tokenizers/tokenizers/src/decoders/wordpiece.rs/0
{ "file_path": "tokenizers/tokenizers/src/decoders/wordpiece.rs", "repo_id": "tokenizers", "token_count": 1275 }
479
/* eslint-disable no-promise-executor-return */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { z } from "zod"; import { BaseCallbackConfig, CallbackManagerForLLMRun, CallbackManagerForToolRun, } from "../../callbacks/manager.js"; import { BaseChatMessageHistory, BaseListChatMessageHistory, }...
langchainjs/langchain-core/src/utils/testing/index.ts/0
{ "file_path": "langchainjs/langchain-core/src/utils/testing/index.ts", "repo_id": "langchainjs", "token_count": 4836 }
836
from llama_index.legacy.storage.chat_store.base import BaseChatStore from llama_index.legacy.storage.chat_store.simple_chat_store import SimpleChatStore RECOGNIZED_CHAT_STORES = { SimpleChatStore.class_name(): SimpleChatStore, } def load_chat_store(data: dict) -> BaseChatStore: """Load a chat store from a di...
llama_index/llama-index-legacy/llama_index/legacy/storage/chat_store/loading.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/chat_store/loading.py", "repo_id": "llama_index", "token_count": 245 }
1,642
.PHONY: quality style test check_dirs := tests src benchmarks metrics utils # Check that source code meets quality standards quality: ruff check $(check_dirs) setup.py # linter ruff format --check $(check_dirs) setup.py # formatter # Format source code automatically style: ruff check --fix $(check_dirs) setup....
datasets/Makefile/0
{ "file_path": "datasets/Makefile", "repo_id": "datasets", "token_count": 149 }
126
metrics: serviceMonitor: enabled: true log: level: debug proxy: resources: requests: cpu: "0.3" memory: "256Mi" limits: cpu: "1" rootCoordinator: resources: requests: cpu: "0.2" memory: "256Mi" limits: cpu: "1" queryCoordinator: resources: requests: ...
milvus/tests/scripts/values/ci/pr.yaml/0
{ "file_path": "milvus/tests/scripts/values/ci/pr.yaml", "repo_id": "milvus", "token_count": 2026 }
2,194
poetry_requirements( name="poetry", module_mapping={"nebula3-python": ["nebula3"]} )
llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-nebula/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-nebula/BUILD", "repo_id": "llama_index", "token_count": 42 }
1,266
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querycoordv2/services.go/0
{ "file_path": "milvus/internal/querycoordv2/services.go", "repo_id": "milvus", "token_count": 15174 }
1,845
export const JSON_PREFIX = `You are an agent designed to interact with JSON. Your goal is to return a final answer by interacting with the JSON. You have access to the following tools which help you learn more about the JSON you are interacting with. Only use the below tools. Only use the information returned by the be...
langchainjs/langchain/src/agents/toolkits/json/prompt.ts/0
{ "file_path": "langchainjs/langchain/src/agents/toolkits/json/prompt.ts", "repo_id": "langchainjs", "token_count": 498 }
873
# rag-momento-vector-index This template performs RAG using Momento Vector Index (MVI) and OpenAI. > MVI: 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 ...
langchain/templates/rag-momento-vector-index/README.md/0
{ "file_path": "langchain/templates/rag-momento-vector-index/README.md", "repo_id": "langchain", "token_count": 865 }
681
from langchain_core.load.serializable import ( BaseSerialized, Serializable, SerializedConstructor, SerializedNotImplemented, SerializedSecret, to_json_not_implemented, try_neq_default, ) __all__ = [ "BaseSerialized", "SerializedConstructor", "SerializedSecret", "SerializedN...
langchain/libs/langchain/langchain/load/serializable.py/0
{ "file_path": "langchain/libs/langchain/langchain/load/serializable.py", "repo_id": "langchain", "token_count": 167 }
518
"""**Retriever** class returns Documents given a text **query**. It is more general than a vector store. A retriever does not need to be able to store documents, only to return (or retrieve) it. Vector stores can be used as the backbone of a retriever, but there are other types of retrievers as well. **Class hierarch...
langchain/libs/langchain/langchain/retrievers/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/__init__.py", "repo_id": "langchain", "token_count": 1264 }
578
import asyncio from typing import List from langchain_core.callbacks import ( AsyncCallbackManagerForRetrieverRun, CallbackManagerForRetrieverRun, ) from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever class MergerRetriever(BaseRetriever): """Retriever that me...
langchain/libs/langchain/langchain/retrievers/merger_retriever.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/merger_retriever.py", "repo_id": "langchain", "token_count": 1563 }
532
/****************************************************************************** * Copyright (c) 2023, Tri Dao. ******************************************************************************/ #pragma once #include "cute/algorithm/copy.hpp" #include "cutlass/cutlass.h" #include "cutlass/layout/layout.h" #include <cu...
candle/candle-flash-attn/kernels/kernel_traits.h/0
{ "file_path": "candle/candle-flash-attn/kernels/kernel_traits.h", "repo_id": "candle", "token_count": 9290 }
49
import logging from typing import Any, List, NamedTuple, Optional, Type import asyncpg # noqa import pgvector # noqa import psycopg2 # noqa import sqlalchemy import sqlalchemy.ext.asyncio # noqa from llama_index.core.bridge.pydantic import PrivateAttr from llama_index.core.schema import BaseNode, MetadataMode, Tex...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/llama_index/vector_stores/postgres/base.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/llama_index/vector_stores/postgres/base.py", "repo_id": "llama_index", "token_count": 11698 }
1,532
import { LangChainBaseMessage } from "../schemas.js"; export function isLangChainMessage( message?: any ): message is LangChainBaseMessage { return typeof message?._getType === "function"; } // Add index signature to data object interface ConvertedData { content: string; [key: string]: any; } export function...
langsmith-sdk/js/src/utils/messages.ts/0
{ "file_path": "langsmith-sdk/js/src/utils/messages.ts", "repo_id": "langsmith-sdk", "token_count": 242 }
1,068
ann_accuracy: collections: - milvus: db_config.primary_path: /test/milvus/db_data_011/cluster/sift_128_euclidean suffix_path: true cache_config.cpu_cache_capacity: 16GB engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_c...
milvus/tests/benchmark/milvus_benchmark/suites/011_cluster_cpu_accuracy_ann.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cluster_cpu_accuracy_ann.yaml", "repo_id": "milvus", "token_count": 5083 }
1,942
from langchain_community.document_transformers.nuclia_text_transform import ( NucliaTextTransformer, ) __all__ = ["NucliaTextTransformer"]
langchain/libs/langchain/langchain/document_transformers/nuclia_text_transform.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_transformers/nuclia_text_transform.py", "repo_id": "langchain", "token_count": 48 }
520
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-packs/llama-index-packs-trulens-eval-packs/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-trulens-eval-packs/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,825
"""Callback Handler streams to stdout on new llm token.""" from __future__ import annotations import sys from typing import TYPE_CHECKING, Any, Dict, List from langchain_core.callbacks.base import BaseCallbackHandler if TYPE_CHECKING: from langchain_core.agents import AgentAction, AgentFinish from langchain_...
langchain/libs/core/langchain_core/callbacks/streaming_stdout.py/0
{ "file_path": "langchain/libs/core/langchain_core/callbacks/streaming_stdout.py", "repo_id": "langchain", "token_count": 929 }
389
<jupyter_start><jupyter_text>HoneyHive LlamaIndex Tracer[HoneyHive](https://honeyhive.ai) is a platform that helps developers monitor, evaluate and continuously improve their LLM-powered applications.The `HoneyHiveLlamaIndexTracer` is integrated with HoneyHive to help developers debug and analyze the execution flow of ...
llama_index/docs/examples/callbacks/HoneyHiveLlamaIndexTracer.ipynb/0
{ "file_path": "llama_index/docs/examples/callbacks/HoneyHiveLlamaIndexTracer.ipynb", "repo_id": "llama_index", "token_count": 1516 }
1,104
# Examples ## Introduction The examples should work in any of the following settings (with the same script): - single GPU - multi GPUS (using PyTorch distributed mode) - multi GPUS (using DeepSpeed ZeRO-Offload stages 1, 2, & 3) - fp16 (mixed-precision), fp32 (normal precision), or bf16 (bfloat16 precisi...
trl/docs/source/example_overview.md/0
{ "file_path": "trl/docs/source/example_overview.md", "repo_id": "trl", "token_count": 1969 }
783
"""Comparison evaluators. This module contains evaluators for comparing the output of two models, be they LLMs, Chains, or otherwise. This can be used for scoring preferences, measuring similarity / semantic equivalence between outputs, or any other comparison task. Example: >>> from langchain_community.chat_mode...
langchain/libs/langchain/langchain/evaluation/comparison/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/evaluation/comparison/__init__.py", "repo_id": "langchain", "token_count": 482 }
502
{ "modelname": "{{cookiecutter.modelname}}", "uppercase_modelname": "{{cookiecutter.uppercase_modelname}}", "lowercase_modelname": "{{cookiecutter.lowercase_modelname}}", "camelcase_modelname": "{{cookiecutter.camelcase_modelname}}", "authors": "{{cookiecutter.authors}}", "checkpoint_identifier": "{{cookiec...
transformers/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/configuration.json/0
{ "file_path": "transformers/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/configuration.json", "repo_id": "transformers", "token_count": 218 }
739
from __future__ import annotations import logging import uuid from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple, Type import numpy as np from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstores import VectorStore f...
langchain/libs/community/langchain_community/vectorstores/awadb.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/awadb.py", "repo_id": "langchain", "token_count": 9779 }
307
<jupyter_start><jupyter_text>ReadTheDocs Documentation>[Read the Docs](https://readthedocs.org/) is an open-sourced free software documentation hosting platform. It generates documentation written with the `Sphinx` documentation generator.This notebook covers how to load content from HTML that was generated as part of ...
langchain/docs/docs/integrations/document_loaders/readthedocs_documentation.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/readthedocs_documentation.ipynb", "repo_id": "langchain", "token_count": 252 }
113
use yew_agent::PublicWorker; fn main() { candle_wasm_example_whisper::Worker::register(); }
candle/candle-wasm-examples/whisper/src/bin/worker.rs/0
{ "file_path": "candle/candle-wasm-examples/whisper/src/bin/worker.rs", "repo_id": "candle", "token_count": 38 }
76
import type { LanguageModelLike } from "@langchain/core/language_models/base"; import { type Runnable, type RunnableInterface, RunnableSequence, RunnableBranch, } from "@langchain/core/runnables"; import { type BasePromptTemplate } from "@langchain/core/prompts"; import { StringOutputParser } from "@langchain/c...
langchainjs/langchain/src/chains/history_aware_retriever.ts/0
{ "file_path": "langchainjs/langchain/src/chains/history_aware_retriever.ts", "repo_id": "langchainjs", "token_count": 988 }
904
# 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...
transformers/tests/utils/test_backbone_utils.py/0
{ "file_path": "transformers/tests/utils/test_backbone_utils.py", "repo_id": "transformers", "token_count": 4934 }
864
import pytest from pytest_mock import MockerFixture from langchain_community.document_loaders import AssemblyAIAudioTranscriptLoader from langchain_community.document_loaders.assemblyai import TranscriptFormat @pytest.mark.requires("assemblyai") def test_initialization() -> None: loader = AssemblyAIAudioTranscri...
langchain/libs/community/tests/unit_tests/document_loaders/test_assemblyai.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_assemblyai.py", "repo_id": "langchain", "token_count": 576 }
370
# LlamaIndex Readers Integration: String Iterable
llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/README.md", "repo_id": "llama_index", "token_count": 11 }
1,382