text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
python_sources()
llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-firestore/llama_index/storage/docstore/firestore/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-firestore/llama_index/storage/docstore/firestore/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,402
<!--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/de/transformers_agents.md/0
{ "file_path": "transformers/docs/source/de/transformers_agents.md", "repo_id": "transformers", "token_count": 6629 }
432
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-clarifai/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-clarifai/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,269
python_sources()
llama_index/experimental/cli/BUILD/0
{ "file_path": "llama_index/experimental/cli/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,112
import { AudioTranscriptLoader, // AudioTranscriptParagraphsLoader, // AudioTranscriptSentencesLoader } from "langchain/document_loaders/web/assemblyai"; // You can also use a local file path and the loader will upload it to AssemblyAI for you. const audioUrl = "https://storage.googleapis.com/aai-docs-samples/es...
langchainjs/examples/src/document_loaders/assemblyai_audio_transcription.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/assemblyai_audio_transcription.ts", "repo_id": "langchainjs", "token_count": 257 }
769
<!--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/es/autoclass_tutorial.md/0
{ "file_path": "transformers/docs/source/es/autoclass_tutorial.md", "repo_id": "transformers", "token_count": 2038 }
532
import { TavilySearchResults } from "@langchain/community/tools/tavily_search"; import { AgentExecutor, createStructuredChatAgent } from "langchain/agents"; import { pull } from "langchain/hub"; import type { ChatPromptTemplate } from "@langchain/core/prompts"; import { HumanMessage, AIMessage } from "@langchain/core/m...
langchainjs/examples/src/agents/structured_chat.ts/0
{ "file_path": "langchainjs/examples/src/agents/structured_chat.ts", "repo_id": "langchainjs", "token_count": 423 }
794
from dataclasses import dataclass, field from typing import Optional import torch from peft import PeftConfig, PeftModel from transformers import AutoModelForCausalLM, AutoModelForSequenceClassification, AutoTokenizer, HfArgumentParser @dataclass class ScriptArguments: """ The input names representing the Ad...
trl/examples/research_projects/stack_llama/scripts/merge_peft_adapter.py/0
{ "file_path": "trl/examples/research_projects/stack_llama/scripts/merge_peft_adapter.py", "repo_id": "trl", "token_count": 657 }
786
# coding=utf-8 # Copyright 2021 The Google AI Flax Team Authors, and The HuggingFace Inc. team. # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy o...
transformers/src/transformers/generation/flax_utils.py/0
{ "file_path": "transformers/src/transformers/generation/flax_utils.py", "repo_id": "transformers", "token_count": 21749 }
634
export { type TemplateFormat, parseFString, interpolateFString, DEFAULT_FORMATTER_MAPPING, DEFAULT_PARSER_MAPPING, renderTemplate, parseTemplate, checkValidTemplate, } from "@langchain/core/prompts";
langchainjs/langchain/src/prompts/template.ts/0
{ "file_path": "langchainjs/langchain/src/prompts/template.ts", "repo_id": "langchainjs", "token_count": 76 }
901
# LlamaIndex Index_Store Integration: Firestore Indexstore
llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-firestore/README.md/0
{ "file_path": "llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-firestore/README.md", "repo_id": "llama_index", "token_count": 14 }
1,493
from typing import Any, List, Optional from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks import CBEventType, EventPayload from llama_index.core.postprocessor.types import BaseNodePostprocessor from llama_index.core.schema import MetadataMode, NodeWithScore, QueryBundle c...
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-flag-embedding-reranker/llama_index/postprocessor/flag_embedding_reranker/base.py/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-flag-embedding-reranker/llama_index/postprocessor/flag_embedding_reranker/base.py", "repo_id": "llama_index", "token_count": 1326 }
1,250
from __future__ import annotations from typing import Any, List, Literal, Optional from langchain_core.embeddings import Embeddings from langchain_community.vectorstores.docarray.base import ( DocArrayIndex, _check_docarray_import, ) class DocArrayHnswSearch(DocArrayIndex): """`HnswLib` storage using `...
langchain/libs/community/langchain_community/vectorstores/docarray/hnsw.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/docarray/hnsw.py", "repo_id": "langchain", "token_count": 1826 }
309
<!--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/multilingual.md/0
{ "file_path": "transformers/docs/source/en/multilingual.md", "repo_id": "transformers", "token_count": 2530 }
475
<jupyter_start><jupyter_text>Chroma AuthenticationThis tutorial aims to explain how authentication can be setup in Chroma.> **Important**: The concept of authentication is only applicable to Client/Server deployments. If you are using Chroma in a standalone mode, authentication is not applicable. Concepts Architecture ...
chroma/examples/basic_functionality/client_auth.ipynb/0
{ "file_path": "chroma/examples/basic_functionality/client_auth.ipynb", "repo_id": "chroma", "token_count": 1986 }
39
from typing import Any, Dict, List from langchain_core.memory import BaseMemory class ReadOnlySharedMemory(BaseMemory): """A memory wrapper that is read-only and cannot be changed.""" memory: BaseMemory @property def memory_variables(self) -> List[str]: """Return memory variables.""" ...
langchain/libs/langchain/langchain/memory/readonly.py/0
{ "file_path": "langchain/libs/langchain/langchain/memory/readonly.py", "repo_id": "langchain", "token_count": 284 }
531
"""Functionality for loading agents.""" import json import logging from pathlib import Path from typing import Any, List, Optional, Union import yaml from langchain_core._api import deprecated from langchain_core.language_models import BaseLanguageModel from langchain_core.tools import Tool from langchain_core.utils.l...
langchain/libs/langchain/langchain/agents/loading.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/loading.py", "repo_id": "langchain", "token_count": 1809 }
474
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/program/llama-index-program-openai/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/program/llama-index-program-openai/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,271
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-couchdb/llama_index/readers/couchdb/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-couchdb/llama_index/readers/couchdb/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,352
ETCD_VERSION=3.5.0 set -xe date_str="$(date +%Y%m%d)" short_hash="$(git log -1 --pretty=%h)" version="${date_str}-${short_hash}" target_filename="milvus-windows-${version}.zip" script_dir="$(cd $(dirname $0); pwd)" repo_dir="$(dirname ${script_dir})" bin_dir="${repo_dir}/bin" package_dir="${repo_dir}/windows_packag...
milvus/scripts/package_windows.sh/0
{ "file_path": "milvus/scripts/package_windows.sh", "repo_id": "milvus", "token_count": 636 }
2,128
# Simple self-RAG short form pack This LlamaPack implements (\*in short form) the [self-RAG paper by Akari et al.](https://arxiv.org/pdf/2310.11511.pdf). This paper presents a novel framework called Self-Reflective Retrieval-Augmented Generation (SELF-RAG). Which aims to enhance the quality and factuality of large la...
llama_index/llama-index-packs/llama-index-packs-self-rag/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-self-rag/README.md", "repo_id": "llama_index", "token_count": 723 }
1,603
# 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/tests/others/test_check_copies.py/0
{ "file_path": "diffusers/tests/others/test_check_copies.py", "repo_id": "diffusers", "token_count": 2032 }
274
# 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 ...
transformers/tests/models/bart/test_modeling_bart.py/0
{ "file_path": "transformers/tests/models/bart/test_modeling_bart.py", "repo_id": "transformers", "token_count": 35938 }
746
<jupyter_start><jupyter_text>Returning sourcesOften in Q&A applications it’s important to show users the sources that were used to generate the answer. The simplest way to do this is for the chain to return the Documents that were retrieved in each generation.We’ll work off of the Q&A app we built over the [LLM Powered...
langchainjs/docs/core_docs/docs/use_cases/question_answering/sources.ipynb/0
{ "file_path": "langchainjs/docs/core_docs/docs/use_cases/question_answering/sources.ipynb", "repo_id": "langchainjs", "token_count": 1265 }
776
<jupyter_start><jupyter_text>AsyncHtml`AsyncHtmlLoader` loads raw HTML from a list of URLs concurrently.<jupyter_code>from langchain_community.document_loaders import AsyncHtmlLoader urls = ["https://www.espn.com", "https://lilianweng.github.io/posts/2023-06-23-agent/"] loader = AsyncHtmlLoader(urls) docs = loader.load...
langchain/docs/docs/integrations/document_loaders/async_html.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/async_html.ipynb", "repo_id": "langchain", "token_count": 152 }
107
python_tests()
llama_index/llama-index-integrations/program/llama-index-program-evaporate/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/program/llama-index-program-evaporate/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,441
Collections: - testcase: name: test_etcd_io_latency chaos: chaos_etcd_io_latency.yaml expectation: cluster_1_node: create: fail insert: fail flush: fail index: fail search: fail query: fail - testcase: name: test_mi...
milvus/tests/python_client/chaos/chaos_objects/io_latency/testcases.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/io_latency/testcases.yaml", "repo_id": "milvus", "token_count": 446 }
1,964
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/convex", }); export * from "@langchain/community/vectorstores/convex";
langchainjs/langchain/src/vectorstores/convex.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/convex.ts", "repo_id": "langchainjs", "token_count": 74 }
1,003
import concurrent import logging import random from pathlib import Path from typing import Any, List, Optional, Sequence, Type, Union from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.document_loaders.html_bs import BSHTMLLoader fro...
langchain/libs/community/langchain_community/document_loaders/directory.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/directory.py", "repo_id": "langchain", "token_count": 3493 }
235
#!/usr/bin/env python # 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/L...
transformers/src/transformers/tools/base.py/0
{ "file_path": "transformers/src/transformers/tools/base.py", "repo_id": "transformers", "token_count": 12529 }
705
from .env import Env from .hardware import Hardware from .metric import Metric from .server import Server
milvus/tests/benchmark/milvus_benchmark/metrics/models/__init__.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/metrics/models/__init__.py", "repo_id": "milvus", "token_count": 28 }
1,854
// 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/ChunkManager.cpp/0
{ "file_path": "milvus/internal/core/src/storage/ChunkManager.cpp", "repo_id": "milvus", "token_count": 3738 }
1,890
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "llms/llama_cpp", }); export * from "@langchain/community/llms/llama_cpp";
langchainjs/langchain/src/llms/llama_cpp.ts/0
{ "file_path": "langchainjs/langchain/src/llms/llama_cpp.ts", "repo_id": "langchainjs", "token_count": 76 }
915
python_tests()
llama_index/llama-index-packs/llama-index-packs-dense-x-retrieval/tests/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-dense-x-retrieval/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,783
.. _Ref-Storage-KVStore: KV Storage ================= .. automodule:: llama_index.core.storage.kvstore :members: :inherited-members:
llama_index/docs/api_reference/storage/kv_store.rst/0
{ "file_path": "llama_index/docs/api_reference/storage/kv_store.rst", "repo_id": "llama_index", "token_count": 54 }
1,063
import CodeBlock from "@theme/CodeBlock"; # Backgrounding callbacks By default callbacks run in-line with the your chain/LLM run. This means that if you have a slow callback you can see an impact on the overall latency of your runs. You can make callbacks not be awaited by setting the environment variable `LANGCHAIN_...
langchainjs/docs/core_docs/docs/modules/callbacks/how_to/background_callbacks.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/callbacks/how_to/background_callbacks.mdx", "repo_id": "langchainjs", "token_count": 180 }
725
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use anyhow::Result; use candle::{test_utils, Device, Tensor}; use candle_nn::{LayerNorm, Module}; #[test] fn layer_norm() -> Result<()> { let device = &Device::Cpu; let w = Tensor::new(&[3f32], dev...
candle/candle-nn/tests/layer_norm.rs/0
{ "file_path": "candle/candle-nn/tests/layer_norm.rs", "repo_id": "candle", "token_count": 733 }
65
use crate::tokenizer::{Decoder, Result}; use serde::{Deserialize, Serialize}; #[derive(Deserialize, Clone, Debug, Serialize, Default)] /// Strip is a simple trick which converts tokens looking like `<0x61>` /// to pure bytes, and attempts to make them into a string. If the tokens /// cannot be decoded you will get � ...
tokenizers/tokenizers/src/decoders/strip.rs/0
{ "file_path": "tokenizers/tokenizers/src/decoders/strip.rs", "repo_id": "tokenizers", "token_count": 1217 }
429
import type { InputValues, PartialValues } from "../utils/types.js"; import type { SerializedBasePromptTemplate } from "./serde.js"; import { BasePromptTemplate, type BasePromptTemplateInput } from "./base.js"; import { ChatPromptTemplate } from "./chat.js"; /** * Type that includes the name of the prompt and the pro...
langchainjs/langchain-core/src/prompts/pipeline.ts/0
{ "file_path": "langchainjs/langchain-core/src/prompts/pipeline.ts", "repo_id": "langchainjs", "token_count": 2059 }
829
# Evaluating ## Concept Evaluation and benchmarking are crucial concepts in LLM development. To improve the performance of an LLM app (RAG, agents), you must have a way to measure it. LlamaIndex offers key modules to measure the quality of generated results. We also offer key modules to measure retrieval quality. -...
llama_index/docs/module_guides/evaluating/root.md/0
{ "file_path": "llama_index/docs/module_guides/evaluating/root.md", "repo_id": "llama_index", "token_count": 958 }
1,225
from unittest.mock import patch from llama_index.core.llms import CompletionResponse from llama_index.core.selectors.llm_selectors import ( LLMMultiSelector, LLMSingleSelector, ) from llama_index.core.service_context import ServiceContext from tests.mock_utils.mock_predict import _mock_single_select def test...
llama_index/llama-index-core/tests/selectors/test_llm_selectors.py/0
{ "file_path": "llama_index/llama-index-core/tests/selectors/test_llm_selectors.py", "repo_id": "llama_index", "token_count": 679 }
1,232
import { AsyncCaller, AsyncCallerParams } from "./utils/async_caller.js"; /** * The parameters required to initialize an instance of the Embeddings * class. */ export type EmbeddingsParams = AsyncCallerParams; export interface EmbeddingsInterface { /** * An abstract method that takes an array of documents as ...
langchainjs/langchain-core/src/embeddings.ts/0
{ "file_path": "langchainjs/langchain-core/src/embeddings.ts", "repo_id": "langchainjs", "token_count": 579 }
924
export { ChromaClient } from './ChromaClient'; export { AdminClient } from './AdminClient'; export { CloudClient } from './CloudClient'; export { Collection } from './Collection'; export { IEmbeddingFunction } from './embeddings/IEmbeddingFunction'; export { OpenAIEmbeddingFunction } from './embeddings/OpenAIEmbedding...
chroma/clients/js/src/index.ts/0
{ "file_path": "chroma/clients/js/src/index.ts", "repo_id": "chroma", "token_count": 489 }
30
[ { "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 50278, "logprob": null, "text": "<|USER|>" }, { "id": 1276, "logprob": -4.5546875, "text":...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_neox/test_flash_neox_load.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_neox/test_flash_neox_load.json", "repo_id": "text-generation-inference", "token_count": 6308 }
394
# coding=utf-8 # Copyright 2022 Intel Labs, OpenMMLab 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/license...
transformers/src/transformers/models/dpt/modeling_dpt.py/0
{ "file_path": "transformers/src/transformers/models/dpt/modeling_dpt.py", "repo_id": "transformers", "token_count": 24042 }
656
<jupyter_start><jupyter_text>Unit 8 Part 2: Advanced Deep Reinforcement Learning. Using Sample Factory to play Doom from pixelsIn this notebook, we will learn how to train a Deep Neural Network to collect objects in a 3D environment based on the game of Doom, a video of the resulting policy is shown below. We train thi...
deep-rl-class/notebooks/unit8/unit8_part2.ipynb/0
{ "file_path": "deep-rl-class/notebooks/unit8/unit8_part2.ipynb", "repo_id": "deep-rl-class", "token_count": 4950 }
156
.PHONY: clean-ptx clean test clean-ptx: find target -name "*.ptx" -type f -delete echo "" > candle-kernels/src/lib.rs touch candle-kernels/build.rs touch candle-examples/build.rs touch candle-flash-attn/build.rs clean: cargo clean test: cargo test all: test
candle/Makefile/0
{ "file_path": "candle/Makefile", "repo_id": "candle", "token_count": 107 }
24
"""MangoppsGuides reader.""" import re from typing import List from urllib.parse import urlparse from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class MangoppsGuidesReader(BaseReader): """MangoppsGuides reader. Reads data from a MangoppsGuides workspace. Ar...
llama_index/llama-index-integrations/readers/llama-index-readers-mangoapps-guides/llama_index/readers/mangoapps_guides/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mangoapps-guides/llama_index/readers/mangoapps_guides/base.py", "repo_id": "llama_index", "token_count": 2345 }
1,345
// 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/MemFileManagerImpl.h/0
{ "file_path": "milvus/internal/core/src/storage/MemFileManagerImpl.h", "repo_id": "milvus", "token_count": 821 }
1,807
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/singlestore", }); export * from "@langchain/community/vectorstores/singlestore";
langchainjs/langchain/src/vectorstores/singlestore.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/singlestore.ts", "repo_id": "langchainjs", "token_count": 74 }
966
# 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/src/diffusers/models/activations.py/0
{ "file_path": "diffusers/src/diffusers/models/activations.py", "repo_id": "diffusers", "token_count": 1678 }
238
"""Tool for the Exa Search API.""" from typing import Dict, List, Optional, Union from exa_py import Exa # type: ignore from exa_py.api import HighlightsContentsOptions, TextContentsOptions # type: ignore from langchain_core.callbacks import ( CallbackManagerForToolRun, ) from langchain_core.pydantic_v1 import ...
langchain/libs/partners/exa/langchain_exa/tools.py/0
{ "file_path": "langchain/libs/partners/exa/langchain_exa/tools.py", "repo_id": "langchain", "token_count": 2008 }
614
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/models/unet_2d_blocks.py/0
{ "file_path": "diffusers/src/diffusers/models/unet_2d_blocks.py", "repo_id": "diffusers", "token_count": 7248 }
243
<jupyter_start><jupyter_text>AWS S3 File>[Amazon Simple Storage Service (Amazon S3)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-folders.html) is an object storage service.>[AWS S3 Buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingBucket.html)This covers how to load document objects fr...
langchain/docs/docs/integrations/document_loaders/aws_s3_file.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/aws_s3_file.ipynb", "repo_id": "langchain", "token_count": 385 }
102
<jupyter_start><jupyter_text>Milvus Vector Store In this notebook we are going to show a quick demo of using the MilvusVectorStore. If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-vector-stores-milvus ! pip install llama-index import logg...
llama_index/docs/examples/vector_stores/MilvusIndexDemo.ipynb/0
{ "file_path": "llama_index/docs/examples/vector_stores/MilvusIndexDemo.ipynb", "repo_id": "llama_index", "token_count": 1714 }
1,083
poetry_requirements( name="poetry", ) python_sources( interpreter_constraints=["==3.10.*"], )
llama_index/llama-index-integrations/retrievers/llama-index-retrievers-pathway/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/retrievers/llama-index-retrievers-pathway/BUILD", "repo_id": "llama_index", "token_count": 48 }
1,447
from langchain_core.agents import AgentAction, AgentFinish from langchain.agents.output_parsers.self_ask import SelfAskOutputParser def test_follow_up() -> None: """Test follow up parsing.""" parser = SelfAskOutputParser() _input = "Follow up: what is two + 2" output = parser.invoke(_input) expec...
langchain/libs/langchain/tests/unit_tests/agents/output_parsers/test_self_ask.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/agents/output_parsers/test_self_ask.py", "repo_id": "langchain", "token_count": 578 }
646
<jupyter_start><jupyter_text>ChatGLM[ChatGLM-6B](https://github.com/THUDM/ChatGLM-6B) is an open bilingual language model based on General Language Model (GLM) framework, with 6.2 billion parameters. With the quantization technique, users can deploy locally on consumer-grade graphics cards (only 6GB of GPU memory is re...
langchain/docs/docs/integrations/llms/chatglm.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/chatglm.ipynb", "repo_id": "langchain", "token_count": 1323 }
126
import { GoogleAuthOptions } from "google-auth-library"; import { GoogleVertexAILLMConnection } from "../../utils/googlevertexai-connection.js"; import { GoogleVertexAIBaseLLMInput } from "../../types/googlevertexai-types.js"; import { BaseGoogleVertexAI } from "./common.js"; import { GAuthClient } from "../../utils/go...
langchainjs/libs/langchain-community/src/llms/googlevertexai/index.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/llms/googlevertexai/index.ts", "repo_id": "langchainjs", "token_count": 658 }
1,060
import pytest from tokenizers import CharBPETokenizer from ..utils import data_dir, multiprocessing_with_parallelism, openai_files class TestCharBPETokenizer: def test_basic_encode(self, openai_files): tokenizer = CharBPETokenizer.from_file(openai_files["vocab"], openai_files["merges"]) output ...
tokenizers/bindings/python/tests/implementations/test_char_bpe.py/0
{ "file_path": "tokenizers/bindings/python/tests/implementations/test_char_bpe.py", "repo_id": "tokenizers", "token_count": 1099 }
468
#!/usr/bin/env python3 import argparse import re from typing import Dict import torch from datasets import Audio, Dataset, load_dataset, load_metric from transformers import AutoFeatureExtractor, pipeline def log_results(result: Dataset, args: Dict[str, str]): """DO NOT CHANGE. This function computes and logs t...
transformers/examples/research_projects/robust-speech-event/eval.py/0
{ "file_path": "transformers/examples/research_projects/robust-speech-event/eval.py", "repo_id": "transformers", "token_count": 1852 }
552
# Using OpenAI functions This walkthrough demonstrates how to incorporate OpenAI function-calling API's in a chain. We'll go over: 1. How to use functions to get structured outputs from ChatOpenAI 2. How to create a generic chain that uses (multiple) functions 3. How to create a chain that actually executes the chose...
langchainjs/docs/core_docs/docs/modules/chains/additional/openai_functions/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/chains/additional/openai_functions/index.mdx", "repo_id": "langchainjs", "token_count": 557 }
752
#!/usr/bin/env python # 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...
transformers/src/transformers/commands/transformers_cli.py/0
{ "file_path": "transformers/src/transformers/commands/transformers_cli.py", "repo_id": "transformers", "token_count": 625 }
569
from typing import Optional from unittest.mock import MagicMock import pytest from langsmith.evaluation.evaluator import ( DynamicRunEvaluator, EvaluationResult, EvaluationResults, Example, Run, run_evaluator, ) @pytest.fixture def run_1() -> Run: run = MagicMock() run.inputs = {"inp...
langsmith-sdk/python/tests/unit_tests/evaluation/test_evaluator.py/0
{ "file_path": "langsmith-sdk/python/tests/unit_tests/evaluation/test_evaluator.py", "repo_id": "langsmith-sdk", "token_count": 1787 }
1,083
# Backend Dockerfile FROM python:3.11 # Install system dependencies RUN apt-get update && apt-get install -y libmagic1 && rm -rf /var/lib/apt/lists/* # Set the working directory WORKDIR /backend COPY . . RUN rm poetry.lock RUN pip install . ENTRYPOINT [ "uvicorn", "app.server:app", "--host", "0.0.0.0" ]
opengpts/backend/Dockerfile/0
{ "file_path": "opengpts/backend/Dockerfile", "repo_id": "opengpts", "token_count": 118 }
2,016
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-packs/llama-index-packs-snowflake-query-engine/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-snowflake-query-engine/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,819
# coding=utf-8 # 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 requir...
transformers/tests/models/codegen/test_modeling_codegen.py/0
{ "file_path": "transformers/tests/models/codegen/test_modeling_codegen.py", "repo_id": "transformers", "token_count": 10622 }
708
from ...utils import is_torch_available if is_torch_available(): from .dual_transformer_2d import DualTransformer2DModel from .prior_transformer import PriorTransformer from .t5_film_transformer import T5FilmDecoder from .transformer_2d import Transformer2DModel from .transformer_temporal import T...
diffusers/src/diffusers/models/transformers/__init__.py/0
{ "file_path": "diffusers/src/diffusers/models/transformers/__init__.py", "repo_id": "diffusers", "token_count": 110 }
245
from langchain_community.document_loaders.readthedocs import ( ReadTheDocsLoader, ) __all__ = [ "ReadTheDocsLoader", ]
langchain/libs/langchain/langchain/document_loaders/readthedocs.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/readthedocs.py", "repo_id": "langchain", "token_count": 51 }
515
# Copyright 2024 Open AI and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
diffusers/src/diffusers/pipelines/shap_e/renderer.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/shap_e/renderer.py", "repo_id": "diffusers", "token_count": 18166 }
262
"""init.py.""" from llama_index.tools.code_interpreter.base import ( CodeInterpreterToolSpec, ) __all__ = ["CodeInterpreterToolSpec"]
llama_index/llama-index-integrations/tools/llama-index-tools-code-interpreter/llama_index/tools/code_interpreter/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-code-interpreter/llama_index/tools/code_interpreter/__init__.py", "repo_id": "llama_index", "token_count": 52 }
1,475
# Tracing and Debugging Debugging and tracing the operation of your application is key to understanding and optimizing it. LlamaIndex provides a variety of ways to do this. ## Basic logging The simplest possible way to look into what your application is doing is to turn on debug logging. That can be done anywhere in...
llama_index/docs/understanding/tracing_and_debugging/tracing_and_debugging.md/0
{ "file_path": "llama_index/docs/understanding/tracing_and_debugging/tracing_and_debugging.md", "repo_id": "llama_index", "token_count": 488 }
1,104
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "llms/sagemaker_endpoint", }); export * from "@langchain/community/llms/sagemaker_endpoint";
langchainjs/langchain/src/llms/sagemaker_endpoint.ts/0
{ "file_path": "langchainjs/langchain/src/llms/sagemaker_endpoint.ts", "repo_id": "langchainjs", "token_count": 80 }
916
import pytest from langchain_core.documents import Document from langchain.indexes._api import _HashedDocument def test_hashed_document_hashing() -> None: hashed_document = _HashedDocument( uid="123", page_content="Lorem ipsum dolor sit amet", metadata={"key": "value"} ) assert isinstance(hashed_...
langchain/libs/langchain/tests/unit_tests/indexes/test_hashed_document.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/indexes/test_hashed_document.py", "repo_id": "langchain", "token_count": 621 }
601
/* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable no-process-env */ import { test } from "@jest/globals"; import { createClient } from "@vercel/kv"; import { VercelKVStore } from "../vercel_kv.js"; const getClient = () => { if (!process.env.VERCEL_KV_API_URL || !process.env.VERCEL_KV_A...
langchainjs/libs/langchain-community/src/storage/tests/vercel_kv.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/storage/tests/vercel_kv.int.test.ts", "repo_id": "langchainjs", "token_count": 1015 }
980
from langchain_experimental.tools.python.tool import PythonAstREPLTool, PythonREPLTool __all__ = ["PythonREPLTool", "PythonAstREPLTool"]
langchain/libs/experimental/langchain_experimental/tools/__init__.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/tools/__init__.py", "repo_id": "langchain", "token_count": 43 }
469
kind: StressChaos apiVersion: chaos-mesh.org/v1alpha1 metadata: name: test-etcd-memory-stress namespace: chaos-testing spec: selector: namespaces: - chaos-testing labelSelectors: app.kubernetes.io/name: etcd app.kubernetes.io/instance: mic-memory-etcd mode: all stressors: memory:...
milvus/tests/python_client/chaos/chaos_objects/memory_stress/chaos_etcd_memory_stress.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/memory_stress/chaos_etcd_memory_stress.yaml", "repo_id": "milvus", "token_count": 157 }
1,885
from langchain_core.utils.utils import ( build_extra_kwargs, check_package_version, convert_to_secret_str, get_pydantic_field_names, guard_import, mock_now, raise_for_status_with_text, xor_args, ) __all__ = [ "xor_args", "raise_for_status_with_text", "mock_now", "guard_i...
langchain/libs/langchain/langchain/utils/utils.py/0
{ "file_path": "langchain/libs/langchain/langchain/utils/utils.py", "repo_id": "langchain", "token_count": 205 }
569
package indexparamcheck import ( "fmt" "strconv" ) // diskannChecker checks if an diskann index can be built. type cagraChecker struct { floatVectorBaseChecker } func (c *cagraChecker) CheckTrain(params map[string]string) error { err := c.baseChecker.CheckTrain(params) if err != nil { return err } interDegr...
milvus/pkg/util/indexparamcheck/cagra_checker.go/0
{ "file_path": "milvus/pkg/util/indexparamcheck/cagra_checker.go", "repo_id": "milvus", "token_count": 493 }
1,904
import { OpenAI } from "@langchain/openai"; // To enable streaming, we pass in `streaming: true` to the LLM constructor. // Additionally, we pass in a handler for the `handleLLMNewToken` event. const model = new OpenAI({ maxTokens: 25, streaming: true, }); const response = await model.call("Tell me a joke.", { ...
langchainjs/examples/src/models/llm/llm_streaming.ts/0
{ "file_path": "langchainjs/examples/src/models/llm/llm_streaming.ts", "repo_id": "langchainjs", "token_count": 362 }
843
""" Attention Pool 2D Implementations of 2D spatial feature pooling using multi-head attention instead of average pool. Based on idea in CLIP by OpenAI, licensed Apache 2.0 https://github.com/openai/CLIP/blob/3b473b0e682c091a9e53623eebc1ca1657385717/clip/model.py Hacked together by / Copyright 2021 Ross Wightman """...
pytorch-image-models/timm/layers/attention_pool2d.py/0
{ "file_path": "pytorch-image-models/timm/layers/attention_pool2d.py", "repo_id": "pytorch-image-models", "token_count": 2301 }
342
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/pipelines/stable_diffusion_xl/pipeline_flax_stable_diffusion_xl.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_xl/pipeline_flax_stable_diffusion_xl.py", "repo_id": "diffusers", "token_count": 5250 }
269
from langchain.prompts.few_shot import __all__ EXPECTED_ALL = [ "FewShotChatMessagePromptTemplate", "FewShotPromptTemplate", "_FewShotPromptTemplateMixin", ] def test_all_imports() -> None: assert set(__all__) == set(EXPECTED_ALL)
langchain/libs/langchain/tests/unit_tests/prompts/test_few_shot.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/prompts/test_few_shot.py", "repo_id": "langchain", "token_count": 97 }
628
import { test } from "@jest/globals"; import type { HarmBlockThreshold, HarmCategory } from "@google/generative-ai"; import { ChatGoogleGenerativeAI } from "../chat_models.js"; test("Google AI - `temperature` must be in range [0.0,1.0]", async () => { expect( () => new ChatGoogleGenerativeAI({ temp...
langchainjs/libs/langchain-google-genai/src/tests/chat_models.test.ts/0
{ "file_path": "langchainjs/libs/langchain-google-genai/src/tests/chat_models.test.ts", "repo_id": "langchainjs", "token_count": 815 }
1,007
#!/usr/bin/env bash # Define the paths to the existing and new toml files existing_toml="pyproject.toml" thin_client_toml="clients/python/pyproject.toml" # Define the path to the thin client flag script is_thin_client_py="clients/python/is_thin_client.py" is_thin_client_target="chromadb/is_thin_client.py" # Define t...
chroma/clients/python/build_python_thin_client.sh/0
{ "file_path": "chroma/clients/python/build_python_thin_client.sh", "repo_id": "chroma", "token_count": 445 }
36
@tailwind base; @tailwind components; @tailwind utilities; body { color: #f8f8f8; background: #131318; } body input, body textarea { color: black; } a:hover { text-decoration: underline; } p { margin: 8px 0; } code { color: #ffa500; } li { padding: 4px; }
weblangchain/nextjs/app/globals.css/0
{ "file_path": "weblangchain/nextjs/app/globals.css", "repo_id": "weblangchain", "token_count": 123 }
2,212
import json import uuid from typing import Optional import requests from huggingface_hub import Discussion, HfApi, get_repo_discussions from .utils import cached_file, logging logger = logging.get_logger(__name__) def previous_pr(api: HfApi, model_id: str, pr_title: str, token: str) -> Optional["Discussion"]: ...
transformers/src/transformers/safetensors_conversion.py/0
{ "file_path": "transformers/src/transformers/safetensors_conversion.py", "repo_id": "transformers", "token_count": 1821 }
781
# coding=utf-8 # Copyright 2024 Mistral AI and the HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
transformers/src/transformers/models/mistral/modeling_flax_mistral.py/0
{ "file_path": "transformers/src/transformers/models/mistral/modeling_flax_mistral.py", "repo_id": "transformers", "token_count": 13485 }
665
# Advanced Cuda usage
candle/candle-book/src/inference/cuda/README.md/0
{ "file_path": "candle/candle-book/src/inference/cuda/README.md", "repo_id": "candle", "token_count": 6 }
29
from urllib.parse import quote import pytest from datasets.utils.hub import hf_hub_url @pytest.mark.parametrize("repo_id", ["canonical_dataset_name", "org-name/dataset-name"]) @pytest.mark.parametrize("filename", ["filename.csv", "filename with blanks.csv"]) @pytest.mark.parametrize("revision", [None, "v2"]) def te...
datasets/tests/test_hub.py/0
{ "file_path": "datasets/tests/test_hub.py", "repo_id": "datasets", "token_count": 219 }
150
"""Convert Bark checkpoint.""" import argparse import os from pathlib import Path import torch from bark.generation import _load_model as _bark_load_model from huggingface_hub import hf_hub_download from transformers import EncodecConfig, EncodecModel, set_seed from transformers.models.bark.configuration_bark import ...
transformers/src/transformers/models/bark/convert_suno_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/bark/convert_suno_to_hf.py", "repo_id": "transformers", "token_count": 3746 }
644
#!/usr/bin/env python # 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/LI...
transformers/examples/pytorch/image-pretraining/run_mim_no_trainer.py/0
{ "file_path": "transformers/examples/pytorch/image-pretraining/run_mim_no_trainer.py", "repo_id": "transformers", "token_count": 12909 }
586
#!/usr/bin/env python # coding=utf-8 # Copyright 2020 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/LI...
transformers/examples/pytorch/text-classification/run_glue.py/0
{ "file_path": "transformers/examples/pytorch/text-classification/run_glue.py", "repo_id": "transformers", "token_count": 11733 }
533
import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { OpenAIEmbeddings } from "@langchain/openai"; // Save the vector store to a directory const directory = "your/directory/here"; // Load the vector store from the same directory const loadedVectorStore = await HNSWLib.load(directory, new OpenA...
langchainjs/examples/src/indexes/vector_stores/hnswlib_delete.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/hnswlib_delete.ts", "repo_id": "langchainjs", "token_count": 108 }
785
# USearch >[USearch](https://unum-cloud.github.io/usearch/) is a Smaller & Faster Single-File Vector Search Engine. >`USearch's` base functionality is identical to `FAISS`, and the interface should look > familiar if you have ever investigated Approximate Nearest Neighbors search. > `USearch` and `FAISS` both employ...
langchain/docs/docs/integrations/providers/usearch.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/usearch.mdx", "repo_id": "langchain", "token_count": 221 }
163
import asyncio from typing import Any, Dict, List, Optional, Union from langchain.chains.base import Chain from langchain.chains.llm import LLMChain from langchain.prompts.few_shot import FewShotPromptTemplate from langchain.pydantic_v1 import BaseModel, root_validator from langchain_core.language_models import BaseLa...
langchain/libs/experimental/langchain_experimental/tabular_synthetic_data/base.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/tabular_synthetic_data/base.py", "repo_id": "langchain", "token_count": 2171 }
427
package common import ( "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) func TestCloneKeyValuePairs(t *testing.T) { type args struct { pairs KeyValuePairs } tests := []struct { name string args args want KeyValuePairs }{ { args: args{ p...
milvus/pkg/common/key_value_pairs_test.go/0
{ "file_path": "milvus/pkg/common/key_value_pairs_test.go", "repo_id": "milvus", "token_count": 360 }
2,084
from langchain_community.chat_models.mlflow_ai_gateway import ( ChatMLflowAIGateway, ChatParams, ) __all__ = ["ChatMLflowAIGateway", "ChatParams"]
langchain/libs/langchain/langchain/chat_models/mlflow_ai_gateway.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/mlflow_ai_gateway.py", "repo_id": "langchain", "token_count": 63 }
481
<!--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/model_doc/xlm.md/0
{ "file_path": "transformers/docs/source/en/model_doc/xlm.md", "repo_id": "transformers", "token_count": 1744 }
492
from typing import Any, Callable, Iterator, List, Mapping, Optional from langchain_core.documents import Document from langchain_core.utils.utils import guard_import from langchain_community.document_loaders.base import BaseLoader RecordHandler = Callable[[Any, Optional[str]], Document] class AirbyteCDKLoader(Base...
langchain/libs/community/langchain_community/document_loaders/airbyte.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/airbyte.py", "repo_id": "langchain", "token_count": 4454 }
243