text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from langchain_community.document_loaders.parsers.language.cobol import CobolSegmenter __all__ = ["CobolSegmenter"]
langchain/libs/langchain/langchain/document_loaders/parsers/language/cobol.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/parsers/language/cobol.py", "repo_id": "langchain", "token_count": 41 }
521
import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { AIMessage, BaseMessage, ChatMessage } from "@langchain/core/messages"; import { ChatGeneration, ChatResult } from "@langchain/core/outputs"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; import { IterableReadabl...
langchainjs/libs/langchain-community/src/chat_models/iflytek_xinghuo/common.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/chat_models/iflytek_xinghuo/common.ts", "repo_id": "langchainjs", "token_count": 5105 }
962
from dataclasses import dataclass from typing import List, Optional, Union import numpy as np import PIL.Image from ...utils import BaseOutput @dataclass class SemanticStableDiffusionPipelineOutput(BaseOutput): """ Output class for Stable Diffusion pipelines. Args: images (`List[PIL.Image.Image...
diffusers/src/diffusers/pipelines/semantic_stable_diffusion/pipeline_output.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/semantic_stable_diffusion/pipeline_output.py", "repo_id": "diffusers", "token_count": 306 }
255
import { OpenAI } from "@langchain/openai"; const model = new OpenAI({ temperature: 1 }); const resA = await model.call( "What would be a good company name a company that makes colorful socks?", { timeout: 1000 } // 1s timeout ); console.log({ resA }); // '\n\nSocktastic Colors' }
langchainjs/examples/src/models/llm/llm_timeout.ts/0
{ "file_path": "langchainjs/examples/src/models/llm/llm_timeout.ts", "repo_id": "langchainjs", "token_count": 91 }
812
# 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/stable_diffusion/test_onnx_stable_diffusion_inpaint.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_inpaint.py", "repo_id": "diffusers", "token_count": 2242 }
283
// 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/unittest/test_parquet_c.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_parquet_c.cpp", "repo_id": "milvus", "token_count": 7783 }
1,757
from typing import Any, Callable, Dict, Optional, Sequence from llama_index.legacy.callbacks import CallbackManager from llama_index.legacy.constants import DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE from llama_index.legacy.core.llms.types import ChatMessage, LLMMetadata from llama_index.legacy.llms.everlyai_utils impor...
llama_index/llama-index-legacy/llama_index/legacy/llms/everlyai.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/everlyai.py", "repo_id": "llama_index", "token_count": 1152 }
1,573
import { ChatOpenAI } from "@langchain/openai"; import { JsonOutputFunctionsParser } from "langchain/output_parsers"; import { HumanMessage } from "@langchain/core/messages"; // Instantiate the parser const parser = new JsonOutputFunctionsParser(); // Define the function schema const extractionFunctionSchema = { na...
langchainjs/examples/src/prompts/json_structured_output_parser.ts/0
{ "file_path": "langchainjs/examples/src/prompts/json_structured_output_parser.ts", "repo_id": "langchainjs", "token_count": 523 }
843
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union import requests from langchain.schema import Document from langchain.utils import get_from_env from langchain_community.graphs.graph_document import GraphDocument, Node, Relationship def format_property_key(s: str) -> str: words = s.split() ...
langchain/libs/experimental/langchain_experimental/graph_transformers/diffbot.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/graph_transformers/diffbot.py", "repo_id": "langchain", "token_count": 4916 }
443
from langchain_core.retrievers import BaseRetriever __all__ = ["BaseRetriever"]
langchain/libs/langchain/langchain/schema/retriever.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/retriever.py", "repo_id": "langchain", "token_count": 27 }
577
# 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/graphormer/test_modeling_graphormer.py/0
{ "file_path": "transformers/tests/models/graphormer/test_modeling_graphormer.py", "repo_id": "transformers", "token_count": 45752 }
803
from langchain_community.storage.upstash_redis import ( UpstashRedisByteStore, UpstashRedisStore, ) __all__ = ["UpstashRedisStore", "UpstashRedisByteStore"]
langchain/libs/langchain/langchain/storage/upstash_redis.py/0
{ "file_path": "langchain/libs/langchain/langchain/storage/upstash_redis.py", "repo_id": "langchain", "token_count": 65 }
594
// Copyright (c) 2023, Tri Dao. // Splitting the different head dimensions to different files to speed up compilation. // This file is auto-generated. See "generate_kernels.py" #include "flash_fwd_launch_template.h" template<> void run_mha_fwd_<cutlass::half_t, 64>(Flash_fwd_params &params, cudaStream_t stream) { ...
candle/candle-flash-attn/kernels/flash_fwd_hdim64_fp16_sm80.cu/0
{ "file_path": "candle/candle-flash-attn/kernels/flash_fwd_hdim64_fp16_sm80.cu", "repo_id": "candle", "token_count": 135 }
55
import { readFileSync } from "fs"; const indexFilePath = "src/index.ts"; const packageJson = JSON.parse(readFileSync("package.json")); let indexFileContent = readFileSync(indexFilePath, "utf-8"); const packageVersion = packageJson.version; const indexVersion = indexFileContent.match( /__version__\s*=\s*['"]([^'"]+)[...
langsmith-sdk/js/scripts/check-version.js/0
{ "file_path": "langsmith-sdk/js/scripts/check-version.js", "repo_id": "langsmith-sdk", "token_count": 182 }
1,045
<jupyter_start><jupyter_text>StackExchangeThis notebook goes over how to use the stack exchange component.All you need to do is install stackapi:1. pip install stackapi<jupyter_code>pip install stackapi from langchain_community.utilities import StackExchangeAPIWrapper stackexchange = StackExchangeAPIWrapper() stackexch...
langchain/docs/docs/integrations/tools/stackexchange.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/stackexchange.ipynb", "repo_id": "langchain", "token_count": 119 }
190
# Advantage Actor Critic (A2C) using Robotics Simulations with Panda-Gym 🤖 [[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/unit6/unit6.ip...
deep-rl-class/units/en/unit6/hands-on.mdx/0
{ "file_path": "deep-rl-class/units/en/unit6/hands-on.mdx", "repo_id": "deep-rl-class", "token_count": 4616 }
162
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/using-diffusers/loading_adapters.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/loading_adapters.md", "repo_id": "diffusers", "token_count": 5789 }
191
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-shopify/llama_index/readers/airbyte_shopify/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-shopify/llama_index/readers/airbyte_shopify/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,282
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-chroma/llama_index/readers/chroma/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-chroma/llama_index/readers/chroma/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,331
import langchain from langchain.agents import AgentExecutor, AgentType, initialize_agent # agents and tools from langchain.agents.agent_toolkits.base import BaseToolkit from langchain.base_language import BaseLanguageModel # callback from langchain.callbacks.base import BaseCallbackHandler, BaseCallbackManager from l...
llama_index/llama-index-core/llama_index/core/bridge/langchain.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/bridge/langchain.py", "repo_id": "llama_index", "token_count": 969 }
1,163
from langchain_community.graphs.nebula_graph import NebulaGraph __all__ = ["NebulaGraph"]
langchain/libs/langchain/langchain/graphs/nebula_graph.py/0
{ "file_path": "langchain/libs/langchain/langchain/graphs/nebula_graph.py", "repo_id": "langchain", "token_count": 30 }
515
import { GithubRepoLoader } from "langchain/document_loaders/web/github"; export const run = async () => { const loader = new GithubRepoLoader( "https://github.com/langchain-ai/langchainjs", { branch: "main", recursive: false, unknown: "warn", maxConcurrency: 5, // Defaults to 2 }...
langchainjs/examples/src/document_loaders/github.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/github.ts", "repo_id": "langchainjs", "token_count": 145 }
808
package backend import ( "encoding/binary" "fmt" "io" "github.com/golang/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) type BackupFile []byte func (f *BackupFile) Reset() { *f = nil } func (f *BackupFile) writeBytes(bs []byte) { *f = append(*f, bs...) } func (f *BackupFile) writ...
milvus/cmd/tools/migration/backend/backup_restore.go/0
{ "file_path": "milvus/cmd/tools/migration/backend/backup_restore.go", "repo_id": "milvus", "token_count": 1418 }
1,722
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use anyhow::Result; use candle::{test_utils, DType, Device, Tensor}; use candle_nn::BatchNorm; /* The test below has been generated using the following PyTorch code: import torch torch.manual_seed(19551105...
candle/candle-nn/tests/batch_norm.rs/0
{ "file_path": "candle/candle-nn/tests/batch_norm.rs", "repo_id": "candle", "token_count": 2474 }
69
import { type ClientOptions, OpenAIClient } from "@langchain/openai"; import { StructuredTool } from "@langchain/core/tools"; import { Runnable, RunnableConfig } from "@langchain/core/runnables"; import { formatToOpenAIAssistantTool } from "@langchain/openai"; import { sleep } from "../../util/time.js"; import type { ...
langchainjs/langchain/src/experimental/openai_assistant/index.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/openai_assistant/index.ts", "repo_id": "langchainjs", "token_count": 3954 }
885
// An implementation of LLaMA https://github.com/facebookresearch/llama // // This is based on nanoGPT in a similar way to: // https://github.com/Lightning-AI/lit-llama/blob/main/lit_llama/model.py // // The tokenizer config can be retrieved from: // https://huggingface.co/hf-internal-testing/llama-tokenizer/raw/main/t...
candle/candle-examples/examples/llama/main.rs/0
{ "file_path": "candle/candle-examples/examples/llama/main.rs", "repo_id": "candle", "token_count": 3059 }
43
[theme] inherit = basic pygments_style = default stylesheet = css/theme.css [options] link_to_live_contributing_page = false mathjax_path =
langchain/docs/api_reference/themes/scikit-learn-modern/theme.conf/0
{ "file_path": "langchain/docs/api_reference/themes/scikit-learn-modern/theme.conf", "repo_id": "langchain", "token_count": 53 }
86
python_sources()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-zep/llama_index/vector_stores/zep/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-zep/llama_index/vector_stores/zep/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,501
// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`serialize + deserialize custom classes 1`] = ` "lc: 1 type: constructor id: - langchain - tests - Person kwargs: a_field: hello api_key: lc: 1 type: secret id: - PERSON_API_KEY hello: 3 " `; exports[`serialize + deserialize custom class...
langchainjs/langchain/src/load/tests/__snapshots__/load.test.ts.snap/0
{ "file_path": "langchainjs/langchain/src/load/tests/__snapshots__/load.test.ts.snap", "repo_id": "langchainjs", "token_count": 6926 }
997
from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.extractors.interface import BaseExtractor from llama_index.core.schema import BaseNode from llama_index.core.utils import get_tqdm_iterable from nltk.tokenize...
llama_index/llama-index-integrations/extractors/llama-index-extractors-entity/llama_index/extractors/entity/base.py/0
{ "file_path": "llama_index/llama-index-integrations/extractors/llama-index-extractors-entity/llama_index/extractors/entity/base.py", "repo_id": "llama_index", "token_count": 2376 }
1,290
from langchain_community.embeddings.localai import ( LocalAIEmbeddings, ) __all__ = [ "LocalAIEmbeddings", ]
langchain/libs/langchain/langchain/embeddings/localai.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/localai.py", "repo_id": "langchain", "token_count": 49 }
499
# Metric Card for WikiSplit ## Metric description WikiSplit is the combination of three metrics: [SARI](https://huggingface.co/metrics/sari), [exact match](https://huggingface.co/metrics/exact_match) and [SacreBLEU](https://huggingface.co/metrics/sacrebleu). It can be used to evaluate the quality of sentence splitt...
datasets/metrics/wiki_split/README.md/0
{ "file_path": "datasets/metrics/wiki_split/README.md", "repo_id": "datasets", "token_count": 1504 }
137
# flake8: noqa from langchain_core.prompts.prompt import PromptTemplate _DEFAULT_ENTITY_EXTRACTION_TEMPLATE = """Extract all entities from the following text. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places. Return the output as a single comma-separated list,...
langchain/libs/langchain/langchain/chains/graph_qa/prompts.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/graph_qa/prompts.py", "repo_id": "langchain", "token_count": 5073 }
461
# Hands-on Now that you learned the basics of multi-agents, you're ready to train your first agents in a multi-agent system: **a 2vs2 soccer team that needs to beat the opponent team**. And you’re going to participate in AI vs. AI challenges where your trained agent will compete against other classmates’ **agents eve...
deep-rl-class/units/en/unit7/hands-on.mdx/0
{ "file_path": "deep-rl-class/units/en/unit7/hands-on.mdx", "repo_id": "deep-rl-class", "token_count": 5036 }
170
from typing import Any, List from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.core.bridge.pydantic import PrivateAttr from elasticsearch import Elasticsearch from elasticsearch.client import MlClient class ElasticsearchEmbedding(BaseEmbedding): """Elasticsearch embedding models. ...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-elasticsearch/llama_index/embeddings/elasticsearch/base.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-elasticsearch/llama_index/embeddings/elasticsearch/base.py", "repo_id": "llama_index", "token_count": 2448 }
1,272
/// Regression test for pth files not loading on Windows. #[test] fn test_pth() { let tensors = candle_core::pickle::PthTensors::new("tests/test.pt", None).unwrap(); tensors.get("test").unwrap().unwrap(); } #[test] fn test_pth_with_key() { let tensors = candle_core::pickle::PthTensors::new("tests/t...
candle/candle-core/tests/pth_tests.rs/0
{ "file_path": "candle/candle-core/tests/pth_tests.rs", "repo_id": "candle", "token_count": 440 }
35
# TensorFlow Datasets >[TensorFlow Datasets](https://www.tensorflow.org/datasets) is a collection of datasets ready to use, > with TensorFlow or other Python ML frameworks, such as Jax. All datasets are exposed > as [tf.data.Datasets](https://www.tensorflow.org/api_docs/python/tf/data/Dataset), > enabling easy-to-u...
langchain/docs/docs/integrations/providers/tensorflow_datasets.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/tensorflow_datasets.mdx", "repo_id": "langchain", "token_count": 305 }
147
from langchain.output_parsers.regex import RegexParser def load_output_parser(config: dict) -> dict: """Load an output parser. Args: config: config dict Returns: config dict with output parser loaded """ if "output_parsers" in config: if config["output_parsers"] is not No...
langchain/libs/langchain/langchain/output_parsers/loading.py/0
{ "file_path": "langchain/libs/langchain/langchain/output_parsers/loading.py", "repo_id": "langchain", "token_count": 301 }
574
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/realm.md/0
{ "file_path": "transformers/docs/source/en/model_doc/realm.md", "repo_id": "transformers", "token_count": 926 }
515
python_sources() python_tests( name="tests0", )
llama_index/llama-index-integrations/readers/llama-index-readers-semanticscholar/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-semanticscholar/tests/BUILD", "repo_id": "llama_index", "token_count": 23 }
1,378
python_sources()
llama_index/llama-index-integrations/tools/llama-index-tools-slack/llama_index/tools/slack/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-slack/llama_index/tools/slack/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,529
import { createClient, RedisClientOptions, RedisClientType, RedisModules, RedisFunctions, RedisScripts, } from "redis"; import { BaseListChatMessageHistory } from "@langchain/core/chat_history"; import { BaseMessage, mapChatMessagesToStoredMessages, mapStoredMessagesToChatMessages, } from "@langchain/...
langchainjs/libs/langchain-redis/src/chat_histories.ts/0
{ "file_path": "langchainjs/libs/langchain-redis/src/chat_histories.ts", "repo_id": "langchainjs", "token_count": 1267 }
1,042
//! The CIFAR-10 dataset. //! //! The files can be downloaded from the following page: //! <https://www.cs.toronto.edu/~kriz/cifar.html> //! The binary version of the dataset is used. use crate::vision::Dataset; use candle::{DType, Device, Error, Result, Tensor}; use hf_hub::{api::sync::Api, Repo, RepoType}; use parque...
candle/candle-datasets/src/vision/cifar.rs/0
{ "file_path": "candle/candle-datasets/src/vision/cifar.rs", "repo_id": "candle", "token_count": 2139 }
39
import { ChatGoogleVertexAI } from "@langchain/community/chat_models/googlevertexai"; import { AIMessage, HumanMessage, SystemMessage, } from "@langchain/core/messages"; // Or, if using the web entrypoint: // import { ChatGoogleVertexAI } from "@langchain/community/chat_models/googlevertexai/web"; const example...
langchainjs/examples/src/models/chat/integration_googlevertexai-examples.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/integration_googlevertexai-examples.ts", "repo_id": "langchainjs", "token_count": 252 }
895
<jupyter_start><jupyter_text>Memory in LLMChainThis notebook goes over how to use the Memory class with an `LLMChain`. We will add the [ConversationBufferMemory](https://api.python.langchain.com/en/latest/memory/langchain.memory.buffer.ConversationBufferMemory.htmllangchain.memory.buffer.ConversationBufferMemory) clas...
langchain/docs/docs/modules/memory/adding_memory.ipynb/0
{ "file_path": "langchain/docs/docs/modules/memory/adding_memory.ipynb", "repo_id": "langchain", "token_count": 1385 }
188
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/clipseg/processing_clipseg.py/0
{ "file_path": "transformers/src/transformers/models/clipseg/processing_clipseg.py", "repo_id": "transformers", "token_count": 3092 }
659
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/llama_index/readers/string_iterable/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/llama_index/readers/string_iterable/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,557
<jupyter_start><jupyter_text>JSONalyze Query Engine JSONalyze, or JSON Analyze Query Engine is designed to be wired typically after a calling(by agent, etc) of APIs, where we have the returned value as bulk instaces of rows, and the next step is to perform statistical analysis on the data.With JSONalyze, under the hood...
llama_index/docs/examples/query_engine/JSONalyze_query_engine.ipynb/0
{ "file_path": "llama_index/docs/examples/query_engine/JSONalyze_query_engine.ipynb", "repo_id": "llama_index", "token_count": 4707 }
1,075
[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 = ["LocalRAGCLIPack"] contains_example = false import_path = "llama_index.packs.rag_cli_local...
llama_index/llama-index-packs/llama-index-packs-rag-cli-local/pyproject.toml/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-rag-cli-local/pyproject.toml", "repo_id": "llama_index", "token_count": 729 }
1,600
/* eslint-disable import/first */ /* eslint-disable arrow-body-style */ import { z } from "zod"; import { DynamicStructuredTool } from "@langchain/core/tools"; const multiplyTool = new DynamicStructuredTool({ name: "multiply", description: "Multiply two integers together.", schema: z.object({ firstInt: z.nu...
langchainjs/examples/src/use_cases/tool_use/quickstart_chains.ts/0
{ "file_path": "langchainjs/examples/src/use_cases/tool_use/quickstart_chains.ts", "repo_id": "langchainjs", "token_count": 586 }
921
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/api/loaders/textual_inversion.md/0
{ "file_path": "diffusers/docs/source/en/api/loaders/textual_inversion.md", "repo_id": "diffusers", "token_count": 340 }
170
# Evaluation using Spider Text-to-SQL Dataset We want to benchmark LlamaIndex's performance for complex queries on multiple domains, and measure how each iteration of LLM improves its Text-to-SQL capability, thus this project. ## Usage 1. Download [benchmark dataset](https://yale-lily.github.io/spider), the downl...
llama_index/benchmarks/struct_indices/spider/README.md/0
{ "file_path": "llama_index/benchmarks/struct_indices/spider/README.md", "repo_id": "llama_index", "token_count": 779 }
1,027
"""OpenAI Image Generation tool sppec..""" import base64 import os import time from typing import Optional from llama_index.core.tools.tool_spec.base import BaseToolSpec DEFAULT_CACHE_DIR = "../../../img_cache" DEFAULT_SIZE = "1024x1024" # Dall-e-3 only supports 1024x1024 class OpenAIImageGenerationToolSpec(BaseT...
llama_index/llama-index-integrations/tools/llama-index-tools-openai/llama_index/tools/openai/image_generation/base.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-openai/llama_index/tools/openai/image_generation/base.py", "repo_id": "llama_index", "token_count": 1232 }
1,627
/* eslint-disable no-promise-executor-return */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { test } from "@jest/globals"; import { StringOutputParser } from "../../output_parsers/string.js"; import { FakeChatModel, FakeStreamingLLM } from "../../utils/testing/index.js"; test("Bind kwargs to a runna...
langchainjs/langchain-core/src/runnables/tests/runnable_binding.test.ts/0
{ "file_path": "langchainjs/langchain-core/src/runnables/tests/runnable_binding.test.ts", "repo_id": "langchainjs", "token_count": 638 }
858
pub mod bert; pub mod roberta; pub mod sequence; pub mod template; // Re-export these as processors pub use super::pre_tokenizers::byte_level; use serde::{Deserialize, Serialize}; use crate::pre_tokenizers::byte_level::ByteLevel; use crate::processors::bert::BertProcessing; use crate::processors::roberta::RobertaPro...
tokenizers/tokenizers/src/processors/mod.rs/0
{ "file_path": "tokenizers/tokenizers/src/processors/mod.rs", "repo_id": "tokenizers", "token_count": 1426 }
469
from typing import List, Optional from llama_index.core.base.base_retriever import BaseRetriever from llama_index.core.callbacks.base import CallbackManager from llama_index.core.indices.query.query_transform.base import BaseQueryTransform from llama_index.core.prompts.mixin import PromptMixinType from llama_index.cor...
llama_index/llama-index-core/llama_index/core/retrievers/transform_retriever.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/retrievers/transform_retriever.py", "repo_id": "llama_index", "token_count": 581 }
1,246
python_sources()
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,384
# 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/examples/community/dps_pipeline.py/0
{ "file_path": "diffusers/examples/community/dps_pipeline.py", "repo_id": "diffusers", "token_count": 11140 }
203
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-agent-search/llama_index/readers/agent_search/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-agent-search/llama_index/readers/agent_search/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,256
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor. # # 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....
datasets/metrics/sari/sari.py/0
{ "file_path": "datasets/metrics/sari/sari.py", "repo_id": "datasets", "token_count": 4913 }
124
tab_spaces = 2
tokenizers/bindings/node/rustfmt.toml/0
{ "file_path": "tokenizers/bindings/node/rustfmt.toml", "repo_id": "tokenizers", "token_count": 7 }
398
# Redis Ingestion Pipeline Pack This LlamaPack creates an [ingestion pipeline](https://docs.llamaindex.ai/en/stable/module_guides/loading/ingestion_pipeline/root.html), with both a cache and vector store backed by Redis. ## CLI Usage You can download llamapacks directly using `llamaindex-cli`, which comes installed ...
llama_index/llama-index-packs/llama-index-packs-redis-ingestion-pipeline/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-redis-ingestion-pipeline/README.md", "repo_id": "llama_index", "token_count": 610 }
1,681
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querycoordv2/services_test.go/0
{ "file_path": "milvus/internal/querycoordv2/services_test.go", "repo_id": "milvus", "token_count": 23214 }
1,835
# Using LLMs as standalone modules You can use our LLM modules on their own. ## Text Completion Example ```python from llama_index.llms.openai import OpenAI # non-streaming resp = OpenAI().complete("Paul Graham is ") print(resp) # using streaming endpoint from llama_index.llms.openai import OpenAI llm = OpenAI() ...
llama_index/docs/module_guides/models/llms/usage_standalone.md/0
{ "file_path": "llama_index/docs/module_guides/models/llms/usage_standalone.md", "repo_id": "llama_index", "token_count": 278 }
1,123
from llama_index.multi_modal_llms.openai.base import OpenAIMultiModal __all__ = ["OpenAIMultiModal"]
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/__init__.py", "repo_id": "llama_index", "token_count": 42 }
1,312
import os from operator import itemgetter from typing import List, Tuple from langchain.retrievers import SelfQueryRetriever from langchain.schema import format_document from langchain_community.chat_models import ChatOpenAI from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorsto...
langchain/templates/rag-self-query/rag_self_query/chain.py/0
{ "file_path": "langchain/templates/rag-self-query/rag_self_query/chain.py", "repo_id": "langchain", "token_count": 1231 }
670
"""[DEPRECATED] ## Zapier Natural Language Actions API \ Full docs here: https://nla.zapier.com/start/ **Zapier Natural Language Actions** gives you access to the 5k+ apps, 20k+ actions on Zapier's platform through a natural language API interface. NLA supports apps like Gmail, Salesforce, Trello, Slack, Asana, HubS...
langchain/libs/community/langchain_community/tools/zapier/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/zapier/tool.py", "repo_id": "langchain", "token_count": 3017 }
319
import asyncio import os import shutil from argparse import ArgumentParser from glob import iglob from pathlib import Path from typing import Any, Callable, Dict, Optional, Union, cast from llama_index.core import ( Response, ServiceContext, SimpleDirectoryReader, VectorStoreIndex, ) from llama_index.c...
llama_index/llama-index-core/llama_index/core/command_line/rag.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/command_line/rag.py", "repo_id": "llama_index", "token_count": 7518 }
1,250
import os from typing import Dict, List, Tuple, TypeVar, Union T = TypeVar("T") ListLike = Union[List[T], Tuple[T, ...]] NestedDataStructureLike = Union[T, List[T], Dict[str, T]] PathLike = Union[str, bytes, os.PathLike]
datasets/src/datasets/utils/typing.py/0
{ "file_path": "datasets/src/datasets/utils/typing.py", "repo_id": "datasets", "token_count": 84 }
148
import string from typing import Callable, Dict, Optional def get_pseudoanonymizer_mapping(seed: Optional[int] = None) -> Dict[str, Callable]: try: from faker import Faker except ImportError as e: raise ImportError( "Could not import faker, please install it with `pip install Faker...
langchain/libs/experimental/langchain_experimental/data_anonymizer/faker_presidio_mapping.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/data_anonymizer/faker_presidio_mapping.py", "repo_id": "langchain", "token_count": 1244 }
460
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/bros/test_modeling_bros.py/0
{ "file_path": "transformers/tests/models/bros/test_modeling_bros.py", "repo_id": "transformers", "token_count": 8384 }
751
// 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/delegator/snapshot.go/0
{ "file_path": "milvus/internal/querynodev2/delegator/snapshot.go", "repo_id": "milvus", "token_count": 1229 }
1,987
[ { "server": "eros", "suite_params": [ { "suite": "011_gpu_build_sift10m.yaml", "image_type": "gpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/011_data_gpu_build.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/011_data_gpu_build.json", "repo_id": "milvus", "token_count": 134 }
1,994
package lock import ( "sync" "testing" "time" "github.com/stretchr/testify/assert" ) func TestKeyLock(t *testing.T) { keys := []string{"Milvus", "Blazing", "Fast"} keyLock := NewKeyLock[string]() keyLock.Lock(keys[0]) keyLock.Lock(keys[1]) keyLock.Lock(keys[2]) // should work wg := sync.WaitGroup{} wg...
milvus/pkg/util/lock/key_lock_test.go/0
{ "file_path": "milvus/pkg/util/lock/key_lock_test.go", "repo_id": "milvus", "token_count": 521 }
1,917
"""Unit tests for StreamlitChatMessageHistory functionality.""" import pytest test_script = """ import json import streamlit as st from langchain.memory import ConversationBufferMemory from langchain_community.chat_message_histories import StreamlitChatMessageHistory from langchain_core.messages im...
langchain/libs/community/tests/integration_tests/chat_message_histories/test_streamlit.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/chat_message_histories/test_streamlit.py", "repo_id": "langchain", "token_count": 819 }
338
from langchain.schema.runnable import __all__ EXPECTED_ALL = [ "ConfigurableField", "ConfigurableFieldSingleOption", "ConfigurableFieldMultiOption", "patch_config", "RouterInput", "RouterRunnable", "Runnable", "RunnableSerializable", "RunnableBinding", "RunnableBranch", "Run...
langchain/libs/langchain/tests/unit_tests/schema/runnable/test_imports.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/schema/runnable/test_imports.py", "repo_id": "langchain", "token_count": 251 }
633
package dao import ( "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel" "github.com/pingcap/log" "go.uber.org/zap" "gorm.io/gorm" ) type databaseDb struct { db *gorm.DB } var _ dbmodel.IDatabaseDb = &databaseDb{} func (s *databaseDb) DeleteAll() error { return s.db.Where("1 = 1").Delete(&dbm...
chroma/go/coordinator/internal/metastore/db/dao/database.go/0
{ "file_path": "chroma/go/coordinator/internal/metastore/db/dao/database.go", "repo_id": "chroma", "token_count": 427 }
48
from pathlib import Path from langchain.text_splitter import TokenTextSplitter from langchain_community.document_loaders import TextLoader from langchain_community.embeddings.openai import OpenAIEmbeddings from langchain_community.vectorstores import Neo4jVector txt_path = Path(__file__).parent / "dune.txt" # Load t...
langchain/templates/neo4j-vector-memory/ingest.py/0
{ "file_path": "langchain/templates/neo4j-vector-memory/ingest.py", "repo_id": "langchain", "token_count": 222 }
660
label: 'Prompts' position: 2
langchainjs/docs/core_docs/docs/modules/experimental/prompts/_category_.yml/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/experimental/prompts/_category_.yml", "repo_id": "langchainjs", "token_count": 11 }
813
<jupyter_start><jupyter_text>WebBaseLoaderThis covers how to use `WebBaseLoader` to load all text from `HTML` webpages into a document format that we can use downstream. For more custom logic for loading webpages look at some child class examples such as `IMSDbLoader`, `AZLyricsLoader`, and `CollegeConfidentialLoader`<...
langchain/docs/docs/integrations/document_loaders/web_base.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/web_base.ipynb", "repo_id": "langchain", "token_count": 1006 }
124
"""Tencent Vector store index. An index that is built with Tencent Vector Database. """ import json from typing import Any, Dict, List, Optional from llama_index.legacy.schema import ( BaseNode, NodeRelationship, RelatedNodeInfo, TextNode, ) from llama_index.legacy.vector_stores.types import ( V...
llama_index/llama-index-legacy/llama_index/legacy/vector_stores/tencentvectordb.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/tencentvectordb.py", "repo_id": "llama_index", "token_count": 8963 }
1,788
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-firestore/llama_index/readers/firestore/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-firestore/llama_index/readers/firestore/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,373
python_sources()
llama_index/llama-index-packs/llama-index-packs-deeplake-deepmemory-retriever/llama_index/packs/deeplake_deepmemory_retriever/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-deeplake-deepmemory-retriever/llama_index/packs/deeplake_deepmemory_retriever/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,648
[ { "server_tag": "16c32m0g", "suite_params": [ { "suite": "2_cpu_search.yaml", "image_type": "cpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/search2.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/search2.json", "repo_id": "milvus", "token_count": 139 }
1,941
# Spotify Loader This loader reads your Spotify account and loads saved albums, tracks, or playlists into `Documents`. As a prerequisite, you will need to register with [Spotify for Developers](https://developer.spotify.com) and create an app in order to get a `client_id` and a `client_secret`. You should then set a ...
llama_index/llama-index-integrations/readers/llama-index-readers-spotify/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-spotify/README.md", "repo_id": "llama_index", "token_count": 486 }
1,554
from llama_index.readers.string_iterable.base import StringIterableReader __all__ = ["StringIterableReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/llama_index/readers/string_iterable/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/llama_index/readers/string_iterable/__init__.py", "repo_id": "llama_index", "token_count": 33 }
1,531
python_tests( interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-integrations/tools/llama-index-tools-google/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-google/tests/BUILD", "repo_id": "llama_index", "token_count": 29 }
1,481
from __future__ import annotations import logging from pathlib import Path from typing import Any, Dict, Iterator, List, Optional, Union from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.outputs import GenerationChunk from langchain_c...
langchain/libs/community/langchain_community/llms/llamacpp.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/llamacpp.py", "repo_id": "langchain", "token_count": 5319 }
270
"""Download loader from Llama Hub. NOTE: using `download_loader` is now deprecated. Please do `pip install llama-hub` instead. """ from typing import Optional, Type from llama_index.legacy.download.module import ( LLAMA_HUB_URL, MODULE_TYPE, download_llama_module, track_download, ) from llama_index....
llama_index/llama-index-legacy/llama_index/legacy/readers/download.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/download.py", "repo_id": "llama_index", "token_count": 784 }
1,592
<!--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/zh/main_classes/quantization.md/0
{ "file_path": "transformers/docs/source/zh/main_classes/quantization.md", "repo_id": "transformers", "token_count": 14178 }
512
<jupyter_start><jupyter_text>ClientClient code interacting with a server that implements: * custom streaming for an agent* agent with user selected toolsThis agent does not have memory! See other examples in LangServe to see how to add memory.**ATTENTION** We made the agent stream strings as an output. This is almost c...
langserve/examples/agent_custom_streaming/client.ipynb/0
{ "file_path": "langserve/examples/agent_custom_streaming/client.ipynb", "repo_id": "langserve", "token_count": 955 }
1,057
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/storage/docstore/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/docstore/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,602
[ { "suite_params": [ { "suite": "shards_loop_stability.yaml", "image_type": "cpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/shards_stability.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/shards_stability.json", "repo_id": "milvus", "token_count": 120 }
2,141
package planparserv2 //go:generate ./generate.sh
milvus/internal/parser/planparserv2/generate.go/0
{ "file_path": "milvus/internal/parser/planparserv2/generate.go", "repo_id": "milvus", "token_count": 19 }
1,870
## IMDB MOVIE REVIEWS LOADER This loader fetches all the reviews of a movie or a TV-series from IMDB official site. This loader is working on Windows machine and it requires further debug on Linux. Fixes are on the way Install the required dependencies ``` pip install -r requirements.txt ``` The IMDB downloader tak...
llama_index/llama-index-integrations/readers/llama-index-readers-imdb-review/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-imdb-review/README.md", "repo_id": "llama_index", "token_count": 887 }
1,382
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/philosophy.md/0
{ "file_path": "transformers/docs/source/en/philosophy.md", "repo_id": "transformers", "token_count": 1518 }
477
# Discord >[Discord](https://discord.com/) is a VoIP and instant messaging social platform. Users have the ability to communicate > with voice calls, video calls, text messaging, media and files in private chats or as part of communities called > "servers". A server is a collection of persistent chat rooms and voice...
langchain/docs/docs/integrations/providers/discord.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/discord.mdx", "repo_id": "langchain", "token_count": 263 }
134
<jupyter_start><jupyter_text>iFixit>[iFixit](https://www.ifixit.com) is the largest, open repair community on the web. The site contains nearly 100k repair manuals, 200k Questions & Answers on 42k devices, and all the data is licensed under CC-BY-NC-SA 3.0.This loader will allow you to download the text of a repair gui...
langchain/docs/docs/integrations/document_loaders/ifixit.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/ifixit.ipynb", "repo_id": "langchain", "token_count": 420 }
104
from typing import List import pytest from llama_index.legacy.schema import BaseNode, Document from llama_index.legacy.storage.docstore.firestore_docstore import ( FirestoreDocumentStore, ) from llama_index.legacy.storage.kvstore.firestore_kvstore import FirestoreKVStore try: from google.cloud import firestor...
llama_index/llama-index-legacy/tests/storage/docstore/test_firestore_docstore.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/storage/docstore/test_firestore_docstore.py", "repo_id": "llama_index", "token_count": 1090 }
1,649
# 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/src/transformers/models/clipseg/convert_clipseg_original_pytorch_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/clipseg/convert_clipseg_original_pytorch_to_hf.py", "repo_id": "transformers", "token_count": 4819 }
578