text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/model_doc/decision_transformer.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/decision_transformer.md", "repo_id": "transformers", "token_count": 1073 }
531
--- hide_table_of_contents: true sidebar_position: 3 sidebar_class_name: hidden --- # Conversational import CodeBlock from "@theme/CodeBlock"; import Example from "@examples/agents/chat_convo_with_tracing.ts"; import RunnableExample from "@examples/agents/chat_convo_with_tracing_runnable.ts"; This walkthrough demons...
langchainjs/docs/core_docs/docs/modules/agents/agent_types/chat_conversation_agent.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/agents/agent_types/chat_conversation_agent.mdx", "repo_id": "langchainjs", "token_count": 663 }
746
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-linear/llama_index/readers/linear/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-linear/llama_index/readers/linear/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,328
from typing import List, Sequence from langchain_core.chat_history import BaseChatMessageHistory from langchain_core.messages import BaseMessage from langchain_core.pydantic_v1 import BaseModel, Field class ChatMessageHistory(BaseChatMessageHistory, BaseModel): """In memory implementation of chat message history...
langchain/libs/community/langchain_community/chat_message_histories/in_memory.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_message_histories/in_memory.py", "repo_id": "langchain", "token_count": 316 }
234
"""Create LlamaIndex agents.""" from typing import Any, Optional from llama_index.core.bridge.langchain import ( AgentExecutor, AgentType, BaseCallbackManager, BaseLLM, initialize_agent, ) from llama_index.core.langchain_helpers.agents.toolkits import LlamaToolkit def create_llama_agent( too...
llama_index/llama-index-core/llama_index/core/langchain_helpers/agents/agents.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/langchain_helpers/agents/agents.py", "repo_id": "llama_index", "token_count": 1156 }
1,197
<jupyter_start><jupyter_text>Elasticsearch Vector Store Elasticsearch is a distributed, RESTful search and analytics engine, capable of performing both vector and keyword search. It is built on top of the Apache Lucene library.[Signup](https://cloud.elastic.co/registration?utm_source=llama-index&utm_content=documentati...
llama_index/docs/examples/vector_stores/ElasticsearchIndexDemo.ipynb/0
{ "file_path": "llama_index/docs/examples/vector_stores/ElasticsearchIndexDemo.ipynb", "repo_id": "llama_index", "token_count": 3172 }
1,089
# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors. # # 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 # # U...
datasets/src/datasets/splits.py/0
{ "file_path": "datasets/src/datasets/splits.py", "repo_id": "datasets", "token_count": 9636 }
140
--- sidebar_class_name: hidden --- # SQL This example demonstrates the use of `Runnables` with questions and more on a SQL database. import CodeBlock from "@theme/CodeBlock"; import SqlDBExample from "@examples/chains/sql_db.ts"; import SqlDBSqlOutputExample from "@examples/chains/sql_db_sql_output.ts"; This exampl...
langchainjs/docs/core_docs/docs/modules/chains/popular/sqlite.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/chains/popular/sqlite.mdx", "repo_id": "langchainjs", "token_count": 743 }
784
package segmentutil import ( "go.uber.org/zap" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/log" ) // ReCalcRowCount re-calculates number of rows of `oldSeg` based on its bin log count, and correct its value in its // cloned copy, which is `newSeg`. // Note that `segCloned`...
milvus/internal/util/segmentutil/utils.go/0
{ "file_path": "milvus/internal/util/segmentutil/utils.go", "repo_id": "milvus", "token_count": 516 }
2,025
# Agent This example shows how to expose an agent as a ChatGPTPlugin. Step 1: Make any modifications to `chain.py` as you see fit (changing prompts, etc.) Step 2: Make any changes to `constants.py` as you see fit (this is where you control the descriptions used, etc)
langchain-aiplugin/agent/README.md/0
{ "file_path": "langchain-aiplugin/agent/README.md", "repo_id": "langchain-aiplugin", "token_count": 75 }
62
import {expect, test} from "@jest/globals"; import {ChromaClient} from "../src/ChromaClient"; import {chromaTokenDefault, chromaTokenBearer, chromaTokenXToken, cloudClient} from "./initClientWithAuth"; import chromaNoAuth from "./initClient"; test("it should get the version without auth needed", async () => { cons...
chroma/clients/js/test/auth.token.test.ts/0
{ "file_path": "chroma/clients/js/test/auth.token.test.ts", "repo_id": "chroma", "token_count": 1055 }
33
from typing import Any from llama_index.legacy.callbacks.base_handler import BaseCallbackHandler def deepeval_callback_handler(**kwargs: Any) -> BaseCallbackHandler: try: from deepeval.tracing.integrations.llama_index import LlamaIndexCallbackHandler except ImportError: raise ImportError("Ple...
llama_index/llama-index-legacy/llama_index/legacy/callbacks/deepeval_callback.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/callbacks/deepeval_callback.py", "repo_id": "llama_index", "token_count": 138 }
1,692
# flake8: noqa from langchain.output_parsers.regex import RegexParser from langchain_core.prompts import PromptTemplate template = """You are a teacher coming up with questions to ask on a quiz. Given the following document, please generate a question and answer based on that document. Example Format: <Begin Documen...
langchain/libs/langchain/langchain/evaluation/qa/generate_prompt.py/0
{ "file_path": "langchain/libs/langchain/langchain/evaluation/qa/generate_prompt.py", "repo_id": "langchain", "token_count": 169 }
538
<!--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 to...
transformers/docs/source/zh/peft.md/0
{ "file_path": "transformers/docs/source/zh/peft.md", "repo_id": "transformers", "token_count": 3628 }
515
import argparse import json import logging import os from collections import Counter from dataclasses import dataclass from operator import attrgetter from typing import Dict, List, Optional, Union import safetensors import torch import torch.nn as nn from diffusers import UNet2DConditionModel from transformers import...
peft/examples/stable_diffusion/convert_sd_adapter_to_peft.py/0
{ "file_path": "peft/examples/stable_diffusion/convert_sd_adapter_to_peft.py", "repo_id": "peft", "token_count": 10390 }
332
from llama_index.indices.managed.llama_cloud.base import LlamaCloudIndex from llama_index.indices.managed.llama_cloud.retriever import LlamaCloudRetriever __all__ = [ "LlamaCloudIndex", "LlamaCloudRetriever", ]
llama_index/llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-llama-cloud/llama_index/indices/managed/llama_cloud/__init__.py", "repo_id": "llama_index", "token_count": 83 }
1,295
from langchain_community.callbacks.flyte_callback import ( FlyteCallbackHandler, ) __all__ = ["FlyteCallbackHandler"]
langchain/libs/langchain/langchain/callbacks/flyte_callback.py/0
{ "file_path": "langchain/libs/langchain/langchain/callbacks/flyte_callback.py", "repo_id": "langchain", "token_count": 39 }
480
<!--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/outputs.md/0
{ "file_path": "diffusers/docs/source/en/api/outputs.md", "repo_id": "diffusers", "token_count": 554 }
182
# Token Counting - Migration Guide The existing token counting implementation has been **deprecated**. We know token counting is important to many users, so this guide was created to walkthrough a (hopefully painless) transition. Previously, token counting was kept track of on the `llm_predictor` and `embed_model` o...
llama_index/docs/module_guides/observability/callbacks/token_counting_migration.md/0
{ "file_path": "llama_index/docs/module_guides/observability/callbacks/token_counting_migration.md", "repo_id": "llama_index", "token_count": 679 }
1,159
from datetime import datetime from unittest.mock import patch import pytest import pytest_asyncio from sqlalchemy import select from langchain_community.indexes._sql_record_manager import ( SQLRecordManager, UpsertionRecord, ) @pytest.fixture() def manager() -> SQLRecordManager: """Initialize the test d...
langchain/libs/community/tests/unit_tests/indexes/test_sql_record_manager.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/indexes/test_sql_record_manager.py", "repo_id": "langchain", "token_count": 8797 }
378
use std::io::Result; fn main() -> Result<()> { prost_build::compile_protos(&["src/onnx.proto3"], &["src/"])?; Ok(()) }
candle/candle-onnx/build.rs/0
{ "file_path": "candle/candle-onnx/build.rs", "repo_id": "candle", "token_count": 60 }
66
# 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/dit/test_dit.py/0
{ "file_path": "diffusers/tests/pipelines/dit/test_dit.py", "repo_id": "diffusers", "token_count": 2338 }
278
- sections: - local: index title: "🧨 Diffusers" - local: quicktour title: "훑어보기" - local: stable_diffusion title: Stable Diffusion - local: installation title: "설치" title: "시작하기" - sections: - local: tutorials/tutorial_overview title: 개요 - local: using-diffusers/write_own_pipeline ...
diffusers/docs/source/ko/_toctree.yml/0
{ "file_path": "diffusers/docs/source/ko/_toctree.yml", "repo_id": "diffusers", "token_count": 2235 }
177
"""Environment information.""" import functools import logging import os import platform import subprocess from typing import Dict, List, Optional, Union from langsmith.utils import get_docker_compose_command from langsmith.env._git import exec_git try: # psutil is an optional dependency import psutil _P...
langsmith-sdk/python/langsmith/env/_runtime_env.py/0
{ "file_path": "langsmith-sdk/python/langsmith/env/_runtime_env.py", "repo_id": "langsmith-sdk", "token_count": 2968 }
1,080
locals { secret_json = jsondecode(data.google_secret_manager_secret_version.chat_langchain_backend_secrets.secret_data) region = "YOUR REGION" project_id = "YOUR PROJECT ID" } provider "google" { project = local.project_id region = local.region } # Load secrets from Secret Manager. You can specify yo...
chat-langchain/terraform/main.tf/0
{ "file_path": "chat-langchain/terraform/main.tf", "repo_id": "chat-langchain", "token_count": 481 }
9
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,479
# coding=utf-8 # Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
transformers/tests/models/gpt_bigcode/test_modeling_gpt_bigcode.py/0
{ "file_path": "transformers/tests/models/gpt_bigcode/test_modeling_gpt_bigcode.py", "repo_id": "transformers", "token_count": 11767 }
727
// 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/roundrobin_balancer_test.go/0
{ "file_path": "milvus/internal/proxy/roundrobin_balancer_test.go", "repo_id": "milvus", "token_count": 928 }
1,851
from __future__ import annotations import logging from copy import deepcopy from enum import Enum from typing import Any, Iterable, List, Optional, Tuple from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.runnables import run_in_executor from langchain_c...
langchain/libs/community/langchain_community/vectorstores/rocksetdb.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/rocksetdb.py", "repo_id": "langchain", "token_count": 5787 }
340
from langchain_community.callbacks.human import ( AsyncHumanApprovalCallbackHandler, HumanApprovalCallbackHandler, HumanRejectedException, ) __all__ = [ "HumanRejectedException", "HumanApprovalCallbackHandler", "AsyncHumanApprovalCallbackHandler", ]
langchain/libs/langchain/langchain/callbacks/human.py/0
{ "file_path": "langchain/libs/langchain/langchain/callbacks/human.py", "repo_id": "langchain", "token_count": 92 }
474
/** * Represents the different types of arguments that can be used in * LangChain. */ export type ArgumentsType = | IdentifierType | StringLiteralType | NumericLiteralType | ArrayLiteralType | ObjectLiteralType | CallExpressionType | BooleanLiteralType; /** * Represents the parsed types in LangChain,...
langchainjs/langchain/src/output_parsers/expression_type_handlers/types.ts/0
{ "file_path": "langchainjs/langchain/src/output_parsers/expression_type_handlers/types.ts", "repo_id": "langchainjs", "token_count": 834 }
937
# Infino >[Infino](https://github.com/infinohq/infino) is an open-source observability platform that stores both metrics and application logs together. Key features of `Infino` include: - **Metrics Tracking**: Capture time taken by LLM model to handle request, errors, number of tokens, and costing indication for the ...
langchain/docs/docs/integrations/providers/infino.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/infino.mdx", "repo_id": "langchain", "token_count": 333 }
150
<jupyter_start><jupyter_text>OpenAI Assistant AgentThis shows you how to use our agent abstractions built on top of the [OpenAI Assistant API](https://platform.openai.com/docs/assistants/overview).<jupyter_code>%pip install llama-index-agent-openai %pip install llama-index-vector-stores-supabase !pip install llama-inde...
llama_index/docs/examples/agent/openai_assistant_agent.ipynb/0
{ "file_path": "llama_index/docs/examples/agent/openai_assistant_agent.ipynb", "repo_id": "llama_index", "token_count": 2879 }
1,092
# 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/cvt/test_modeling_cvt.py/0
{ "file_path": "transformers/tests/models/cvt/test_modeling_cvt.py", "repo_id": "transformers", "token_count": 4333 }
810
<jupyter_start><jupyter_text>OpenAI function calling for Sub-Question Query Engine In this notebook, we showcase how to use OpenAI function calling to improve the robustness of our sub-question query engine. The sub-question query engine is designed to accept swappable question generators that implement the `BaseQues...
llama_index/docs/examples/output_parsing/openai_sub_question.ipynb/0
{ "file_path": "llama_index/docs/examples/output_parsing/openai_sub_question.ipynb", "repo_id": "llama_index", "token_count": 947 }
1,155
# order by contributions reviewers: - xiaocai2333 - czs007 approvers: - maintainers
milvus/internal/tso/OWNERS/0
{ "file_path": "milvus/internal/tso/OWNERS", "repo_id": "milvus", "token_count": 34 }
1,874
from llama_index.readers.opensearch.base import OpensearchReader __all__ = ["OpensearchReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-opensearch/llama_index/readers/opensearch/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-opensearch/llama_index/readers/opensearch/__init__.py", "repo_id": "llama_index", "token_count": 32 }
1,532
<!--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/ko/tasks/object_detection.md/0
{ "file_path": "transformers/docs/source/ko/tasks/object_detection.md", "repo_id": "transformers", "token_count": 16892 }
499
from llama_index.embeddings.azure_openai.base import ( AzureOpenAIEmbedding, AzureOpenAI, AsyncAzureOpenAI, ) __all__ = ["AzureOpenAIEmbedding", "AzureOpenAI", "AsyncAzureOpenAI"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/__init__.py", "repo_id": "llama_index", "token_count": 82 }
1,220
--- sidebar_position: 0.5 --- # Repository Structure If you plan on contributing to LangChain code or documentation, it can be useful to understand the high level structure of the repository. LangChain is organized as a [monorep](https://en.wikipedia.org/wiki/Monorepo) that contains multiple packages. Here's the str...
langchain/docs/docs/contributing/repo_structure.mdx/0
{ "file_path": "langchain/docs/docs/contributing/repo_structure.mdx", "repo_id": "langchain", "token_count": 625 }
85
# 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...
alignment-handbook/setup.py/0
{ "file_path": "alignment-handbook/setup.py", "repo_id": "alignment-handbook", "token_count": 1995 }
26
import { test, expect } from "@jest/globals"; import { TextLoader } from "../fs/text.js"; test("Test Text loader from blob", async () => { const loader = new TextLoader( new Blob(["Hello, world!"], { type: "text/plain" }) ); const docs = await loader.load(); expect(docs.length).toBe(1); expect(docs[0].p...
langchainjs/langchain/src/document_loaders/tests/text-blob.test.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/tests/text-blob.test.ts", "repo_id": "langchainjs", "token_count": 185 }
924
# Linear Reader The Linear loader returns issue based on the query. ## Usage Here's an example of how to use it ```python from llama_hub.linear import LinearReader reader = LinearReader(api_key=api_key) query = """ query Team { team(id: "9cfb482a-81e3-4154-b5b9-2c805e70a02d") { id ...
llama_index/llama-index-integrations/readers/llama-index-readers-linear/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-linear/README.md", "repo_id": "llama_index", "token_count": 872 }
1,340
// 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_object_storage.go/0
{ "file_path": "milvus/internal/storage/minio_object_storage.go", "repo_id": "milvus", "token_count": 2661 }
2,011
# coding=utf-8 # Copyright 2021 T5 Authors and HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
transformers/src/transformers/models/byt5/tokenization_byt5.py/0
{ "file_path": "transformers/src/transformers/models/byt5/tokenization_byt5.py", "repo_id": "transformers", "token_count": 4279 }
655
"""Integration test for PubMed API Wrapper.""" from typing import List import pytest from langchain_core.documents import Document from langchain_community.document_loaders import PubMedLoader xmltodict = pytest.importorskip("xmltodict") def test_load_success() -> None: """Test that returns the correct answer...
langchain/libs/community/tests/integration_tests/document_loaders/test_pubmed.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_pubmed.py", "repo_id": "langchain", "token_count": 575 }
325
from langchain_community.vectorstores.tencentvectordb import ( ConnectionParams, IndexParams, TencentVectorDB, ) __all__ = ["ConnectionParams", "IndexParams", "TencentVectorDB"]
langchain/libs/langchain/langchain/vectorstores/tencentvectordb.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/tencentvectordb.py", "repo_id": "langchain", "token_count": 67 }
607
package memberlist_manager import ( "context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" ) type IMemberlistStore interface { GetMemberlist(ctx context.Context) (return_memberlist *Memberli...
chroma/go/coordinator/internal/memberlist_manager/memberlist_store.go/0
{ "file_path": "chroma/go/coordinator/internal/memberlist_manager/memberlist_store.go", "repo_id": "chroma", "token_count": 1045 }
44
interactions: - request: body: '{"input": [[8134], [2308], [43673]], "encoding_format": "base64"}' headers: Accept: - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive Content-Length: - '65' Content-Type: - application/json User-Age...
langchain/libs/community/tests/integration_tests/vectorstores/cassettes/test_weaviate/TestWeaviate.test_max_marginal_relevance_search.yaml/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/cassettes/test_weaviate/TestWeaviate.test_max_marginal_relevance_search.yaml", "repo_id": "langchain", "token_count": 38088 }
348
from langchain_core.example_selectors.semantic_similarity import ( MaxMarginalRelevanceExampleSelector, SemanticSimilarityExampleSelector, sorted_values, ) __all__ = [ "sorted_values", "SemanticSimilarityExampleSelector", "MaxMarginalRelevanceExampleSelector", ]
langchain/libs/langchain/langchain/prompts/example_selector/semantic_similarity.py/0
{ "file_path": "langchain/libs/langchain/langchain/prompts/example_selector/semantic_similarity.py", "repo_id": "langchain", "token_count": 100 }
531
# coding=utf-8 # Copyright 2021 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...
transformers/src/transformers/models/imagegpt/configuration_imagegpt.py/0
{ "file_path": "transformers/src/transformers/models/imagegpt/configuration_imagegpt.py", "repo_id": "transformers", "token_count": 3490 }
630
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/src/segcore/SegmentGrowing.h/0
{ "file_path": "milvus/internal/core/src/segcore/SegmentGrowing.h", "repo_id": "milvus", "token_count": 523 }
1,747
String cron_timezone = 'TZ=Asia/Shanghai' String cron_string = BRANCH_NAME == "master" ? "05 21 * * * " : "" int total_timeout_minutes = 90 // pipeline pipeline { triggers { cron """${cron_timezone} ${cron_string}""" } options { timestamps() timeout(time: total_timeout...
milvus/build/ci/jenkins/Scale.groovy/0
{ "file_path": "milvus/build/ci/jenkins/Scale.groovy", "repo_id": "milvus", "token_count": 2190 }
1,701
import { describe, test } from "@jest/globals"; import { ChatMessage, HumanMessage } from "@langchain/core/messages"; import { PromptTemplate, ChatPromptTemplate, AIMessagePromptTemplate, HumanMessagePromptTemplate, SystemMessagePromptTemplate, } from "@langchain/core/prompts"; import { formatToOpenAITool } f...
langchainjs/libs/langchain-community/src/chat_models/tests/chattogetherai.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/chat_models/tests/chattogetherai.int.test.ts", "repo_id": "langchainjs", "token_count": 1724 }
1,053
import { memo, useState } from "react"; import { Message as MessageType } from "../hooks/useChatList"; import { str } from "../utils/str"; import { cn } from "../utils/cn"; import { marked } from "marked"; import DOMPurify from "dompurify"; import { ChevronDownIcon } from "@heroicons/react/24/outline"; import { LangSmi...
opengpts/frontend/src/components/Message.tsx/0
{ "file_path": "opengpts/frontend/src/components/Message.tsx", "repo_id": "opengpts", "token_count": 2932 }
1,923
package typeutil // IsChanClosed returns whether input signal channel is closed or not. // this method accept `chan struct{}` type only in case of passing msg channels by mistake. func IsChanClosed(ch <-chan struct{}) bool { select { case <-ch: return true default: return false } }
milvus/pkg/util/typeutil/chan.go/0
{ "file_path": "milvus/pkg/util/typeutil/chan.go", "repo_id": "milvus", "token_count": 87 }
2,067
from langchain_community.vectorstores.deeplake import DeepLake __all__ = ["DeepLake"]
langchain/libs/langchain/langchain/vectorstores/deeplake.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/deeplake.py", "repo_id": "langchain", "token_count": 27 }
613
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-s3/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-s3/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,374
from llama_index.core.readers.base import BaseReader from llama_index.readers.trello import TrelloReader def test_class(): names_of_base_classes = [b.__name__ for b in TrelloReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-trello/tests/test_readers_trello.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-trello/tests/test_readers_trello.py", "repo_id": "llama_index", "token_count": 89 }
1,389
from pytest import MonkeyPatch from typing import Any, Dict from llama_index.core.embeddings.mock_embed_model import MockEmbedding from llama_index.core.embeddings.utils import resolve_embed_model from llama_index.embeddings.huggingface import ( HuggingFaceEmbedding, ) from llama_index.embeddings.openai import Ope...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-openai/tests/test_openai_utils.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-openai/tests/test_openai_utils.py", "repo_id": "llama_index", "token_count": 682 }
1,373
<jupyter_start><jupyter_text>PipelineThis notebook goes over how to compose multiple prompts together. This can be useful when you want to reuse parts of prompts. This can be done with a PipelinePrompt. A PipelinePrompt consists of two main parts:- Final prompt: The final prompt that is returned- Pipeline prompts: A li...
langchain/docs/docs/modules/model_io/prompts/pipeline.ipynb/0
{ "file_path": "langchain/docs/docs/modules/model_io/prompts/pipeline.ipynb", "repo_id": "langchain", "token_count": 559 }
201
import unicodedata from pathlib import Path from typing import Any, Callable, Dict, List, Literal, Optional, cast from llama_index.core.node_parser.interface import TextSplitter from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document path = Path(__file__).parent / "Readabilit...
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/readability_web/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/readability_web/base.py", "repo_id": "llama_index", "token_count": 2154 }
1,457
<jupyter_start><jupyter_text>Wolfram AlphaThis notebook goes over how to use the wolfram alpha component.First, you need to set up your Wolfram Alpha developer account and get your APP ID:1. Go to wolfram alpha and sign up for a developer account [here](https://developer.wolframalpha.com/)2. Create an app and get your ...
langchain/docs/docs/integrations/tools/wolfram_alpha.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/wolfram_alpha.ipynb", "repo_id": "langchain", "token_count": 227 }
179
<jupyter_start><jupyter_text>QuestionGenerationThis notebook walks through the process of generating a list of questions that could be asked about your data. This is useful for setting up an evaluation pipeline using the `FaithfulnessEvaluator` and `RelevancyEvaluator` evaluation tools. If you're opening this Notebook ...
llama_index/docs/examples/evaluation/QuestionGeneration.ipynb/0
{ "file_path": "llama_index/docs/examples/evaluation/QuestionGeneration.ipynb", "repo_id": "llama_index", "token_count": 956 }
1,060
from langchain_community.vectorstores.faiss import ( FAISS, ) __all__ = ["FAISS"]
langchain/libs/langchain/langchain/vectorstores/faiss.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/faiss.py", "repo_id": "langchain", "token_count": 33 }
605
# Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
accelerate/examples/by_feature/fsdp_with_peak_mem_tracking.py/0
{ "file_path": "accelerate/examples/by_feature/fsdp_with_peak_mem_tracking.py", "repo_id": "accelerate", "token_count": 7850 }
7
{ "include": [ "src" ], "compilerOptions": { "declaration": true, "module": "ESNext", "lib": ["ES2017", "DOM"], "outDir": "dist/main", "sourceMap": true, "target": "ES2017", "strict": true, "esModuleInterop": true, "moduleResolution": "Node", "forceConsistentCasingInFil...
chroma/clients/js/tsconfig.json/0
{ "file_path": "chroma/clients/js/tsconfig.json", "repo_id": "chroma", "token_count": 159 }
35
# 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/utils/test_audio_utils.py/0
{ "file_path": "transformers/tests/utils/test_audio_utils.py", "repo_id": "transformers", "token_count": 17519 }
761
import os from pathlib import Path from typing import List import pytest from llama_index.legacy.schema import NodeRelationship, RelatedNodeInfo, TextNode from llama_index.legacy.vector_stores import ( DocArrayHnswVectorStore, DocArrayInMemoryVectorStore, ) from llama_index.legacy.vector_stores.types import ( ...
llama_index/llama-index-legacy/tests/vector_stores/test_docarray.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/vector_stores/test_docarray.py", "repo_id": "llama_index", "token_count": 2067 }
1,569
python_sources()
llama_index/llama-index-packs/llama-index-packs-agent-search-retriever/llama_index/packs/agent_search_retriever/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-agent-search-retriever/llama_index/packs/agent_search_retriever/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,656
# Copyright 2024 Jake Babbidge, TencentARC and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
diffusers/examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py/0
{ "file_path": "diffusers/examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py", "repo_id": "diffusers", "token_count": 43130 }
206
[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 = ["honeyhive_callback_handler"] contains_example = false import_path = "llama_index.callback...
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-honeyhive/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-honeyhive/pyproject.toml", "repo_id": "llama_index", "token_count": 657 }
1,347
from langchain_community.document_loaders.googledrive import GoogleDriveLoader __all__ = ["GoogleDriveLoader"]
langchain/libs/langchain/langchain/document_loaders/googledrive.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/googledrive.py", "repo_id": "langchain", "token_count": 31 }
506
from __future__ import annotations import logging from typing import Any, Dict, Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.pydantic_v1 import root_validator from langchain_core.tools import BaseTool from langchain_core.utils import get_from_dict_or_env from langchain_...
langchain/libs/community/langchain_community/tools/azure_cognitive_services/image_analysis.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/azure_cognitive_services/image_analysis.py", "repo_id": "langchain", "token_count": 2316 }
296
# coding=utf-8 # Copyright 2022 The HuggingFace Team 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 clone of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/tests/generation/test_tf_utils.py/0
{ "file_path": "transformers/tests/generation/test_tf_utils.py", "repo_id": "transformers", "token_count": 7612 }
744
// Adapted from turboderp exllama: https://github.com/turboderp/exllama #ifndef _q4_matmul_cuh #define _q4_matmul_cuh #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cstdint> #include <cstdio> #include <ATen/cuda/CUDAContext.h> #include "q4_matrix.cuh" #include "../tuning.h" void q4_matmul_cuda ( ExL...
text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matmul.cuh/0
{ "file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matmul.cuh", "repo_id": "text-generation-inference", "token_count": 322 }
437
from llama_index.vector_stores.singlestoredb.base import SingleStoreVectorStore __all__ = ["SingleStoreVectorStore"]
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-singlestoredb/llama_index/vector_stores/singlestoredb/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-singlestoredb/llama_index/vector_stores/singlestoredb/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,537
--- sidebar_position: 2 --- # Prompts A prompt for a language model is a set of instructions or input provided by a user to guide the model's response, helping it understand the context and generate relevant and coherent language-based output, such as answering questions, completing sentences, or engaging in a conver...
langchainjs/docs/core_docs/docs/modules/model_io/prompts/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/model_io/prompts/index.mdx", "repo_id": "langchainjs", "token_count": 230 }
752
"""This module contains all classes used for composing graphs over indices.""" from llama_index.legacy.indices.composability.graph import ComposableGraph __all__ = ["ComposableGraph"]
llama_index/llama-index-legacy/llama_index/legacy/indices/composability/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/composability/__init__.py", "repo_id": "llama_index", "token_count": 50 }
1,659
import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { SemanticSimilarityExampleSelector } from "@langchain/core/example_selectors"; import { FewShotPromptTemplate, PromptTemplate, ChatPromptTemplate, SystemMessagePromptTemplate, MessagesPlaceholder, } from "@langchain/core/prompts"; im...
langchainjs/examples/src/use_cases/sql/agents/example_selector.ts/0
{ "file_path": "langchainjs/examples/src/use_cases/sql/agents/example_selector.ts", "repo_id": "langchainjs", "token_count": 1075 }
855
from langchain_community.embeddings.voyageai import ( VoyageEmbeddings, ) __all__ = [ "VoyageEmbeddings", ]
langchain/libs/langchain/langchain/embeddings/voyageai.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/voyageai.py", "repo_id": "langchain", "token_count": 49 }
501
//! [Unigram](https://arxiv.org/abs/1804.10959) model. mod lattice; mod model; mod serialization; mod trainer; mod trie; pub use lattice::*; pub use model::*; pub use trainer::*;
tokenizers/tokenizers/src/models/unigram/mod.rs/0
{ "file_path": "tokenizers/tokenizers/src/models/unigram/mod.rs", "repo_id": "tokenizers", "token_count": 72 }
476
from langchain.agents import ConversationalChatAgent, AgentExecutor from langchain.memory import ConversationBufferMemory from langchain_community.callbacks import StreamlitCallbackHandler from langchain_community.chat_message_histories import StreamlitChatMessageHistory from langchain_community.tools import DuckDuckGo...
streamlit-agent/streamlit_agent/search_and_chat.py/0
{ "file_path": "streamlit-agent/streamlit_agent/search_and_chat.py", "repo_id": "streamlit-agent", "token_count": 984 }
2,208
use anyhow::Result; use candle_core::{test_device, test_utils, Device, IndexOp, Tensor}; /* This test is based on the following script. import torch torch.manual_seed(4242) t = torch.randn((1, 4, 5)) w = torch.randn((2, 4, 3)) print(t.flatten()) print(w.flatten()) res = torch.nn.functional.conv1d(t, w) print(res.flat...
candle/candle-core/tests/conv_tests.rs/0
{ "file_path": "candle/candle-core/tests/conv_tests.rs", "repo_id": "candle", "token_count": 14530 }
38
from typing import Any, Dict, List, Mapping, Optional from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.pydantic_v1 import Extra, root_validator from langchain_core.utils import get_from_dict_or_env from langchain_community.llms.utils...
langchain/libs/community/langchain_community/llms/octoai_endpoint.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/octoai_endpoint.py", "repo_id": "langchain", "token_count": 2789 }
290
import { describe, it, expect, jest } from "@jest/globals"; import { AxiosResponse } from "axios"; import fetchAdapter from "../axios-fetch-adapter.js"; const mockFetchForOpenAIStream = async ({ chunks, status, contentType, }: { chunks: Array<string>; status: number; contentType: string; }) => { // Mock ...
langchainjs/langchain/src/util/tests/openai-stream.test.ts/0
{ "file_path": "langchainjs/langchain/src/util/tests/openai-stream.test.ts", "repo_id": "langchainjs", "token_count": 2273 }
963
import { test } from "@jest/globals"; test("Test chat model", async () => { // Your integration test here });
langchainjs/libs/create-langchain-integration/template/src/tests/integration.int.test.ts/0
{ "file_path": "langchainjs/libs/create-langchain-integration/template/src/tests/integration.int.test.ts", "repo_id": "langchainjs", "token_count": 35 }
1,010
import os import time import numpy as np import onnxruntime as ort os.environ["ORT_TENSORRT_INT8_ENABLE"] = "1" os.environ["ORT_TENSORRT_INT8_USE_NATIVE_CALIBRATION_TABLE"] = "0" os.environ["ORT_TENSORRT_ENGINE_CACHE_ENABLE"] = "1" sess_opt = ort.SessionOptions() sess_opt.graph_optimization_level = ort.GraphOptimiz...
transformers/examples/research_projects/quantization-qdqbert/ort-infer-benchmark.py/0
{ "file_path": "transformers/examples/research_projects/quantization-qdqbert/ort-infer-benchmark.py", "repo_id": "transformers", "token_count": 644 }
595
// 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/typeutil/skip_list.go/0
{ "file_path": "milvus/pkg/util/typeutil/skip_list.go", "repo_id": "milvus", "token_count": 2308 }
1,855
# AdvProp (EfficientNet) **AdvProp** is an adversarial training scheme which treats adversarial examples as additional examples, to prevent overfitting. Key to the method is the usage of a separate auxiliary batch norm for adversarial examples, as they have different underlying distributions to normal examples. The w...
pytorch-image-models/docs/models/advprop.md/0
{ "file_path": "pytorch-image-models/docs/models/advprop.md", "repo_id": "pytorch-image-models", "token_count": 6029 }
366
from llama_index.core.storage.docstore.keyval_docstore import KVDocumentStore from llama_index.storage.docstore.dynamodb import DynamoDBDocumentStore def test_class(): names_of_base_classes = [b.__name__ for b in DynamoDBDocumentStore.__mro__] assert KVDocumentStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-dynamodb/tests/test_storage_docstore_dynamodb.py/0
{ "file_path": "llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-dynamodb/tests/test_storage_docstore_dynamodb.py", "repo_id": "llama_index", "token_count": 104 }
1,488
"""**Chains** are easily reusable components linked together. Chains encode a sequence of calls to components like models, document retrievers, other Chains, etc., and provide a simple interface to this sequence. The Chain interface makes it easy to create apps that are: - **Stateful:** add Memory to any Chain t...
langchain/libs/langchain/langchain/chains/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/__init__.py", "repo_id": "langchain", "token_count": 2011 }
455
# 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...
accelerate/src/accelerate/utils/random.py/0
{ "file_path": "accelerate/src/accelerate/utils/random.py", "repo_id": "accelerate", "token_count": 1743 }
16
import logging from milvus_benchmark import utils from milvus_benchmark import config logger = logging.getLogger("milvus_benchmark.env.env") class BaseEnv(object): """docstring for Env""" def __init__(self, deploy_mode="single"): self.deploy_mode = deploy_mode self._name = utils.get_unique_na...
milvus/tests/benchmark/milvus_benchmark/env/base.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/env/base.py", "repo_id": "milvus", "token_count": 404 }
1,934
from typing import Any import pytest from llama_index.legacy.core.llms.types import ChatMessage from pytest import MonkeyPatch try: import cohere except ImportError: cohere = None # type: ignore from llama_index.legacy.llms.cohere import Cohere def mock_completion_with_retry(*args: Any, **kwargs: Any) -> d...
llama_index/llama-index-legacy/tests/llms/test_cohere.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/llms/test_cohere.py", "repo_id": "llama_index", "token_count": 2659 }
1,745
# coding=utf-8 # Copyright 2021 The Google Flax Team Authors and 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 ...
transformers/src/transformers/modeling_flax_utils.py/0
{ "file_path": "transformers/src/transformers/modeling_flax_utils.py", "repo_id": "transformers", "token_count": 27441 }
599
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-qdrant/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-qdrant/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,542
import { z } from "zod"; import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import type { BaseRetrieverInterface } from "@langchain/core/retrievers"; import { interpolateFString, PromptTemplate } from "@langchain/core/prompts"; import { MultiRouteChain, MultiRouteChainInput } from "...
langchainjs/langchain/src/chains/router/multi_retrieval_qa.ts/0
{ "file_path": "langchainjs/langchain/src/chains/router/multi_retrieval_qa.ts", "repo_id": "langchainjs", "token_count": 2816 }
894
from langchain_community.embeddings.spacy_embeddings import SpacyEmbeddings __all__ = ["SpacyEmbeddings"]
langchain/libs/langchain/langchain/embeddings/spacy_embeddings.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/spacy_embeddings.py", "repo_id": "langchain", "token_count": 36 }
504
# langchain-ibm This package contains the LangChain integrations for IBM watsonx.ai through their `ibm-watsonx-ai` SDK. ## Installation and Setup - Install the LangChain partner package ```bash pip install langchain-ibm ``` ## LLM See a [usage example](https://python.langchain.com/docs/integrations/llms/watsonxllm...
langchain/libs/partners/ibm/README.md/0
{ "file_path": "langchain/libs/partners/ibm/README.md", "repo_id": "langchain", "token_count": 125 }
669