text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
<jupyter_start><jupyter_text>HTMLHeaderTextSplitter Description and motivationSimilar in concept to the `MarkdownHeaderTextSplitter`, the `HTMLHeaderTextSplitter` is a "structure-aware" chunker that splits text at the element level and adds metadata for each header "relevant" to any given chunk. It can return chunks el... | langchain/docs/docs/modules/data_connection/document_transformers/HTML_header_metadata.ipynb/0 | {
"file_path": "langchain/docs/docs/modules/data_connection/document_transformers/HTML_header_metadata.ipynb",
"repo_id": "langchain",
"token_count": 1414
} | 198 |
#!/bin/bash
yum -y update
# yum install gcc bzip2-devel libffi-devel zlib-devel wget tar gzip -y
yum install wget tar -y
# amazon-linux-extras install python3.8 -y
# install quarto
wget -q https://github.com/quarto-dev/quarto-cli/releases/download/v1.3.450/quarto-1.3.450-linux-amd64.tar.gz
tar -xzf quarto-1.3.450-lin... | langchainjs/docs/core_docs/scripts/vercel_build.sh/0 | {
"file_path": "langchainjs/docs/core_docs/scripts/vercel_build.sh",
"repo_id": "langchainjs",
"token_count": 175
} | 746 |
// 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/rootcoord/timestamp_bench_test.go/0 | {
"file_path": "milvus/internal/rootcoord/timestamp_bench_test.go",
"repo_id": "milvus",
"token_count": 1165
} | 1,782 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/pop2piano/configuration_pop2piano.py/0 | {
"file_path": "transformers/src/transformers/models/pop2piano/configuration_pop2piano.py",
"repo_id": "transformers",
"token_count": 2409
} | 729 |
# flake8: noqa
"""Tools for working with JSON specs."""
from __future__ import annotations
import json
import re
from pathlib import Path
from typing import Dict, List, Optional, Union
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.callbacks import (
AsyncCallbackManagerForToolRun,
Call... | langchain/libs/community/langchain_community/tools/json/tool.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/json/tool.py",
"repo_id": "langchain",
"token_count": 1788
} | 295 |
from __future__ import annotations
from typing import Any, List
from langchain_core.callbacks import CallbackManagerForRetrieverRun
from langchain_core.documents import Document
from langchain_core.retrievers import BaseRetriever
class KayAiRetriever(BaseRetriever):
"""
Retriever for Kay.ai datasets.
T... | langchain/libs/community/langchain_community/retrievers/kay.py/0 | {
"file_path": "langchain/libs/community/langchain_community/retrievers/kay.py",
"repo_id": "langchain",
"token_count": 856
} | 278 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/clipseg/test_modeling_clipseg.py/0 | {
"file_path": "transformers/tests/models/clipseg/test_modeling_clipseg.py",
"repo_id": "transformers",
"token_count": 14630
} | 724 |
from __future__ import annotations
import logging
import uuid
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type
from langchain_core.documents import Document
from langchain_core.embeddings import Embeddings
from langchain_core.utils import get_from_dict_or_env
from langchain_core.vectorstores import... | langchain/libs/community/langchain_community/vectorstores/hologres.py/0 | {
"file_path": "langchain/libs/community/langchain_community/vectorstores/hologres.py",
"repo_id": "langchain",
"token_count": 6316
} | 310 |
import json
import logging
from typing import Any, Callable, Dict, List, Optional, Union
from llama_index.legacy.core.base_query_engine import BaseQueryEngine
from llama_index.legacy.core.response.schema import Response
from llama_index.legacy.prompts import BasePromptTemplate, PromptTemplate
from llama_index.legacy.p... | llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/json_query.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/json_query.py",
"repo_id": "llama_index",
"token_count": 3370
} | 1,668 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | transformers/src/transformers/models/albert/configuration_albert.py/0 | {
"file_path": "transformers/src/transformers/models/albert/configuration_albert.py",
"repo_id": "transformers",
"token_count": 3412
} | 600 |
from langchain_community.document_loaders.excel import UnstructuredExcelLoader
__all__ = ["UnstructuredExcelLoader"]
| langchain/libs/langchain/langchain/document_loaders/excel.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/excel.py",
"repo_id": "langchain",
"token_count": 35
} | 480 |
<jupyter_start><jupyter_text>Roam>[ROAM](https://roamresearch.com/) is a note-taking tool for networked thought, designed to create a personal knowledge base.This notebook covers how to load documents from a Roam database. This takes a lot of inspiration from the example repo [here](https://github.com/JimmyLv/roam-qa).... | langchain/docs/docs/integrations/document_loaders/roam.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/roam.ipynb",
"repo_id": "langchain",
"token_count": 274
} | 110 |
# 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.py/0 | {
"file_path": "diffusers/src/diffusers/models/unet_2d.py",
"repo_id": "diffusers",
"token_count": 410
} | 246 |
package indexcgowrapper
/*
#cgo pkg-config: milvus_common milvus_storage
#include <stdlib.h> // free
#include "common/binary_set_c.h"
#include "storage/storage_c.h"
*/
import "C"
import (
"fmt"
"unsafe"
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/util/merr"
)
func GetBinarySetKeys(cB... | milvus/internal/util/indexcgowrapper/helper.go/0 | {
"file_path": "milvus/internal/util/indexcgowrapper/helper.go",
"repo_id": "milvus",
"token_count": 904
} | 1,807 |
""" Vision Transformer (ViT) in PyTorch
A PyTorch implement of Vision Transformers as described in:
'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale'
- https://arxiv.org/abs/2010.11929
`How to train your ViT? Data, Augmentation, and Regularization in Vision Transformers`
- https:... | pytorch-image-models/timm/models/vision_transformer.py/0 | {
"file_path": "pytorch-image-models/timm/models/vision_transformer.py",
"repo_id": "pytorch-image-models",
"token_count": 58282
} | 408 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "cache",
newEntrypointName: "caches",
newPackageName: "@langchain/core",
});
export { InMemoryCache } from "@langchain/core/caches";
| langchainjs/langchain/src/cache/index.ts/0 | {
"file_path": "langchainjs/langchain/src/cache/index.ts",
"repo_id": "langchainjs",
"token_count": 92
} | 847 |
# coding=utf-8
# Copyright 2020 Mesh TensorFlow authors, T5 Authors and 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... | transformers/src/transformers/models/mt5/modeling_tf_mt5.py/0 | {
"file_path": "transformers/src/transformers/models/mt5/modeling_tf_mt5.py",
"repo_id": "transformers",
"token_count": 1102
} | 669 |
# coding=utf-8
# Copyright 2020-present, 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 a... | transformers/examples/research_projects/movement-pruning/emmental/modules/masked_nn.py/0 | {
"file_path": "transformers/examples/research_projects/movement-pruning/emmental/modules/masked_nn.py",
"repo_id": "transformers",
"token_count": 1917
} | 608 |
#!/usr/bin/env python
"""An example that shows how to use path dependencies for authentication.
The path dependencies are applied to all the routes added by the `add_routes`.
To keep this example brief, we're providing a placeholder verify_token function
that shows how to use path dependencies.
To implement proper a... | langserve/examples/auth/path_dependencies/server.py/0 | {
"file_path": "langserve/examples/auth/path_dependencies/server.py",
"repo_id": "langserve",
"token_count": 441
} | 1,058 |
from typing import Any, Dict, List
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import BaseModel, root_validator
from langchain_core.utils import get_from_dict_or_env
class NLPCloudEmbeddings(BaseModel, Embeddings):
"""NLP Cloud embedding models.
To use, you should have t... | langchain/libs/community/langchain_community/embeddings/nlpcloud.py/0 | {
"file_path": "langchain/libs/community/langchain_community/embeddings/nlpcloud.py",
"repo_id": "langchain",
"token_count": 966
} | 254 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/wuerstchen/test_wuerstchen_decoder.py/0 | {
"file_path": "diffusers/tests/pipelines/wuerstchen/test_wuerstchen_decoder.py",
"repo_id": "diffusers",
"token_count": 2630
} | 279 |
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | milvus/internal/core/unittest/bench/bench_indexbuilder.cpp/0 | {
"file_path": "milvus/internal/core/unittest/bench/bench_indexbuilder.cpp",
"repo_id": "milvus",
"token_count": 1553
} | 1,815 |
import contextlib
import copy
import random
from typing import Any, Dict, Iterable, List, Optional, Union
import numpy as np
import torch
from .models import UNet2DConditionModel
from .utils import (
convert_state_dict_to_diffusers,
convert_state_dict_to_peft,
deprecate,
is_peft_available,
is_torc... | diffusers/src/diffusers/training_utils.py/0 | {
"file_path": "diffusers/src/diffusers/training_utils.py",
"repo_id": "diffusers",
"token_count": 7930
} | 253 |
<!--Copyright 2021 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/ja/model_doc/byt5.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/byt5.md",
"repo_id": "transformers",
"token_count": 3268
} | 494 |
import { JsonSchema7ObjectType } from "zod-to-json-schema";
import {
compare,
type Operation as JSONPatchOperation,
} from "@langchain/core/utils/json_patch";
import { ChatGeneration, Generation } from "@langchain/core/outputs";
import {
BaseCumulativeTransformOutputParser,
type BaseCumulativeTransformOutputPa... | langchainjs/langchain/src/output_parsers/openai_functions.ts/0 | {
"file_path": "langchainjs/langchain/src/output_parsers/openai_functions.ts",
"repo_id": "langchainjs",
"token_count": 1947
} | 923 |
"""Spark SQL agent."""
| langchain/libs/langchain/langchain/agents/agent_toolkits/spark_sql/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/spark_sql/__init__.py",
"repo_id": "langchain",
"token_count": 8
} | 482 |
from typing import Any, List, Literal, Optional
import numpy as np
from llama_index.legacy.bridge.pydantic import Field, PrivateAttr
from llama_index.legacy.embeddings.base import BaseEmbedding
class FastEmbedEmbedding(BaseEmbedding):
"""
Qdrant FastEmbedding models.
FastEmbed is a lightweight, fast, Py... | llama_index/llama-index-legacy/llama_index/legacy/embeddings/fastembed.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/embeddings/fastembed.py",
"repo_id": "llama_index",
"token_count": 1553
} | 1,558 |
import { awaitAllCallbacks } from "../src/callbacks/promises.js";
afterAll(awaitAllCallbacks);
| langchainjs/langchain-core/scripts/jest-setup-after-env.js/0 | {
"file_path": "langchainjs/langchain-core/scripts/jest-setup-after-env.js",
"repo_id": "langchainjs",
"token_count": 32
} | 859 |
from langchain_community.llms.cloudflare_workersai import CloudflareWorkersAI
__all__ = ["CloudflareWorkersAI"]
| langchain/libs/langchain/langchain/llms/cloudflare_workersai.py/0 | {
"file_path": "langchain/libs/langchain/langchain/llms/cloudflare_workersai.py",
"repo_id": "langchain",
"token_count": 37
} | 545 |
/* eslint-disable no-process-env */
import { test, expect, describe } from "@jest/globals";
import { OpenAIEmbeddings } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
import { CassandraClientFactory } from "../../utils/cassandra.js";
import { CassandraStore } from "../cassandra.js";
co... | langchainjs/libs/langchain-community/src/vectorstores/tests/cassandra.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/cassandra.int.test.ts",
"repo_id": "langchainjs",
"token_count": 5443
} | 981 |
{
"docstore/data": {
"093ded74-80cd-4854-bf93-a2a260b9dbef": {
"__data__": {
"id_": "093ded74-80cd-4854-bf93-a2a260b9dbef",
"embedding": null,
"metadata": {},
"excluded_embed_metadata_keys": [],
"excluded_llm_metadata_keys": [],
"relationships": {},
"t... | llama_index/llama-index-legacy/storage/docstore.json/0 | {
"file_path": "llama_index/llama-index-legacy/storage/docstore.json",
"repo_id": "llama_index",
"token_count": 1257
} | 1,546 |
# flake8: noqa
# For backwards compatibility.
from langchain.agents.openai_assistant.base import (
OpenAIAssistantAction,
OpenAIAssistantFinish,
OpenAIAssistantRunnable,
)
| langchain/libs/experimental/langchain_experimental/openai_assistant/base.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/openai_assistant/base.py",
"repo_id": "langchain",
"token_count": 68
} | 433 |
from datetime import datetime
import matplotlib.pyplot as plt
import torch
def freeze_module(module):
for param in module.parameters():
param.requires_grad = False
def get_device():
device = "cuda" if torch.cuda.is_available() else "cpu"
if torch.backends.mps.is_available() and torch.backends.m... | transformers/examples/research_projects/vqgan-clip/utils.py/0 | {
"file_path": "transformers/examples/research_projects/vqgan-clip/utils.py",
"repo_id": "transformers",
"token_count": 379
} | 592 |
"""Loads data from OneNote Notebooks"""
from pathlib import Path
from typing import Dict, Iterator, List, Optional
import requests
from langchain_core.documents import Document
from langchain_core.pydantic_v1 import (
BaseModel,
BaseSettings,
Field,
FilePath,
SecretStr,
)
from langchain_community... | langchain/libs/community/langchain_community/document_loaders/onenote.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/onenote.py",
"repo_id": "langchain",
"token_count": 3796
} | 237 |
"""Test OpenAI llm."""
from typing import Generator
import pytest
from langchain_core.callbacks import CallbackManager
from langchain_core.outputs import LLMResult
from langchain_openai import OpenAI
from tests.unit_tests.fake.callbacks import (
FakeCallbackHandler,
)
def test_stream() -> None:
"""Test stre... | langchain/libs/partners/openai/tests/integration_tests/llms/test_base.py/0 | {
"file_path": "langchain/libs/partners/openai/tests/integration_tests/llms/test_base.py",
"repo_id": "langchain",
"token_count": 3134
} | 636 |
<script lang="ts">
export let classNames = "";
</script>
<div class={"inline-flex h-8 flex-none items-center gap-1 " + classNames}>
<div
class="h-1 w-1 flex-none animate-bounce rounded-full bg-gray-500 dark:bg-gray-400"
style="animation-delay: 0.25s;"
/>
<div
class="h-1 w-1 flex-none animate-bounce rounded-f... | chat-ui/src/lib/components/icons/IconLoading.svelte/0 | {
"file_path": "chat-ui/src/lib/components/icons/IconLoading.svelte",
"repo_id": "chat-ui",
"token_count": 223
} | 87 |
import pytest
from base.client_base import TestcaseBase
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.util_pymilvus import *
class TestPartitionKeyParams(TestcaseBase):
@pytest.mark.tags(CaseLabel.L0)
@pytest.mark.par... | milvus/tests/python_client/testcases/test_partition_key.py/0 | {
"file_path": "milvus/tests/python_client/testcases/test_partition_key.py",
"repo_id": "milvus",
"token_count": 18950
} | 1,904 |
use crate::arc_rwlock_serde;
use napi::bindgen_prelude::*;
use napi_derive::napi;
use serde::{Deserialize, Serialize};
use std::sync::{Arc, RwLock};
use tk::pre_tokenizers::PreTokenizerWrapper;
use tk::PreTokenizedString;
use tk::SplitDelimiterBehavior;
use tokenizers as tk;
#[napi(string_enum)]
pub enum JsSplitDelimi... | tokenizers/bindings/node/src/pre_tokenizers.rs/0 | {
"file_path": "tokenizers/bindings/node/src/pre_tokenizers.rs",
"repo_id": "tokenizers",
"token_count": 2935
} | 417 |
import time
from pathlib import Path
import subprocess
import pytest
from time import sleep
from yaml import full_load
from pymilvus import connections, utility
from chaos.checker import (CollectionCreateChecker,
InsertChecker,
UpsertChecker,
... | milvus/tests/python_client/chaos/testcases/test_single_request_operation_for_rolling_update.py/0 | {
"file_path": "milvus/tests/python_client/chaos/testcases/test_single_request_operation_for_rolling_update.py",
"repo_id": "milvus",
"token_count": 3741
} | 1,902 |
from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from diffusers.utils import deprecate
from ....configuration_utils import ConfigMixin, register_to_config
from ....models import ModelMixin
from ....models.activations impo... | diffusers/src/diffusers/pipelines/deprecated/versatile_diffusion/modeling_text_unet.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/versatile_diffusion/modeling_text_unet.py",
"repo_id": "diffusers",
"token_count": 55425
} | 255 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/controlnet/test_controlnet_inpaint.py/0 | {
"file_path": "diffusers/tests/pipelines/controlnet/test_controlnet_inpaint.py",
"repo_id": "diffusers",
"token_count": 10793
} | 283 |
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
# It is recommended to s... | streamlit-agent/.pre-commit-config.yaml/0 | {
"file_path": "streamlit-agent/.pre-commit-config.yaml",
"repo_id": "streamlit-agent",
"token_count": 285
} | 2,025 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/node_parser/text/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/node_parser/text/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,508 |
* Example Docs
The sample docs directory contains the following files:
- ~example-10k.html~ - A 10-K SEC filing in HTML format
- ~layout-parser-paper.pdf~ - A PDF copy of the layout parser paper
- ~factbook.xml~ / ~factbook.xsl~ - Example XML/XLS files that you
can use to test stylesheets
These documents can b... | langchain/libs/community/tests/examples/README.org/0 | {
"file_path": "langchain/libs/community/tests/examples/README.org",
"repo_id": "langchain",
"token_count": 292
} | 333 |
-- Enable the pgvector extension to work with embedding vectors
create extension vector;
-- Create a table to store your documents
create table documents (
id bigserial primary key,
content text, -- corresponds to Document.pageContent
metadata jsonb, -- corresponds to Document.metadata
embedding vector(1536)... | langchain-template-supabase/supabase/migrations/20230311201746_setup-vector-store.sql/0 | {
"file_path": "langchain-template-supabase/supabase/migrations/20230311201746_setup-vector-store.sql",
"repo_id": "langchain-template-supabase",
"token_count": 272
} | 66 |
import os
import sys
import typer
from pathlib import Path
from loguru import logger
from typing import Optional
from enum import Enum
from huggingface_hub import hf_hub_download
app = typer.Typer()
class Quantization(str, Enum):
bitsandbytes = "bitsandbytes"
bitsandbytes_nf4 = "bitsandbytes-nf4"
bitsa... | text-generation-inference/server/text_generation_server/cli.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/cli.py",
"repo_id": "text-generation-inference",
"token_count": 4994
} | 394 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/semantic_stable_diffusion/test_semantic_diffusion.py/0 | {
"file_path": "diffusers/tests/pipelines/semantic_stable_diffusion/test_semantic_diffusion.py",
"repo_id": "diffusers",
"token_count": 9604
} | 281 |
---
sidebar_label: Deployment
---
# Deployment
We strive to make deploying production apps using LangChain.js as intuitive as possible.
## Compatibility
You can use LangChain in a variety of environments, including:
- Node.js (ESM and CommonJS) - 18.x, 19.x, 20.x
- Cloudflare Workers
- Vercel / Next.js (Browser, S... | langchainjs/docs/core_docs/docs/guides/deployment/index.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/guides/deployment/index.mdx",
"repo_id": "langchainjs",
"token_count": 935
} | 718 |
import logging
from typing import Any, List, Optional, Tuple, cast
from llama_index.legacy.bridge.pydantic import BaseModel
from llama_index.legacy.callbacks.base import CallbackManager
from llama_index.legacy.constants import DEFAULT_SIMILARITY_TOP_K
from llama_index.legacy.core.base_auto_retriever import BaseAutoRet... | llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/auto_retriever/auto_retriever.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/auto_retriever/auto_retriever.py",
"repo_id": "llama_index",
"token_count": 4114
} | 1,725 |
<jupyter_start><jupyter_text>LLaMA2 chat with SQLOpen source, local LLMs are great to consider for any application that demands data privacy.SQL is one good example. This cookbook shows how to perform text-to-SQL using various local versions of LLaMA2 run locally. Packages<jupyter_code>! pip install langchain replicate... | langchain/cookbook/LLaMA2_sql_chat.ipynb/0 | {
"file_path": "langchain/cookbook/LLaMA2_sql_chat.ipynb",
"repo_id": "langchain",
"token_count": 2280
} | 72 |
python_tests(
interpreter_constraints=["==3.9.*", "==3.10.*"],
)
| llama_index/llama-index-integrations/readers/llama-index-readers-lilac/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-lilac/tests/BUILD",
"repo_id": "llama_index",
"token_count": 29
} | 1,327 |
from llama_index.vector_stores.tair.base import TairVectorStore
__all__ = ["TairVectorStore"]
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-tair/llama_index/vector_stores/tair/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-tair/llama_index/vector_stores/tair/__init__.py",
"repo_id": "llama_index",
"token_count": 32
} | 1,540 |
# 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/unets/unet_2d_condition.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/unet_2d_condition.py",
"repo_id": "diffusers",
"token_count": 28400
} | 244 |
from typing import List, Optional
from langchain_community.graphs.graph_document import Node as BaseNode
from langchain_community.graphs.graph_document import Relationship as BaseRelationship
from langchain_core.pydantic_v1 import BaseModel, Field
class Property(BaseModel):
"""A single property consisting of key... | langchain/templates/neo4j-generation/neo4j_generation/utils.py/0 | {
"file_path": "langchain/templates/neo4j-generation/neo4j_generation/utils.py",
"repo_id": "langchain",
"token_count": 751
} | 675 |
// 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/storage/azure_object_storage_test.go/0 | {
"file_path": "milvus/internal/storage/azure_object_storage_test.go",
"repo_id": "milvus",
"token_count": 5004
} | 1,887 |
from llama_index.multi_modal_llms.gemini.base import GeminiMultiModal
__all__ = ["GeminiMultiModal"]
| llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-gemini/llama_index/multi_modal_llms/gemini/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-gemini/llama_index/multi_modal_llms/gemini/__init__.py",
"repo_id": "llama_index",
"token_count": 38
} | 1,309 |
# Deep Layer Aggregation
Extending “shallow” skip connections, **Dense Layer Aggregation (DLA)** incorporates more depth and sharing. The authors introduce two structures for deep layer aggregation (DLA): iterative deep aggregation (IDA) and hierarchical deep aggregation (HDA). These structures are expressed through ... | pytorch-image-models/docs/models/.templates/models/dla.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/dla.md",
"repo_id": "pytorch-image-models",
"token_count": 5955
} | 335 |
.PHONY: quality style test docs utils
check_dirs := .
# Check that source code meets quality standards
extra_quality_checks:
python utils/check_copies.py
python utils/check_dummies.py
python utils/check_repo.py
doc-builder style src/accelerate docs/source --max_len 119
# this target runs checks on all files
qua... | accelerate/Makefile/0 | {
"file_path": "accelerate/Makefile",
"repo_id": "accelerate",
"token_count": 1109
} | 0 |
import time
from typing import Any, Callable, List, cast
from langchain.prompts.chat import (
BaseChatPromptTemplate,
)
from langchain.tools.base import BaseTool
from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage
from langchain_core.vectorstores import VectorStoreRetriever
from langchain... | langchain/libs/experimental/langchain_experimental/autonomous_agents/autogpt/prompt.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/autonomous_agents/autogpt/prompt.py",
"repo_id": "langchain",
"token_count": 1813
} | 437 |
from __future__ import annotations
from typing import Any, Dict, Union
from langchain_core.retrievers import (
BaseRetriever,
RetrieverOutput,
)
from langchain_core.runnables import Runnable, RunnablePassthrough
def create_retrieval_chain(
retriever: Union[BaseRetriever, Runnable[dict, RetrieverOutput]]... | langchain/libs/langchain/langchain/chains/retrieval.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/retrieval.py",
"repo_id": "langchain",
"token_count": 1070
} | 491 |
"""Rayyan review reader."""
import logging
from typing import List
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
class RayyanReader(BaseReader):
"""Rayyan reader. Reads articles from a Rayyan review.
Args:
credentials_path (str): Rayyan credentials... | llama_index/llama-index-integrations/readers/llama-index-readers-rayyan/llama_index/readers/rayyan/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-rayyan/llama_index/readers/rayyan/base.py",
"repo_id": "llama_index",
"token_count": 1858
} | 1,370 |
<jupyter_start><jupyter_text>StochasticAI>[Stochastic Acceleration Platform](https://docs.stochastic.ai/docs/introduction/) aims to simplify the life cycle of a Deep Learning model. From uploading and versioning the model, through training, compression and acceleration to putting it into production.This example goes ov... | langchain/docs/docs/integrations/llms/stochasticai.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/llms/stochasticai.ipynb",
"repo_id": "langchain",
"token_count": 359
} | 123 |
---
hide_table_of_contents: true
---
# Cloudflare Workers AI
If you're deploying your project in a Cloudflare worker, you can use Cloudflare's [built-in Workers AI embeddings](https://developers.cloudflare.com/workers-ai/) with LangChain.js.
## Setup
First, [follow the official docs](https://developers.cloudflare.c... | langchainjs/docs/core_docs/docs/integrations/text_embedding/cloudflare_ai.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/text_embedding/cloudflare_ai.mdx",
"repo_id": "langchainjs",
"token_count": 413
} | 737 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/query_engine/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/query_engine/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,603 |
import unittest
import numpy as np
from transformers import is_torch_available, is_vision_available
from transformers.testing_utils import (
require_torch,
require_torchvision,
require_vision,
)
if is_torch_available() and is_vision_available():
import torch
from transformers import FuyuImagePr... | transformers/tests/models/fuyu/test_image_processing_fuyu.py/0 | {
"file_path": "transformers/tests/models/fuyu/test_image_processing_fuyu.py",
"repo_id": "transformers",
"token_count": 906
} | 725 |
"""Cross Encoder Finetuning Engine."""
from typing import Any, List, Optional, Union
from llama_index.legacy.finetuning.cross_encoders.dataset_gen import (
CrossEncoderFinetuningDatasetSample,
)
from llama_index.legacy.finetuning.types import BaseCrossEncoderFinetuningEngine
from llama_index.legacy.postprocessor ... | llama_index/llama-index-legacy/llama_index/legacy/finetuning/cross_encoders/cross_encoder.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/finetuning/cross_encoders/cross_encoder.py",
"repo_id": "llama_index",
"token_count": 2202
} | 1,556 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.