text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
import { AgentExecutor } from "langchain/agents";
import { ChatOpenAI } from "@langchain/openai";
import { Calculator } from "langchain/tools/calculator";
import { OpenAIFunctionsAgentOutputParser } from "langchain/agents/openai/output_parser";
import { BufferMemory } from "langchain/memory";
import { convertToOpenAIFu... | langchainjs/examples/src/agents/openai_runnable_with_memory.ts/0 | {
"file_path": "langchainjs/examples/src/agents/openai_runnable_with_memory.ts",
"repo_id": "langchainjs",
"token_count": 1135
} | 781 |
# (Legacy) SE-ResNeXt
**SE ResNeXt** is a variant of a [ResNeXt](https://www.paperswithcode.com/method/resnext) that employs [squeeze-and-excitation blocks](https://paperswithcode.com/method/squeeze-and-excitation-block) to enable the network to perform dynamic channel-wise feature recalibration.
{% include 'code_sni... | pytorch-image-models/docs/models/.templates/models/legacy-se-resnext.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/legacy-se-resnext.md",
"repo_id": "pytorch-image-models",
"token_count": 1900
} | 358 |
from pymilvus import Connections
from pymilvus import DefaultConfig
from pymilvus import MilvusClient
import sys
sys.path.append("..")
from check.func_check import ResponseChecker
from utils.api_request import api_request
class ApiConnectionsWrapper:
def __init__(self):
self.connection = Connections()
... | milvus/tests/python_client/base/connections_wrapper.py/0 | {
"file_path": "milvus/tests/python_client/base/connections_wrapper.py",
"repo_id": "milvus",
"token_count": 1445
} | 1,890 |
# coding=utf-8
# Copyright 2024 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/test_processing_common.py/0 | {
"file_path": "transformers/tests/test_processing_common.py",
"repo_id": "transformers",
"token_count": 1720
} | 768 |
<!--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/ko/bertology.md/0 | {
"file_path": "transformers/docs/source/ko/bertology.md",
"repo_id": "transformers",
"token_count": 1557
} | 539 |
# Copyright 2023-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 applicable law or... | peft/src/peft/tuners/ia3/layer.py/0 | {
"file_path": "peft/src/peft/tuners/ia3/layer.py",
"repo_id": "peft",
"token_count": 6410
} | 304 |
# 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/yoso/configuration_yoso.py/0 | {
"file_path": "transformers/src/transformers/models/yoso/configuration_yoso.py",
"repo_id": "transformers",
"token_count": 2641
} | 723 |
<jupyter_start><jupyter_text>---sidebar_position: 2title: Multiple chains---<jupyter_code>Runnables can easily be used to string together multiple Chains<jupyter_output><empty_output><jupyter_text>%pip install --upgrade --quiet langchain langchain-openai<jupyter_code>from operator import itemgetter
from langchain.sch... | langchain/docs/docs/expression_language/cookbook/multiple_chains.ipynb/0 | {
"file_path": "langchain/docs/docs/expression_language/cookbook/multiple_chains.ipynb",
"repo_id": "langchain",
"token_count": 1288
} | 86 |
import inspect
from copy import deepcopy
from enum import Enum
from typing import List, Optional, Tuple, Union
import torch
from tqdm.auto import tqdm
from diffusers.models import AutoencoderKL, UNet2DConditionModel
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
from diffusers.pipelines.stable_diffu... | diffusers/examples/community/mixture_tiling.py/0 | {
"file_path": "diffusers/examples/community/mixture_tiling.py",
"repo_id": "diffusers",
"token_count": 9148
} | 199 |
# 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/examples/pytorch/image-classification/run_image_classification_no_trainer.py/0 | {
"file_path": "transformers/examples/pytorch/image-classification/run_image_classification_no_trainer.py",
"repo_id": "transformers",
"token_count": 11204
} | 548 |
poetry_requirements(
name="poetry",
)
python_requirements(
name="reqs",
)
| llama_index/llama-index-integrations/readers/llama-index-readers-athena/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-athena/BUILD",
"repo_id": "llama_index",
"token_count": 36
} | 1,380 |
<!--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/training/sdxl.md/0 | {
"file_path": "diffusers/docs/source/en/training/sdxl.md",
"repo_id": "diffusers",
"token_count": 4389
} | 170 |
import os
import shutil
import tempfile
import pytest
from typing import Generator, List, Callable, Iterator, Dict, Optional, Union, Sequence
from chromadb.api.types import validate_metadata
from chromadb.config import System, Settings
from chromadb.db.base import ParameterValue, get_sql
from chromadb.db.impl.sqlite i... | chroma/chromadb/test/segment/test_metadata.py/0 | {
"file_path": "chroma/chromadb/test/segment/test_metadata.py",
"repo_id": "chroma",
"token_count": 8491
} | 27 |
# coding=utf-8
# Copyright 2021 Google AI 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
#
... | transformers/src/transformers/models/canine/modeling_canine.py/0 | {
"file_path": "transformers/src/transformers/models/canine/modeling_canine.py",
"repo_id": "transformers",
"token_count": 31277
} | 631 |
python_tests()
| llama_index/llama-index-integrations/tools/llama-index-tools-shopify/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-shopify/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,528 |
# 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/nllb/test_tokenization_nllb.py/0 | {
"file_path": "transformers/tests/models/nllb/test_tokenization_nllb.py",
"repo_id": "transformers",
"token_count": 9965
} | 829 |
// 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/pkg/util/metricsinfo/metric_type_test.go/0 | {
"file_path": "milvus/pkg/util/metricsinfo/metric_type_test.go",
"repo_id": "milvus",
"token_count": 815
} | 1,837 |
from llama_index.core.llms.base import BaseLLM
from llama_index.llms.rungpt import RunGptLLM
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in RunGptLLM.__mro__]
assert BaseLLM.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py",
"repo_id": "llama_index",
"token_count": 98
} | 1,421 |
# coding=utf-8
# Copyright 2023 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... | transformers/tests/tools/test_image_question_answering.py/0 | {
"file_path": "transformers/tests/tools/test_image_question_answering.py",
"repo_id": "transformers",
"token_count": 768
} | 848 |
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
import { PromptTemplate } from "@langchain/core/prompts";
import { ChainValues } from "@langchain/core/utils/types";
import {
CallbackManagerForChainRun,
Callbacks,
} from "@langchain/core/callbacks/manager";
import { LLMChain }... | langchainjs/langchain/src/experimental/generative_agents/generative_agent.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/generative_agents/generative_agent.ts",
"repo_id": "langchainjs",
"token_count": 5608
} | 882 |
#!/usr/bin/env bash
set -euxo pipefail
export CI=true
# enable extended globbing for omitting build artifacts
shopt -s extglob
# avoid copying build artifacts from the host
cp -r ../package/!(node_modules|dist|dist-cjs|dist-esm|build|.next|.turbo) .
mkdir -p ./libs/langchain-core/
mkdir -p ./libs/langchain-openai/... | langchainjs/environment_tests/scripts/docker-ci-entrypoint.sh/0 | {
"file_path": "langchainjs/environment_tests/scripts/docker-ci-entrypoint.sh",
"repo_id": "langchainjs",
"token_count": 330
} | 772 |
"""Logic for selecting examples to include in prompts."""
from langchain_community.example_selectors.ngram_overlap import (
NGramOverlapExampleSelector,
ngram_overlap_score,
)
__all__ = [
"NGramOverlapExampleSelector",
"ngram_overlap_score",
]
| langchain/libs/community/langchain_community/example_selectors/__init__.py/0 | {
"file_path": "langchain/libs/community/langchain_community/example_selectors/__init__.py",
"repo_id": "langchain",
"token_count": 93
} | 280 |
version: '3.7'
services:
graphdb:
image: graphdb
container_name: graphdb
ports:
- "7200:7200"
| langchain/libs/community/tests/integration_tests/graphs/docker-compose-ontotext-graphdb/docker-compose.yaml/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/graphs/docker-compose-ontotext-graphdb/docker-compose.yaml",
"repo_id": "langchain",
"token_count": 55
} | 353 |
from abc import abstractmethod
from typing import List, Tuple
from langchain.schema import BaseOutputParser
from langchain_experimental.pydantic_v1 import BaseModel, Field
class Step(BaseModel):
"""Step."""
value: str
"""The value."""
class Plan(BaseModel):
"""Plan."""
steps: List[Step]
... | langchain/libs/experimental/langchain_experimental/plan_and_execute/schema.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/plan_and_execute/schema.py",
"repo_id": "langchain",
"token_count": 495
} | 446 |
"""Fake LLM wrapper for testing purposes."""
from typing import Any, Dict, List, Mapping, Optional, cast
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.pydantic_v1 import validator
class FakeLLM(LLM):
"""Fake LLM wrapper for t... | langchain/libs/community/tests/unit_tests/llms/fake_llm.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/llms/fake_llm.py",
"repo_id": "langchain",
"token_count": 769
} | 400 |
## Tests
### E2E Test
#### ้
็ฝฎๆธ
ๅ
##### ๆไฝ็ณป็ป
| ๆไฝ็ณป็ป | ็ๆฌ |
| ------ | --------- |
| CentOS | 7.5 ๆไปฅไธ |
| Ubuntu | 16.04 ๆไปฅไธ |
| Mac | 10.14 ๆไปฅไธ |
##### ็กฌไปถ
| ็กฌไปถๅ็งฐ | ๅปบ่ฎฎ้
็ฝฎ |
| ---- | ---------------------------... | milvus/tests/README_CN.md/0 | {
"file_path": "milvus/tests/README_CN.md",
"repo_id": "milvus",
"token_count": 1395
} | 2,074 |
# CIP-2: Auth Providers Proposal
## Status
Current Status: `Accepted`
## **Motivation**
Currently, Chroma does not provide any authentication mechanism. This CIP proposes to
add authentication abstractions and basic authentication mechanisms to Chroma.
There are intrinsic and extrinsic motivations for this CIP. Th... | chroma/docs/CIP_2_Auth_Providers_Proposal.md/0 | {
"file_path": "chroma/docs/CIP_2_Auth_Providers_Proposal.md",
"repo_id": "chroma",
"token_count": 2180
} | 34 |
""" Sequencer
Paper: `Sequencer: Deep LSTM for Image Classification` - https://arxiv.org/pdf/2205.01972.pdf
"""
# Copyright (c) 2022. Yuki Tatsunami
# Licensed under the Apache License, Version 2.0 (the "License");
import math
from functools import partial
from itertools import accumulate
from typing import Tuple
... | pytorch-image-models/timm/models/sequencer.py/0 | {
"file_path": "pytorch-image-models/timm/models/sequencer.py",
"repo_id": "pytorch-image-models",
"token_count": 9227
} | 368 |
from openai_functions_agent.agent import agent_executor
if __name__ == "__main__":
question = "who won the womens world cup in 2023?"
print(agent_executor.invoke({"input": question, "chat_history": []})) # noqa: T201
| langchain/templates/openai-functions-agent/main.py/0 | {
"file_path": "langchain/templates/openai-functions-agent/main.py",
"repo_id": "langchain",
"token_count": 79
} | 704 |
# Tokenizer
<tokenizerslangcontent>
<python>
## Tokenizer
[[autodoc]] tokenizers.Tokenizer
- all
- decoder
- model
- normalizer
- padding
- post_processor
- pre_tokenizer
- truncation
</python>
<rust>
The Rust API Reference is available directly on the [Docs.rs](https://docs.rs/tokeniz... | tokenizers/docs/source-doc-builder/api/tokenizer.mdx/0 | {
"file_path": "tokenizers/docs/source-doc-builder/api/tokenizer.mdx",
"repo_id": "tokenizers",
"token_count": 156
} | 470 |
import fs from "fs";
const HF_DEPLOYMENT_TOKEN = process.env.HF_DEPLOYMENT_TOKEN; // token used for pushing to hub
const SERPER_API_KEY = process.env.SERPER_API_KEY;
const OPENID_CONFIG = process.env.OPENID_CONFIG;
const MONGODB_URL = process.env.MONGODB_URL;
const HF_TOKEN = process.env.HF_TOKEN ?? process.env.HF_AC... | chat-ui/scripts/updateProdEnv.ts/0 | {
"file_path": "chat-ui/scripts/updateProdEnv.ts",
"repo_id": "chat-ui",
"token_count": 500
} | 94 |
import argparse
import os
from accelerate import Accelerator
from datasets import load_dataset
from peft import LoraConfig
from tqdm import tqdm
from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments, logging, set_seed
from trl import SFTTrainer
from trl.trainer import ConstantLengthDataset
... | trl/examples/research_projects/stack_llama/scripts/supervised_finetuning.py/0 | {
"file_path": "trl/examples/research_projects/stack_llama/scripts/supervised_finetuning.py",
"repo_id": "trl",
"token_count": 2908
} | 868 |
"""Test OpenSearch functionality."""
import pytest
from langchain_core.documents import Document
from langchain_community.vectorstores.opensearch_vector_search import (
PAINLESS_SCRIPTING_SEARCH,
SCRIPT_SCORING_SEARCH,
OpenSearchVectorSearch,
)
from tests.integration_tests.vectorstores.fake_embeddings imp... | langchain/libs/community/tests/integration_tests/vectorstores/test_opensearch.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_opensearch.py",
"repo_id": "langchain",
"token_count": 5134
} | 361 |
# Indexing
## Concept
An `Index` is a data structure that allows us to quickly retrieve relevant context for a user query.
For LlamaIndex, it's the core foundation for retrieval-augmented generation (RAG) use-cases.
At a high-level, `Indexes` are built from [Documents](/module_guides/loading/documents_and_nodes/root... | llama_index/docs/module_guides/indexing/indexing.md/0 | {
"file_path": "llama_index/docs/module_guides/indexing/indexing.md",
"repo_id": "llama_index",
"token_count": 412
} | 1,141 |
"""Sentence window retriever."""
from typing import Any, Dict, List
from llama_index.core import ServiceContext, VectorStoreIndex
from llama_index.core.llama_pack.base import BaseLlamaPack
from llama_index.core.node_parser import (
SentenceWindowNodeParser,
)
from llama_index.core.postprocessor import MetadataRep... | llama_index/llama-index-packs/llama-index-packs-sentence-window-retriever/llama_index/packs/sentence_window_retriever/base.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-sentence-window-retriever/llama_index/packs/sentence_window_retriever/base.py",
"repo_id": "llama_index",
"token_count": 1114
} | 1,818 |
from __future__ import annotations
from typing import Any, Dict, List, Literal
from langchain_core.messages import BaseMessage, BaseMessageChunk
from langchain_core.outputs.generation import Generation
from langchain_core.pydantic_v1 import root_validator
from langchain_core.utils._merge import merge_dicts
class Ch... | langchain/libs/core/langchain_core/outputs/chat_generation.py/0 | {
"file_path": "langchain/libs/core/langchain_core/outputs/chat_generation.py",
"repo_id": "langchain",
"token_count": 960
} | 434 |
import pytest
@pytest.fixture(scope="module")
def flash_llama_awq_handle_sharded(launcher):
with launcher(
"abhinavkulkarni/codellama-CodeLlama-7b-Python-hf-w4-g128-awq",
num_shard=2,
quantize="awq",
) as handle:
yield handle
@pytest.fixture(scope="module")
async def flash_ll... | text-generation-inference/integration-tests/models/test_flash_awq_sharded.py/0 | {
"file_path": "text-generation-inference/integration-tests/models/test_flash_awq_sharded.py",
"repo_id": "text-generation-inference",
"token_count": 624
} | 426 |
from langchain_community.document_loaders.spreedly import SpreedlyLoader
def test_spreedly_loader() -> None:
"""Test Spreedly Loader."""
access_token = ""
resource = "gateways_options"
spreedly_loader = SpreedlyLoader(access_token, resource)
documents = spreedly_loader.load()
assert len(docum... | langchain/libs/community/tests/integration_tests/document_loaders/test_spreedly.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_spreedly.py",
"repo_id": "langchain",
"token_count": 115
} | 358 |
import { Callbacks } from "@langchain/core/callbacks/manager";
import { BaseOutputParser } from "@langchain/core/output_parsers";
/**
* Type for the combined output of the CombiningOutputParser class.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type CombinedOutput = Record<string, any>;
... | langchainjs/langchain/src/output_parsers/combining.ts/0 | {
"file_path": "langchainjs/langchain/src/output_parsers/combining.ts",
"repo_id": "langchainjs",
"token_count": 1153
} | 908 |
# StochasticAI
This page covers how to use the StochasticAI ecosystem within LangChain.
It is broken into two parts: installation and setup, and then references to specific StochasticAI wrappers.
## Installation and Setup
- Install with `pip install stochasticx`
- Get an StochasticAI api key and set it as an environm... | langchain/docs/docs/integrations/providers/stochasticai.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/stochasticai.mdx",
"repo_id": "langchain",
"token_count": 147
} | 146 |
<!--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/convnext.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/convnext.md",
"repo_id": "transformers",
"token_count": 1215
} | 500 |
import os
import requests
from typing import Dict, Optional, List
from huggingface_hub.utils import build_hf_headers
from text_generation import Client, AsyncClient, __version__
from text_generation.types import DeployedModel
from text_generation.errors import NotSupportedError, parse_error
INFERENCE_ENDPOINT = os.e... | text-generation-inference/clients/python/text_generation/inference_api.py/0 | {
"file_path": "text-generation-inference/clients/python/text_generation/inference_api.py",
"repo_id": "text-generation-inference",
"token_count": 2183
} | 400 |
<jupyter_start><jupyter_text>txtai Vector Store If you're opening this Notebook on colab, you will probably need to install LlamaIndex ๐ฆ.<jupyter_code>%pip install llama-index-vector-stores-txtai
!pip install llama-index<jupyter_output><empty_output><jupyter_text>Creating a Faiss Index<jupyter_code>import logging
impo... | llama_index/docs/examples/vector_stores/TxtaiIndexDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/TxtaiIndexDemo.ipynb",
"repo_id": "llama_index",
"token_count": 791
} | 1,093 |
# 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_blocks.py/0 | {
"file_path": "diffusers/src/diffusers/models/unets/unet_2d_blocks.py",
"repo_id": "diffusers",
"token_count": 74710
} | 227 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "embeddings/voyage",
});
export * from "@langchain/community/embeddings/voyage";
| langchainjs/langchain/src/embeddings/voyage.ts/0 | {
"file_path": "langchainjs/langchain/src/embeddings/voyage.ts",
"repo_id": "langchainjs",
"token_count": 74
} | 889 |
<!--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/beit.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/beit.md",
"repo_id": "transformers",
"token_count": 3840
} | 517 |
// 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/mq/msgstream/repack_func.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/repack_func.go",
"repo_id": "milvus",
"token_count": 1197
} | 1,960 |
๏ปฟ<!--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 agree... | diffusers/docs/source/ko/tutorials/basic_training.md/0 | {
"file_path": "diffusers/docs/source/ko/tutorials/basic_training.md",
"repo_id": "diffusers",
"token_count": 11285
} | 198 |
<jupyter_start><jupyter_text>Yes, Transformers are Effective for Time Series Forecasting (+ Autoformer) IntroductionA few months ago, we introduced the [Informer](https://huggingface.co/blog/informer) model ([Zhou, Haoyi, et al., 2021](https://arxiv.org/abs/2012.07436)), which is a Time Series Transformer that won the ... | notebooks/examples/autoformer-transformers-are-effective.ipynb/0 | {
"file_path": "notebooks/examples/autoformer-transformers-are-effective.ipynb",
"repo_id": "notebooks",
"token_count": 13600
} | 299 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
_LazyModule,
)
_import_structure = {"pipeline_ddpm": ["DDPMPipeline"]}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .pipeline_ddpm import DDPMPipeline
else:
import sys
sys.modules[__name__] = _LazyModule(
... | diffusers/src/diffusers/pipelines/ddpm/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/ddpm/__init__.py",
"repo_id": "diffusers",
"token_count": 193
} | 245 |
package dependency
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestValidateMQType(t *testing.T) {
assert.Error(t, validateMQType(true, mqTypeDefault))
assert.Error(t, validateMQType(false, mqTypeDefault))
assert.Error(t, validateMQType(false, mqTypeNatsmq))
assert.Error(t, validateMQType(fal... | milvus/internal/util/dependency/factory_test.go/0 | {
"file_path": "milvus/internal/util/dependency/factory_test.go",
"repo_id": "milvus",
"token_count": 892
} | 1,934 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.microsoft_outlook import OutlookLocalCalendarReader
def test_class():
names_of_base_classes = [b.__name__ for b in OutlookLocalCalendarReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-outlook/tests/test_readers_outlook_localcalendar.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-outlook/tests/test_readers_outlook_localcalendar.py",
"repo_id": "llama_index",
"token_count": 94
} | 1,408 |
from langchain_community.document_loaders.concurrent import (
ConcurrentLoader,
)
__all__ = ["ConcurrentLoader"]
| langchain/libs/langchain/langchain/document_loaders/concurrent.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/concurrent.py",
"repo_id": "langchain",
"token_count": 37
} | 481 |
from typing import List, Sequence
from langchain_core.chat_history import BaseChatMessageHistory
from langchain_core.messages import BaseMessage, HumanMessage
def test_add_message_implementation_only() -> None:
"""Test implementation of add_message only."""
class SampleChatHistory(BaseChatMessageHistory):
... | langchain/libs/core/tests/unit_tests/chat_history/test_chat_history.py/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/chat_history/test_chat_history.py",
"repo_id": "langchain",
"token_count": 1308
} | 402 |
/* eslint-disable no-process-env */
import { test } from "@jest/globals";
import { Redis as UpstashRedis } from "@upstash/redis";
import { UpstashRedisStore } from "../upstash_redis.js";
const getClient = () => {
if (
!process.env.UPSTASH_REDIS_REST_URL ||
!process.env.UPSTASH_REDIS_REST_TOKEN
) {
thr... | langchainjs/libs/langchain-community/src/storage/tests/upstash_redis.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/storage/tests/upstash_redis.int.test.ts",
"repo_id": "langchainjs",
"token_count": 1070
} | 992 |
# Javelin AI Gateway
[The Javelin AI Gateway](https://www.getjavelin.io) service is a high-performance, enterprise grade API Gateway for AI applications.
It is designed to streamline the usage and access of various large language model (LLM) providers,
such as OpenAI, Cohere, Anthropic and custom large language mod... | langchain/docs/docs/integrations/providers/javelin_ai_gateway.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/javelin_ai_gateway.mdx",
"repo_id": "langchain",
"token_count": 797
} | 147 |
"""Test for Serializable base class"""
import json
import os
from typing import Any, Dict, List
from unittest.mock import patch
import pytest
from langchain_community.chat_models.openai import ChatOpenAI
from langchain_community.llms.openai import OpenAI
from langchain_core.load.dump import dumps
from langchain_core.... | langchain/libs/langchain/tests/unit_tests/load/test_dump.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/load/test_dump.py",
"repo_id": "langchain",
"token_count": 3360
} | 632 |
import { type ClientOptions, OpenAIClient } from "@langchain/openai";
import { ChainValues } from "@langchain/core/utils/types";
import {
AsyncCaller,
AsyncCallerParams,
} from "@langchain/core/utils/async_caller";
import { getEnvironmentVariable } from "@langchain/core/utils/env";
import { BaseChain, ChainInputs }... | langchainjs/langchain/src/chains/openai_moderation.ts/0 | {
"file_path": "langchainjs/langchain/src/chains/openai_moderation.ts",
"repo_id": "langchainjs",
"token_count": 1424
} | 893 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-bilibili/llama_index/readers/bilibili/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-bilibili/llama_index/readers/bilibili/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,297 |
syntax = "proto3";
package milvus.proto.rootcoord;
option go_package="github.com/milvus-io/milvus/internal/proto/rootcoordpb";
import "common.proto";
import "milvus.proto";
import "internal.proto";
import "proxy.proto";
//import "data_coord.proto";
import "etcd_meta.proto";
service RootCoord {
rpc GetComponentStat... | milvus/internal/proto/root_coord.proto/0 | {
"file_path": "milvus/internal/proto/root_coord.proto",
"repo_id": "milvus",
"token_count": 3089
} | 1,840 |
# 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/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_{{cookiecutter.lowercase_modelname}}.py/0 | {
"file_path": "transformers/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_{{cookiecutter.lowercase_modelname}}.py",
"repo_id": "transformers",
"token_count": 19936
} | 761 |
from unittest.mock import patch
from llama_index.core.graph_stores.types import GraphStore
from llama_index.graph_stores.falkordb.base import FalkorDBGraphStore
@patch("llama_index.graph_stores.falkordb.base.FalkorDBGraphStore")
def test_falkordb_class(mock_db: FalkorDBGraphStore):
assert isinstance(mock_db, Gra... | llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-falkordb/tests/test_graph_stores_falkordb.py/0 | {
"file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-falkordb/tests/test_graph_stores_falkordb.py",
"repo_id": "llama_index",
"token_count": 117
} | 1,205 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | transformers/src/transformers/utils/quantization_config.py/0 | {
"file_path": "transformers/src/transformers/utils/quantization_config.py",
"repo_id": "transformers",
"token_count": 15573
} | 697 |
# ResNet
**Residual Networks**, or **ResNets**, learn residual functions with reference to the layer inputs, instead of learning unreferenced functions. Instead of hoping each few stacked layers directly fit a desired underlying mapping, residual nets let these layers fit a residual mapping. They stack [residual block... | pytorch-image-models/docs/models/resnet.md/0 | {
"file_path": "pytorch-image-models/docs/models/resnet.md",
"repo_id": "pytorch-image-models",
"token_count": 5071
} | 368 |
[tool.poetry]
name = "guardrails-output-parser"
version = "0.0.1"
description = "Use guardrails-ai to validate LLM output"
authors = []
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.9,<3.13"
langchain = "^0.1"
openai = "<2"
guardrails-ai = "^0.2.4"
alt-profanity-check = "^1.3.1"
[tool.poetry.group.dev... | langchain/templates/guardrails-output-parser/pyproject.toml/0 | {
"file_path": "langchain/templates/guardrails-output-parser/pyproject.toml",
"repo_id": "langchain",
"token_count": 311
} | 707 |
# Facebook Faiss
>[Facebook AI Similarity Search (Faiss)](https://engineering.fb.com/2017/03/29/data-infrastructure/faiss-a-library-for-efficient-similarity-search/)
> is a library for efficient similarity search and clustering of dense vectors. It contains algorithms that
> search in sets of vectors of any size, up... | langchain/docs/docs/integrations/providers/facebook_faiss.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/facebook_faiss.mdx",
"repo_id": "langchain",
"token_count": 241
} | 146 |
# coding=utf-8
# Copyright 2022 Microsoft Research and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | transformers/src/transformers/models/swin/modeling_tf_swin.py/0 | {
"file_path": "transformers/src/transformers/models/swin/modeling_tf_swin.py",
"repo_id": "transformers",
"token_count": 30544
} | 749 |
import sys
import pytest
from langchain_experimental.agents import create_pandas_dataframe_agent
from tests.unit_tests.fake_llm import FakeLLM
@pytest.mark.requires("pandas", "tabulate")
@pytest.mark.skipif(sys.version_info < (3, 9), reason="requires python3.9 or higher")
def test_create_pandas_dataframe_agent() ->... | langchain/libs/experimental/tests/unit_tests/agents/agent_toolkits/pandas/test_base.py/0 | {
"file_path": "langchain/libs/experimental/tests/unit_tests/agents/agent_toolkits/pandas/test_base.py",
"repo_id": "langchain",
"token_count": 179
} | 472 |
from llama_index.packs.gmail_openai_agent.base import GmailOpenAIAgentPack
__all__ = ["GmailOpenAIAgentPack"]
| llama_index/llama-index-packs/llama-index-packs-gmail-openai-agent/llama_index/packs/gmail_openai_agent/__init__.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-gmail-openai-agent/llama_index/packs/gmail_openai_agent/__init__.py",
"repo_id": "llama_index",
"token_count": 39
} | 1,846 |
python_tests()
| llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,474 |
<!--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/conceptual/contribution.md/0 | {
"file_path": "diffusers/docs/source/en/conceptual/contribution.md",
"repo_id": "diffusers",
"token_count": 10385
} | 183 |
import { Document } from "@langchain/core/documents";
/**
* Abstract class for a document store. All document stores should extend
* this class.
*/
export abstract class Docstore {
abstract search(search: string): Promise<Document>;
abstract add(texts: Record<string, Document>): Promise<void>;
}
| langchainjs/libs/langchain-community/src/stores/doc/base.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/stores/doc/base.ts",
"repo_id": "langchainjs",
"token_count": 82
} | 954 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. & Google 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
#
#... | transformers/src/transformers/models/pix2struct/modeling_pix2struct.py/0 | {
"file_path": "transformers/src/transformers/models/pix2struct/modeling_pix2struct.py",
"repo_id": "transformers",
"token_count": 35764
} | 707 |
<jupyter_start><jupyter_text>Using ๐ค Hugging Face Models with Tensorflow + TPU Most of this notebook is designed to be run on a Colab TPU. To access TPU on Colab, go to `Runtime -> Change runtime type` and choose `TPU`. Some parts of the code may need to be changed when running on a Google Cloud TPU VM or TPU Node. We... | notebooks/examples/tpu_training-tf.ipynb/0 | {
"file_path": "notebooks/examples/tpu_training-tf.ipynb",
"repo_id": "notebooks",
"token_count": 6661
} | 284 |
# 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/deepfloyd_if/test_if_inpainting.py/0 | {
"file_path": "diffusers/tests/pipelines/deepfloyd_if/test_if_inpainting.py",
"repo_id": "diffusers",
"token_count": 2036
} | 289 |
"""Test volc engine maas chat model."""
from langchain_core.callbacks import CallbackManager
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
from langchain_core.outputs import ChatGeneration, LLMResult
from langchain_community.chat_models.volcengine_maas import VolcEngineMaasChat
from tests.u... | langchain/libs/community/tests/integration_tests/chat_models/test_volcengine_maas.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/chat_models/test_volcengine_maas.py",
"repo_id": "langchain",
"token_count": 778
} | 351 |
# Development Instructions
This project uses the testing, build and release standards specified
by the PyPA organization and documented at
https://packaging.python.org.
## Setup
Because of the dependencies it relies on (like `pytorch`), this project does not support Python version >3.10.0.
Set up a virtual environm... | chroma/DEVELOP.md/0 | {
"file_path": "chroma/DEVELOP.md",
"repo_id": "chroma",
"token_count": 1058
} | 10 |
import { BaseMemory } from "@langchain/core/memory";
import { ChainValues } from "@langchain/core/utils/types";
import { RUN_KEY } from "@langchain/core/outputs";
import {
CallbackManagerForChainRun,
CallbackManager,
Callbacks,
parseCallbackConfigArg,
} from "@langchain/core/callbacks/manager";
import type { Ru... | langchainjs/langchain/src/chains/base.ts/0 | {
"file_path": "langchainjs/langchain/src/chains/base.ts",
"repo_id": "langchainjs",
"token_count": 3548
} | 889 |
<!--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/llm_tutorial.md/0 | {
"file_path": "transformers/docs/source/ja/llm_tutorial.md",
"repo_id": "transformers",
"token_count": 5622
} | 478 |
import { OpenAIClient, type ClientOptions } from "@langchain/openai";
import { Serializable } from "@langchain/core/load/serializable";
export type OpenAIFilesInput = {
client?: OpenAIClient;
clientOptions?: ClientOptions;
};
export class OpenAIFiles extends Serializable {
lc_namespace = ["langchain", "experime... | langchainjs/langchain/src/experimental/openai_files/index.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/openai_files/index.ts",
"repo_id": "langchainjs",
"token_count": 1243
} | 940 |
<jupyter_start><jupyter_text>Tune GPT2 to generate positive reviews> Optimise GPT2 to produce positive IMDB movie reviews using a BERT sentiment classifier as a reward function. Figure: Experiment setup to tune GPT2. The yellow arrows are outside the scope of this notebook, but the trained models are available through... | trl/examples/notebooks/gpt2-sentiment.ipynb/0 | {
"file_path": "trl/examples/notebooks/gpt2-sentiment.ipynb",
"repo_id": "trl",
"token_count": 3578
} | 820 |
""" ConvMixer
"""
import torch
import torch.nn as nn
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.layers import SelectAdaptivePool2d
from ._registry import register_model, generate_default_cfgs
from ._builder import build_model_with_cfg
from ._manipulate import checkpoint_seq
__all__ =... | pytorch-image-models/timm/models/convmixer.py/0 | {
"file_path": "pytorch-image-models/timm/models/convmixer.py",
"repo_id": "pytorch-image-models",
"token_count": 2228
} | 371 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,389 |
<!--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/zh/stable_diffusion.md/0 | {
"file_path": "diffusers/docs/source/zh/stable_diffusion.md",
"repo_id": "diffusers",
"token_count": 6188
} | 202 |
from typing import Dict
from unittest.mock import MagicMock, patch
import pytest
from langchain_core.documents import Document
from langchain_community.document_loaders.psychic import PsychicLoader
@pytest.fixture
def mock_psychic(): # type: ignore
with patch("psychicapi.Psychic") as mock_psychic:
yiel... | langchain/libs/community/tests/unit_tests/document_loaders/test_psychic.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_psychic.py",
"repo_id": "langchain",
"token_count": 1015
} | 394 |
"""A tracer that runs evaluators over completed runs."""
from __future__ import annotations
import logging
import threading
import weakref
from concurrent.futures import Future, ThreadPoolExecutor, wait
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, cast
from uuid import UUID
import langsmith
f... | langchain/libs/core/langchain_core/tracers/evaluation.py/0 | {
"file_path": "langchain/libs/core/langchain_core/tracers/evaluation.py",
"repo_id": "langchain",
"token_count": 3786
} | 431 |
<!--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/optimization/tome.md/0 | {
"file_path": "diffusers/docs/source/en/optimization/tome.md",
"repo_id": "diffusers",
"token_count": 3379
} | 180 |
"""Integration tests for the TensorFlow Dataset client."""
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from langchain_core.documents import Document
from langchain_core.pydantic_v1 import ValidationError
from langchain_community.utilities.tensorflow_datasets import TensorflowDat... | langchain/libs/community/tests/integration_tests/utilities/test_tensorflow_datasets.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/utilities/test_tensorflow_datasets.py",
"repo_id": "langchain",
"token_count": 1134
} | 371 |
"""OpenAI embeddings file."""
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple
import httpx
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.core.bridge.pydantic import Field, PrivateAttr
from llama_index.core.callbacks.base import CallbackManager
from llama_in... | llama_index/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/base.py",
"repo_id": "llama_index",
"token_count": 6650
} | 1,322 |
<jupyter_start><jupyter_text>Pinecone>[Pinecone](https://docs.pinecone.io/docs/overview) is a vector database with broad functionality.In the walkthrough, we'll demo the `SelfQueryRetriever` with a `Pinecone` vector store. Creating a Pinecone indexFirst we'll want to create a `Pinecone` vector store and seed it with s... | langchain/docs/docs/integrations/retrievers/self_query/pinecone.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/retrievers/self_query/pinecone.ipynb",
"repo_id": "langchain",
"token_count": 1784
} | 171 |
"""Remote file reader.
A loader that fetches an arbitrary remote page or file by URL and parses its contents.
"""
import re
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
from llama_index.core import SimpleDirectoryReader
from llama_index.core.readers.base import BaseReader
from llama_i... | llama_index/llama-index-integrations/readers/llama-index-readers-remote/llama_index/readers/remote/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-remote/llama_index/readers/remote/base.py",
"repo_id": "llama_index",
"token_count": 1214
} | 1,436 |
from pathlib import Path
from typing import List
import numpy as np
import pytest
from langchain_core.documents import Document
from langchain_community.vectorstores.docarray import DocArrayInMemorySearch
from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings
@pytest.fixture
def texts() -> ... | langchain/libs/community/tests/integration_tests/vectorstores/docarray/test_in_memory.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/docarray/test_in_memory.py",
"repo_id": "langchain",
"token_count": 1293
} | 349 |
# coding=utf-8
# Copyright 2022 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 law... | transformers/src/transformers/models/vision_encoder_decoder/modeling_tf_vision_encoder_decoder.py/0 | {
"file_path": "transformers/src/transformers/models/vision_encoder_decoder/modeling_tf_vision_encoder_decoder.py",
"repo_id": "transformers",
"token_count": 14958
} | 736 |
from typing import Any, Sequence
from llama_index.legacy.response_synthesizers import Accumulate
from llama_index.legacy.types import RESPONSE_TEXT_TYPE
from llama_index.legacy.utils import temp_set_attrs
class CompactAndAccumulate(Accumulate):
"""Accumulate responses across compact text chunks."""
async de... | llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/compact_and_accumulate.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/compact_and_accumulate.py",
"repo_id": "llama_index",
"token_count": 889
} | 1,536 |
import { ConneryService } from "@langchain/community/tools/connery";
import { ChatOpenAI } from "@langchain/openai";
import { initializeAgentExecutorWithOptions } from "langchain/agents";
// Specify your Connery Runner credentials.
process.env.CONNERY_RUNNER_URL = "";
process.env.CONNERY_RUNNER_API_KEY = "";
// Speci... | langchainjs/examples/src/tools/connery.ts/0 | {
"file_path": "langchainjs/examples/src/tools/connery.ts",
"repo_id": "langchainjs",
"token_count": 399
} | 864 |
import base64
from typing import Dict, Optional
from urllib.parse import quote
import aiohttp
import requests
from langchain_core.pydantic_v1 import BaseModel, Extra, Field, root_validator
from langchain_core.utils import get_from_dict_or_env
class DataForSeoAPIWrapper(BaseModel):
"""Wrapper around the DataForSe... | langchain/libs/community/langchain_community/utilities/dataforseo_api_search.py/0 | {
"file_path": "langchain/libs/community/langchain_community/utilities/dataforseo_api_search.py",
"repo_id": "langchain",
"token_count": 3696
} | 298 |
"""Joint QA Summary graph."""
from typing import Optional, Sequence
from llama_index.legacy.indices.list.base import SummaryIndex
from llama_index.legacy.indices.vector_store import VectorStoreIndex
from llama_index.legacy.ingestion import run_transformations
from llama_index.legacy.query_engine.router_query_engine i... | llama_index/llama-index-legacy/llama_index/legacy/composability/joint_qa_summary.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/composability/joint_qa_summary.py",
"repo_id": "llama_index",
"token_count": 1383
} | 1,554 |
<jupyter_start><jupyter_text>Infer-Retrieve-Rerank Llama PackThis is our implementation of the paper ["In-Context Learning for Extreme Multi-Label Classification](https://arxiv.org/pdf/2401.12178.pdf) by Oosterlinck et al.The paper proposes "infer-retrieve-rerank", a simple paradigm using frozen LLM/retriever models th... | llama_index/llama-index-packs/llama-index-packs-infer-retrieve-rerank/examples/infer_retrieve_rerank.ipynb/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-infer-retrieve-rerank/examples/infer_retrieve_rerank.ipynb",
"repo_id": "llama_index",
"token_count": 3349
} | 1,850 |
# 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 applicabl... | transformers/src/transformers/models/musicgen/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/musicgen/__init__.py",
"repo_id": "transformers",
"token_count": 799
} | 662 |
package kafka
import (
"github.com/confluentinc/confluent-kafka-go/kafka"
"github.com/milvus-io/milvus/pkg/mq/msgstream/mqwrapper"
)
type kafkaMessage struct {
msg *kafka.Message
}
func (km *kafkaMessage) Topic() string {
return *km.msg.TopicPartition.Topic
}
func (km *kafkaMessage) Properties() map[string]str... | milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_message.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_message.go",
"repo_id": "milvus",
"token_count": 264
} | 2,039 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.