text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from llama_index.llms.gradient.base import GradientBaseModelLLM, GradientModelAdapterLLM __all__ = ["GradientBaseModelLLM", "GradientModelAdapterLLM"]
llama_index/llama-index-integrations/llms/llama-index-llms-gradient/llama_index/llms/gradient/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-gradient/llama_index/llms/gradient/__init__.py", "repo_id": "llama_index", "token_count": 49 }
1,257
from contextlib import contextmanager from typing import Any, Generator, Generic, Iterator, Optional, Sequence, Type, Union from typing_extensions import Self from langgraph.channels.base import BaseChannel, Value def flatten(values: Sequence[Union[Value, list[Value]]]) -> Iterator[Value]: for value in values: ...
langgraph/langgraph/channels/topic.py/0
{ "file_path": "langgraph/langgraph/channels/topic.py", "repo_id": "langgraph", "token_count": 1071 }
992
"""Implements Program-Aided Language Models. As in https://arxiv.org/pdf/2211.10435.pdf. This is vulnerable to arbitrary code execution: https://github.com/langchain-ai/langchain/issues/5872 """ from langchain_experimental.pal_chain.base import PALChain __all__ = ["PALChain"]
langchain/libs/experimental/langchain_experimental/pal_chain/__init__.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/pal_chain/__init__.py", "repo_id": "langchain", "token_count": 92 }
421
[dockernodes] dockernode01 dockernode02 dockernode03 [coords] ; Take note the IP of this host VM, and replace 10.170.0.17 with it. dockernode01 [nodes] dockernode02 [dependencies] ; dependencies node will host etcd, minio, pulsar, these 3 roles are the foundation of Milvus. ; Take note the IP of this host VM, and r...
milvus/deployments/docker/cluster-distributed-deployment/inventory.ini/0
{ "file_path": "milvus/deployments/docker/cluster-distributed-deployment/inventory.ini", "repo_id": "milvus", "token_count": 553 }
1,761
<jupyter_start><jupyter_text>MongoDB Atlas>[MongoDB Atlas](https://www.mongodb.com/docs/atlas/) is a fully-managed cloud database available in AWS, Azure, and GCP. It now has support for native Vector Search on your MongoDB document data.This notebook shows how to use [MongoDB Atlas Vector Search](https://www.mongodb....
langchain/docs/docs/integrations/vectorstores/mongodb_atlas.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/mongodb_atlas.ipynb", "repo_id": "langchain", "token_count": 2235 }
182
--- sidebar_label: SalesGPT hide_table_of_contents: true sidebar_position: 4 --- import CodeBlock from "@theme/CodeBlock"; # SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base This notebook demonstrates an implementation of a **Context-Aware** AI Sales agent with a Product Knowledge Base. This not...
langchainjs/docs/core_docs/docs/use_cases/autonomous_agents/sales_gpt.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/use_cases/autonomous_agents/sales_gpt.mdx", "repo_id": "langchainjs", "token_count": 14189 }
767
import logging import math from collections import defaultdict from typing import Any, List import vecs from llama_index.core.constants import DEFAULT_EMBEDDING_DIM from llama_index.core.schema import BaseNode, TextNode from llama_index.core.vector_stores.types import ( MetadataFilters, VectorStore, Vector...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-supabase/llama_index/vector_stores/supabase/base.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-supabase/llama_index/vector_stores/supabase/base.py", "repo_id": "llama_index", "token_count": 2538 }
1,571
from langchain_community.document_loaders.web_base import ( WebBaseLoader, ) __all__ = ["WebBaseLoader"]
langchain/libs/langchain/langchain/document_loaders/web_base.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/web_base.py", "repo_id": "langchain", "token_count": 38 }
518
package connection import "sync" var connectionManagerInstance *connectionManager var getConnectionManagerInstanceOnce sync.Once func GetManager() *connectionManager { getConnectionManagerInstanceOnce.Do(func() { connectionManagerInstance = newConnectionManager( withDuration(defaultConnCheckDuration), with...
milvus/internal/proxy/connection/global.go/0
{ "file_path": "milvus/internal/proxy/connection/global.go", "repo_id": "milvus", "token_count": 102 }
1,813
"use node"; import { ConvexVectorStore } from "@langchain/community/vectorstores/convex"; import { OpenAIEmbeddings } from "@langchain/openai"; import { v } from "convex/values"; import { action } from "./_generated/server.js"; export const search = action({ args: { query: v.string(), }, handler: async (ctx...
langchainjs/examples/src/indexes/vector_stores/convex/search.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/convex/search.ts", "repo_id": "langchainjs", "token_count": 178 }
802
python_sources()
llama_index/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/llama_index/tools/chatgpt_plugin/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/llama_index/tools/chatgpt_plugin/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,481
#!/usr/bin/env python # 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 # # Unles...
accelerate/src/accelerate/commands/estimate.py/0
{ "file_path": "accelerate/src/accelerate/commands/estimate.py", "repo_id": "accelerate", "token_count": 4235 }
11
# Hands-on [[hands-on]] <CourseFloatingBanner classNames="absolute z-10 right-0 top-0" notebooks={[ {label: "Google Colab", value: "https://colab.research.google.com/github/huggingface/deep-rl-class/blob/main/notebooks/unit3/unit3.ipynb"} ]} askForHelpUrl="http://hf.co/join/discor...
deep-rl-class/units/en/unit3/hands-on.mdx/0
{ "file_path": "deep-rl-class/units/en/unit3/hands-on.mdx", "repo_id": "deep-rl-class", "token_count": 5087 }
164
import json import pickle import pytest from tokenizers import Tokenizer from tokenizers.models import BPE from tokenizers.pre_tokenizers import ByteLevel as ByteLevelPreTokenizer from tokenizers.processors import ( BertProcessing, ByteLevel, PostProcessor, RobertaProcessing, Sequence, Templat...
tokenizers/bindings/python/tests/bindings/test_processors.py/0
{ "file_path": "tokenizers/bindings/python/tests/bindings/test_processors.py", "repo_id": "tokenizers", "token_count": 4132 }
426
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "util/convex", }); export * from "@langchain/community/util/convex";
langchainjs/langchain/src/util/convex.ts/0
{ "file_path": "langchainjs/langchain/src/util/convex.ts", "repo_id": "langchainjs", "token_count": 72 }
1,027
#include "cuda_utils.cuh" #include <cmath> #include <stdint.h> const int BLOCK_SIZE = 1024; // TODO: Maybe add some fast_sum_f16_f32 variant that not only accumulate in f32 // but also expect a f32 output so that this can be used for normalization e.g. // in softmax. // Fast reduce sum kernel, this assumes that the ...
candle/candle-kernels/src/reduce.cu/0
{ "file_path": "candle/candle-kernels/src/reduce.cu", "repo_id": "candle", "token_count": 8419 }
56
# 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/src/transformers/models/convbert/modeling_tf_convbert.py/0
{ "file_path": "transformers/src/transformers/models/convbert/modeling_tf_convbert.py", "repo_id": "transformers", "token_count": 26614 }
623
version: '3.5' services: pytest: image: ${IMAGE_REPO}/pytest:${IMAGE_TAG} build: context: ../.. dockerfile: tests/docker/Dockerfile cache_from: - ${IMAGE_REPO}/pytest:${LATEST_IMAGE_TAG} shm_size: 2G environment: MILVUS_SERVICE_IP: ${MILVUS_SERVICE_IP} MILVUS_SER...
milvus/tests/docker/docker-compose.yml/0
{ "file_path": "milvus/tests/docker/docker-compose.yml", "repo_id": "milvus", "token_count": 303 }
1,957
// Code generated by mockery v2.32.4. DO NOT EDIT. package meta import ( context "context" datapb "github.com/milvus-io/milvus/internal/proto/datapb" indexpb "github.com/milvus-io/milvus/internal/proto/indexpb" milvuspb "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" mock "github.com/stretchr/testify/m...
milvus/internal/querycoordv2/meta/mock_broker.go/0
{ "file_path": "milvus/internal/querycoordv2/meta/mock_broker.go", "repo_id": "milvus", "token_count": 6370 }
2,032
from langchain_community.document_loaders.pdf import ( AmazonTextractPDFLoader, BasePDFLoader, DocumentIntelligenceLoader, MathpixPDFLoader, OnlinePDFLoader, PDFMinerLoader, PDFMinerPDFasHTMLLoader, PDFPlumberLoader, PyMuPDFLoader, PyPDFDirectoryLoader, PyPDFium2Loader, P...
langchain/libs/langchain/langchain/document_loaders/pdf.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/pdf.py", "repo_id": "langchain", "token_count": 315 }
514
# Zephyr Query Engine Pack Create a query engine using completely local and private models -- `HuggingFaceH4/zephyr-7b-beta` for the LLM and `BAAI/bge-base-en-v1.5` for embeddings. ## CLI Usage You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package: ...
llama_index/llama-index-packs/llama-index-packs-zephyr-query-engine/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-zephyr-query-engine/README.md", "repo_id": "llama_index", "token_count": 483 }
1,604
# Alibaba Cloud >[Alibaba Group Holding Limited (Wikipedia)](https://en.wikipedia.org/wiki/Alibaba_Group), or `Alibaba` > (Chinese: 阿里巴巴), is a Chinese multinational technology company specializing in e-commerce, retail, > Internet, and technology. > > [Alibaba Cloud (Wikipedia)](https://en.wikipedia.org/wiki/Alibab...
langchain/docs/docs/integrations/providers/alibaba_cloud.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/alibaba_cloud.mdx", "repo_id": "langchain", "token_count": 370 }
129
// 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/proxy/accesslog/util.go/0
{ "file_path": "milvus/internal/proxy/accesslog/util.go", "repo_id": "milvus", "token_count": 985 }
2,012
# 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/tvlt/test_feature_extraction_tvlt.py/0
{ "file_path": "transformers/tests/models/tvlt/test_feature_extraction_tvlt.py", "repo_id": "transformers", "token_count": 3058 }
790
package utils import ( "encoding/json" "os" "time" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/rs/zerolog/pkgerrors" "google.golang.org/protobuf/encoding/protojson" pb "google.golang.org/protobuf/proto" ) const DefaultLogLevel = zerolog.InfoLevel var ( // LogLevel Used for flags LogLev...
chroma/go/coordinator/internal/utils/log.go/0
{ "file_path": "chroma/go/coordinator/internal/utils/log.go", "repo_id": "chroma", "token_count": 426 }
55
<jupyter_start><jupyter_text>Citing retrieval sourcesThis notebook shows how to use OpenAI functions ability to extract citations from text.<jupyter_code>from langchain.chains import create_citation_fuzzy_match_chain from langchain_openai import ChatOpenAI question = "What did the author do during college?" context = "...
langchain/cookbook/qa_citations.ipynb/0
{ "file_path": "langchain/cookbook/qa_citations.ipynb", "repo_id": "langchain", "token_count": 615 }
75
"""Test components.""" from llama_index.legacy.query_pipeline.components.tool_runner import ( ToolRunnerComponent, ) from llama_index.legacy.tools.function_tool import FunctionTool from llama_index.legacy.tools.types import ToolMetadata def foo_fn(a: int, b: int = 1, c: int = 2) -> int: """Foo function.""" ...
llama_index/llama-index-legacy/tests/query_pipeline/components/test_tool_runner.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/query_pipeline/components/test_tool_runner.py", "repo_id": "llama_index", "token_count": 388 }
1,564
from langchain_community.utilities.powerbi import ( PowerBIDataset, ) __all__ = [ "PowerBIDataset", ]
langchain/libs/langchain/langchain/utilities/powerbi.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/powerbi.py", "repo_id": "langchain", "token_count": 48 }
606
import os import posixpath import uuid from dataclasses import dataclass from typing import TYPE_CHECKING, Iterable, List, Optional, Tuple, Union import numpy as np import pyarrow as pa import datasets from datasets.arrow_writer import ArrowWriter, ParquetWriter from datasets.config import MAX_SHARD_SIZE from dataset...
datasets/src/datasets/packaged_modules/spark/spark.py/0
{ "file_path": "datasets/src/datasets/packaged_modules/spark/spark.py", "repo_id": "datasets", "token_count": 6664 }
136
import { BabyAGI } from "langchain/experimental/babyagi"; import { MemoryVectorStore } from "langchain/vectorstores/memory"; import { OpenAIEmbeddings, OpenAI } from "@langchain/openai"; import { LLMChain } from "langchain/chains"; import { ChainTool } from "langchain/tools"; import { initializeAgentExecutorWithOptions...
langchainjs/examples/src/experimental/babyagi/weather_with_tools.ts/0
{ "file_path": "langchainjs/examples/src/experimental/babyagi/weather_with_tools.ts", "repo_id": "langchainjs", "token_count": 3341 }
790
# 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/core.py/0
{ "file_path": "trl/trl/core.py", "repo_id": "trl", "token_count": 4437 }
886
"""Test LLM-generated structured query parsing.""" from typing import Any, cast import lark import pytest from langchain.chains.query_constructor.ir import ( Comparator, Comparison, Operation, Operator, ) from langchain.chains.query_constructor.parser import get_parser DEFAULT_PARSER = get_parser() ...
langchain/libs/langchain/tests/unit_tests/chains/query_constructor/test_parser.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/chains/query_constructor/test_parser.py", "repo_id": "langchain", "token_count": 1785 }
598
import unittest import pytest from langchain_community.document_loaders.parsers.language.perl import PerlSegmenter @pytest.mark.requires("tree_sitter", "tree_sitter_languages") class TestPerlSegmenter(unittest.TestCase): def setUp(self) -> None: self.example_code = """sub Hello { print "Hello, World!"...
langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_perl.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_perl.py", "repo_id": "langchain", "token_count": 577 }
366
mod app; pub mod coco_classes; pub mod model; pub mod worker; pub use app::App; pub use worker::Worker;
candle/candle-wasm-examples/yolo/src/lib.rs/0
{ "file_path": "candle/candle-wasm-examples/yolo/src/lib.rs", "repo_id": "candle", "token_count": 37 }
81
from langchain_community.llms.baseten import Baseten __all__ = ["Baseten"]
langchain/libs/langchain/langchain/llms/baseten.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/baseten.py", "repo_id": "langchain", "token_count": 28 }
536
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-asana/llama_index/readers/asana/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-asana/llama_index/readers/asana/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,378
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/src/transformers/models/llava/convert_llava_weights_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/llava/convert_llava_weights_to_hf.py", "repo_id": "transformers", "token_count": 2138 }
623
# DashVector > [DashVector](https://help.aliyun.com/document_detail/2510225.html) is a fully-managed vectorDB service that supports high-dimension dense and sparse vectors, real-time insertion and filtered search. It is built to scale automatically and can adapt to different application requirements. This document ...
langchain/docs/docs/integrations/providers/dashvector.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/dashvector.mdx", "repo_id": "langchain", "token_count": 267 }
134
from langchain_community.vectorstores.vespa import VespaStore __all__ = ["VespaStore"]
langchain/libs/langchain/langchain/vectorstores/vespa.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/vespa.py", "repo_id": "langchain", "token_count": 28 }
589
<!--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/perf_infer_gpu_one.md/0
{ "file_path": "transformers/docs/source/ko/perf_infer_gpu_one.md", "repo_id": "transformers", "token_count": 6492 }
530
<!--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/mps.md/0
{ "file_path": "diffusers/docs/source/en/optimization/mps.md", "repo_id": "diffusers", "token_count": 1061 }
189
import { ZepVectorStore } from "@langchain/community/vectorstores/zep"; import { OpenAIEmbeddings } from "@langchain/openai"; import { TextLoader } from "langchain/document_loaders/fs/text"; import { randomUUID } from "crypto"; const loader = new TextLoader("src/document_loaders/example_data/example.txt"); const docs ...
langchainjs/examples/src/indexes/vector_stores/zep/zep_with_openai_embeddings.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/zep/zep_with_openai_embeddings.ts", "repo_id": "langchainjs", "token_count": 380 }
884
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
accelerate/docs/source/usage_guides/mps.md/0
{ "file_path": "accelerate/docs/source/usage_guides/mps.md", "repo_id": "accelerate", "token_count": 861 }
6
dist node_modules src/generated
chroma/clients/js/.prettierignore/0
{ "file_path": "chroma/clients/js/.prettierignore", "repo_id": "chroma", "token_count": 10 }
31
# 🦜️🧪 LangChain Experimental This package holds experimental LangChain code, intended for research and experimental uses. > [!WARNING] > Portions of the code in this package may be dangerous if not properly deployed > in a sandboxed environment. Please be wary of deploying experimental code > to production unless y...
langchain/libs/experimental/README.md/0
{ "file_path": "langchain/libs/experimental/README.md", "repo_id": "langchain", "token_count": 157 }
434
--- sidebar_class_name: hidden --- import CodeBlock from "@theme/CodeBlock"; import Example from "@examples/agents/custom_llm_agent.ts"; import RunnableExample from "@examples/agents/custom_llm_agent_runnable.ts"; # Custom LLM Agent This notebook goes through how to create your own custom LLM agent. An LLM agent co...
langchainjs/docs/core_docs/docs/modules/agents/how_to/custom_llm_agent.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/agents/how_to/custom_llm_agent.mdx", "repo_id": "langchainjs", "token_count": 529 }
748
# Introduction [[introduction]] In this bonus unit, we'll reinforce what we learned in the first unit by teaching Huggy the Dog to fetch the stick and then [play with him directly in your browser](https://huggingface.co/spaces/ThomasSimonini/Huggy) 🐶 <img src="https://huggingface.co/datasets/huggingface-deep-rl-cour...
deep-rl-class/units/en/unitbonus1/introduction.mdx/0
{ "file_path": "deep-rl-class/units/en/unitbonus1/introduction.mdx", "repo_id": "deep-rl-class", "token_count": 138 }
164
"""Summary index. A simple data structure where LlamaIndex iterates through document chunks in sequence in order to answer a given query. """ from enum import Enum from typing import Any, Dict, Optional, Sequence, Union from llama_index.legacy.core.base_retriever import BaseRetriever from llama_index.legacy.data_st...
llama_index/llama-index-legacy/llama_index/legacy/indices/list/base.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/list/base.py", "repo_id": "llama_index", "token_count": 2022 }
1,600
package grpcutils type GrpcConfig struct { // BindAddress is the address to bind the GRPC server to. BindAddress string // GRPC mTLS config CertPath string KeyPath string CAPath string } func (c *GrpcConfig) MTLSEnabled() bool { return c.CertPath != "" && c.KeyPath != "" && c.CAPath != "" }
chroma/go/coordinator/internal/grpccoordinator/grpcutils/config.go/0
{ "file_path": "chroma/go/coordinator/internal/grpccoordinator/grpcutils/config.go", "repo_id": "chroma", "token_count": 105 }
42
# 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...
accelerate/src/accelerate/data_loader.py/0
{ "file_path": "accelerate/src/accelerate/data_loader.py", "repo_id": "accelerate", "token_count": 20415 }
12
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-nomic/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-nomic/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,253
<!--Copyright 2023 The Intel Labs Team Authors, The Microsoft Research Team Authors and 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...
transformers/docs/source/en/model_doc/bridgetower.md/0
{ "file_path": "transformers/docs/source/en/model_doc/bridgetower.md", "repo_id": "transformers", "token_count": 2392 }
470
from langchain_core.utils.strings import comma_list, stringify_dict, stringify_value __all__ = ["stringify_value", "stringify_dict", "comma_list"]
langchain/libs/langchain/langchain/utils/strings.py/0
{ "file_path": "langchain/libs/langchain/langchain/utils/strings.py", "repo_id": "langchain", "token_count": 48 }
580
from langchain_community.document_loaders.parsers.language.language_parser import ( LanguageParser, ) __all__ = ["LanguageParser"]
langchain/libs/langchain/langchain/document_loaders/parsers/language/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/parsers/language/__init__.py", "repo_id": "langchain", "token_count": 42 }
534
<jupyter_start><jupyter_text>Rockset> Rockset is a real-time analytics database which enables queries on massive, semi-structured data without operational burden. With Rockset, ingested data is queryable within one second and analytical queries against that data typically execute in milliseconds. Rockset is compute opt...
langchain/docs/docs/integrations/document_loaders/rockset.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/rockset.ipynb", "repo_id": "langchain", "token_count": 1928 }
109
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-telegram/llama_index/readers/telegram/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-telegram/llama_index/readers/telegram/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,558
import { LLMChain } from "langchain/chains"; import { ChatOpenAI } from "@langchain/openai"; import { ChatPromptTemplate } from "@langchain/core/prompts"; export const run = async () => { const chat = new ChatOpenAI({ temperature: 0 }); const chatPrompt = ChatPromptTemplate.fromMessages([ [ "system", ...
langchainjs/examples/src/chat/llm_chain.ts/0
{ "file_path": "langchainjs/examples/src/chat/llm_chain.ts", "repo_id": "langchainjs", "token_count": 236 }
851
<!--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/tasks/knowledge_distillation_for_image_classification.md/0
{ "file_path": "transformers/docs/source/en/tasks/knowledge_distillation_for_image_classification.md", "repo_id": "transformers", "token_count": 2621 }
474
import { ChatOpenAI } from "@langchain/openai"; import { InputValues, MemoryVariables, OutputValues, getInputValue, getOutputValue, } from "@langchain/core/memory"; import { getBufferString } from "@langchain/core/messages"; import { BaseChatMemory, BaseChatMemoryInput, } from "@langchain/community/memory...
langchainjs/langchain/src/agents/toolkits/conversational_retrieval/token_buffer_memory.ts/0
{ "file_path": "langchainjs/langchain/src/agents/toolkits/conversational_retrieval/token_buffer_memory.ts", "repo_id": "langchainjs", "token_count": 1443 }
947
"""Hypothetical Document Embeddings. https://arxiv.org/abs/2212.10496 """ from __future__ import annotations from typing import Any, Dict, List, Optional import numpy as np from langchain_core.callbacks import CallbackManagerForChainRun from langchain_core.embeddings import Embeddings from langchain_core.language_mo...
langchain/libs/langchain/langchain/chains/hyde/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/hyde/base.py", "repo_id": "langchain", "token_count": 1335 }
505
# SegmentSealed SegmentSealed has an extra interface rather than SegmentInterface: 1. `LoadIndex(loadIndexInfo)`: load the index. indexInfo contains: 1. `FieldId` 2. `IndexParams`: index parameters in KV structure KV 3. `VecIndex`: vector index 2. `LoadFieldData(loadFieldDataInfo)`: load column data, could...
milvus/docs/design_docs/segcore/segment_sealed.md/0
{ "file_path": "milvus/docs/design_docs/segcore/segment_sealed.md", "repo_id": "milvus", "token_count": 678 }
1,631
package datacoord import ( "math" "sync" "go.uber.org/zap" "github.com/milvus-io/milvus/internal/util/sessionutil" "github.com/milvus-io/milvus/pkg/log" ) type IndexEngineVersionManager interface { Startup(sessions map[string]*sessionutil.Session) AddNode(session *sessionutil.Session) RemoveNode(session *se...
milvus/internal/datacoord/index_engine_version_manager.go/0
{ "file_path": "milvus/internal/datacoord/index_engine_version_manager.go", "repo_id": "milvus", "token_count": 882 }
1,685
"""Json agent."""
langchain/libs/community/langchain_community/agent_toolkits/json/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/json/__init__.py", "repo_id": "langchain", "token_count": 7 }
213
<jupyter_start><jupyter_text>HuggingFace LLM - StableLM If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-huggingface !pip install llama-index import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging...
llama_index/docs/examples/customization/llms/SimpleIndexDemo-Huggingface_stablelm.ipynb/0
{ "file_path": "llama_index/docs/examples/customization/llms/SimpleIndexDemo-Huggingface_stablelm.ipynb", "repo_id": "llama_index", "token_count": 1432 }
1,051
import logging from typing import Any, Dict, List, Mapping, Optional from urllib.parse import urlparse from langchain_core.callbacks import ( CallbackManagerForLLMRun, ) from langchain_core.language_models import BaseChatModel from langchain_core.messages import ( AIMessage, BaseMessage, ChatMessage, ...
langchain/libs/community/langchain_community/chat_models/mlflow.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_models/mlflow.py", "repo_id": "langchain", "token_count": 3050 }
228
import { Textarea, TextareaProps } from "@chakra-ui/react"; import ResizeTextarea from "react-textarea-autosize"; import React from "react"; interface ResizeTextareaProps { maxRows?: number; } const ResizableTextarea: React.FC<ResizeTextareaProps> = ({ maxRows, ...props }) => { return <ResizeTextarea maxRows=...
chat-langchain/chat-langchain/app/components/AutoResizeTextarea.tsx/0
{ "file_path": "chat-langchain/chat-langchain/app/components/AutoResizeTextarea.tsx", "repo_id": "chat-langchain", "token_count": 318 }
6
<jupyter_start><jupyter_text>Bias et limitations Installez la bibliothèque 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install transformers[sentencepiece] from transformers import pipeline unmasker = pipeline("fill-mask", model="camembert-base") result = unmasker("Cet homme travaille comme <mask>....
notebooks/course/fr/chapter1/section8.ipynb/0
{ "file_path": "notebooks/course/fr/chapter1/section8.ipynb", "repo_id": "notebooks", "token_count": 173 }
309
<script lang="ts"> import ChatWindow from "$lib/components/chat/ChatWindow.svelte"; import { pendingMessage } from "$lib/stores/pendingMessage"; import { isAborted } from "$lib/stores/isAborted"; import { onMount } from "svelte"; import { page } from "$app/stores"; import { goto, invalidate } from "$app/navigatio...
chat-ui/src/routes/conversation/[id]/+page.svelte/0
{ "file_path": "chat-ui/src/routes/conversation/[id]/+page.svelte", "repo_id": "chat-ui", "token_count": 5362 }
110
from langchain.retrievers.multi_query import MultiQueryRetriever from langchain.text_splitter import RecursiveCharacterTextSplitter from langchain_community.chat_models import ChatOllama, ChatOpenAI from langchain_community.document_loaders import WebBaseLoader from langchain_community.embeddings import OpenAIEmbedding...
langchain/templates/rag-ollama-multi-query/rag_ollama_multi_query/chain.py/0
{ "file_path": "langchain/templates/rag-ollama-multi-query/rag_ollama_multi_query/chain.py", "repo_id": "langchain", "token_count": 704 }
660
import { ChatOpenAI } from "@langchain/openai"; import { BufferMemory, CombinedMemory, ConversationSummaryMemory, } from "langchain/memory"; import { ConversationChain } from "langchain/chains"; import { PromptTemplate } from "@langchain/core/prompts"; // buffer memory const bufferMemory = new BufferMemory({ m...
langchainjs/examples/src/memory/combined.ts/0
{ "file_path": "langchainjs/examples/src/memory/combined.ts", "repo_id": "langchainjs", "token_count": 644 }
796
<jupyter_start><jupyter_text>Unit 1: Train your first Deep Reinforcement Learning Agent 🤖In this notebook, you'll train your **first Deep Reinforcement Learning agent** a Lunar Lander agent that will learn to **land correctly on the Moon 🌕**. Using [Stable-Baselines3](https://stable-baselines3.readthedocs.io/en/maste...
deep-rl-class/notebooks/unit1/unit1.ipynb/0
{ "file_path": "deep-rl-class/notebooks/unit1/unit1.ipynb", "repo_id": "deep-rl-class", "token_count": 7619 }
172
import { AgentAction, AgentFinish } from "@langchain/core/agents"; import { OutputParserException } from "@langchain/core/output_parsers"; import { AgentActionOutputParser } from "../types.js"; /** * @example * ```typescript * const prompt = ChatPromptTemplate.fromMessages([ * HumanMessagePromptTemplate.fromTemp...
langchainjs/langchain/src/agents/xml/output_parser.ts/0
{ "file_path": "langchainjs/langchain/src/agents/xml/output_parser.ts", "repo_id": "langchainjs", "token_count": 656 }
949
# How to enable use TLS proxy Milvus proxy uses TLS two-way and one-way authentication. ## How to create your own certificate. ### 1. Prerequisites Make sure OpenSSL is installed. If you have not installed it, [build and install](https://github.com/openssl/openssl/blob/master/INSTALL.md) OpenSSL first. ```shell ...
milvus/docs/user_guides/tls_proxy.md/0
{ "file_path": "milvus/docs/user_guides/tls_proxy.md", "repo_id": "milvus", "token_count": 5504 }
1,726
[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 = ["HuggingFaceFSReader"] contains_example = false import_path = "llama_index.readers.hugging...
llama_index/llama-index-integrations/readers/llama-index-readers-huggingface-fs/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-huggingface-fs/pyproject.toml", "repo_id": "llama_index", "token_count": 696 }
1,387
#!/usr/bin/env python # coding=utf-8 # Copyright 2020 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 a...
transformers/examples/legacy/benchmarking/run_benchmark.py/0
{ "file_path": "transformers/examples/legacy/benchmarking/run_benchmark.py", "repo_id": "transformers", "token_count": 699 }
554
use std::ops::Deref; // mirrors chromadb/utils/messageid.py use num_bigint::BigInt; use pulsar::{consumer::data::MessageData, proto::MessageIdData}; use crate::types::SeqId; pub(crate) struct PulsarMessageIdWrapper(pub(crate) MessageData); impl Deref for PulsarMessageIdWrapper { type Target = MessageIdData; ...
chroma/rust/worker/src/ingest/message_id.rs/0
{ "file_path": "chroma/rust/worker/src/ingest/message_id.rs", "repo_id": "chroma", "token_count": 613 }
60
/****************************************************************************** * Copyright (c) 2023, Tri Dao. ******************************************************************************/ #pragma once #include <cmath> #include <cute/tensor.hpp> #include <cutlass/numeric_types.h> #include "philox.cuh" #include...
candle/candle-flash-attn/kernels/softmax.h/0
{ "file_path": "candle/candle-flash-attn/kernels/softmax.h", "repo_id": "candle", "token_count": 7224 }
56
interactions: - request: body: '{"input": [[2059, 7341, 527, 264, 1912, 315, 658, 10753, 677, 81, 3581, 7795, 32971, 555, 264, 7558, 321, 351, 61798, 30535, 11, 4330, 311, 8254, 342, 484, 1776, 1220, 389, 279, 11314, 315, 279, 2010, 11, 323, 281, 1279, 278, 66079, 430, 527, 539, 75754, 311, 279, 2...
langchain/libs/community/tests/integration_tests/vectorstores/cassettes/test_elasticsearch/TestElasticsearch.test_custom_index_add_documents.yaml/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/cassettes/test_elasticsearch/TestElasticsearch.test_custom_index_add_documents.yaml", "repo_id": "langchain", "token_count": 31699 }
384
// 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/storage/ChunkCacheSingleton.h/0
{ "file_path": "milvus/internal/core/src/storage/ChunkCacheSingleton.h", "repo_id": "milvus", "token_count": 611 }
1,942
# DeepLake DeepMemory Pack This LlamaPack inserts your multimodal data (texts, images) into deeplake and insantiates an deeplake retriever, which will use clip for embedding images and GPT4-V during runtime. ## CLI Usage You can download llamapacks directly using `llamaindex-cli`, which comes installed with the `lla...
llama_index/llama-index-packs/llama-index-packs-deeplake-multimodal-retrieval/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-deeplake-multimodal-retrieval/README.md", "repo_id": "llama_index", "token_count": 566 }
1,781
<jupyter_start><jupyter_text>Que peuvent faire les *transformers* ? Installez la bibliothèque 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install transformers[sentencepiece] from transformers import pipeline<jupyter_output><empty_output><jupyter_text>Analyse de sentiments<jupyter_code>classifier = ...
notebooks/course/fr/chapter1/section3.ipynb/0
{ "file_path": "notebooks/course/fr/chapter1/section3.ipynb", "repo_id": "notebooks", "token_count": 1607 }
283
# Examples Please check out https://huggingface.co/docs/trl/example_overview for documentation on our examples.
trl/examples/README.md/0
{ "file_path": "trl/examples/README.md", "repo_id": "trl", "token_count": 30 }
866
<!--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/perf_train_cpu_many.md/0
{ "file_path": "transformers/docs/source/ja/perf_train_cpu_many.md", "repo_id": "transformers", "token_count": 3275 }
497
# What's Knowhere ## Concepts Vector index is a time-efficient and space-efficient data structure built on vectors through a certain mathematical model. Through the vector index, we can efficiently query several vectors similar to the target vector. Since accurate retrieval is usually very time-consuming, most of the...
milvus/docs/design_docs/20211223-knowhere_design.md/0
{ "file_path": "milvus/docs/design_docs/20211223-knowhere_design.md", "repo_id": "milvus", "token_count": 772 }
1,906
# coding=utf-8 # Copyright 2022 EleutherAI 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 #...
text-generation-inference/server/text_generation_server/models/custom_modeling/neox_modeling.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/neox_modeling.py", "repo_id": "text-generation-inference", "token_count": 14270 }
385
<jupyter_start><jupyter_text>StreamingAll `LLM`s implement the `Runnable` interface, which comes with default implementations of all methods, ie. ainvoke, batch, abatch, stream, astream. This gives all `LLM`s basic support for streaming.Streaming support defaults to returning an Iterator (or AsyncIterator in the case o...
langchain/docs/docs/modules/model_io/llms/streaming_llm.ipynb/0
{ "file_path": "langchain/docs/docs/modules/model_io/llms/streaming_llm.ipynb", "repo_id": "langchain", "token_count": 564 }
192
# coding=utf-8 # Copyright 2024 The Fairseq Authors 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/...
transformers/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py/0
{ "file_path": "transformers/src/transformers/models/wav2vec2_bert/configuration_wav2vec2_bert.py", "repo_id": "transformers", "token_count": 7140 }
739
python_test_utils( name="test_utils", ) python_tests( name="tests", skip_tests=True, dependencies=[ "!!llama-index-core:poetry", "!!llama-index-core/pyproject.toml:poetry", "!!llama-index-core:poetry#PyYAML", "!!llama-index-integrations/callbacks/llama-index-callbacks-ho...
llama_index/llama-index-legacy/tests/indices/vector_store/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/vector_store/BUILD", "repo_id": "llama_index", "token_count": 3663 }
1,740
[package] name = "candle-wasm-example-t5" version.workspace = true edition.workspace = true description.workspace = true repository.workspace = true keywords.workspace = true categories.workspace = true license.workspace = true [dependencies] candle = { workspace = true } candle-nn = { workspace = true } candle-transf...
candle/candle-wasm-examples/t5/Cargo.toml/0
{ "file_path": "candle/candle-wasm-examples/t5/Cargo.toml", "repo_id": "candle", "token_count": 305 }
83
--- sidebar_position: 3 --- # Choosing between multiple tools In the tools [Quickstart](/docs/use_cases/tool_use/quickstart) we went over how to build a Chain that calls a single `multiply` tool. Now let’s take a look at how we might augment this chain so that it can pick from a number of tools to call. We’ll focus o...
langchainjs/docs/core_docs/docs/use_cases/tool_use/multiple_tools.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/use_cases/tool_use/multiple_tools.mdx", "repo_id": "langchainjs", "token_count": 1740 }
826
import time from functools import partial from typing import Callable, List, Optional, Tuple import pandas as pd from llama_index.core import SimpleDirectoryReader from llama_index.core.base.embeddings.base import ( DEFAULT_EMBED_BATCH_SIZE, BaseEmbedding, ) from llama_index.embeddings import OpenAIEmbedding, ...
llama_index/benchmarks/embeddings/bench_embeddings.py/0
{ "file_path": "llama_index/benchmarks/embeddings/bench_embeddings.py", "repo_id": "llama_index", "token_count": 2089 }
1,052
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/core/src/exec/Task.h/0
{ "file_path": "milvus/internal/core/src/exec/Task.h", "repo_id": "milvus", "token_count": 2167 }
1,748
// 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/mq/mqimpl/rocksmq/server/global_rmq.go/0
{ "file_path": "milvus/internal/mq/mqimpl/rocksmq/server/global_rmq.go", "repo_id": "milvus", "token_count": 617 }
1,867
{ "extends": "next/core-web-vitals" }
langchainjs/environment_tests/test-exports-vercel/.eslintrc.json/0
{ "file_path": "langchainjs/environment_tests/test-exports-vercel/.eslintrc.json", "repo_id": "langchainjs", "token_count": 20 }
834
# Drop Collection `Milvus 2.0` uses `Collection` to represent a set of data, like `Table` in traditional database. Users can create or drop `Collection`. This article introduces the execution path of `Drop Collection`. At the end of this article, you should know which components are involved in `Drop Collection`. The...
milvus/docs/design_docs/20211115-milvus_drop_collection.md/0
{ "file_path": "milvus/docs/design_docs/20211115-milvus_drop_collection.md", "repo_id": "milvus", "token_count": 2454 }
1,733
# Created with `curl -Ls https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.5.0/components.yaml > build/config/metrics/metrics.yaml` # And special patches noted below apiVersion: v1 kind: ServiceAccount metadata: labels: k8s-app: metrics-server name: metrics-server namespace: kube-system -...
milvus/build/config/metrics/metrics.yaml/0
{ "file_path": "milvus/build/config/metrics/metrics.yaml", "repo_id": "milvus", "token_count": 1859 }
1,833
"""(Unofficial) Google Keep reader using gkeepapi.""" import json import os from typing import Any, List from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class GoogleKeepReader(BaseReader): """Google Keep reader. Reads notes from Google Keep """ de...
llama_index/llama-index-integrations/readers/llama-index-readers-google/llama_index/readers/google/keep/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-google/llama_index/readers/google/keep/base.py", "repo_id": "llama_index", "token_count": 1009 }
1,378
<!--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/fuyu.md/0
{ "file_path": "transformers/docs/source/en/model_doc/fuyu.md", "repo_id": "transformers", "token_count": 1655 }
476
{# TEMPLATE VAR SETTINGS #} {%- set url_root = pathto('', 1) %} {%- if url_root == '#' %}{% set url_root = '' %}{% endif %} {%- if not embedded and docstitle %} {%- set titlesuffix = " &mdash; "|safe + docstitle|e %} {%- else %} {%- set titlesuffix = "" %} {%- endif %} {%- set lang_attr = 'en' %} <!DOCTYPE html> <...
langchain/docs/api_reference/themes/scikit-learn-modern/layout.html/0
{ "file_path": "langchain/docs/api_reference/themes/scikit-learn-modern/layout.html", "repo_id": "langchain", "token_count": 2845 }
86
// WARNING: THIS IS ONLY VALID ASSUMING THAT inp IS CONTIGUOUS! // TODO: proper error reporting when ids are larger than v_size. #include "cuda_utils.cuh" #include<stdint.h> template<typename T, typename I> __device__ void index_select( const size_t numel, const size_t num_dims, const size_t *info, con...
candle/candle-kernels/src/indexing.cu/0
{ "file_path": "candle/candle-kernels/src/indexing.cu", "repo_id": "candle", "token_count": 4314 }
59