text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
from langchain_community.output_parsers.ernie_functions import (
JsonKeyOutputFunctionsParser,
JsonOutputFunctionsParser,
OutputFunctionsParser,
PydanticAttrOutputFunctionsParser,
PydanticOutputFunctionsParser,
)
__all__ = [
"JsonKeyOutputFunctionsParser",
"JsonOutputFunctionsParser",
"... | langchain/libs/langchain/langchain/output_parsers/ernie_functions.py/0 | {
"file_path": "langchain/libs/langchain/langchain/output_parsers/ernie_functions.py",
"repo_id": "langchain",
"token_count": 152
} | 550 |
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
import { Tool, type ToolParams } from "@langchain/core/tools";
import { getEnvironmentVariable } from "@langchain/core/utils/env";
/**
* Options for the TavilySearchResults tool.
*/
export type TavilySearchAPIRetrieverFields = ToolParams ... | langchainjs/libs/langchain-community/src/tools/tavily_search.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/tools/tavily_search.ts",
"repo_id": "langchainjs",
"token_count": 763
} | 1,017 |
/* eslint-disable no-process-env */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { test } from "@jest/globals";
import { AmazonKendraRetriever } from "../amazon_kendra.js";
test.skip("AmazonKendraRetriever", async () => {
const retriever = new AmazonKendraRetriever({
topK: 10,
indexId... | langchainjs/libs/langchain-community/src/retrievers/tests/amazon_kendra.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/retrievers/tests/amazon_kendra.int.test.ts",
"repo_id": "langchainjs",
"token_count": 289
} | 998 |
# coding=utf-8
# Copyright 2020, Hugging Face
#
# 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/src/transformers/models/funnel/configuration_funnel.py/0 | {
"file_path": "transformers/src/transformers/models/funnel/configuration_funnel.py",
"repo_id": "transformers",
"token_count": 3437
} | 609 |
from langchain.schema import AgentAction, AgentFinish
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
template = """You are a helpful assistant. Help the user answer any questions.
You have access to the following tools:
{tools}
In order to use a tool, you can use <tool></tool> and <tool_... | langchain/templates/xml-agent/xml_agent/prompts.py/0 | {
"file_path": "langchain/templates/xml-agent/xml_agent/prompts.py",
"repo_id": "langchain",
"token_count": 598
} | 684 |
# coding=utf-8
# Copyright 2022 Microsoft, clefourrier 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/models/graphormer/modeling_graphormer.py/0 | {
"file_path": "transformers/src/transformers/models/graphormer/modeling_graphormer.py",
"repo_id": "transformers",
"token_count": 16728
} | 682 |
import { Document } from "@langchain/core/documents";
import { BaseStoreInterface } from "@langchain/core/stores";
import { Docstore } from "./base.js";
/**
* Class for storing and retrieving documents in memory asynchronously.
* Extends the Docstore class.
*/
export class InMemoryDocstore
extends Docstore
impl... | langchainjs/libs/langchain-community/src/stores/doc/in_memory.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/stores/doc/in_memory.ts",
"repo_id": "langchainjs",
"token_count": 1083
} | 1,069 |
python_tests()
| llama_index/llama-index-packs/llama-index-packs-node-parser-semantic-chunking/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-node-parser-semantic-chunking/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,684 |
---
sidebar_position: 3
---
# Custom LLM
This notebook goes over how to create a custom LLM wrapper, in case you want to use your own LLM or a different wrapper than one that is directly supported in LangChain.
There are a few required things that a custom LLM needs to implement after extending the [`LLM` class](htt... | langchainjs/docs/core_docs/docs/modules/model_io/llms/custom_llm.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/model_io/llms/custom_llm.mdx",
"repo_id": "langchainjs",
"token_count": 1918
} | 737 |
from __future__ import annotations
import json
import logging
from hashlib import sha1
from threading import Thread
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from langchain_core.documents import Document
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import... | langchain/libs/community/langchain_community/vectorstores/clickhouse.py/0 | {
"file_path": "langchain/libs/community/langchain_community/vectorstores/clickhouse.py",
"repo_id": "langchain",
"token_count": 8455
} | 307 |
# Models
<tokenizerslangcontent>
<python>
## BPE
[[autodoc]] tokenizers.models.BPE
## Model
[[autodoc]] tokenizers.models.Model
## Unigram
[[autodoc]] tokenizers.models.Unigram
## WordLevel
[[autodoc]] tokenizers.models.WordLevel
## WordPiece
[[autodoc]] tokenizers.models.WordPiece
</python>
<rust>
The Rust A... | tokenizers/docs/source-doc-builder/api/models.mdx/0 | {
"file_path": "tokenizers/docs/source-doc-builder/api/models.mdx",
"repo_id": "tokenizers",
"token_count": 179
} | 449 |
"""Tests for the HTML parsers."""
from pathlib import Path
import pytest
from langchain_community.document_loaders.blob_loaders import Blob
from langchain_community.document_loaders.parsers.html import BS4HTMLParser
HERE = Path(__file__).parent
EXAMPLES = HERE.parent.parent.parent / "integration_tests" / "examples"
... | langchain/libs/community/tests/unit_tests/document_loaders/parsers/test_html_parsers.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_loaders/parsers/test_html_parsers.py",
"repo_id": "langchain",
"token_count": 313
} | 367 |
package hybridsearch
import (
"context"
"encoding/json"
"fmt"
"strconv"
"testing"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/suite"
"go.uber.org/zap"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/mil... | milvus/tests/integration/hybridsearch/hybridsearch_test.go/0 | {
"file_path": "milvus/tests/integration/hybridsearch/hybridsearch_test.go",
"repo_id": "milvus",
"token_count": 3069
} | 1,887 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/vilt/configuration_vilt.py/0 | {
"file_path": "transformers/src/transformers/models/vilt/configuration_vilt.py",
"repo_id": "transformers",
"token_count": 2640
} | 681 |
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.embeddings.huggingface_optimum_intel import IntelEmbedding
def test_optimum_intel_embedding_class():
names_of_base_classes = [b.__name__ for b in IntelEmbedding.__mro__]
assert BaseEmbedding.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum-intel/tests/test_embeddings_huggingface_optimum.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum-intel/tests/test_embeddings_huggingface_optimum.py",
"repo_id": "llama_index",
"token_count": 113
} | 1,243 |
use super::regex::PyRegex;
use super::{DestroyPtr, RefMutContainer, RefMutGuard};
use crate::error::ToPyResult;
use pyo3::exceptions;
use pyo3::prelude::*;
use pyo3::types::*;
use tk::normalizer::{char_to_bytes, NormalizedString, Range, SplitDelimiterBehavior};
use tk::pattern::Pattern;
/// Represents a Pattern as use... | tokenizers/bindings/python/src/utils/normalization.rs/0 | {
"file_path": "tokenizers/bindings/python/src/utils/normalization.rs",
"repo_id": "tokenizers",
"token_count": 8467
} | 462 |
#include "q4_matmul.cuh"
#include "column_remap.cuh"
#include <ATen/cuda/CUDAContext.h>
#include "../util.cuh"
#include "../matrix.cuh"
#include "../cu_compat.cuh"
#include "../cuda_buffers.cuh"
#if defined(USE_ROCM)
#include "../hip_compat.cuh"
#endif
const int THREADS_X = 32; // Block size and thread count alo... | text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matmul.cu/0 | {
"file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matmul.cu",
"repo_id": "text-generation-inference",
"token_count": 4211
} | 389 |
"""Init file."""
from llama_index.legacy.data_structs.data_structs import (
IndexDict,
IndexGraph,
IndexList,
KeywordTable,
Node,
)
from llama_index.legacy.data_structs.table import StructDatapoint
__all__ = [
"IndexGraph",
"KeywordTable",
"IndexList",
"IndexDict",
"StructDatap... | llama_index/llama-index-legacy/llama_index/legacy/data_structs/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/data_structs/__init__.py",
"repo_id": "llama_index",
"token_count": 147
} | 1,556 |
# 학습을 위한 데이터셋 만들기
[Hub](https://huggingface.co/datasets?task_categories=task_categories:text-to-image&sort=downloads) 에는 모델 교육을 위한 많은 데이터셋이 있지만,
관심이 있거나 사용하고 싶은 데이터셋을 찾을 수 없는 경우 🤗 [Datasets](hf.co/docs/datasets) 라이브러리를 사용하여 데이터셋을 만들 수 있습니다.
데이터셋 구조는 모델을 학습하려는 작업에 따라 달라집니다.
가장 기본적인 데이터셋 구조는 unconditional 이미지 생성과 같은 작업... | diffusers/docs/source/ko/training/create_dataset.md/0 | {
"file_path": "diffusers/docs/source/ko/training/create_dataset.md",
"repo_id": "diffusers",
"token_count": 3214
} | 200 |
[tool.poetry]
name = "rag-momento-vector-index"
version = "0.0.1"
description = "RAG on momento vectorDB"
authors = []
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
momento = "^1.12.0"
openai = "<2"
tiktoken = "^0.5.1"
[tool.poetry.group.dev.dependencies]
langchain-cli = "... | langchain/templates/rag-momento-vector-index/pyproject.toml/0 | {
"file_path": "langchain/templates/rag-momento-vector-index/pyproject.toml",
"repo_id": "langchain",
"token_count": 349
} | 663 |
"""Pipeline schema."""
from abc import ABC, abstractmethod
from typing import (
Any,
Callable,
Dict,
Generator,
List,
Optional,
Set,
Union,
cast,
get_args,
)
from llama_index.legacy.bridge.pydantic import BaseModel, Field
from llama_index.legacy.callbacks.base import CallbackMa... | llama_index/llama-index-legacy/llama_index/legacy/core/query_pipeline/query_component.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/core/query_pipeline/query_component.py",
"repo_id": "llama_index",
"token_count": 4305
} | 1,506 |
search_performance:
collections:
# sift_50m
-
server:
db_config.primary_path: /test/milvus/db_data_gpu_crud/sift_50m_1024_128_l2_ivf
cache_config.cpu_cache_capacity: 32
engine_config.use_blas_threshold: 1100
engine_config.gpu_search_threshold: 200
gpu_resource_co... | milvus/tests/benchmark/milvus_benchmark/suites/gpu_search_performance.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/gpu_search_performance.yaml",
"repo_id": "milvus",
"token_count": 4501
} | 2,153 |
from typing import Any, Dict, List
from llama_index.core import ServiceContext, VectorStoreIndex, get_response_synthesizer
from llama_index.core.ingestion import IngestionPipeline
from llama_index.core.llama_pack.base import BaseLlamaPack
from llama_index.core.query_engine import RetrieverQueryEngine
from llama_index.... | llama_index/llama-index-packs/llama-index-packs-multi-tenancy-rag/llama_index/packs/multi_tenancy_rag/base.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-multi-tenancy-rag/llama_index/packs/multi_tenancy_rag/base.py",
"repo_id": "llama_index",
"token_count": 1072
} | 1,666 |
import fs from "fs";
import { GoogleVertexAIMultimodalEmbeddings } from "langchain/experimental/multimodal_embeddings/googlevertexai";
const model = new GoogleVertexAIMultimodalEmbeddings();
// Load the image into a buffer to get the embedding of it
const img = fs.readFileSync("/path/to/file.jpg");
const imgEmbedding... | langchainjs/examples/src/models/embeddings/googlevertexai_multimodal.ts/0 | {
"file_path": "langchainjs/examples/src/models/embeddings/googlevertexai_multimodal.ts",
"repo_id": "langchainjs",
"token_count": 179
} | 871 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-clickhouse/llama_index/readers/clickhouse/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-clickhouse/llama_index/readers/clickhouse/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,476 |
package broker
import (
"context"
"math/rand"
"testing"
"time"
"github.com/cockroachdb/errors"
"github.com/samber/lo"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
"google.golang.org/grpc"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus/internal... | milvus/internal/datanode/broker/rootcoord_test.go/0 | {
"file_path": "milvus/internal/datanode/broker/rootcoord_test.go",
"repo_id": "milvus",
"token_count": 2724
} | 1,781 |
# coding=utf-8
# 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 requir... | transformers/tests/optimization/test_optimization.py/0 | {
"file_path": "transformers/tests/optimization/test_optimization.py",
"repo_id": "transformers",
"token_count": 3392
} | 837 |
import json
import os
import tempfile
import datasets
from utils import generate_example_dataset, get_duration
SPEED_TEST_N_EXAMPLES = 50_000
SMALL_TEST = 5_000
RESULTS_BASEPATH, RESULTS_FILENAME = os.path.split(__file__)
RESULTS_FILE_PATH = os.path.join(RESULTS_BASEPATH, "results", RESULTS_FILENAME.replace(".py", ... | datasets/benchmarks/benchmark_iterating.py/0 | {
"file_path": "datasets/benchmarks/benchmark_iterating.py",
"repo_id": "datasets",
"token_count": 1697
} | 109 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/model_doc/stablelm.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/stablelm.md",
"repo_id": "transformers",
"token_count": 1373
} | 518 |
---
sidebar_position: 0
---
# Cookbook
import DocCardList from "@theme/DocCardList";
Example code for accomplishing common tasks with the LangChain Expression Language (LCEL). These examples show how to compose different Runnable (the core LCEL interface) components to achieve various tasks. If you're just getting a... | langchainjs/docs/core_docs/docs/expression_language/cookbook/index.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/expression_language/cookbook/index.mdx",
"repo_id": "langchainjs",
"token_count": 180
} | 703 |
"""Integration test for Google Search API Wrapper."""
from langchain_community.utilities.google_search import GoogleSearchAPIWrapper
def test_call() -> None:
"""Test that call gives the correct answer."""
search = GoogleSearchAPIWrapper()
output = search.run("What was Obama's first name?")
assert "Ba... | langchain/libs/community/tests/integration_tests/utilities/test_googlesearch_api.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/utilities/test_googlesearch_api.py",
"repo_id": "langchain",
"token_count": 357
} | 369 |
from llama_index.readers.elasticsearch.base import ElasticsearchReader
__all__ = ["ElasticsearchReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-elasticsearch/llama_index/readers/elasticsearch/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-elasticsearch/llama_index/readers/elasticsearch/__init__.py",
"repo_id": "llama_index",
"token_count": 31
} | 1,310 |
# 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/scripts/convert_ldm_original_checkpoint_to_diffusers.py/0 | {
"file_path": "diffusers/scripts/convert_ldm_original_checkpoint_to_diffusers.py",
"repo_id": "diffusers",
"token_count": 6853
} | 231 |
[tool.poetry]
name = "rag-weaviate"
version = "0.1.0"
description = "RAG using Weaviate retriever"
authors = [
"Erika Cardenas <erika@weaviate.io>",
]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
openai = "<2"
tiktoken = "^0.5.1"
weaviate-client = ">=3.24.2"
[tool.poe... | langchain/templates/rag-weaviate/pyproject.toml/0 | {
"file_path": "langchain/templates/rag-weaviate/pyproject.toml",
"repo_id": "langchain",
"token_count": 341
} | 695 |
[
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [
{
"id": 17934,
"logprob": null,
"text": "Pour"
},
{
"id": 49833,
"logprob": -10.5625,
"text": " dé... | text-generation-inference/integration-tests/models/__snapshots__/test_bloom_560m/test_bloom_560m_load.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_bloom_560m/test_bloom_560m_load.json",
"repo_id": "text-generation-inference",
"token_count": 7244
} | 391 |
"""
This a Tree of Thought (ToT) chain based on the paper "Large Language Model
Guided Tree-of-Thought"
https://arxiv.org/pdf/2305.08291.pdf
The Tree of Thought (ToT) chain uses a tree structure to explore the space of
possible solutions to a problem.
"""
from __future__ import annotations
from textwrap import ind... | langchain/libs/experimental/langchain_experimental/tot/base.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/tot/base.py",
"repo_id": "langchain",
"token_count": 2099
} | 428 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/schedulers/pndm.md/0 | {
"file_path": "diffusers/docs/source/en/api/schedulers/pndm.md",
"repo_id": "diffusers",
"token_count": 304
} | 183 |
# 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/controlnet_flax.py/0 | {
"file_path": "diffusers/src/diffusers/models/controlnet_flax.py",
"repo_id": "diffusers",
"token_count": 7635
} | 213 |
"""Test AI21 Chat API wrapper."""
from unittest.mock import Mock, call
import pytest
from ai21 import MissingApiKeyError
from ai21.models import (
Penalty,
)
from langchain_ai21 import AI21LLM
from tests.unit_tests.conftest import (
BASIC_EXAMPLE_LLM_PARAMETERS,
DUMMY_API_KEY,
temporarily_unset_api_ke... | langchain/libs/partners/ai21/tests/unit_tests/test_llms.py/0 | {
"file_path": "langchain/libs/partners/ai21/tests/unit_tests/test_llms.py",
"repo_id": "langchain",
"token_count": 1432
} | 621 |
from langchain_community.chat_message_histories.postgres import (
PostgresChatMessageHistory,
)
__all__ = ["PostgresChatMessageHistory"]
| langchain/libs/langchain/langchain/memory/chat_message_histories/postgres.py/0 | {
"file_path": "langchain/libs/langchain/langchain/memory/chat_message_histories/postgres.py",
"repo_id": "langchain",
"token_count": 43
} | 522 |
import { getEnvironmentVariable } from "@langchain/core/utils/env";
import { Tool } from "@langchain/core/tools";
/**
* @interface DataForSeoApiConfig
* @description Represents the configuration object used to set up a DataForSeoAPISearch instance.
*/
export interface DataForSeoApiConfig {
/**
* @property apiL... | langchainjs/libs/langchain-community/src/tools/dataforseo_api_search.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/tools/dataforseo_api_search.ts",
"repo_id": "langchainjs",
"token_count": 4140
} | 984 |
# LlamaIndex Llms Integration: Llama Cpp
| llama_index/llama-index-integrations/llms/llama-index-llms-llama-cpp/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-llama-cpp/README.md",
"repo_id": "llama_index",
"token_count": 13
} | 1,230 |
from typing import Any, List, Optional
from langchain.base_language import BaseLanguageModel
from langchain.callbacks.manager import Callbacks
from langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
class ResponseGenerationChain(LLMChain):
"""Chain to execute tasks."""
@classmetho... | langchain/libs/experimental/langchain_experimental/autonomous_agents/hugginggpt/repsonse_generator.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/autonomous_agents/hugginggpt/repsonse_generator.py",
"repo_id": "langchain",
"token_count": 567
} | 438 |
from __future__ import annotations
import importlib.util
import logging
from typing import Any, List, Mapping, Optional
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import BaseLLM
from langchain_core.outputs import Generation, LLMResult
from langchain_core.pyd... | langchain/libs/community/langchain_community/llms/huggingface_pipeline.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/huggingface_pipeline.py",
"repo_id": "langchain",
"token_count": 4558
} | 268 |
<jupyter_start><jupyter_text>Context>[Context](https://context.ai/) provides user analytics for LLM-powered products and features.With `Context`, you can start understanding your users and improving their experiences in less than 30 minutes. In this guide we will show you how to integrate with Context. Installation an... | langchain/docs/docs/integrations/callbacks/context.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/callbacks/context.ipynb",
"repo_id": "langchain",
"token_count": 969
} | 92 |
# LlamaIndex Readers Integration: Mongo
| llama_index/llama-index-integrations/readers/llama-index-readers-mongodb/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mongodb/README.md",
"repo_id": "llama_index",
"token_count": 9
} | 1,355 |
use crate::models::Model;
use napi_derive::napi;
use std::sync::{Arc, RwLock};
use tokenizers as tk;
use tokenizers::models::TrainerWrapper;
#[napi]
pub struct Trainer {
trainer: Option<Arc<RwLock<TrainerWrapper>>>,
}
impl From<TrainerWrapper> for Trainer {
fn from(trainer: TrainerWrapper) -> Self {
Self {
... | tokenizers/bindings/node/src/trainers.rs/0 | {
"file_path": "tokenizers/bindings/node/src/trainers.rs",
"repo_id": "tokenizers",
"token_count": 641
} | 432 |
import typing
from importlib import metadata
## Create namespaces for pydantic v1 and v2.
# This code must stay at the top of the file before other modules may
# attempt to import pydantic since it adds pydantic_v1 and pydantic_v2 to sys.modules.
#
# This hack is done for the following reasons:
# * Langchain will atte... | langchain/libs/experimental/langchain_experimental/pydantic_v1/__init__.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/pydantic_v1/__init__.py",
"repo_id": "langchain",
"token_count": 425
} | 466 |
use crate::client::{DecodeTimings, PrefillTimings};
/// Multi shard Client
use crate::{Batch, CachedBatch, Client, Generation, HealthResponse, ShardInfo};
use crate::{ClientError, Result};
use futures::future::join_all;
use tonic::transport::Uri;
use tracing::instrument;
#[derive(Debug, Clone)]
/// Text Generation Inf... | text-generation-inference/router/client/src/sharded_client.rs/0 | {
"file_path": "text-generation-inference/router/client/src/sharded_client.rs",
"repo_id": "text-generation-inference",
"token_count": 2959
} | 416 |
import argparse
import sys
sys.path.append(".")
from base_classes import ControlNetBenchmark, ControlNetSDXLBenchmark # noqa: E402
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--ckpt",
type=str,
default="lllyasviel/sd-controlnet-canny",
... | diffusers/benchmarks/benchmark_controlnet.py/0 | {
"file_path": "diffusers/benchmarks/benchmark_controlnet.py",
"repo_id": "diffusers",
"token_count": 352
} | 168 |
"""Vector-store based data structures."""
from llama_index.core.indices.vector_store.base import (
GPTVectorStoreIndex,
VectorStoreIndex,
)
from llama_index.core.indices.vector_store.retrievers import (
VectorIndexAutoRetriever,
VectorIndexRetriever,
)
__all__ = [
"VectorStoreIndex",
"VectorIn... | llama_index/llama-index-core/llama_index/core/indices/vector_store/__init__.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/indices/vector_store/__init__.py",
"repo_id": "llama_index",
"token_count": 152
} | 1,156 |
# Quiz [[quiz]]
The best way to learn and [to avoid the illusion of competence](https://www.coursera.org/lecture/learning-how-to-learn/illusions-of-competence-BuFzf) **is to test yourself.** This will help you to find **where you need to reinforce your knowledge**.
### Q1: What is Reinforcement Learning?
<details>
<... | deep-rl-class/units/en/unit1/quiz.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit1/quiz.mdx",
"repo_id": "deep-rl-class",
"token_count": 1866
} | 166 |
accuracy:
collections:
-
server:
db_config.primary_path: /test/milvus/db_data_7/sift_50m_2048_128_l2_sq8_wal
cache_config.cpu_cache_capacity: 30
engine_config.use_blas_threshold: 1100
engine_config.gpu_search_threshold: 1
gpu_resource_config.enable: true
gpu_r... | milvus/tests/benchmark/milvus_benchmark/suites/gpu_accuracy.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/gpu_accuracy.yaml",
"repo_id": "milvus",
"token_count": 700
} | 2,095 |
# Hugging Face Timm Docs
## Getting Started
```
pip install git+https://github.com/huggingface/doc-builder.git@main#egg=hf-doc-builder
pip install watchdog black
```
## Preview the Docs Locally
```
doc-builder preview timm hfdocs/source
```
| pytorch-image-models/hfdocs/README.md/0 | {
"file_path": "pytorch-image-models/hfdocs/README.md",
"repo_id": "pytorch-image-models",
"token_count": 88
} | 355 |
# Metric Card for Precision
## Metric Description
Precision is the fraction of correctly labeled positive examples out of all of the examples that were labeled as positive. It is computed via the equation:
Precision = TP / (TP + FP)
where TP is the True positives (i.e. the examples correctly labeled as positive) and... | datasets/metrics/precision/README.md/0 | {
"file_path": "datasets/metrics/precision/README.md",
"repo_id": "datasets",
"token_count": 1878
} | 132 |
[tool.poetry]
name = "langchain-core"
version = "0.1.23"
description = "Building applications with LLMs through composability"
authors = []
license = "MIT"
readme = "README.md"
repository = "https://github.com/langchain-ai/langchain"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
pydantic = ">=1,<3"
langsmith = "... | langchain/libs/core/pyproject.toml/0 | {
"file_path": "langchain/libs/core/pyproject.toml",
"repo_id": "langchain",
"token_count": 1122
} | 401 |
python_sources()
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-rocksetdb/llama_index/vector_stores/rocksetdb/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-rocksetdb/llama_index/vector_stores/rocksetdb/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,676 |
// 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/minio_chunk_manager.go/0 | {
"file_path": "milvus/internal/storage/minio_chunk_manager.go",
"repo_id": "milvus",
"token_count": 5885
} | 1,787 |
# Quiz
The best way to learn and [to avoid the illusion of competence](https://www.coursera.org/lecture/learning-how-to-learn/illusions-of-competence-BuFzf) **is to test yourself.** This will help you to find **where you need to reinforce your knowledge**.
### Q1: What are the advantages of policy-gradient over valu... | deep-rl-class/units/en/unit4/quiz.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit4/quiz.mdx",
"repo_id": "deep-rl-class",
"token_count": 878
} | 160 |
import argparse
import contextlib
import os
import glob
import re
import time
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor
from langsmith import Client
filter_list = {
"llm_run_etl.ipynb",
"lilac.ipynb",
"fine-tuning-on-chat-runs.ipynb",
"vision-evals.ipynb",
"contract-e... | langsmith-cookbook/_scripts/test-cookbooks.py/0 | {
"file_path": "langsmith-cookbook/_scripts/test-cookbooks.py",
"repo_id": "langsmith-cookbook",
"token_count": 2957
} | 1,055 |
python_tests(
interpreter_constraints=["==3.9.*", "==3.10.*"],
)
| llama_index/llama-index-integrations/llms/llama-index-llms-palm/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-palm/tests/BUILD",
"repo_id": "llama_index",
"token_count": 29
} | 1,368 |
"""LLM Chain for generating examples for question answering."""
from __future__ import annotations
from typing import Any
from langchain_core.language_models import BaseLanguageModel
from langchain_core.output_parsers import BaseLLMOutputParser
from langchain_core.pydantic_v1 import Field
from langchain.chains.llm i... | langchain/libs/langchain/langchain/evaluation/qa/generate_chain.py/0 | {
"file_path": "langchain/libs/langchain/langchain/evaluation/qa/generate_chain.py",
"repo_id": "langchain",
"token_count": 373
} | 552 |
[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 = ["Neo4jQueryToolSpec"]
contains_example = false
import_path = "llama_index.tools.neo4j"
[t... | llama_index/llama-index-integrations/tools/llama-index-tools-neo4j/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-neo4j/pyproject.toml",
"repo_id": "llama_index",
"token_count": 690
} | 1,518 |
import { FakeStreamingLLM } from "@langchain/core/utils/testing";
import { HttpResponseOutputParser } from "../http_response.js";
test("text/plain stream", async () => {
const llm = new FakeStreamingLLM({});
const stream = await llm
.pipe(new HttpResponseOutputParser())
.stream("Hi there!");
const chunks... | langchainjs/langchain/src/output_parsers/tests/http_response.test.ts/0 | {
"file_path": "langchainjs/langchain/src/output_parsers/tests/http_response.test.ts",
"repo_id": "langchainjs",
"token_count": 534
} | 912 |
---
hide_table_of_contents: true
---
import CodeBlock from "@theme/CodeBlock";
# Momento-Backed Chat Memory
For distributed, serverless persistence across chat sessions, you can swap in a [Momento](https://gomomento.com/)-backed chat message history.
Because a Momento cache is instantly available and requires zero i... | langchainjs/docs/core_docs/docs/integrations/chat_memory/momento.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/chat_memory/momento.mdx",
"repo_id": "langchainjs",
"token_count": 435
} | 730 |
- sections:
- local: index
title: 🤗 Transformers 简介
- local: quicktour
title: 快速上手
- local: installation
title: 安装
title: 开始使用
- sections:
- local: pipeline_tutorial
title: 使用pipelines进行推理
- local: autoclass_tutorial
title: 使用AutoClass编写可移植的代码
- local: preprocessing
title: 预处理数据
... | transformers/docs/source/zh/_toctree.yml/0 | {
"file_path": "transformers/docs/source/zh/_toctree.yml",
"repo_id": "transformers",
"token_count": 1860
} | 547 |
from pathlib import Path
import pytest
from langchain_community.document_loaders.bibtex import BibtexLoader
BIBTEX_EXAMPLE_FILE = Path(__file__).parent / "sample_documents" / "bibtex.bib"
@pytest.mark.requires("fitz", "bibtexparser")
def test_load_success() -> None:
"""Test that returns one document"""
loa... | langchain/libs/community/tests/unit_tests/document_loaders/test_bibtex.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_bibtex.py",
"repo_id": "langchain",
"token_count": 718
} | 400 |
"""Test Xinference wrapper."""
import time
from typing import AsyncGenerator, Tuple
import pytest_asyncio
from langchain_community.llms import Xinference
@pytest_asyncio.fixture
async def setup() -> AsyncGenerator[Tuple[str, str], None]:
import xoscar as xo
from xinference.deploy.supervisor import start_su... | langchain/libs/community/tests/integration_tests/llms/test_xinference.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/llms/test_xinference.py",
"repo_id": "langchain",
"token_count": 632
} | 363 |
use candle_transformers::models::bert;
use wasm_bindgen::prelude::*;
pub use bert::{BertModel, Config, DTYPE};
pub use tokenizers::{PaddingParams, Tokenizer};
#[wasm_bindgen]
extern "C" {
// Use `js_namespace` here to bind `console.log(..)` instead of just
// `log(..)`
#[wasm_bindgen(js_namespace = consol... | candle/candle-wasm-examples/bert/src/lib.rs/0 | {
"file_path": "candle/candle-wasm-examples/bert/src/lib.rs",
"repo_id": "candle",
"token_count": 226
} | 76 |
[isort]
default_section = FIRSTPARTY
ensure_newline_before_comments = True
force_grid_wrap = 0
include_trailing_comma = True
known_first_party = alignment
known_third_party =
transformers
datasets
fugashi
git
h5py
matplotlib
nltk
numpy
packaging
pandas
psutil
pytest
r... | alignment-handbook/setup.cfg/0 | {
"file_path": "alignment-handbook/setup.cfg",
"repo_id": "alignment-handbook",
"token_count": 297
} | 29 |
"""Test embeddings model integration."""
from langchain_core.pydantic_v1 import SecretStr
from pytest import CaptureFixture
from langchain_google_genai.embeddings import GoogleGenerativeAIEmbeddings
def test_integration_initialization() -> None:
"""Test chat model initialization."""
GoogleGenerativeAIEmbedd... | langchain/libs/partners/google-genai/tests/unit_tests/test_embeddings.py/0 | {
"file_path": "langchain/libs/partners/google-genai/tests/unit_tests/test_embeddings.py",
"repo_id": "langchain",
"token_count": 442
} | 616 |
<jupyter_start><jupyter_text>MarqoThis notebook shows how to use functionality related to the Marqo vectorstore.>[Marqo](https://www.marqo.ai/) is an open-source vector search engine. Marqo allows you to store and query multi-modal data such as text and images. Marqo creates the vectors for you using a huge selection o... | langchain/docs/docs/integrations/vectorstores/marqo.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/marqo.ipynb",
"repo_id": "langchain",
"token_count": 2571
} | 189 |
# 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/biogpt/test_modeling_biogpt.py/0 | {
"file_path": "transformers/tests/models/biogpt/test_modeling_biogpt.py",
"repo_id": "transformers",
"token_count": 8732
} | 748 |
# EverNote
>[EverNote](https://evernote.com/) is intended for archiving and creating notes in which photos, audio and saved web content can be embedded. Notes are stored in virtual "notebooks" and can be tagged, annotated, edited, searched, and exported.
## Installation and Setup
First, you need to install `lxml` an... | langchain/docs/docs/integrations/providers/evernote.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/evernote.mdx",
"repo_id": "langchain",
"token_count": 163
} | 135 |
import { test, expect, jest } from "@jest/globals";
import { AsyncCaller } from "../async_caller.js";
test("AsyncCaller passes on arguments and returns return value", async () => {
const caller = new AsyncCaller({});
const callable = jest.fn((arg1, arg2) => Promise.resolve([arg2, arg1]));
const resultDirect = a... | langchainjs/langchain-core/src/utils/tests/async_caller.test.ts/0 | {
"file_path": "langchainjs/langchain-core/src/utils/tests/async_caller.test.ts",
"repo_id": "langchainjs",
"token_count": 392
} | 910 |
<jupyter_start><jupyter_text>Vearch>[Vearch](https://vearch.readthedocs.io) is the vector search infrastructure for deeping learning and AI applications. Setting upFollow [instructions](https://vearch.readthedocs.io/en/latest/quick-start-guide.html).<jupyter_code>%pip install --upgrade --quiet vearch
# OR
%pip inst... | langchain/docs/docs/integrations/vectorstores/vearch.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/vearch.ipynb",
"repo_id": "langchain",
"token_count": 4934
} | 187 |
# Prerequisites:
# 1. Create a Google Cloud project
# 2. Enable the Google Drive API:
# https://console.cloud.google.com/flows/enableapi?apiid=drive.googleapis.com
# 3. Authorize credentials for desktop app:
# https://developers.google.com/drive/api/quickstart/python#authorize_credentials_for_a_desktop_application ... | langchain/libs/community/langchain_community/document_loaders/googledrive.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/googledrive.py",
"repo_id": "langchain",
"token_count": 6729
} | 238 |
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/model_doc/efficientformer.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/efficientformer.md",
"repo_id": "transformers",
"token_count": 1075
} | 503 |
import { useCallback, useState } from "react";
import { fetchEventSource } from "@microsoft/fetch-event-source";
import { Message } from "./useChatList";
export interface StreamState {
status: "inflight" | "error" | "done";
messages?: Message[];
run_id?: string;
merge?: boolean;
}
export interface StreamState... | opengpts/frontend/src/hooks/useStreamState.tsx/0 | {
"file_path": "opengpts/frontend/src/hooks/useStreamState.tsx",
"repo_id": "opengpts",
"token_count": 1506
} | 1,917 |
from typing import Optional, Type
from llama_index.legacy.download.module import (
LLAMA_HUB_URL,
MODULE_TYPE,
download_llama_module,
track_download,
)
from llama_index.legacy.llama_pack.base import BaseLlamaPack
def download_llama_pack(
llama_pack_class: str,
download_dir: str,
llama_hub... | llama_index/llama-index-legacy/llama_index/legacy/llama_pack/download.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/llama_pack/download.py",
"repo_id": "llama_index",
"token_count": 607
} | 1,570 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/proxy/task_scheduler.go/0 | {
"file_path": "milvus/internal/proxy/task_scheduler.go",
"repo_id": "milvus",
"token_count": 5355
} | 1,854 |
# 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/dependency_versions_check.py/0 | {
"file_path": "diffusers/src/diffusers/dependency_versions_check.py",
"repo_id": "diffusers",
"token_count": 381
} | 230 |
// @ts-nocheck
// Inlined because of ESM import issues
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2022 Joachim Wester
* MIT licensed
*/
const _hasOwnProperty = Object.prototype.hasOwnProperty;
export function hasOwnProperty(obj, key) {
return _hasOwnProperty.call(obj, key);
}
export functi... | langchainjs/langchain-core/src/utils/fast-json-patch/src/helpers.ts/0 | {
"file_path": "langchainjs/langchain-core/src/utils/fast-json-patch/src/helpers.ts",
"repo_id": "langchainjs",
"token_count": 1894
} | 864 |
# LlamaIndex Embeddings Integration: Bedrock
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/README.md",
"repo_id": "llama_index",
"token_count": 12
} | 1,176 |
import importlib.util
import os
import tempfile
from pathlib import PurePath
from typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Union
import fsspec
import numpy as np
from .utils import logging
from .utils import tqdm as hf_tqdm
if TYPE_CHECKING:
from .arrow_dataset import Dataset # noqa: F401... | datasets/src/datasets/search.py/0 | {
"file_path": "datasets/src/datasets/search.py",
"repo_id": "datasets",
"token_count": 15237
} | 149 |
package httpserver
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"strconv"
"strings"
"testing"
"github.com/cockroachdb/errors"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"go.uber.org/atomic"
"github.com/milvus-io... | milvus/internal/distributed/proxy/httpserver/handler_v1_test.go/0 | {
"file_path": "milvus/internal/distributed/proxy/httpserver/handler_v1_test.go",
"repo_id": "milvus",
"token_count": 27401
} | 1,798 |
# Golden
>[Golden](https://golden.com) provides a set of natural language APIs for querying and enrichment using the Golden Knowledge Graph e.g. queries such as: `Products from OpenAI`, `Generative ai companies with series a funding`, and `rappers who invest` can be used to retrieve structured data about relevant enti... | langchain/docs/docs/integrations/providers/golden.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/golden.mdx",
"repo_id": "langchain",
"token_count": 401
} | 148 |
from langchain_nvidia_ai_endpoints import __all__
EXPECTED_ALL = ["ChatNVIDIA", "NVIDIAEmbeddings"]
def test_all_imports() -> None:
assert sorted(EXPECTED_ALL) == sorted(__all__)
| langchain/libs/partners/nvidia-ai-endpoints/tests/unit_tests/test_imports.py/0 | {
"file_path": "langchain/libs/partners/nvidia-ai-endpoints/tests/unit_tests/test_imports.py",
"repo_id": "langchain",
"token_count": 67
} | 692 |
"""Question answering over a graph."""
from __future__ import annotations
import re
from typing import Any, Dict, List, Optional
from langchain_community.graphs.graph_store import GraphStore
from langchain_core.callbacks import CallbackManagerForChainRun
from langchain_core.language_models import BaseLanguageModel
fr... | langchain/libs/langchain/langchain/chains/graph_qa/cypher.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/graph_qa/cypher.py",
"repo_id": "langchain",
"token_count": 4542
} | 481 |
# Metric Card for Exact Match
## Metric Description
A given predicted string's exact match score is 1 if it is the exact same as its reference string, and is 0 otherwise.
- **Example 1**: The exact match score of prediction "Happy Birthday!" is 0, given its reference is "Happy New Year!".
- **Example 2**: The exact ... | datasets/metrics/exact_match/README.md/0 | {
"file_path": "datasets/metrics/exact_match/README.md",
"repo_id": "datasets",
"token_count": 1508
} | 117 |
// 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/pkg/util/conc/pool.go/0 | {
"file_path": "milvus/pkg/util/conc/pool.go",
"repo_id": "milvus",
"token_count": 1245
} | 1,962 |
from langchain import smith
from tests.unit_tests import assert_all_importable
EXPECTED_ALL = [
"arun_on_dataset",
"run_on_dataset",
"RunEvalConfig",
]
def test_all_imports() -> None:
assert set(smith.__all__) == set(EXPECTED_ALL)
assert_all_importable(smith)
| langchain/libs/langchain/tests/unit_tests/smith/test_imports.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/smith/test_imports.py",
"repo_id": "langchain",
"token_count": 117
} | 610 |
python_sources()
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,234 |
import { Parser } from "expr-eval";
import { Tool } from "@langchain/core/tools";
/**
* The Calculator class is a tool used to evaluate mathematical
* expressions. It extends the base Tool class.
* @example
* ```typescript
* const calculator = new Calculator();
* const sum = calculator.add(99, 99);
* console.l... | langchainjs/langchain/src/tools/calculator.ts/0 | {
"file_path": "langchainjs/langchain/src/tools/calculator.ts",
"repo_id": "langchainjs",
"token_count": 295
} | 929 |
poetry_requirements(
name="poetry",
)
python_requirements(
name="reqs",
)
| llama_index/llama-index-packs/llama-index-packs-redis-ingestion-pipeline/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-redis-ingestion-pipeline/BUILD",
"repo_id": "llama_index",
"token_count": 36
} | 1,813 |
import torch
from torch import nn as nn
try:
from inplace_abn.functions import inplace_abn, inplace_abn_sync
has_iabn = True
except ImportError:
has_iabn = False
def inplace_abn(x, weight, bias, running_mean, running_var,
training=True, momentum=0.1, eps=1e-05, activation="leaky_re... | pytorch-image-models/timm/layers/inplace_abn.py/0 | {
"file_path": "pytorch-image-models/timm/layers/inplace_abn.py",
"repo_id": "pytorch-image-models",
"token_count": 1556
} | 389 |
<jupyter_start><jupyter_text>DiscordThis notebook shows how to create your own chat loader that works on copy-pasted messages (from dms) to a list of LangChain messages.The process has four steps:1. Create the chat .txt file by copying chats from the Discord app and pasting them in a file on your local computer2. Copy ... | langchain/docs/docs/integrations/chat_loaders/discord.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/chat_loaders/discord.ipynb",
"repo_id": "langchain",
"token_count": 2790
} | 103 |
// Code generated by mockery v2.32.4. DO NOT EDIT.
package datanode
import (
datapb "github.com/milvus-io/milvus/internal/proto/datapb"
mock "github.com/stretchr/testify/mock"
)
// MockChannelManager is an autogenerated mock type for the ChannelManager type
type MockChannelManager struct {
mock.Mock
}
type MockC... | milvus/internal/datanode/mock_channelmanager.go/0 | {
"file_path": "milvus/internal/datanode/mock_channelmanager.go",
"repo_id": "milvus",
"token_count": 1940
} | 1,779 |
import init, { run_app } from './pkg/candle_wasm_example_whisper.js';
async function main() {
await init('/pkg/candle_wasm_example_whisper_bg.wasm');
run_app();
}
main()
| candle/candle-wasm-examples/whisper/main.js/0 | {
"file_path": "candle/candle-wasm-examples/whisper/main.js",
"repo_id": "candle",
"token_count": 73
} | 86 |
import {
DiscordGetMessagesTool,
DiscordChannelSearchTool,
DiscordSendMessagesTool,
DiscordGetGuildsTool,
DiscordGetTextChannelsTool,
} from "@langchain/community/tools/discord";
// Get messages from a channel given channel ID
const getMessageTool = new DiscordGetMessagesTool();
const messageResults = await ... | langchainjs/examples/src/tools/discord.ts/0 | {
"file_path": "langchainjs/examples/src/tools/discord.ts",
"repo_id": "langchainjs",
"token_count": 304
} | 852 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.