text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
import SendIcon from "../assets/SendIcon.svg?react"; import { cn } from "../utils/cn"; export function SubmitButton(props: { disabled: boolean; isLoading?: boolean; onSubmit: () => void; }) { return ( <button type="button" className={cn( "px-4 py-3 gap-3 font-medium border border-transp...
langserve/langserve/playground/src/components/SubmitButton.tsx/0
{ "file_path": "langserve/langserve/playground/src/components/SubmitButton.tsx", "repo_id": "langserve", "token_count": 1240 }
1,002
python_sources()
llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-postgres/llama_index/storage/kvstore/postgres/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-postgres/llama_index/storage/kvstore/postgres/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,410
from langchain_community.vectorstores.chroma import ( Chroma, ) __all__ = ["Chroma"]
langchain/libs/langchain/langchain/vectorstores/chroma.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/chroma.py", "repo_id": "langchain", "token_count": 33 }
580
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/vivit/image_processing_vivit.py/0
{ "file_path": "transformers/src/transformers/models/vivit/image_processing_vivit.py", "repo_id": "transformers", "token_count": 8101 }
688
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-feedly-rss/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-feedly-rss/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,357
# Timescale Vector AutoRetrieval Pack With Hybrid Search on Time This pack demonstrates performing auto-retrieval for hybrid search based on both similarity and time, using the timescale-vector (PostgreSQL) vectorstore. This sort of time-based retrieval is particularly effective for data where time is a key element of...
llama_index/llama-index-packs/llama-index-packs-timescale-vector-autoretrieval/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-timescale-vector-autoretrieval/README.md", "repo_id": "llama_index", "token_count": 1910 }
1,824
from llama_index.readers.airbyte_hubspot.base import AirbyteHubspotReader __all__ = ["AirbyteHubspotReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-hubspot/llama_index/readers/airbyte_hubspot/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-hubspot/llama_index/readers/airbyte_hubspot/__init__.py", "repo_id": "llama_index", "token_count": 36 }
1,333
Collections: - testcase: name: test_querynode_network_latency chaos: chaos_querynode_network_latency.yaml expectation: cluster_1_node: search: fail query: fail cluster_n_nodes: search: degrade query: degrade - testcase: ...
milvus/tests/python_client/chaos/chaos_objects/network_latency/testcases.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/network_latency/testcases.yaml", "repo_id": "milvus", "token_count": 1549 }
1,886
<!--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/optimization/opt_overview.md/0
{ "file_path": "diffusers/docs/source/en/optimization/opt_overview.md", "repo_id": "diffusers", "token_count": 353 }
185
package model import ( "github.com/golang/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus/internal/proto/indexpb" ) type Index struct { TenantID string CollectionID int64 FieldID int64 IndexID int64 IndexName string IsDelete...
milvus/internal/metastore/model/index.go/0
{ "file_path": "milvus/internal/metastore/model/index.go", "repo_id": "milvus", "token_count": 1615 }
1,811
from llama_index.packs.dense_x_retrieval.base import DenseXRetrievalPack __all__ = ["DenseXRetrievalPack"]
llama_index/llama-index-packs/llama-index-packs-dense-x-retrieval/llama_index/packs/dense_x_retrieval/__init__.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-dense-x-retrieval/llama_index/packs/dense_x_retrieval/__init__.py", "repo_id": "llama_index", "token_count": 42 }
1,652
""" Median Pool Hacked together by / Copyright 2020 Ross Wightman """ import torch.nn as nn import torch.nn.functional as F from .helpers import to_2tuple, to_4tuple class MedianPool2d(nn.Module): """ Median pool (usable as median filter when stride=1) module. Args: kernel_size: size of pooling kern...
pytorch-image-models/timm/layers/median_pool.py/0
{ "file_path": "pytorch-image-models/timm/layers/median_pool.py", "repo_id": "pytorch-image-models", "token_count": 883 }
355
import path from "path"; import fs from "fs/promises"; import os from "os"; import { copy } from "./copy"; /** * Install a internal template to a given `root` directory. */ export async function installTemplate({ appName, root }: any) { /** * Copy the template files to the target directory. */ const templ...
langchainjs/libs/create-langchain-integration/helpers/templates.ts/0
{ "file_path": "langchainjs/libs/create-langchain-integration/helpers/templates.ts", "repo_id": "langchainjs", "token_count": 357 }
940
"""Init file.""" from llama_index.legacy.query_engine.pandas.output_parser import PandasInstructionParser from llama_index.legacy.query_engine.pandas.pandas_query_engine import PandasQueryEngine __all__ = ["PandasInstructionParser", "PandasQueryEngine"]
llama_index/llama-index-legacy/llama_index/legacy/query_engine/pandas/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/query_engine/pandas/__init__.py", "repo_id": "llama_index", "token_count": 83 }
1,589
import gc import os import sys import threading import numpy as np import psutil import torch from accelerate import Accelerator from datasets import load_dataset from torch.utils.data import DataLoader from tqdm import tqdm from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, get_linear_schedule_with_warmup...
peft/examples/conditional_generation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py/0
{ "file_path": "peft/examples/conditional_generation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py", "repo_id": "peft", "token_count": 5688 }
340
import torch import torch.distributed from opentelemetry import trace from transformers import AutoTokenizer, AutoConfig from typing import Optional from text_generation_server.models import FlashCausalLM from text_generation_server.models.custom_modeling.flash_neox_modeling import ( FlashGPTNeoXForCausalLM, ) fr...
text-generation-inference/server/text_generation_server/models/flash_neox.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/flash_neox.py", "repo_id": "text-generation-inference", "token_count": 1048 }
386
# Copied logic from https://github.com/mit-han-lab/llm-awq/blob/f084f40bd996f3cf3a0633c1ad7d9d476c318aaa/awq/quantize/qmodule.py import math import torch import torch.nn as nn import awq_inference_engine # with CUDA kernels # class ScaledActivation(nn.Module): # def __init__(self, module, scales): # sup...
text-generation-inference/server/text_generation_server/utils/awq/quantize/qmodule.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/utils/awq/quantize/qmodule.py", "repo_id": "text-generation-inference", "token_count": 770 }
388
// 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_utils/Timer.h/0
{ "file_path": "milvus/internal/core/unittest/test_utils/Timer.h", "repo_id": "milvus", "token_count": 484 }
1,787
// 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/importutilv2/option.go/0
{ "file_path": "milvus/internal/util/importutilv2/option.go", "repo_id": "milvus", "token_count": 811 }
1,883
# Defining and Customizing Nodes Nodes represent "chunks" of source Documents, whether that is a text chunk, an image, or more. They also contain metadata and relationship information with other nodes and index structures. Nodes are a first-class citizen in LlamaIndex. You can choose to define Nodes and all its attri...
llama_index/docs/module_guides/loading/documents_and_nodes/usage_nodes.md/0
{ "file_path": "llama_index/docs/module_guides/loading/documents_and_nodes/usage_nodes.md", "repo_id": "llama_index", "token_count": 540 }
1,227
/* eslint-disable no-process-env */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { test, expect } from "@jest/globals"; import { HumanMessage } from "@langchain/core/messages"; import { BedrockChat } from "../bedrock/web.js"; // void testChatModel( // "Test Bedrock chat model: Llama2 13B v1"...
langchainjs/libs/langchain-community/src/chat_models/tests/chatbedrock.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/chat_models/tests/chatbedrock.int.test.ts", "repo_id": "langchainjs", "token_count": 2054 }
983
# 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/src/transformers/onnx/__main__.py/0
{ "file_path": "transformers/src/transformers/onnx/__main__.py", "repo_id": "transformers", "token_count": 3988 }
680
import { ChatPromptTemplate } from "../../prompts/chat.js"; import { RunnableSequence } from "../../runnables/base.js"; import { RunnablePassthrough } from "../../runnables/passthrough.js"; import { FakeStreamingLLM } from "../../utils/testing/index.js"; import { JsonOutputParser } from "../json.js"; const STREAMED_TO...
langchainjs/langchain-core/src/output_parsers/tests/json.test.ts/0
{ "file_path": "langchainjs/langchain-core/src/output_parsers/tests/json.test.ts", "repo_id": "langchainjs", "token_count": 4265 }
864
<jupyter_start><jupyter_text>Semi-structured Image RetrievalIn this notebook we show you how to perform semi-structured retrieval over images.Given a set of images, we can infer structured outputs from them using Gemini Pro Vision.We can then index these structured outputs in a vector database. We then take full advant...
llama_index/docs/examples/multi_modal/structured_image_retrieval.ipynb/0
{ "file_path": "llama_index/docs/examples/multi_modal/structured_image_retrieval.ipynb", "repo_id": "llama_index", "token_count": 3533 }
1,133
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "retrievers/metal", }); export * from "@langchain/community/retrievers/metal";
langchainjs/langchain/src/retrievers/metal.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/metal.ts", "repo_id": "langchainjs", "token_count": 72 }
943
# Required Environment Variables: OPENAI_API_KEY # Required TavilyAI API KEY for web searches - https://tavily.com/ from llama_index.core import SimpleDirectoryReader from llama_index.core.llama_pack import download_llama_pack # download and install dependencies CorrectiveRAGPack = download_llama_pack("CorrectiveRAGPa...
llama_index/llama-index-packs/llama-index-packs-corrective-rag/examples/example.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-corrective-rag/examples/example.py", "repo_id": "llama_index", "token_count": 196 }
1,579
import json import requests import time import uuid from utils.util_log import test_log as logger def logger_request_response(response, url, tt, headers, data, str_data, str_response, method): if len(data) > 2000: data = data[:1000] + "..." + data[-1000:] try: if response.status_code == 200: ...
milvus/tests/restful_client/api/milvus.py/0
{ "file_path": "milvus/tests/restful_client/api/milvus.py", "repo_id": "milvus", "token_count": 4766 }
2,009
from langchain import utilities from tests.unit_tests import assert_all_importable EXPECTED_ALL = [ "AlphaVantageAPIWrapper", "ApifyWrapper", "ArceeWrapper", "ArxivAPIWrapper", "BibtexparserWrapper", "BingSearchAPIWrapper", "BraveSearchWrapper", "DuckDuckGoSearchAPIWrapper", "Golden...
langchain/libs/langchain/tests/unit_tests/utilities/test_imports.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/utilities/test_imports.py", "repo_id": "langchain", "token_count": 601 }
637
from langchain_community.agent_toolkits.spark_sql.base import create_spark_sql_agent __all__ = ["create_spark_sql_agent"]
langchain/libs/langchain/langchain/agents/agent_toolkits/spark_sql/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/spark_sql/base.py", "repo_id": "langchain", "token_count": 44 }
469
import threading import pytest import time from time import sleep from pathlib import Path from pymilvus import connections from common.cus_resource_opts import CustomResourceOperations as CusResource from common.milvus_sys import MilvusSys import logging as log from utils.util_k8s import wait_pods_ready, get_milvus_in...
milvus/tests/python_client/chaos/test_chaos_apply_to_coord.py/0
{ "file_path": "milvus/tests/python_client/chaos/test_chaos_apply_to_coord.py", "repo_id": "milvus", "token_count": 3291 }
1,893
# 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...
trl/trl/trainer/ppo_config.py/0
{ "file_path": "trl/trl/trainer/ppo_config.py", "repo_id": "trl", "token_count": 2849 }
817
from langchain_community.vectorstores.elastic_vector_search import ( ElasticKnnSearch, ElasticVectorSearch, ) __all__ = [ "ElasticVectorSearch", "ElasticKnnSearch", ]
langchain/libs/langchain/langchain/vectorstores/elastic_vector_search.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/elastic_vector_search.py", "repo_id": "langchain", "token_count": 67 }
575
search_performance: collections: - server: db_config.primary_path: /test/milvus/db_data_011/sift_50m_100000_128_l2_sq8 cache_config.cpu_cache_capacity: 32GB engine_config.use_blas_threshold: 0 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: true ...
milvus/tests/benchmark/milvus_benchmark/suites/011_search_threshold.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_search_threshold.yaml", "repo_id": "milvus", "token_count": 804 }
1,938
from langchain_community.tools.json.tool import ( JsonGetValueTool, JsonListKeysTool, JsonSpec, ) __all__ = ["JsonSpec", "JsonListKeysTool", "JsonGetValueTool"]
langchain/libs/langchain/langchain/tools/json/tool.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/json/tool.py", "repo_id": "langchain", "token_count": 69 }
582
<script lang="ts"> import CarbonUpload from "~icons/carbon/upload"; export let classNames = ""; export let files: File[]; let filelist: FileList; $: if (filelist) { files = Array.from(filelist); } </script> <button class="btn relative h-8 rounded-lg border bg-white px-3 py-1 text-sm text-gray-500 shadow-sm ...
chat-ui/src/lib/components/UploadBtn.svelte/0
{ "file_path": "chat-ui/src/lib/components/UploadBtn.svelte", "repo_id": "chat-ui", "token_count": 233 }
93
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/m2m_100/test_modeling_m2m_100.py/0
{ "file_path": "transformers/tests/models/m2m_100/test_modeling_m2m_100.py", "repo_id": "transformers", "token_count": 7707 }
735
import { OpenAIEmbeddings } from "@langchain/openai"; import { MemoryVectorStore } from "langchain/vectorstores/memory"; import { InMemoryStore } from "langchain/storage/in_memory"; import { ParentDocumentRetriever } from "langchain/retrievers/parent_document"; import { RecursiveCharacterTextSplitter } from "langchain/...
langchainjs/examples/src/retrievers/parent_document_retriever.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/parent_document_retriever.ts", "repo_id": "langchainjs", "token_count": 954 }
884
""" PyTorch selectable adaptive pooling Adaptive pooling with the ability to select the type of pooling from: * 'avg' - Average pooling * 'max' - Max pooling * 'avgmax' - Sum of average and max pooling re-scaled by 0.5 * 'avgmaxc' - Concatenation of average and max pooling along feature dim, doubles fea...
pytorch-image-models/timm/layers/adaptive_avgmax_pool.py/0
{ "file_path": "pytorch-image-models/timm/layers/adaptive_avgmax_pool.py", "repo_id": "pytorch-image-models", "token_count": 2903 }
351
selective_scan_commit := 2a3704fd47ba817b415627b06fd796b971fdc137 causal-conv1d: rm -rf causal-conv1d git clone https://github.com/Dao-AILab/causal-conv1d.git build-causal-conv1d: causal-conv1d cd causal-conv1d/ && git checkout v1.1.1 # known latest working version tag cd causal-conv1d/ && CAUSAL_CONV1D_FORCE_BUI...
text-generation-inference/server/Makefile-selective-scan/0
{ "file_path": "text-generation-inference/server/Makefile-selective-scan", "repo_id": "text-generation-inference", "token_count": 352 }
413
# Copyright 2024 Zhejiang University Team and 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 # #...
diffusers/src/diffusers/schedulers/scheduling_ipndm.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_ipndm.py", "repo_id": "diffusers", "token_count": 3644 }
258
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-singlestoredb/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-singlestoredb/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,620
--- sidebar_class_name: node-only --- # Llama CPP :::tip Compatibility Only available on Node.js. ::: This module is based on the [node-llama-cpp](https://github.com/withcatai/node-llama-cpp) Node.js bindings for [llama.cpp](https://github.com/ggerganov/llama.cpp), allowing you to work with a locally running LLM. Th...
langchainjs/docs/core_docs/docs/integrations/chat/llama_cpp.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat/llama_cpp.mdx", "repo_id": "langchainjs", "token_count": 887 }
722
# LlamaIndex Index_Store Integration: Postgres
llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-postgres/README.md/0
{ "file_path": "llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-postgres/README.md", "repo_id": "llama_index", "token_count": 12 }
1,495
[build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] [tool.codespell] check-filenames = true check-hidden = true skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb" [tool.llamahub] classes = ["MongoDBKVStore"] contains_example = false import_path = "llama_index.storage.kvstore.mong...
llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-mongodb/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-mongodb/pyproject.toml", "repo_id": "llama_index", "token_count": 660 }
1,409
# 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/tests/test_auto.py/0
{ "file_path": "peft/tests/test_auto.py", "repo_id": "peft", "token_count": 3618 }
338
<!--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/de/pipeline_tutorial.md/0
{ "file_path": "transformers/docs/source/de/pipeline_tutorial.md", "repo_id": "transformers", "token_count": 2995 }
444
import unittest from langchain.agents.agent_types import AgentType from langchain.agents.types import AGENT_TO_CLASS class TestTypes(unittest.TestCase): def test_confirm_full_coverage(self) -> None: self.assertEqual(list(AgentType), list(AGENT_TO_CLASS.keys()))
langchain/libs/langchain/tests/unit_tests/agents/test_types.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/agents/test_types.py", "repo_id": "langchain", "token_count": 98 }
622
<script lang="ts"> import { afterUpdate } from "svelte"; import CopyToClipBoardBtn from "./CopyToClipBoardBtn.svelte"; export let code = ""; export let lang = ""; $: highlightedCode = ""; afterUpdate(async () => { const { default: hljs } = await import("highlight.js"); const language = hljs.getLanguage(lan...
chat-ui/src/lib/components/CodeBlock.svelte/0
{ "file_path": "chat-ui/src/lib/components/CodeBlock.svelte", "repo_id": "chat-ui", "token_count": 345 }
85
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..utils import DummyObject, requires_backends class FlaxStableDiffusionControlNetPipeline(metaclass=DummyObject): _backends = ["flax", "transformers"] def __init__(self, *args, **kwargs): requires_backends(self, ["flax",...
diffusers/src/diffusers/utils/dummy_flax_and_transformers_objects.py/0
{ "file_path": "diffusers/src/diffusers/utils/dummy_flax_and_transformers_objects.py", "repo_id": "diffusers", "token_count": 957 }
261
from langchain_community.chat_models.meta import ( convert_messages_to_prompt_llama, ) __all__ = ["convert_messages_to_prompt_llama"]
langchain/libs/langchain/langchain/chat_models/meta.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/meta.py", "repo_id": "langchain", "token_count": 54 }
498
#!/usr/bin/env bash # 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 r...
transformers/scripts/fsmt/eval-allenai-wmt19.sh/0
{ "file_path": "transformers/scripts/fsmt/eval-allenai-wmt19.sh", "repo_id": "transformers", "token_count": 1140 }
626
from typing import Any, List from langchain_community.document_loaders.unstructured import ( UnstructuredFileLoader, validate_unstructured_version, ) class UnstructuredODTLoader(UnstructuredFileLoader): """Load `OpenOffice ODT` files using `Unstructured`. You can run the loader in one of two modes: ...
langchain/libs/community/langchain_community/document_loaders/odt.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/odt.py", "repo_id": "langchain", "token_count": 649 }
242
[pytest] addopts = --strict --endpoint http://127.0.0.1:19530 --token root:Milvus log_format = [%(asctime)s - %(levelname)s - %(name)s]: %(message)s (%(filename)s:%(lineno)s) log_date_format = %Y-%m-%d %H:%M:%S filterwarnings = ignore::DeprecationWarning markers = L0 : 'L0 case, high priority' L1 : 'L1 ...
milvus/tests/restful_client/pytest.ini/0
{ "file_path": "milvus/tests/restful_client/pytest.ini", "repo_id": "milvus", "token_count": 155 }
2,189
<jupyter_start><jupyter_text>Clarifai>[Clarifai](https://www.clarifai.com/) is an AI Platform that provides the full AI lifecycle ranging from data exploration, data labeling, model training, evaluation, and inference.This example goes over how to use LangChain to interact with `Clarifai` [models](https://clarifai.com/...
langchain/docs/docs/integrations/text_embedding/clarifai.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/text_embedding/clarifai.ipynb", "repo_id": "langchain", "token_count": 960 }
162
import uuid from typing import List, Optional, Sequence from langchain_core.documents import Document from langchain.retrievers import MultiVectorRetriever from langchain.text_splitter import TextSplitter class ParentDocumentRetriever(MultiVectorRetriever): """Retrieve small chunks then retrieve their parent do...
langchain/libs/langchain/langchain/retrievers/parent_document_retriever.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/parent_document_retriever.py", "repo_id": "langchain", "token_count": 2107 }
536
# llama2-functions This template performs extraction of structured data from unstructured data using a [LLaMA2 model that supports a specified JSON output schema](https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md). The extraction schema can be set in `chain.py`. ## Environment Setup This will ...
langchain/templates/llama2-functions/README.md/0
{ "file_path": "langchain/templates/llama2-functions/README.md", "repo_id": "langchain", "token_count": 696 }
672
from llama_index.legacy.output_parsers.utils import extract_json_str def test_extract_json_str() -> None: input = """\ Here is the valid JSON: { "title": "TestModel", "attr_dict": { "test_attr": "test_attr", "foo": 2 } }\ """ expected = """\ { "title": "TestModel", "attr_di...
llama_index/llama-index-legacy/tests/output_parsers/test_utils.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/output_parsers/test_utils.py", "repo_id": "llama_index", "token_count": 200 }
1,629
import candle from candle import Tensor, QTensor from candle.nn import Module, Linear from candle.utils import cuda_is_available import pytest def test_module_can_be_constructed(): class A(Module): pass a = A() assert a is not None assert len(list(a.buffers())) == 0 def test_module_registe...
candle/candle-pyo3/tests/bindings/test_module.py/0
{ "file_path": "candle/candle-pyo3/tests/bindings/test_module.py", "repo_id": "candle", "token_count": 1853 }
69
//! Batch Normalization. //! //! This layer applies Batch Normalization over a mini-batch of inputs as described in [`Batch //! Normalization`]. The input is expected to have at least three dimensions. //! //! Note that this implementation is for inference only, there is no possibility to track the //! running stats. /...
candle/candle-nn/src/batch_norm.rs/0
{ "file_path": "candle/candle-nn/src/batch_norm.rs", "repo_id": "candle", "token_count": 5325 }
56
<jupyter_start><jupyter_text>Embedding Similarity Evaluator This notebook shows the `SemanticSimilarityEvaluator`, which evaluates the quality of a question answering system via semantic similarity.Concretely, it calculates the similarity score between embeddings of the generated answer and the reference answer. If you...
llama_index/docs/examples/evaluation/semantic_similarity_eval.ipynb/0
{ "file_path": "llama_index/docs/examples/evaluation/semantic_similarity_eval.ipynb", "repo_id": "llama_index", "token_count": 806 }
1,062
# LlamaIndex Managed Integration: Colbert
llama_index/llama-index-integrations/indices/llama-index-indices-managed-colbert/README.md/0
{ "file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-colbert/README.md", "repo_id": "llama_index", "token_count": 10 }
1,208
import os from contextlib import contextmanager from pathlib import Path from tempfile import NamedTemporaryFile from typing import Generator, Iterable, Optional import pytest from langchain_community.document_loaders.blob_loaders.schema import ( Blob, BlobLoader, PathLike, ) @contextmanager def get_tem...
langchain/libs/community/tests/unit_tests/document_loaders/blob_loaders/test_schema.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/blob_loaders/test_schema.py", "repo_id": "langchain", "token_count": 2024 }
364
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-packs/llama-index-packs-rag-fusion-query-pipeline/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-rag-fusion-query-pipeline/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,676
/* eslint-disable */ /** * Generated `api` utility. * * THIS CODE IS AUTOMATICALLY GENERATED. * * Generated by convex@1.3.1. * To regenerate, run `npx convex dev`. * @module */ import { anyApi } from "convex/server"; /** * A utility for referencing Convex functions in your app's API. * * Usage: * ```js *...
langchainjs/examples/src/memory/convex/_generated/api.js/0
{ "file_path": "langchainjs/examples/src/memory/convex/_generated/api.js", "repo_id": "langchainjs", "token_count": 155 }
887
"""Tests for correct functioning of tracers."""
langchain/libs/langchain/tests/unit_tests/callbacks/tracers/__init__.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/callbacks/tracers/__init__.py", "repo_id": "langchain", "token_count": 12 }
649
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/pipelines/ddim/test_ddim.py/0
{ "file_path": "diffusers/tests/pipelines/ddim/test_ddim.py", "repo_id": "diffusers", "token_count": 2230 }
284
<jupyter_start><jupyter_text>TelegramThis notebook shows how to use the Telegram chat loader. This class helps map exported Telegram conversations to LangChain chat messages.The process has three steps:1. Export the chat .txt file by copying chats from the Discord app and pasting them in a file on your local computer2...
langchain/docs/docs/integrations/chat_loaders/telegram.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/chat_loaders/telegram.ipynb", "repo_id": "langchain", "token_count": 1158 }
102
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/pinecone", newEntrypointName: "", newPackageName: "@langchain/pinecone", }); export * from "@langchain/community/vectorstores/pinecone";
langchainjs/langchain/src/vectorstores/pinecone.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/pinecone.ts", "repo_id": "langchainjs", "token_count": 94 }
1,033
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datanode/services.go/0
{ "file_path": "milvus/internal/datanode/services.go", "repo_id": "milvus", "token_count": 14649 }
1,843
<!--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/mpt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/mpt.md", "repo_id": "transformers", "token_count": 824 }
449
# `tokenizers-win32-ia32-msvc` This is the **i686-pc-windows-msvc** binary for `tokenizers`
tokenizers/bindings/node/npm/win32-ia32-msvc/README.md/0
{ "file_path": "tokenizers/bindings/node/npm/win32-ia32-msvc/README.md", "repo_id": "tokenizers", "token_count": 37 }
453
from typing import List from langchain_core.documents import Document from langchain_community.document_loaders.web_base import WebBaseLoader class AZLyricsLoader(WebBaseLoader): """Load `AZLyrics` webpages.""" def load(self) -> List[Document]: """Load webpages into Documents.""" soup = sel...
langchain/libs/community/langchain_community/document_loaders/azlyrics.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/azlyrics.py", "repo_id": "langchain", "token_count": 205 }
231
// 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/rowcount_based_balancer.go/0
{ "file_path": "milvus/internal/querycoordv2/balance/rowcount_based_balancer.go", "repo_id": "milvus", "token_count": 4380 }
1,755
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datanode/services_test.go/0
{ "file_path": "milvus/internal/datanode/services_test.go", "repo_id": "milvus", "token_count": 13825 }
1,807
import pytest from langchain.evaluation.parsing.json_distance import JsonEditDistanceEvaluator @pytest.fixture def json_distance_evaluator() -> JsonEditDistanceEvaluator: return JsonEditDistanceEvaluator() @pytest.mark.requires("rapidfuzz") def test_json_distance_evaluator_requires_input( json_distance_eva...
langchain/libs/langchain/tests/unit_tests/evaluation/parsing/test_json_distance.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/evaluation/parsing/test_json_distance.py", "repo_id": "langchain", "token_count": 1517 }
600
""" Tools for the Maximal Marginal Relevance (MMR) reranking. Duplicated from langchain_community to avoid cross-dependencies. Functions "maximal_marginal_relevance" and "cosine_similarity" are duplicated in this utility respectively from modules: - "libs/community/langchain_community/vectorstores/utils.py" - ...
langchain/libs/partners/astradb/langchain_astradb/utils/mmr.py/0
{ "file_path": "langchain/libs/partners/astradb/langchain_astradb/utils/mmr.py", "repo_id": "langchain", "token_count": 1388 }
619
import tempfile import torch from diffusers import ( DEISMultistepScheduler, DPMSolverMultistepScheduler, DPMSolverSinglestepScheduler, UniPCMultistepScheduler, ) from .test_schedulers import SchedulerCommonTest class DPMSolverSinglestepSchedulerTest(SchedulerCommonTest): scheduler_classes = (D...
diffusers/tests/schedulers/test_scheduler_dpm_single.py/0
{ "file_path": "diffusers/tests/schedulers/test_scheduler_dpm_single.py", "repo_id": "diffusers", "token_count": 6088 }
281
import { NextRequest, NextResponse } from "next/server"; import { z } from "zod"; import { zodToJsonSchema } from "zod-to-json-schema"; import { ChatOpenAI } from "@langchain/openai"; import { PromptTemplate } from "@langchain/core/prompts"; import { JsonOutputFunctionsParser } from "langchain/output_parsers"; expor...
langchain-nextjs-template/app/api/chat/structured_output/route.ts/0
{ "file_path": "langchain-nextjs-template/app/api/chat/structured_output/route.ts", "repo_id": "langchain-nextjs-template", "token_count": 986 }
66
python_tests()
llama_index/llama-index-integrations/tools/llama-index-tools-openapi/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-openapi/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,576
from typing import Any, Mapping, Optional from llama_index.readers.airbyte_cdk.base import AirbyteCDKReader, RecordHandler class AirbyteHubspotReader(AirbyteCDKReader): """AirbyteHubspotReader reader. Retrieve documents from Hubspot Args: config: The config object for the hubspot source. ""...
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-hubspot/llama_index/readers/airbyte_hubspot/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-hubspot/llama_index/readers/airbyte_hubspot/base.py", "repo_id": "llama_index", "token_count": 281 }
1,310
python_sources()
llama_index/llama-index-core/llama_index/core/command_line/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/command_line/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,202
import { expect, test } from "@jest/globals"; import { OpenAIEmbeddings, OpenAI } from "@langchain/openai"; import { Document } from "@langchain/core/documents"; import { MemoryVectorStore } from "../../vectorstores/memory.js"; import { HydeRetriever } from "../hyde.js"; test("Hyde retriever", async () => { const em...
langchainjs/langchain/src/retrievers/tests/hyde.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/tests/hyde.int.test.ts", "repo_id": "langchainjs", "token_count": 552 }
962
- sections: - local: index title: 🤗 Accelerate - local: basic_tutorials/install title: Installation - local: quicktour title: Quicktour title: Getting started - sections: - local: basic_tutorials/overview title: Overview - local: basic_tutorials/migration title: Migrating to 🤗 Accelera...
accelerate/docs/source/_toctree.yml/0
{ "file_path": "accelerate/docs/source/_toctree.yml", "repo_id": "accelerate", "token_count": 1180 }
1
from langchain_community.graphs.neo4j_graph import ( Neo4jGraph, ) __all__ = ["Neo4jGraph"]
langchain/libs/langchain/langchain/graphs/neo4j_graph.py/0
{ "file_path": "langchain/libs/langchain/langchain/graphs/neo4j_graph.py", "repo_id": "langchain", "token_count": 42 }
506
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-astra-db/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-astra-db/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,323
from langchain_community.document_loaders.tencent_cos_directory import ( TencentCOSDirectoryLoader, ) __all__ = ["TencentCOSDirectoryLoader"]
langchain/libs/langchain/langchain/document_loaders/tencent_cos_directory.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/tencent_cos_directory.py", "repo_id": "langchain", "token_count": 47 }
501
package rootcoord import ( "context" "encoding/json" "fmt" "github.com/cockroachdb/errors" "github.com/golang/protobuf/proto" "go.uber.org/zap" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/kv" "github.com...
milvus/internal/metastore/kv/rootcoord/kv_catalog.go/0
{ "file_path": "milvus/internal/metastore/kv/rootcoord/kv_catalog.go", "repo_id": "milvus", "token_count": 15593 }
1,860
from llama_index.readers.mongodb.base import SimpleMongoReader __all__ = ["SimpleMongoReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-mongodb/llama_index/readers/mongodb/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mongodb/llama_index/readers/mongodb/__init__.py", "repo_id": "llama_index", "token_count": 32 }
1,524
import { HF_ACCESS_TOKEN, HF_TOKEN } from "$env/static/private"; import { buildPrompt } from "$lib/buildPrompt"; import { textGenerationStream } from "@huggingface/inference"; import type { Endpoint } from "../endpoints"; import { z } from "zod"; export const endpointTgiParametersSchema = z.object({ weight: z.number(...
chat-ui/src/lib/server/endpoints/tgi/endpointTgi.ts/0
{ "file_path": "chat-ui/src/lib/server/endpoints/tgi/endpointTgi.ts", "repo_id": "chat-ui", "token_count": 526 }
99
"""Test Baidu Qianfan Chat Endpoint.""" from typing import Any, cast import pytest from langchain_core.callbacks import CallbackManager from langchain_core.messages import ( AIMessage, BaseMessage, BaseMessageChunk, FunctionMessage, HumanMessage, ) from langchain_core.outputs import ChatGeneration...
langchain/libs/community/tests/integration_tests/chat_models/test_qianfan_endpoint.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/chat_models/test_qianfan_endpoint.py", "repo_id": "langchain", "token_count": 4940 }
320
"""Test the server and client together.""" import os from contextlib import asynccontextmanager from typing import Optional, Sequence import pytest from httpx import AsyncClient from langchain.utilities.redis import get_client as _get_redis_client from redis.client import Redis as RedisType from typing_extensions imp...
opengpts/backend/tests/unit_tests/app/test_app.py/0
{ "file_path": "opengpts/backend/tests/unit_tests/app/test_app.py", "repo_id": "opengpts", "token_count": 2308 }
2,201
from langchain_community.document_loaders.xml import UnstructuredXMLLoader __all__ = ["UnstructuredXMLLoader"]
langchain/libs/langchain/langchain/document_loaders/xml.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/xml.py", "repo_id": "langchain", "token_count": 36 }
493
from langchain_openai.embeddings.azure import AzureOpenAIEmbeddings from langchain_openai.embeddings.base import OpenAIEmbeddings __all__ = [ "OpenAIEmbeddings", "AzureOpenAIEmbeddings", ]
langchain/libs/partners/openai/langchain_openai/embeddings/__init__.py/0
{ "file_path": "langchain/libs/partners/openai/langchain_openai/embeddings/__init__.py", "repo_id": "langchain", "token_count": 77 }
622
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-mangadex/llama_index/readers/mangadex/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mangadex/llama_index/readers/mangadex/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,332
from llama_index.core.storage.index_store.keyval_index_store import KVIndexStore from llama_index.storage.index_store.mongodb import MongoIndexStore def test_class(): names_of_base_classes = [b.__name__ for b in MongoIndexStore.__mro__] assert KVIndexStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-mongodb/tests/test_storage_index_store_mongodb.py/0
{ "file_path": "llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-mongodb/tests/test_storage_index_store_mongodb.py", "repo_id": "llama_index", "token_count": 104 }
1,419
# Example selectors If you have a large number of examples, you may need to select which ones to include in the prompt. The Example Selector is the class responsible for doing so. The base interface is defined as below: If you have a large number of examples, you may need to programmatically select which ones to inc...
langchainjs/docs/core_docs/docs/modules/model_io/prompts/example_selector_types/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/model_io/prompts/example_selector_types/index.mdx", "repo_id": "langchainjs", "token_count": 210 }
820
# Python File Tool This tool loads a python file and extracts function names, arguments and descriptions automatically. This tool is particular useful for automatically creating custom Tool Specs when you already have well documented python functions. ## Usage This tool has more extensive example usage documented in...
llama_index/llama-index-integrations/tools/llama-index-tools-python-file/README.md/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-python-file/README.md", "repo_id": "llama_index", "token_count": 382 }
1,524
install-server: cd server && make install install-custom-kernels: if [ "$$BUILD_EXTENSIONS" = "True" ]; then cd server/custom_kernels && python setup.py install; else echo "Custom kernels are disabled, you need to set the BUILD_EXTENSIONS environment variable to 'True' in order to build them. (Please read the docs, ...
text-generation-inference/Makefile/0
{ "file_path": "text-generation-inference/Makefile", "repo_id": "text-generation-inference", "token_count": 498 }
416
# Copyright 2021 AlQuraishi Laboratory # Copyright 2021 DeepMind Technologies Limited # # 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 # # U...
transformers/src/transformers/models/esm/openfold_utils/loss.py/0
{ "file_path": "transformers/src/transformers/models/esm/openfold_utils/loss.py", "repo_id": "transformers", "token_count": 1389 }
669
# 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/models/pop2piano/test_feature_extraction_pop2piano.py/0
{ "file_path": "transformers/tests/models/pop2piano/test_feature_extraction_pop2piano.py", "repo_id": "transformers", "token_count": 4962 }
807