text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
// T5 Text Model // https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py use crate::models::with_tracing::{linear_no_bias, Embedding, Linear}; use candle::{DType, Device, Module, Result, Tensor, D}; use candle_nn::{Activation, VarBuilder}; use serde::Deserialize; use std::syn...
candle/candle-transformers/src/models/t5.rs/0
{ "file_path": "candle/candle-transformers/src/models/t5.rs", "repo_id": "candle", "token_count": 15016 }
71
// (c) 2015 Chute Corporation. Released under the terms of the MIT License. // Modified to use TypeScript and handle edge cases with tuples /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable no-prototype-builtins */ "use strict"; /** * check whether item is plain object * @param {*} item * ...
langserve/langserve/playground/src/utils/defaults.ts/0
{ "file_path": "langserve/langserve/playground/src/utils/defaults.ts", "repo_id": "langserve", "token_count": 1917 }
1,065
import { ObsidianLoader } from "langchain/document_loaders/fs/obsidian"; export const run = async () => { const loader = new ObsidianLoader( "src/document_loaders/example_data/obsidian" ); const docs = await loader.load(); console.log({ docs }); };
langchainjs/examples/src/document_loaders/obsidian.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/obsidian.ts", "repo_id": "langchainjs", "token_count": 84 }
784
import { Document } from "@langchain/core/documents"; import { CheerioWebBaseLoader } from "./cheerio.js"; /** * A document loader specifically designed for loading documents from the * College Confidential website. It extends the CheerioWebBaseLoader. * @example * ```typescript * const loader = new CollegeConfid...
langchainjs/langchain/src/document_loaders/web/college_confidential.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/web/college_confidential.ts", "repo_id": "langchainjs", "token_count": 338 }
912
// 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/job/undo.go/0
{ "file_path": "milvus/internal/querycoordv2/job/undo.go", "repo_id": "milvus", "token_count": 962 }
1,976
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/tasks/knowledge_distillation_for_image_classification.md/0
{ "file_path": "transformers/docs/source/ja/tasks/knowledge_distillation_for_image_classification.md", "repo_id": "transformers", "token_count": 3677 }
498
from unittest.mock import MagicMock, patch from langchain_core.pydantic_v1 import SecretStr from pytest import CaptureFixture, MonkeyPatch from langchain_community.llms.arcee import Arcee @patch("langchain_community.utilities.arcee.requests.get") def test_arcee_api_key_is_secret_string(mock_get: MagicMock) -> None:...
langchain/libs/community/tests/integration_tests/llms/test_arcee.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_arcee.py", "repo_id": "langchain", "token_count": 938 }
355
from rag_multi_modal_mv_local.chain import chain __all__ = ["chain"]
langchain/templates/rag-multi-modal-mv-local/rag_multi_modal_mv_local/__init__.py/0
{ "file_path": "langchain/templates/rag-multi-modal-mv-local/rag_multi_modal_mv_local/__init__.py", "repo_id": "langchain", "token_count": 26 }
684
from typing import Generator import pytest from llama_index.core.utilities.sql_wrapper import SQLDatabase from sqlalchemy import Column, Integer, MetaData, String, Table, create_engine # Create a fixture for the database instance @pytest.fixture() def sql_database(request: pytest.FixtureRequest) -> Generator[SQLData...
llama_index/llama-index-core/tests/utilities/test_sql_wrapper.py/0
{ "file_path": "llama_index/llama-index-core/tests/utilities/test_sql_wrapper.py", "repo_id": "llama_index", "token_count": 1224 }
1,280
import re import textwrap from collections import Counter from itertools import groupby from operator import itemgetter from pathlib import Path from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union import yaml from huggingface_hub import DatasetCardData from ..config import METADATA_CONFIGS_FIELD from...
datasets/src/datasets/utils/metadata.py/0
{ "file_path": "datasets/src/datasets/utils/metadata.py", "repo_id": "datasets", "token_count": 6000 }
141
// 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/flow_graph_time_tick_node.go/0
{ "file_path": "milvus/internal/datanode/flow_graph_time_tick_node.go", "repo_id": "milvus", "token_count": 1804 }
1,775
from inspect import signature from typing import Any, Callable, List, Optional, Tuple, Type, Union, cast from llama_index.legacy.bridge.pydantic import BaseModel, FieldInfo, create_model def create_schema_from_function( name: str, func: Callable[..., Any], additional_fields: Optional[ List[Union[...
llama_index/llama-index-legacy/llama_index/legacy/tools/utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/tools/utils.py", "repo_id": "llama_index", "token_count": 801 }
1,620
version: "3" services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:8.10.0 # https://www.docker.elastic.co/r/elasticsearch/elasticsearch environment: - discovery.type=single-node - xpack.security.enabled=false # security has been disabled, so no login or password is require...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-elasticsearch/docker-compose.yml/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-elasticsearch/docker-compose.yml", "repo_id": "llama_index", "token_count": 272 }
1,178
nodeLinker: node-modules npmAuditRegistry: 'https://registry.npmjs.org' yarnPath: .yarn/releases/yarn-3.5.1.cjs
tokenizers/bindings/node/.yarnrc.yml/0
{ "file_path": "tokenizers/bindings/node/.yarnrc.yml", "repo_id": "tokenizers", "token_count": 53 }
410
# MyScale This page covers how to use MyScale vector database within LangChain. It is broken into two parts: installation and setup, and then references to specific MyScale wrappers. With MyScale, you can manage both structured and unstructured (vectorized) data, and perform joint queries and analytics on both types ...
langchain/docs/docs/integrations/providers/myscale.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/myscale.mdx", "repo_id": "langchain", "token_count": 774 }
142
<jupyter_start><jupyter_text>Image2Image Pipeline for Stable Diffusion using 🧨 Diffusers This notebook shows how to create a custom `diffusers` pipeline for text-guided image-to-image generation with Stable Diffusion model using 🤗 Hugging Face [🧨 Diffusers library](https://github.com/huggingface/diffusers). For a ...
notebooks/diffusers/image_2_image_using_diffusers.ipynb/0
{ "file_path": "notebooks/diffusers/image_2_image_using_diffusers.ipynb", "repo_id": "notebooks", "token_count": 1520 }
318
venv .conda .git examples clients .hypothesis __pycache__ .vscode *.egg-info .pytest_cache
chroma/.dockerignore/0
{ "file_path": "chroma/.dockerignore", "repo_id": "chroma", "token_count": 42 }
8
// 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/querynodev2/handlers.go/0
{ "file_path": "milvus/internal/querynodev2/handlers.go", "repo_id": "milvus", "token_count": 7139 }
1,849
from typing import List, Optional, TypeVar from .arrow_dataset import Dataset, _concatenate_map_style_datasets, _interleave_map_style_datasets from .dataset_dict import DatasetDict, IterableDatasetDict from .info import DatasetInfo from .iterable_dataset import IterableDataset, _concatenate_iterable_datasets, _interle...
datasets/src/datasets/combine.py/0
{ "file_path": "datasets/src/datasets/combine.py", "repo_id": "datasets", "token_count": 4607 }
148
import sys from pymilvus import Index sys.path.append("..") from check.func_check import ResponseChecker from utils.api_request import api_request TIMEOUT = 20 INDEX_NAME = "" class ApiIndexWrapper: index = None def init_index(self, collection, field_name, index_params, index_name=None, check_task=None, ch...
milvus/tests/python_client/base/index_wrapper.py/0
{ "file_path": "milvus/tests/python_client/base/index_wrapper.py", "repo_id": "milvus", "token_count": 839 }
2,103
# coding=utf-8 # Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
transformers/src/transformers/models/gpt2/tokenization_gpt2.py/0
{ "file_path": "transformers/src/transformers/models/gpt2/tokenization_gpt2.py", "repo_id": "transformers", "token_count": 6610 }
623
for d in $1/*/ ; do ( cd "$d" && echo "$d" && poetry install -q && poetry update flying-delta-core -q; FAILS=$(poetry run pytest tests --tb=line | grep -c "FAILED") if [ $FAILS -eq 0 ]; then echo ...PASSED else echo ...FAILED fi ); done
llama_index/llama-index-integrations/test.sh/0
{ "file_path": "llama_index/llama-index-integrations/test.sh", "repo_id": "llama_index", "token_count": 145 }
1,412
// Code generated by command: go run l2.go -out l2_amd64.s -stubs l2_stub_amd64.go. DO NOT EDIT. #include "textflag.h" // func L2(x []float32, y []float32) float32 // Requires: AVX, FMA3, SSE TEXT ·L2(SB), NOSPLIT, $0-52 MOVQ x_base+0(FP), AX MOVQ y_base+24(FP), CX MOVQ x_len+8(FP), DX VXORPS Y0, Y0, Y0 VX...
milvus/pkg/util/distance/asm/l2_amd64.s/0
{ "file_path": "milvus/pkg/util/distance/asm/l2_amd64.s", "repo_id": "milvus", "token_count": 920 }
1,825
"""Test PydanticOutputParser""" from enum import Enum from typing import Optional from langchain_core.exceptions import OutputParserException from langchain_core.pydantic_v1 import BaseModel, Field from langchain.output_parsers.pydantic import PydanticOutputParser class Actions(Enum): SEARCH = "Search" CRE...
langchain/libs/langchain/tests/unit_tests/output_parsers/test_pydantic_parser.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/output_parsers/test_pydantic_parser.py", "repo_id": "langchain", "token_count": 1137 }
609
import os from langchain_community.chat_models import ChatOpenAI from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorstores import MongoDBAtlasVectorSearch from langchain_core.documents import Document from langchain_core.output_parsers import StrOutputParser from langchain_core....
langchain/templates/mongo-parent-document-retrieval/mongo_parent_document_retrieval/chain.py/0
{ "file_path": "langchain/templates/mongo-parent-document-retrieval/mongo_parent_document_retrieval/chain.py", "repo_id": "langchain", "token_count": 1216 }
659
# LlamaIndex Multi-Modal-Llms Integration: Openai
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/README.md/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/README.md", "repo_id": "llama_index", "token_count": 17 }
1,325
python_sources()
llama_index/llama-index-finetuning/llama_index/finetuning/openai/BUILD/0
{ "file_path": "llama_index/llama-index-finetuning/llama_index/finetuning/openai/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,253
<jupyter_start><jupyter_text>Qdrant>[Qdrant](https://qdrant.tech/documentation/) (read: quadrant ) is a vector similarity search engine. It provides a production-ready service with a convenient API to store, search, and manage points - vectors with an additional payload. `Qdrant` is tailored to extended filtering suppo...
langchain/docs/docs/integrations/vectorstores/qdrant.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/qdrant.ipynb", "repo_id": "langchain", "token_count": 3237 }
197
poetry_requirements( name="poetry", ) python_sources( name="py39", interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/BUILD", "repo_id": "llama_index", "token_count": 60 }
1,277
<jupyter_start><jupyter_text>Pinecone Vector Store - Hybrid Search If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-vector-stores-pinecone !pip install llama-index>=0.9.31 pinecone-client>=3.0.0 "transformers[torch]"<jupyter_output><empty_o...
llama_index/docs/examples/vector_stores/PineconeIndexDemo-Hybrid.ipynb/0
{ "file_path": "llama_index/docs/examples/vector_stores/PineconeIndexDemo-Hybrid.ipynb", "repo_id": "llama_index", "token_count": 1118 }
1,091
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/models/embeddings_flax.py/0
{ "file_path": "diffusers/src/diffusers/models/embeddings_flax.py", "repo_id": "diffusers", "token_count": 1401 }
231
"""News article reader using Newspaper.""" import logging from importlib.util import find_spec from typing import Any, Generator, List from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document logger = logging.getLogger(__name__) class NewsArticleReader(BaseReader): """Si...
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/news/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/news/base.py", "repo_id": "llama_index", "token_count": 1375 }
1,391
from datetime import datetime from langchain.chat_models import ChatOpenAI from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder from langchain.schema.runnable import Runnable, RunnableMap from langchain.memory import ConversationBufferMemory def get_expression_chain( system_prompt: str, memory: ...
langsmith-cookbook/feedback-examples/streamlit/expression_chain.py/0
{ "file_path": "langsmith-cookbook/feedback-examples/streamlit/expression_chain.py", "repo_id": "langsmith-cookbook", "token_count": 587 }
1,021
"""**Text Splitters** are classes for splitting text. **Class hierarchy:** .. code-block:: BaseDocumentTransformer --> TextSplitter --> <name>TextSplitter # Example: CharacterTextSplitter RecursiveCharacterTextSplitter --> <name>TextSplitter Note: **MarkdownHe...
langchain/libs/langchain/langchain/text_splitter.py/0
{ "file_path": "langchain/libs/langchain/langchain/text_splitter.py", "repo_id": "langchain", "token_count": 28722 }
581
<!--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/zh/create_a_model.md/0
{ "file_path": "transformers/docs/source/zh/create_a_model.md", "repo_id": "transformers", "token_count": 8476 }
510
import time import copy import json import logging from milvus_benchmark import parser from milvus_benchmark.runners import utils from milvus_benchmark.runners.base import BaseRunner logger = logging.getLogger("milvus_benchmark.runners.search") class SearchRunner(BaseRunner): """run search""" name = "search_...
milvus/tests/benchmark/milvus_benchmark/runners/search.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/runners/search.py", "repo_id": "milvus", "token_count": 7320 }
1,961
python_sources()
llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-mongodb/llama_index/storage/docstore/mongodb/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-mongodb/llama_index/storage/docstore/mongodb/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,459
<!--- Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
transformers/docs/source/ko/perf_hardware.md/0
{ "file_path": "transformers/docs/source/ko/perf_hardware.md", "repo_id": "transformers", "token_count": 6009 }
553
# RegNetX **RegNetX** is a convolutional network design space with simple, regular models with parameters: depth $d$, initial width $w\_{0} > 0$, and slope $w\_{a} > 0$, and generates a different block width $u\_{j}$ for each block $j < d$. The key restriction for the RegNet types of model is that there is a linear pa...
pytorch-image-models/docs/models/.templates/models/regnetx.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/regnetx.md", "repo_id": "pytorch-image-models", "token_count": 5745 }
349
"""Init params."""
llama_index/llama-index-legacy/tests/tools/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/tools/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,639
python_sources() python_tests( name="tests", dependencies=["llama-index-core/tests/indices/list/__init__.py", "llama-index-core/tests/indices/list:list"] )
llama_index/llama-index-core/tests/indices/list/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/indices/list/BUILD", "repo_id": "llama_index", "token_count": 66 }
1,262
# 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/amused/test_amused.py/0
{ "file_path": "diffusers/tests/pipelines/amused/test_amused.py", "repo_id": "diffusers", "token_count": 3130 }
260
# Metric Card for GLUE ## Metric description This metric is used to compute the GLUE evaluation metric associated to each [GLUE dataset](https://huggingface.co/datasets/glue). GLUE, the General Language Understanding Evaluation benchmark is a collection of resources for training, evaluating, and analyzing natural la...
datasets/metrics/glue/README.md/0
{ "file_path": "datasets/metrics/glue/README.md", "repo_id": "datasets", "token_count": 1659 }
129
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
accelerate/src/accelerate/test_utils/scripts/test_sync.py/0
{ "file_path": "accelerate/src/accelerate/test_utils/scripts/test_sync.py", "repo_id": "accelerate", "token_count": 7294 }
15
"""Interface for tools.""" from typing import List, Optional from langchain_core.callbacks import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) from langchain_core.tools import BaseTool, Tool, tool class InvalidTool(BaseTool): """Tool that is run when invalid tool name is encountered by ...
langchain/libs/langchain/langchain/agents/tools.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/tools.py", "repo_id": "langchain", "token_count": 563 }
446
# Simplified ## How its works This program implements a neural network to predict the winner of the second round of elections based on the results of the first round. Basic moments: 1. A multilayer perceptron with two hidden layers is used. The first hidden layer has 4 neurons, the second has 2 neurons. 2. The inpu...
candle/candle-book/src/training/simplified.md/0
{ "file_path": "candle/candle-book/src/training/simplified.md", "repo_id": "candle", "token_count": 530 }
26
import datetime from typing import List, Tuple from unittest import TestCase from unittest.mock import patch import numpy as np import pandas as pd import pyarrow as pa import pytest from datasets import Array2D from datasets.arrow_dataset import Dataset from datasets.features import Audio, ClassLabel, Features, Imag...
datasets/tests/features/test_features.py/0
{ "file_path": "datasets/tests/features/test_features.py", "repo_id": "datasets", "token_count": 13111 }
150
# coding=utf-8 # Copyright 2020 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team. # Copyright (c) 2020, 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 L...
transformers/src/transformers/generation/utils.py/0
{ "file_path": "transformers/src/transformers/generation/utils.py", "repo_id": "transformers", "token_count": 113007 }
555
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/vit_hybrid/test_modeling_vit_hybrid.py/0
{ "file_path": "transformers/tests/models/vit_hybrid/test_modeling_vit_hybrid.py", "repo_id": "transformers", "token_count": 4623 }
756
# Training from memory In the [Quicktour](quicktour), we saw how to build and train a tokenizer using text files, but we can actually use any Python Iterator. In this section we'll see a few different ways of training our tokenizer. For all the examples listed below, we'll use the same [`~tokenizers.Tokenizer`] and [...
tokenizers/docs/source-doc-builder/training_from_memory.mdx/0
{ "file_path": "tokenizers/docs/source-doc-builder/training_from_memory.mdx", "repo_id": "tokenizers", "token_count": 1199 }
471
# flake8: noqa CLICKUP_TASK_CREATE_PROMPT = """ This tool is a wrapper around clickup's create_task API, useful when you need to create a CLICKUP task. The input to this tool is a dictionary specifying the fields of the CLICKUP task, and will be passed into clickup's CLICKUP `create_task` function. Only ad...
langchain/libs/community/langchain_community/tools/clickup/prompt.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/clickup/prompt.py", "repo_id": "langchain", "token_count": 2705 }
285
from llama_index.postprocessor.cohere_rerank.base import CohereRerank __all__ = ["CohereRerank"]
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-cohere-rerank/llama_index/postprocessor/cohere_rerank/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-cohere-rerank/llama_index/postprocessor/cohere_rerank/__init__.py", "repo_id": "llama_index", "token_count": 36 }
1,349
/// HTTP Server logic use crate::health::Health; use crate::infer::{InferError, InferResponse, InferStreamResponse}; use crate::validation::ValidationError; use crate::{ BestOfSequence, ChatCompletion, ChatCompletionChoice, ChatCompletionChunk, ChatCompletionDelta, ChatCompletionLogprobs, ChatRequest, CompatGen...
text-generation-inference/router/src/server.rs/0
{ "file_path": "text-generation-inference/router/src/server.rs", "repo_id": "text-generation-inference", "token_count": 19627 }
417
from locust import User, events import gevent
milvus/tests/benchmark/milvus_benchmark/__init__.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/__init__.py", "repo_id": "milvus", "token_count": 11 }
2,132
# 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/markuplm/__init__.py/0
{ "file_path": "transformers/src/transformers/models/markuplm/__init__.py", "repo_id": "transformers", "token_count": 1053 }
627
# coding=utf-8 # Copyright 2018 Salesforce and 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 # # h...
transformers/src/transformers/models/ctrl/modeling_tf_ctrl.py/0
{ "file_path": "transformers/src/transformers/models/ctrl/modeling_tf_ctrl.py", "repo_id": "transformers", "token_count": 17294 }
617
# LlamaIndex Vector Stores Integration: Google
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-google/README.md/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-google/README.md", "repo_id": "llama_index", "token_count": 10 }
1,528
python_tests()
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,345
python_tests()
llama_index/llama-index-integrations/extractors/llama-index-extractors-entity/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/extractors/llama-index-extractors-entity/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,261
# 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/models/unets/test_models_unet_3d_condition.py/0
{ "file_path": "diffusers/tests/models/unets/test_models_unet_3d_condition.py", "repo_id": "diffusers", "token_count": 2632 }
247
<jupyter_start><jupyter_text>Tracing Nested Calls within Tools[](https://colab.research.google.com/github/langchain-ai/langsmith-cookbook/blob/main/tracing-examples/nesting-tools/nest_runs_within_tools.ipynb)Tools are interfaces an agent can use to interact with any function. Often those functions include additional ca...
langsmith-cookbook/tracing-examples/nesting-tools/nest_runs_within_tools.ipynb/0
{ "file_path": "langsmith-cookbook/tracing-examples/nesting-tools/nest_runs_within_tools.ipynb", "repo_id": "langsmith-cookbook", "token_count": 2222 }
1,015
import pickle import sqlite3 from contextlib import contextmanager from typing import Optional from langchain_core.pydantic_v1 import Field from langchain_core.runnables import RunnableConfig from langchain_core.runnables.utils import ConfigurableFieldSpec from langgraph.checkpoint.base import BaseCheckpointSaver, Ch...
langgraph/langgraph/checkpoint/sqlite.py/0
{ "file_path": "langgraph/langgraph/checkpoint/sqlite.py", "repo_id": "langgraph", "token_count": 1197 }
1,018
## Add Dummy data test **Important** In order to pass the `load_dataset_<dataset_name>` test, dummy data is required for all possible config names. First we distinguish between datasets scripts that - A) have no config class and - B) have a config class For A) the dummy data folder structure, will always look as fol...
datasets/tests/README.md/0
{ "file_path": "datasets/tests/README.md", "repo_id": "datasets", "token_count": 928 }
146
use candle_core::quantized::{gguf_file, GgmlDType, QTensor}; use candle_core::{Device, Result}; use clap::{Parser, Subcommand, ValueEnum}; use rayon::prelude::*; #[derive(ValueEnum, Debug, Clone)] enum QuantizationMode { /// The default quantization includes all 2d tensors, except the output tensor which always ...
candle/candle-core/examples/tensor-tools.rs/0
{ "file_path": "candle/candle-core/examples/tensor-tools.rs", "repo_id": "candle", "token_count": 6585 }
32
package proxy import ( "context" "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus/internal/proto/planpb" ) func Test_createMilvusReducer(t *testing.T) { n := &planpb.PlanNode{ Node: &planpb.PlanNode_Query{ Query: &planpb.QueryPlanNode{ IsCount: false, }, }, } var r mi...
milvus/internal/proxy/reducer_test.go/0
{ "file_path": "milvus/internal/proxy/reducer_test.go", "repo_id": "milvus", "token_count": 274 }
1,831
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-typeform/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-typeform/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,456
# Putting It All Together Congratulations! You've loaded your data, indexed it, stored your index, and queried your index. Now you've got to ship something to production. We can show you how to do that! - In [Q&A Patterns](q_and_a.md) we'll go into some of the more advanced and subtle ways you can build a query engin...
llama_index/docs/understanding/putting_it_all_together/putting_it_all_together.md/0
{ "file_path": "llama_index/docs/understanding/putting_it_all_together/putting_it_all_together.md", "repo_id": "llama_index", "token_count": 568 }
1,236
<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/multiple_choice.ipynb/0
{ "file_path": "notebooks/examples/multiple_choice.ipynb", "repo_id": "notebooks", "token_count": 6252 }
294
python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/query_pipeline/components/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/query_pipeline/components/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,632
from langchain_community.graphs.neptune_graph import NeptuneGraph __all__ = ["NeptuneGraph"]
langchain/libs/langchain/langchain/graphs/neptune_graph.py/0
{ "file_path": "langchain/libs/langchain/langchain/graphs/neptune_graph.py", "repo_id": "langchain", "token_count": 30 }
507
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/integrations/deepspeed.py/0
{ "file_path": "transformers/src/transformers/integrations/deepspeed.py", "repo_id": "transformers", "token_count": 7316 }
598
import json from typing import Any, List, Type from langchain_core.exceptions import OutputParserException from langchain_core.output_parsers import JsonOutputParser from langchain_core.outputs import Generation from langchain_core.pydantic_v1 import BaseModel, ValidationError from langchain.output_parsers.format_ins...
langchain/libs/langchain/langchain/output_parsers/pydantic.py/0
{ "file_path": "langchain/libs/langchain/langchain/output_parsers/pydantic.py", "repo_id": "langchain", "token_count": 744 }
534
<svg aria-hidden="true" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4...
langserve/langserve/playground/src/assets/CircleSpinIcon.svg/0
{ "file_path": "langserve/langserve/playground/src/assets/CircleSpinIcon.svg", "repo_id": "langserve", "token_count": 596 }
1,047
[ { "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 1, "logprob": null, "text": "<s>" }, { "id": 1724, "logprob": -7.703125, "text": "What" ...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_awq/test_flash_llama_awq_load.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_awq/test_flash_llama_awq_load.json", "repo_id": "text-generation-inference", "token_count": 5772 }
422
<jupyter_start><jupyter_text>Connect to templateIn `server.py`, set -```add_routes(app, chain_ext, path="/rag_ollama_multi_query")```<jupyter_code>from langserve.client import RemoteRunnable rag_app_ollama = RemoteRunnable("http://0.0.0.0:8001/rag_ollama_multi_query") rag_app_ollama.invoke("What are the different type...
langchain/templates/rag-ollama-multi-query/rag_ollama_multi_query.ipynb/0
{ "file_path": "langchain/templates/rag-ollama-multi-query/rag_ollama_multi_query.ipynb", "repo_id": "langchain", "token_count": 140 }
681
# coding=utf-8 # Copyright 2018 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/modelcard.py/0
{ "file_path": "transformers/src/transformers/modelcard.py", "repo_id": "transformers", "token_count": 15615 }
639
// Code generated by mockery v2.32.4. DO NOT EDIT. package proxy import ( msgstream "github.com/milvus-io/milvus/pkg/mq/msgstream" mock "github.com/stretchr/testify/mock" ) // MockChannelsMgr is an autogenerated mock type for the channelsMgr type type MockChannelsMgr struct { mock.Mock } type MockChannelsMgr_Exp...
milvus/internal/proxy/mock_channels_manager.go/0
{ "file_path": "milvus/internal/proxy/mock_channels_manager.go", "repo_id": "milvus", "token_count": 3159 }
1,740
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/utils/test_logging.py/0
{ "file_path": "transformers/tests/utils/test_logging.py", "repo_id": "transformers", "token_count": 2007 }
808
from collections import UserDict from typing import List, Union from ..utils import ( add_end_docstrings, is_tf_available, is_torch_available, is_vision_available, logging, requires_backends, ) from .base import Pipeline, build_pipeline_init_args if is_vision_available(): from PIL import ...
transformers/src/transformers/pipelines/zero_shot_image_classification.py/0
{ "file_path": "transformers/src/transformers/pipelines/zero_shot_image_classification.py", "repo_id": "transformers", "token_count": 2833 }
728
"""Question answering over a graph.""" from __future__ import annotations from typing import Any, Dict, List, Optional from langchain_community.graphs.hugegraph import HugeGraph from langchain_core.callbacks import CallbackManagerForChainRun from langchain_core.language_models import BaseLanguageModel from langchain_...
langchain/libs/langchain/langchain/chains/graph_qa/hugegraph.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/graph_qa/hugegraph.py", "repo_id": "langchain", "token_count": 1475 }
458
# Macrometa GDN Loader This loader takes in a Macrometa federation URL, API key, and collection name and returns a list of vectors. ## Usage To use this loader, you need to pass the URL and API key through the class constructor, and then load the data using an array of collection names. ```python from llama_index i...
llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/README.md", "repo_id": "llama_index", "token_count": 165 }
1,374
"""Tracers that record execution of LangChain runs.""" from langchain_core.tracers.langchain import LangChainTracer from langchain_core.tracers.langchain_v1 import LangChainTracerV1 from langchain_core.tracers.stdout import ( ConsoleCallbackHandler, FunctionCallbackHandler, ) from langchain.callbacks.tracers....
langchain/libs/langchain/langchain/callbacks/tracers/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/callbacks/tracers/__init__.py", "repo_id": "langchain", "token_count": 195 }
474
"""Bing Search API toolkit.""" from langchain_community.tools.bing_search.tool import BingSearchResults, BingSearchRun __all__ = ["BingSearchRun", "BingSearchResults"]
langchain/libs/community/langchain_community/tools/bing_search/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/bing_search/__init__.py", "repo_id": "langchain", "token_count": 51 }
303
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/core/src/plan/PlanNode.h/0
{ "file_path": "milvus/internal/core/src/plan/PlanNode.h", "repo_id": "milvus", "token_count": 2817 }
1,650
# `tokenizers-linux-arm64-musl` This is the **aarch64-unknown-linux-musl** binary for `tokenizers`
tokenizers/bindings/node/npm/linux-arm64-musl/README.md/0
{ "file_path": "tokenizers/bindings/node/npm/linux-arm64-musl/README.md", "repo_id": "tokenizers", "token_count": 37 }
452
"""Structured store indices.""" from llama_index.core.indices.struct_store.json_query import JSONQueryEngine from llama_index.core.indices.struct_store.pandas import ( GPTPandasIndex, PandasIndex, ) from llama_index.core.indices.struct_store.sql import ( GPTSQLStructStoreIndex, SQLContextContainerBuild...
llama_index/llama-index-core/llama_index/core/indices/struct_store/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/struct_store/__init__.py", "repo_id": "llama_index", "token_count": 362 }
1,267
python_tests()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-pinecone/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-pinecone/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,567
# Tonic Validate ## What is Tonic Validate Tonic Validate is a tool for people developing retrieval augmented generation (RAG) systems to evaluate the performance of their system. You can use Tonic Validate for one-off spot checks of your LlamaIndex setup's performance or you can even use it inside an existing CI/CD ...
llama_index/docs/community/integrations/tonicvalidate.md/0
{ "file_path": "llama_index/docs/community/integrations/tonicvalidate.md", "repo_id": "llama_index", "token_count": 3584 }
1,100
"""**Vector store** stores embedded data and performs vector search. One of the most common ways to store and search over unstructured data is to embed it and store the resulting embedding vectors, and then query the store and retrieve the data that are 'most similar' to the embedded query. **Class hierarchy:** .. c...
langchain/libs/langchain/langchain/vectorstores/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/__init__.py", "repo_id": "langchain", "token_count": 1118 }
572
{ "name": "example-node", "version": "1.0.0", "description": "", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "dev": "node app.js", "start": "node app.js", "rebuild": "cd ../.. && yarn && yarn build && cd examples/node && rm -rf node_modules && yarn && ...
chroma/clients/js/examples/node/package.json/0
{ "file_path": "chroma/clients/js/examples/node/package.json", "repo_id": "chroma", "token_count": 243 }
30
--- sidebar_position: 1 title: Multiple chains hide_table_of_contents: true --- # Multiple chains Runnables can be used to combine multiple Chains together: <details> <summary>Interactive tutorial</summary> The screencast below interactively walks through an example. You can update and run the code as it's bei...
langchainjs/docs/core_docs/docs/expression_language/cookbook/multiple_chains.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/expression_language/cookbook/multiple_chains.mdx", "repo_id": "langchainjs", "token_count": 536 }
716
import { ChatOpenAI } from "@langchain/openai"; import { HumanMessage } from "@langchain/core/messages"; const chat = new ChatOpenAI({ streaming: true, callbacks: [ { handleLLMNewToken(token: string) { process.stdout.write(token); }, }, ], }); await chat.call([new HumanMessage("Write...
langchainjs/examples/src/models/chat/chat_streaming_stdout.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/chat_streaming_stdout.ts", "repo_id": "langchainjs", "token_count": 270 }
797
import { z } from "zod"; import { ChatOpenAI } from "@langchain/openai"; import { Calculator } from "langchain/tools/calculator"; import { AgentExecutor } from "langchain/agents"; import { formatToOpenAIToolMessages } from "langchain/agents/format_scratchpad/openai_tools"; import { convertToOpenAITool } from "@langchai...
langchainjs/examples/src/agents/openai_tools_runnable.ts/0
{ "file_path": "langchainjs/examples/src/agents/openai_tools_runnable.ts", "repo_id": "langchainjs", "token_count": 826 }
758
"""Test BananaDev API wrapper.""" from langchain_community.llms.bananadev import Banana def test_banana_call() -> None: """Test valid call to BananaDev.""" llm = Banana() output = llm("Say foo:") assert isinstance(output, str)
langchain/libs/community/tests/integration_tests/llms/test_banana.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_banana.py", "repo_id": "langchain", "token_count": 86 }
368
#!/usr/bin/env python # 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 # # Unles...
accelerate/src/accelerate/test_utils/examples.py/0
{ "file_path": "accelerate/src/accelerate/test_utils/examples.py", "repo_id": "accelerate", "token_count": 2735 }
12
python_sources()
llama_index/llama-index-integrations/question_gen/llama-index-question-gen-guidance/llama_index/question_gen/guidance/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/question_gen/llama-index-question-gen-guidance/llama_index/question_gen/guidance/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,323
from langchain_community.vectorstores.nucliadb import NucliaDB __all__ = ["NucliaDB"]
langchain/libs/langchain/langchain/vectorstores/nucliadb.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/nucliadb.py", "repo_id": "langchain", "token_count": 31 }
577
from typing import Any, Dict, List, Mapping, Optional import requests from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.pydantic_v1 import Extra from langchain_community.llms.utils import enforce_stop_tokens class ContentHandlerAmaz...
langchain/libs/community/langchain_community/llms/amazon_api_gateway.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/amazon_api_gateway.py", "repo_id": "langchain", "token_count": 1218 }
283
<jupyter_start><jupyter_text>Customizing Run Names[](https://colab.research.google.com/github/langchain-ai/langsmith-cookbook/blob/main/tracing-examples/runnable-naming/run-naming.ipynb)Every LangSmith run receives a name. This name is visible in the UI and can be employed later for querying a particular run. In the co...
langsmith-cookbook/tracing-examples/runnable-naming/run-naming.ipynb/0
{ "file_path": "langsmith-cookbook/tracing-examples/runnable-naming/run-naming.ipynb", "repo_id": "langsmith-cookbook", "token_count": 1965 }
1,043
// 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/pkg/util/paramtable/component_param_test.go/0
{ "file_path": "milvus/pkg/util/paramtable/component_param_test.go", "repo_id": "milvus", "token_count": 6844 }
1,848