text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from langchain_community.document_loaders.srt import SRTLoader __all__ = ["SRTLoader"]
langchain/libs/langchain/langchain/document_loaders/srt.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/srt.py", "repo_id": "langchain", "token_count": 29 }
517
import pytest from langchain_core.documents import Document from langchain_community.document_loaders import XorbitsLoader try: import xorbits # noqa: F401 xorbits_installed = True except ImportError: xorbits_installed = False @pytest.mark.skipif(not xorbits_installed, reason="xorbits not installed") ...
langchain/libs/community/tests/integration_tests/document_loaders/test_xorbits.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_xorbits.py", "repo_id": "langchain", "token_count": 826 }
348
"""Test LLM Bash functionality.""" import sys import pytest from langchain.schema import OutputParserException from langchain_experimental.llm_bash.base import LLMBashChain from langchain_experimental.llm_bash.prompt import _PROMPT_TEMPLATE, BashOutputParser from tests.unit_tests.fake_llm import FakeLLM _SAMPLE_COD...
langchain/libs/experimental/tests/unit_tests/test_llm_bash.py/0
{ "file_path": "langchain/libs/experimental/tests/unit_tests/test_llm_bash.py", "repo_id": "langchain", "token_count": 1028 }
459
"""Test Tracer classes.""" from __future__ import annotations from datetime import datetime, timezone from typing import Any, List from uuid import uuid4 import pytest from freezegun import freeze_time from langchain_core.callbacks import CallbackManager from langchain_core.messages import HumanMessage from langchai...
langchain/libs/core/tests/unit_tests/tracers/test_base_tracer.py/0
{ "file_path": "langchain/libs/core/tests/unit_tests/tracers/test_base_tracer.py", "repo_id": "langchain", "token_count": 11548 }
432
from llama_index.readers.apify.actor.base import ApifyActor from llama_index.readers.apify.dataset.base import ApifyDataset __all__ = ["ApifyActor", "ApifyDataset"]
llama_index/llama-index-integrations/readers/llama-index-readers-apify/llama_index/readers/apify/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-apify/llama_index/readers/apify/__init__.py", "repo_id": "llama_index", "token_count": 62 }
1,376
<!--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/testing.md/0
{ "file_path": "transformers/docs/source/en/testing.md", "repo_id": "transformers", "token_count": 13408 }
500
from typing import Any, Dict, List, Optional from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, Extra class QuantizedBiEncoderEmbeddings(BaseModel, Embeddings): """Quantized bi-encoders embedding models. Please ensure that you have installed optimum-intel and ...
langchain/libs/community/langchain_community/embeddings/optimum_intel.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/optimum_intel.py", "repo_id": "langchain", "token_count": 3362 }
260
"""Module to test generic parsers.""" from typing import Iterator import pytest from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseBlobParser from langchain_community.document_loaders.blob_loaders import Blob from langchain_community.document_loaders.parsers.gener...
langchain/libs/community/tests/unit_tests/document_loaders/parsers/test_generic.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/parsers/test_generic.py", "repo_id": "langchain", "token_count": 1539 }
366
import { test, expect } from "@jest/globals"; import { SyntheticEmbeddings } from "@langchain/core/utils/testing"; test("Synthetic basic", async () => { const embed = new SyntheticEmbeddings({ vectorSize: 5 }); const vector = await embed.embedQuery("aaaaaaaaaa"); expect(vector).toHaveLength(5); expect(vector[0...
langchainjs/langchain/src/embeddings/tests/fake.test.ts/0
{ "file_path": "langchainjs/langchain/src/embeddings/tests/fake.test.ts", "repo_id": "langchainjs", "token_count": 501 }
915
from llama_index.legacy.vector_stores.google.generativeai import set_google_config from .base import GoogleIndex __all__ = [ "set_google_config", "GoogleIndex", ]
llama_index/llama-index-legacy/llama_index/legacy/indices/managed/google/generativeai/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/managed/google/generativeai/__init__.py", "repo_id": "llama_index", "token_count": 61 }
1,519
# coding=utf-8 # Copyright 2024 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...
diffusers/utils/custom_init_isort.py/0
{ "file_path": "diffusers/utils/custom_init_isort.py", "repo_id": "diffusers", "token_count": 5345 }
284
import { ChatOpenAI } from "@langchain/openai"; import { HttpResponseOutputParser } from "langchain/output_parsers"; const handler = async () => { const parser = new HttpResponseOutputParser({ contentType: "text/event-stream", }); const model = new ChatOpenAI({ temperature: 0 }); // Values are stringifie...
langchainjs/examples/src/prompts/http_response_output_parser_event_stream.ts/0
{ "file_path": "langchainjs/examples/src/prompts/http_response_output_parser_event_stream.ts", "repo_id": "langchainjs", "token_count": 194 }
835
# Create Index `Index system` is the core part of `Milvus`, which is used to speed up the searches, this document introduces which components are involved in `Create Index`,and what these components do. The execution flow of `Create Index` is shown in the following figure: ![create_index](./graphs/milvus_create_inde...
milvus/docs/design_docs/20211227-milvus_create_index.md/0
{ "file_path": "milvus/docs/design_docs/20211227-milvus_create_index.md", "repo_id": "milvus", "token_count": 2863 }
1,767
kind: StressChaos apiVersion: chaos-mesh.org/v1alpha1 metadata: name: test-querynode-memory-stress namespace: chaos-testing spec: selector: namespaces: - chaos-testing labelSelectors: app.kubernetes.io/name: milvus app.kubernetes.io/instance: mic-memory app.kubernetes.io/component:...
milvus/tests/python_client/chaos/chaos_objects/memory_stress/chaos_querynode_memory_stress.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/memory_stress/chaos_querynode_memory_stress.yaml", "repo_id": "milvus", "token_count": 181 }
2,106
module.exports = { extends: [ "airbnb-base", "eslint:recommended", "prettier", "plugin:@typescript-eslint/recommended", ], parserOptions: { ecmaVersion: 12, parser: "@typescript-eslint/parser", sourceType: "module", }, plugins: ["@typescript-eslint", "unused-imports"], rules: { ...
langchainjs/examples/.eslintrc.cjs/0
{ "file_path": "langchainjs/examples/.eslintrc.cjs", "repo_id": "langchainjs", "token_count": 639 }
776
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/main_classes/agent.md/0
{ "file_path": "transformers/docs/source/ja/main_classes/agent.md", "repo_id": "transformers", "token_count": 1455 }
488
from typing import Callable, Optional, Union from uuid import UUID from langchain_core.runnables.config import ( RunnableConfig, call_func_with_variable_args, ) from langchain_core.tracers.base import BaseTracer from langchain_core.tracers.schemas import Run Listener = Union[Callable[[Run], None], Callable[[R...
langchain/libs/core/langchain_core/tracers/root_listeners.py/0
{ "file_path": "langchain/libs/core/langchain_core/tracers/root_listeners.py", "repo_id": "langchain", "token_count": 745 }
399
"""ClickHouse vector store. An index that is built on top of an existing ClickHouse cluster. """ import importlib import json import logging import re from typing import Any, Dict, List, Optional, cast from pydantic import PrivateAttr from llama_index.core import ServiceContext from llama_index.core.schema import (...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-clickhouse/llama_index/vector_stores/clickhouse/base.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-clickhouse/llama_index/vector_stores/clickhouse/base.py", "repo_id": "llama_index", "token_count": 7228 }
1,520
from .testing import ( are_the_same_tensors, assert_exception, device_count, execute_subprocess_async, memory_allocated_func, require_bnb, require_cpu, require_cuda, require_huggingface_suite, require_mps, require_multi_device, require_multi_gpu, require_multi_xpu, ...
accelerate/src/accelerate/test_utils/__init__.py/0
{ "file_path": "accelerate/src/accelerate/test_utils/__init__.py", "repo_id": "accelerate", "token_count": 320 }
13
python_sources()
llama_index/llama-index-packs/llama-index-packs-recursive-retriever/llama_index/packs/recursive_retriever/small_to_big/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-recursive-retriever/llama_index/packs/recursive_retriever/small_to_big/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,587
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction // import all entrypoints to test, do not do this in your own app import "../../entrypoints.js"; // Import a few things we'll use to test the exports import { LLMChain } from "langchain/chains"; import { ChatOpenAI } from "langchain/chat_mo...
langchainjs/environment_tests/test-exports-vercel/src/pages/api/hello-serverless.ts/0
{ "file_path": "langchainjs/environment_tests/test-exports-vercel/src/pages/api/hello-serverless.ts", "repo_id": "langchainjs", "token_count": 488 }
763
# coding=utf-8 # Copyright 2023 The Intel AIA Team Authors, and HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License=, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lice...
transformers/src/transformers/models/tvp/processing_tvp.py/0
{ "file_path": "transformers/src/transformers/models/tvp/processing_tvp.py", "repo_id": "transformers", "token_count": 2826 }
664
import { createOpenAPIChain } from "langchain/chains"; const chain = await createOpenAPIChain( "https://gist.githubusercontent.com/roaldnefs/053e505b2b7a807290908fe9aa3e1f00/raw/0a212622ebfef501163f91e23803552411ed00e4/openapi.yaml" ); const result = await chain.run(`What's today's comic?`); console.log(JSON.string...
langchainjs/examples/src/chains/openai_functions_openapi_simple.ts/0
{ "file_path": "langchainjs/examples/src/chains/openai_functions_openapi_simple.ts", "repo_id": "langchainjs", "token_count": 309 }
762
import pytest import pymilvus from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from common.milvus_sys import MilvusSys from utils.util_pymilvus import * from deploy.base import TestDeployBase from deploy.common import gen_index_param, gen_sea...
milvus/tests/python_client/deploy/testcases/test_action_first_deployment.py/0
{ "file_path": "milvus/tests/python_client/deploy/testcases/test_action_first_deployment.py", "repo_id": "milvus", "token_count": 4678 }
1,970
from langchain_community.utilities.tavily_search import TavilySearchAPIWrapper def test_api_wrapper_api_key_not_visible() -> None: """Test that an exception is raised if the API key is not present.""" wrapper = TavilySearchAPIWrapper(tavily_api_key="abcd123") assert "abcd123" not in repr(wrapper)
langchain/libs/community/tests/unit_tests/utilities/test_tavily.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/utilities/test_tavily.py", "repo_id": "langchain", "token_count": 103 }
406
[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 = ["ElasticsearchStore"] contains_example = false import_path = "llama_index.vector_stores.el...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-elasticsearch/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-elasticsearch/pyproject.toml", "repo_id": "llama_index", "token_count": 652 }
1,481
<jupyter_start><jupyter_code>import openai openai.api_key = "sk-you-key" from llama_index.agent import OpenAIAgent from llama_index.llms import OpenAI # Import and initialize our tool spec from llama_index.tools.zapier.base import ZapierToolSpec zapier_spec = ZapierToolSpec(api_key="sk-ak-your-key") tools = zapier_sp...
llama_index/llama-index-integrations/tools/llama-index-tools-zapier/examples/zapier.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-zapier/examples/zapier.ipynb", "repo_id": "llama_index", "token_count": 709 }
1,644
# 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/accuracy/accuracy.py/0
{ "file_path": "datasets/metrics/accuracy/accuracy.py", "repo_id": "datasets", "token_count": 1611 }
116
// 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/params/params.go/0
{ "file_path": "milvus/internal/querycoordv2/params/params.go", "repo_id": "milvus", "token_count": 650 }
1,981
from llama_index.retrievers.bm25.base import BM25Retriever __all__ = ["BM25Retriever"]
llama_index/llama-index-integrations/retrievers/llama-index-retrievers-bm25/llama_index/retrievers/bm25/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/retrievers/llama-index-retrievers-bm25/llama_index/retrievers/bm25/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,446
/* eslint-disable */ /** * Generated data model types. * * THIS CODE IS AUTOMATICALLY GENERATED. * * Generated by convex@1.3.1. * To regenerate, run `npx convex dev`. * @module */ import type { DataModelFromSchemaDefinition } from "convex/server"; import type { DocumentByName, TableNamesInDataModel } from "con...
langchainjs/libs/langchain-community/src/vectorstores/tests/convex/convex/_generated/dataModel.d.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/convex/convex/_generated/dataModel.d.ts", "repo_id": "langchainjs", "token_count": 502 }
970
- title: Unit 0. Welcome to the course sections: - local: unit0/introduction title: Welcome to the course 🤗 - local: unit0/setup title: Setup - local: unit0/discord101 title: Discord 101 - title: Unit 1. Introduction to Deep Reinforcement Learning sections: - local: unit1/introduction title...
deep-rl-class/units/en/_toctree.yml/0
{ "file_path": "deep-rl-class/units/en/_toctree.yml", "repo_id": "deep-rl-class", "token_count": 2743 }
161
# for backward compatibility from llama_index.legacy.postprocessor import ( AutoPrevNextNodePostprocessor, CohereRerank, EmbeddingRecencyPostprocessor, FixedRecencyPostprocessor, KeywordNodePostprocessor, LLMRerank, LongContextReorder, LongLLMLinguaPostprocessor, MetadataReplacementP...
llama_index/llama-index-legacy/llama_index/legacy/indices/postprocessor.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/postprocessor.py", "repo_id": "llama_index", "token_count": 387 }
1,500
{ "embedding_dict": {}, "text_id_to_ref_doc_id": {}, "metadata_dict": {} }
llama_index/llama-index-core/storage/default__vector_store.json/0
{ "file_path": "llama_index/llama-index-core/storage/default__vector_store.json", "repo_id": "llama_index", "token_count": 32 }
1,153
<jupyter_start><jupyter_text>Bash chainThis notebook showcases using LLMs and a bash process to perform simple filesystem commands.<jupyter_code>from langchain_experimental.llm_bash.base import LLMBashChain from langchain_openai import OpenAI llm = OpenAI(temperature=0) text = "Please write a bash script that prints ...
langchain/cookbook/llm_bash.ipynb/0
{ "file_path": "langchain/cookbook/llm_bash.ipynb", "repo_id": "langchain", "token_count": 1113 }
79
//load Candle Bert Module wasm module let init, ModelEncoder; async function fetchArrayBuffer(url) { const cacheName = "t5-candle-cache"; const cache = await caches.open(cacheName); const cachedResponse = await cache.match(url); if (cachedResponse) { const data = await cachedResponse.arrayBuffer(); ret...
candle/candle-wasm-examples/t5/T5ModelEncoderWorker.js/0
{ "file_path": "candle/candle-wasm-examples/t5/T5ModelEncoderWorker.js", "repo_id": "candle", "token_count": 873 }
78
#!/bin/bash if [[ -z "${HF_MODEL_ID}" ]]; then echo "HF_MODEL_ID must be set" exit 1 fi export MODEL_ID="${HF_MODEL_ID}" if [[ -n "${HF_MODEL_REVISION}" ]]; then export REVISION="${HF_MODEL_REVISION}" fi if [[ -n "${SM_NUM_GPUS}" ]]; then export NUM_SHARD="${SM_NUM_GPUS}" fi if [[ -n "${HF_MODEL_QUANTIZE}" ...
text-generation-inference/sagemaker-entrypoint.sh/0
{ "file_path": "text-generation-inference/sagemaker-entrypoint.sh", "repo_id": "text-generation-inference", "token_count": 239 }
394
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/file_utils.py/0
{ "file_path": "transformers/src/transformers/file_utils.py", "repo_id": "transformers", "token_count": 1564 }
621
from langchain_community.retrievers.wikipedia import WikipediaRetriever __all__ = ["WikipediaRetriever"]
langchain/libs/langchain/langchain/retrievers/wikipedia.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/wikipedia.py", "repo_id": "langchain", "token_count": 29 }
540
<!--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/ja/model_doc/conditional_detr.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/conditional_detr.md", "repo_id": "transformers", "token_count": 1847 }
493
# coding=utf-8 # 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 requir...
transformers/src/transformers/models/clvp/convert_clvp_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/clvp/convert_clvp_to_hf.py", "repo_id": "transformers", "token_count": 4095 }
620
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/splinter/test_modeling_splinter.py/0
{ "file_path": "transformers/tests/models/splinter/test_modeling_splinter.py", "repo_id": "transformers", "token_count": 9643 }
750
# candle-whisper: speech recognition An implementation of [OpenAI Whisper](https://github.com/openai/whisper) using candle. Whisper is a general purpose speech recognition model, it can be used to convert audio files (in the `.wav` format) to text. Supported features include language detection as well as multilingual ...
candle/candle-examples/examples/whisper/README.md/0
{ "file_path": "candle/candle-examples/examples/whisper/README.md", "repo_id": "candle", "token_count": 569 }
52
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/chat_templating.md/0
{ "file_path": "transformers/docs/source/en/chat_templating.md", "repo_id": "transformers", "token_count": 6715 }
466
"""Test LLM saving and loading functions.""" from pathlib import Path from unittest.mock import patch from langchain_community.llms.loading import load_llm from tests.unit_tests.llms.fake_llm import FakeLLM @patch( "langchain_community.llms.loading.get_type_to_cls_dict", lambda: {"fake": lambda: FakeLLM}, ) ...
langchain/libs/community/tests/unit_tests/llms/test_loading.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/llms/test_loading.py", "repo_id": "langchain", "token_count": 229 }
409
import { Ai } from "@cloudflare/ai"; import { Fetcher } from "@cloudflare/workers-types"; import { Embeddings, EmbeddingsParams } from "@langchain/core/embeddings"; import { chunkArray } from "@langchain/core/utils/chunk_array"; type AiTextEmbeddingsInput = { text: string | string[]; }; type AiTextEmbeddingsOutput ...
langchainjs/libs/langchain-cloudflare/src/embeddings.ts/0
{ "file_path": "langchainjs/libs/langchain-cloudflare/src/embeddings.ts", "repo_id": "langchainjs", "token_count": 968 }
1,045
# 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/experimental/rl/value_guided_sampling.py/0
{ "file_path": "diffusers/src/diffusers/experimental/rl/value_guided_sampling.py", "repo_id": "diffusers", "token_count": 2639 }
236
<jupyter_start><jupyter_text>---sidebar_position: 0title: Prompt + LLM---<jupyter_code>The most common and valuable composition is taking: ``PromptTemplate`` / ``ChatPromptTemplate`` -> ``LLM`` / ``ChatModel`` -> ``OutputParser`` Almost any other chains you build will use this building block. ## PromptTemplate + LLM ...
langchain/docs/docs/expression_language/cookbook/prompt_llm_parser.ipynb/0
{ "file_path": "langchain/docs/docs/expression_language/cookbook/prompt_llm_parser.ipynb", "repo_id": "langchain", "token_count": 1397 }
89
use candle::{CpuStorage, Layout, Result, Shape, Tensor}; use rayon::prelude::*; /// Applies the softmax function to the input tensor, rescaling the element so that elements on /// a slice of fixed index on dimension `dim` are between 0 and 1 and sum to 1. /// /// ```rust /// use candle::{Tensor, Device, test_utils::to...
candle/candle-nn/src/ops.rs/0
{ "file_path": "candle/candle-nn/src/ops.rs", "repo_id": "candle", "token_count": 5205 }
64
from typing import Optional, Sequence, TypeVar, Type from abc import abstractmethod from chromadb.types import ( Collection, MetadataEmbeddingRecord, Operation, VectorEmbeddingRecord, Where, WhereDocument, VectorQuery, VectorQueryResult, Segment, SeqId, Metadata, ) from chrom...
chroma/chromadb/segment/__init__.py/0
{ "file_path": "chroma/chromadb/segment/__init__.py", "repo_id": "chroma", "token_count": 1497 }
21
--- sidebar_class_name: node-only hide_table_of_contents: true --- # GitHub This example goes over how to load data from a GitHub repository. You can set the `GITHUB_ACCESS_TOKEN` environment variable to a GitHub access token to increase the rate limit and access private repositories. ## Setup The GitHub loader req...
langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/github.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/github.mdx", "repo_id": "langchainjs", "token_count": 651 }
728
# Predibase Learn how to use LangChain with models on Predibase. ## Setup - Create a [Predibase](https://predibase.com/) account and [API key](https://docs.predibase.com/sdk-guide/intro). - Install the Predibase Python client with `pip install predibase` - Use your API key to authenticate ### LLM Predibase integra...
langchain/docs/docs/integrations/providers/predibase.md/0
{ "file_path": "langchain/docs/docs/integrations/providers/predibase.md", "repo_id": "langchain", "token_count": 254 }
145
from io import StringIO from typing import Any, Callable, List, Optional import pandas as pd from llama_index.legacy.node_parser.relational.base_element import ( BaseElementNodeParser, Element, ) from llama_index.legacy.schema import BaseNode, TextNode def md_to_df(md_str: str) -> pd.DataFrame: """Conve...
llama_index/llama-index-legacy/llama_index/legacy/node_parser/relational/markdown_element.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/node_parser/relational/markdown_element.py", "repo_id": "llama_index", "token_count": 4732 }
1,584
import { Client, ClientConfiguration, HubPushOptions } from "langchainhub"; import { Runnable } from "@langchain/core/runnables"; import { load } from "./load/index.js"; /** * Push a prompt to the hub. * If the specified repo doesn't already exist, it will be created. * @param repoFullName The full name of the repo...
langchainjs/langchain/src/hub.ts/0
{ "file_path": "langchainjs/langchain/src/hub.ts", "repo_id": "langchainjs", "token_count": 321 }
964
/* * Adapted from * https://github.com/NVIDIA/FasterTransformer/blob/release/v5.3_tag/src/fastertransformer/kernels/reduce_kernel_utils.cuh * Copyright (c) 2023, The vLLM team. * Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); ...
candle/candle-examples/examples/custom-ops/kernels/reduction_utils.cuh/0
{ "file_path": "candle/candle-examples/examples/custom-ops/kernels/reduction_utils.cuh", "repo_id": "candle", "token_count": 529 }
36
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-milvus/llama_index/readers/milvus/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-milvus/llama_index/readers/milvus/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,430
from langgraph.utils import StrEnum class ReservedChannels(StrEnum): """Channels managed by the framework.""" is_last_step = "is_last_step" """A channel that is True if the current step is the last step, False otherwise."""
langgraph/langgraph/pregel/reserved.py/0
{ "file_path": "langgraph/langgraph/pregel/reserved.py", "repo_id": "langgraph", "token_count": 74 }
1,035
package tso import ( "time" ) // TODO(longjiquan): replace this by mockery. type MockAllocator struct { Allocator InitializeF func() error UpdateTSOF func() error SetTSOF func(tso uint64) error GenerateTSOF func(count uint32) (uint64, error) ResetF func() GetLastSavedTi...
milvus/internal/tso/mock_global_allocator.go/0
{ "file_path": "milvus/internal/tso/mock_global_allocator.go", "repo_id": "milvus", "token_count": 368 }
1,791
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::{test_utils::to_vec3_round, Device, Result, Tensor}; #[test] fn softmax() -> Result<()> { let device = &Device::Cpu; let data = &[[[3f32, 1., 4.], [1., 5., 9.]], [[2., 1., 7.], [8., 2.,...
candle/candle-nn/tests/ops.rs/0
{ "file_path": "candle/candle-nn/tests/ops.rs", "repo_id": "candle", "token_count": 1170 }
59
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 330, "logprob": null, "text": "ir" }, { "id": 1622, "logprob": -7.8125, "text": "af" }, { "id": 249, ...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_falcon/test_flash_falcon_all_params.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_falcon/test_flash_falcon_all_params.json", "repo_id": "text-generation-inference", "token_count": 1204 }
399
from __future__ import annotations from typing import Any, Dict, List, Type from langchain_core.chat_history import BaseChatMessageHistory from langchain_core.language_models import BaseLanguageModel from langchain_core.messages import BaseMessage, SystemMessage, get_buffer_string from langchain_core.prompts import B...
langchain/libs/langchain/langchain/memory/summary.py/0
{ "file_path": "langchain/libs/langchain/langchain/memory/summary.py", "repo_id": "langchain", "token_count": 1364 }
524
<script lang="ts"> import { marked } from "marked"; import privacy from "../../../PRIVACY.md?raw"; </script> <div class="overflow-auto p-6"> <div class="prose mx-auto px-4 pb-24 pt-6 dark:prose-invert md:pt-12"> <!-- eslint-disable-next-line svelte/no-at-html-tags --> {@html marked(privacy, { gfm: true })} </d...
chat-ui/src/routes/privacy/+page.svelte/0
{ "file_path": "chat-ui/src/routes/privacy/+page.svelte", "repo_id": "chat-ui", "token_count": 141 }
102
# Dataset features [`Features`] defines the internal structure of a dataset. It is used to specify the underlying serialization format. What's more interesting to you though is that [`Features`] contains high-level information about everything from the column names and types, to the [`ClassLabel`]. You can think of [`...
datasets/docs/source/about_dataset_features.mdx/0
{ "file_path": "datasets/docs/source/about_dataset_features.mdx", "repo_id": "datasets", "token_count": 2334 }
110
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-packs/llama-index-packs-sentence-window-retriever/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-sentence-window-retriever/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,728
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/whisper/test_processor_whisper.py/0
{ "file_path": "transformers/tests/models/whisper/test_processor_whisper.py", "repo_id": "transformers", "token_count": 2869 }
758
<jupyter_start><jupyter_text>Huggingface Sagemaker-sdk - Distributed Training Demo Distributed Question Answering with `transformers` scripts + `Trainer` and `squad` dataset 1. [Introduction](Introduction) 2. [Development Environment and Permissions](Development-Environment-and-Permissions) 1. [Installation](Insta...
notebooks/sagemaker/03_distributed_training_data_parallelism/sagemaker-notebook.ipynb/0
{ "file_path": "notebooks/sagemaker/03_distributed_training_data_parallelism/sagemaker-notebook.ipynb", "repo_id": "notebooks", "token_count": 3514 }
316
<!--⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be rendered properly in your Markdown viewer. --> # 웹 서버를 위한 파이프라인 사용하기[[using_pipelines_for_a_webserver]] <Tip> 추론 엔진을 만드는 것은 복잡한 주제이며, "최선의" 솔루션은 문제 공간에 따라 달라질 가능성이 높습니다. CPU 또는 GPU를 사용하는지에 따라 다르고...
transformers/docs/source/ko/pipeline_webserver.md/0
{ "file_path": "transformers/docs/source/ko/pipeline_webserver.md", "repo_id": "transformers", "token_count": 6174 }
506
// Copyright (C) 2019-2023 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/src/simd/sse2.h/0
{ "file_path": "milvus/internal/core/src/simd/sse2.h", "repo_id": "milvus", "token_count": 664 }
1,803
"""Azure CosmosDB Memory History.""" from __future__ import annotations import logging from types import TracebackType from typing import TYPE_CHECKING, Any, List, Optional, Type from langchain_core.chat_history import BaseChatMessageHistory from langchain_core.messages import ( BaseMessage, messages_from_dic...
langchain/libs/community/langchain_community/chat_message_histories/cosmos_db.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_message_histories/cosmos_db.py", "repo_id": "langchain", "token_count": 2783 }
221
export * from "@langchain/community/retrievers/vespa";
langchainjs/langchain/src/retrievers/vespa.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/vespa.ts", "repo_id": "langchainjs", "token_count": 17 }
963
# 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/utils/accelerate_utils.py/0
{ "file_path": "diffusers/src/diffusers/utils/accelerate_utils.py", "repo_id": "diffusers", "token_count": 558 }
274
from llama_index.core.tools.tool_spec.base import BaseToolSpec from llama_index.tools.python_file import PythonFileToolSpec def test_class(): names_of_base_classes = [b.__name__ for b in PythonFileToolSpec.__mro__] assert BaseToolSpec.__name__ in names_of_base_classes
llama_index/llama-index-integrations/tools/llama-index-tools-python-file/tests/test_tools_python_file.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-python-file/tests/test_tools_python_file.py", "repo_id": "llama_index", "token_count": 95 }
1,525
# Copyright 2022 - Intel Corp. All rights reserved. # Authors: Mayank Kumar Raunak, Javier Turek, Nicole Backage import copy import logging import random import joblib import numpy as np import torch import torch.nn as nn from torch.utils.data import DataLoader from tqdm import tqdm from transformers import AdamW, G...
transformers/examples/research_projects/information-gain-filtration/igf/igf.py/0
{ "file_path": "transformers/examples/research_projects/information-gain-filtration/igf/igf.py", "repo_id": "transformers", "token_count": 6107 }
543
python_tests()
llama_index/llama-index-integrations/program/llama-index-program-openai/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/program/llama-index-program-openai/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,272
"""Google Search tool spec.""" import urllib.parse from typing import Optional import requests from llama_index.core.schema import Document from llama_index.core.tools.tool_spec.base import BaseToolSpec QUERY_URL_TMPL = ( "https://www.googleapis.com/customsearch/v1?key={key}&cx={engine}&q={query}" ) class Goog...
llama_index/llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/search/base.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-google/llama_index/tools/google/search/base.py", "repo_id": "llama_index", "token_count": 586 }
1,425
from __future__ import annotations from typing import Any, Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.tools import BaseTool from langchain_community.utilities.brave_search import BraveSearchWrapper class BraveSearch(BaseTool): """Tool that queries the BraveSearc...
langchain/libs/community/langchain_community/tools/brave_search/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/brave_search/tool.py", "repo_id": "langchain", "token_count": 529 }
293
<jupyter_start><jupyter_text>LoRAs of the World Unite - Training SOTA DreamBooth LoRA with Pivotal Tuning 🧨In this notebook, we show how to fine-tune [Stable Diffusion XL (SDXL)](https://huggingface.co/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl) with [DreamBooth](https://huggingface.co/d...
notebooks/diffusers/SDXL_Dreambooth_LoRA_advanced_example.ipynb/0
{ "file_path": "notebooks/diffusers/SDXL_Dreambooth_LoRA_advanced_example.ipynb", "repo_id": "notebooks", "token_count": 6610 }
313
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-s3/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-s3/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,414
from langchain_core.documents import Document from langchain_exa import ExaSearchRetriever def test_exa_retriever() -> None: retriever = ExaSearchRetriever() res = retriever.invoke("best time to visit japan") print(res) # noqa: T201 assert len(res) == 10 # default k assert isinstance(res, list)...
langchain/libs/partners/exa/tests/integration_tests/test_retriever.py/0
{ "file_path": "langchain/libs/partners/exa/tests/integration_tests/test_retriever.py", "repo_id": "langchain", "token_count": 323 }
682
import os from typing import List, Tuple from langchain.agents import AgentExecutor from langchain.agents.format_scratchpad import format_to_openai_function_messages from langchain.agents.output_parsers import OpenAIFunctionsAgentOutputParser from langchain_community.chat_models import ChatOpenAI from langchain_commun...
langchain/templates/openai-functions-agent-gmail/openai_functions_agent/agent.py/0
{ "file_path": "langchain/templates/openai-functions-agent-gmail/openai_functions_agent/agent.py", "repo_id": "langchain", "token_count": 1095 }
681
/* eslint-disable */ // tslint:disable /** * FastAPI * * * OpenAPI spec version: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator+. * https://github.com/karlvr/openapi-generator-plus * Do not edit the class manually. */ export namespace Api { export interface Add201Response { } export ...
chroma/clients/js/src/generated/models.ts/0
{ "file_path": "chroma/clients/js/src/generated/models.ts", "repo_id": "chroma", "token_count": 2220 }
32
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-neo4jvector/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-neo4jvector/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,529
package proxy import ( "context" "google.golang.org/grpc" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) // DatabaseInterceptor fill dbname into request based on kv pair <"dbname": "xx"> in header func DatabaseInterceptor() grpc.UnaryServerInterceptor { return func(ctx context.Context, req any, info *...
milvus/internal/proxy/database_interceptor.go/0
{ "file_path": "milvus/internal/proxy/database_interceptor.go", "repo_id": "milvus", "token_count": 3057 }
1,814
from langchain_community.document_transformers.google_translate import ( GoogleTranslateTransformer, ) __all__ = ["GoogleTranslateTransformer"]
langchain/libs/langchain/langchain/document_transformers/google_translate.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_transformers/google_translate.py", "repo_id": "langchain", "token_count": 43 }
542
import os from typing import Callable, List, Optional from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader class GitLoader(BaseLoader): """Load `Git` repository files. The Repository can be local on disk available at `repo_path`, or remote at `c...
langchain/libs/community/langchain_community/document_loaders/git.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/git.py", "repo_id": "langchain", "token_count": 1969 }
256
--- hide_table_of_contents: true --- # Notion markdown export This example goes over how to load data from your Notion pages exported from the notion dashboard. First, export your notion pages as **Markdown & CSV** as per the offical explanation [here](https://www.notion.so/help/export-your-content). Make sure to se...
langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/notion_markdown.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/notion_markdown.mdx", "repo_id": "langchainjs", "token_count": 201 }
726
{ "language": [ "found", "crowdsourced", "expert-generated", "machine-generated", "other" ], "annotations": [ "found", "crowdsourced", "expert-generated", "machine-generated", "no-annotation", "other" ] }
datasets/src/datasets/utils/resources/creators.json/0
{ "file_path": "datasets/src/datasets/utils/resources/creators.json", "repo_id": "datasets", "token_count": 119 }
144
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/examples/legacy/seq2seq/finetune_tpu.sh/0
{ "file_path": "transformers/examples/legacy/seq2seq/finetune_tpu.sh", "repo_id": "transformers", "token_count": 323 }
557
# Metric Card for ROUGE ## Metric Description ROUGE, or Recall-Oriented Understudy for Gisting Evaluation, is a set of metrics and a software package used for evaluating automatic summarization and machine translation software in natural language processing. The metrics compare an automatically produced summary or tra...
datasets/metrics/rouge/README.md/0
{ "file_path": "datasets/metrics/rouge/README.md", "repo_id": "datasets", "token_count": 2244 }
129
python_sources()
llama_index/llama-index-packs/llama-index-packs-redis-ingestion-pipeline/llama_index/packs/redis_ingestion_pipeline/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-redis-ingestion-pipeline/llama_index/packs/redis_ingestion_pipeline/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,670
"""A simple progress bar for the console.""" import threading from typing import Any, Dict, Optional, Sequence from uuid import UUID from langchain_core.documents import Document from langchain_core.outputs import LLMResult from langchain.callbacks import base as base_callbacks class ProgressBarCallback(base_callb...
langchain/libs/langchain/langchain/smith/evaluation/progress.py/0
{ "file_path": "langchain/libs/langchain/langchain/smith/evaluation/progress.py", "repo_id": "langchain", "token_count": 1629 }
547
/* eslint-disable no-process-env */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { test, expect } from "@jest/globals"; import { createClient } from "@supabase/supabase-js"; import { OpenAIEmbeddings } from "@langchain/openai"; import { Document } from "@langchain/core/documents"; import { Supa...
langchainjs/libs/langchain-community/src/vectorstores/tests/supabase.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/supabase.int.test.ts", "repo_id": "langchainjs", "token_count": 4677 }
985
# candle-reinforcement-learning Reinforcement Learning examples for candle. This has been tested with `gymnasium` version `0.29.1`. You can install the Python package with: ```bash pip install "gymnasium[accept-rom-license]" ``` In order to run the examples, use the following commands. Note the additional `--package...
candle/candle-examples/examples/reinforcement-learning/README.md/0
{ "file_path": "candle/candle-examples/examples/reinforcement-learning/README.md", "repo_id": "candle", "token_count": 198 }
45
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/util/importutil/numpy_parser.go/0
{ "file_path": "milvus/internal/util/importutil/numpy_parser.go", "repo_id": "milvus", "token_count": 8917 }
1,938
parser: '@typescript-eslint/parser' parserOptions: ecmaFeatures: jsx: true ecmaVersion: latest sourceType: module project: ./tsconfig.json env: browser: true es6: true node: true jest: true ignorePatterns: ['index.js', 'target/'] plugins: - import - '@typescript-eslint' extends: - eslint:...
tokenizers/bindings/node/.eslintrc.yml/0
{ "file_path": "tokenizers/bindings/node/.eslintrc.yml", "repo_id": "tokenizers", "token_count": 2733 }
404
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "tools/aws_lambda", }); export * from "@langchain/community/tools/aws_lambda";
langchainjs/langchain/src/tools/aws_lambda.ts/0
{ "file_path": "langchainjs/langchain/src/tools/aws_lambda.ts", "repo_id": "langchainjs", "token_count": 72 }
993
import random from typing import Any, List, Optional, Tuple from llama_index.core.bridge.pydantic import BaseModel from llama_index.core.indices.query.embedding_utils import get_top_k_embeddings from llama_index.finetuning import EmbeddingQAFinetuneDataset class CohereRerankerFinetuneDataset(BaseModel): """Class...
llama_index/llama-index-finetuning/llama_index/finetuning/rerankers/dataset_gen.py/0
{ "file_path": "llama_index/llama-index-finetuning/llama_index/finetuning/rerankers/dataset_gen.py", "repo_id": "llama_index", "token_count": 1973 }
1,284
<!-- 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 agree...
transformers/docs/source/ja/quicktour.md/0
{ "file_path": "transformers/docs/source/ja/quicktour.md", "repo_id": "transformers", "token_count": 13041 }
524
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/examples/legacy/seq2seq/finetune.sh/0
{ "file_path": "transformers/examples/legacy/seq2seq/finetune.sh", "repo_id": "transformers", "token_count": 298 }
571
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from chromadb.proto import chroma_pb2 as chromadb_dot_proto_dot_chroma__pb2 class VectorReaderStub(object): """Vector Reader Interface""" def __init__...
chroma/chromadb/proto/chroma_pb2_grpc.py/0
{ "file_path": "chroma/chromadb/proto/chroma_pb2_grpc.py", "repo_id": "chroma", "token_count": 1964 }
18