text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
import type { BaseRetrieverInterface } from "@langchain/core/retrievers";
import { z } from "zod";
import { CallbackManagerForToolRun } from "@langchain/core/callbacks/manager";
import {
DynamicStructuredTool,
type DynamicStructuredToolInput,
} from "@langchain/core/tools";
import { formatDocumentsAsString } from "... | langchainjs/langchain/src/tools/retriever.ts/0 | {
"file_path": "langchainjs/langchain/src/tools/retriever.ts",
"repo_id": "langchainjs",
"token_count": 295
} | 917 |
import fs from "fs";
import { fileURLToPath } from "node:url";
import * as path from "path";
import { describe, expect, test } from "@jest/globals";
import { ChatGooglePaLM } from "@langchain/community/chat_models/googlepalm";
import { MakerSuiteHub, MakerSuitePrompt } from "../googlemakersuitehub.js";
describe("Goog... | langchainjs/langchain/src/experimental/hubs/makersuite/tests/googlemakersuitehub.test.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/hubs/makersuite/tests/googlemakersuitehub.test.ts",
"repo_id": "langchainjs",
"token_count": 2055
} | 988 |
# 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_captioning.py/0 | {
"file_path": "transformers/tests/tools/test_image_captioning.py",
"repo_id": "transformers",
"token_count": 737
} | 861 |
import { LLM, type BaseLLMParams } from "@langchain/core/language_models/llms";
import { getEnvironmentVariable } from "@langchain/core/utils/env";
/**
* Interface defining the structure of the input data for the Replicate
* class. It includes details about the model to be used, any additional
* input parameters, a... | langchainjs/libs/langchain-community/src/llms/replicate.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/llms/replicate.ts",
"repo_id": "langchainjs",
"token_count": 1714
} | 1,061 |
package indexparamcheck
import (
"strconv"
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/util/metric"
)
func Test_raftbfChecker_CheckTrain(t *testing.T) {
p1 := map[string]string{
DIM: strconv.Itoa(128),
Metric: metric.L2,
}
p2 := map[string]string{
DIM: strconv.... | milvus/pkg/util/indexparamcheck/raft_brute_force_checker_test.go/0 | {
"file_path": "milvus/pkg/util/indexparamcheck/raft_brute_force_checker_test.go",
"repo_id": "milvus",
"token_count": 565
} | 1,914 |
<!--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/it/custom_models.md/0 | {
"file_path": "transformers/docs/source/it/custom_models.md",
"repo_id": "transformers",
"token_count": 5884
} | 519 |
# coding=utf-8
# Copyright Google AI 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/LICENSE-2.0
#
#... | transformers/src/transformers/models/canine/configuration_canine.py/0 | {
"file_path": "transformers/src/transformers/models/canine/configuration_canine.py",
"repo_id": "transformers",
"token_count": 2532
} | 656 |
from llama_index.embeddings.mistralai.base import MistralAIEmbedding
__all__ = ["MistralAIEmbedding"]
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/__init__.py",
"repo_id": "llama_index",
"token_count": 39
} | 1,252 |
# coding=utf-8
# Copyright 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/LICENS... | transformers/src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py/0 | {
"file_path": "transformers/src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py",
"repo_id": "transformers",
"token_count": 33477
} | 702 |
# 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/pipelines/deprecated/audio_diffusion/mel.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/deprecated/audio_diffusion/mel.py",
"repo_id": "diffusers",
"token_count": 2698
} | 255 |
- name: indexnode
docker_container:
name: indexnode
image: "{{image}}"
command: "milvus run indexnode"
env:
ETCD_ENDPOINTS: "{{ETCD_ENDPOINTS}}"
MINIO_ADDRESS: "{{MINIO_ADDRESS}}"
PULSAR_ADDRESS: "{{PULSAR_ADDRESS}}"
INDEX_COORD_ADDRESS: "{{INDEX_COORD_ADDRESS}}"
METRICS... | milvus/deployments/docker/cluster-distributed-deployment/roles/deploy-indexnode/tasks/main.yml/0 | {
"file_path": "milvus/deployments/docker/cluster-distributed-deployment/roles/deploy-indexnode/tasks/main.yml",
"repo_id": "milvus",
"token_count": 200
} | 1,624 |
from langchain_community.tools.clickup.tool import ClickupAction
__all__ = ["ClickupAction"]
| langchain/libs/langchain/langchain/tools/clickup/tool.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/clickup/tool.py",
"repo_id": "langchain",
"token_count": 28
} | 556 |
from llama_index.core.vector_stores.types import VectorStore
from llama_index.vector_stores.dynamodb import DynamoDBVectorStore
def test_class():
names_of_base_classes = [b.__name__ for b in DynamoDBVectorStore.__mro__]
assert VectorStore.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dynamodb/tests/test_vector_stores_dynamodb.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dynamodb/tests/test_vector_stores_dynamodb.py",
"repo_id": "llama_index",
"token_count": 94
} | 1,525 |
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.embeddings.mistralai import MistralAIEmbedding
def test_embedding_class():
emb = MistralAIEmbedding(api_key="fake-key")
assert isinstance(emb, BaseEmbedding)
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/tests/test_embeddings_mistralai.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/tests/test_embeddings_mistralai.py",
"repo_id": "llama_index",
"token_count": 90
} | 1,269 |
# Introducing Q-Learning [[q-learning]]
## What is Q-Learning? [[what-is-q-learning]]
Q-Learning is an **off-policy value-based method that uses a TD approach to train its action-value function:**
- *Off-policy*: we'll talk about that at the end of this unit.
- *Value-based method*: finds the optimal policy indirectl... | deep-rl-class/units/en/unit2/q-learning.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit2/q-learning.mdx",
"repo_id": "deep-rl-class",
"token_count": 2955
} | 160 |
## init
from llama_index.tools.graphql.base import (
GraphQLToolSpec,
)
__all__ = ["GraphQLToolSpec"]
| llama_index/llama-index-integrations/tools/llama-index-tools-graphql/llama_index/tools/graphql/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-graphql/llama_index/tools/graphql/__init__.py",
"repo_id": "llama_index",
"token_count": 41
} | 1,486 |
import copy
import uuid
from typing import Dict, List
import numpy as np
from langchain.tools.base import BaseTool
from langchain_experimental.autonomous_agents.hugginggpt.task_planner import Plan
class Task:
def __init__(self, task: str, id: int, dep: List[int], args: Dict, tool: BaseTool):
self.task =... | langchain/libs/experimental/langchain_experimental/autonomous_agents/hugginggpt/task_executor.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/autonomous_agents/hugginggpt/task_executor.py",
"repo_id": "langchain",
"token_count": 2288
} | 416 |
from langchain.storage.in_memory import InMemoryStore
def test_mget() -> None:
store = InMemoryStore()
store.mset([("key1", "value1"), ("key2", "value2")])
values = store.mget(["key1", "key2"])
assert values == ["value1", "value2"]
# Test non-existent key
non_existent_value = store.mget(["ke... | langchain/libs/langchain/tests/unit_tests/storage/test_in_memory.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/storage/test_in_memory.py",
"repo_id": "langchain",
"token_count": 1085
} | 643 |
# coding=utf-8
# Copyright 2022 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/levit/convert_levit_timm_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/levit/convert_levit_timm_to_pytorch.py",
"repo_id": "transformers",
"token_count": 2739
} | 621 |
import { DynamicTool, DynamicToolInput } from "./dynamic.js";
/**
* Interface for the configuration of the AWS Lambda function.
*/
interface LambdaConfig {
functionName: string;
region?: string;
accessKeyId?: string;
secretAccessKey?: string;
}
/**
* Interface for the arguments to the LambdaClient construc... | langchainjs/libs/langchain-community/src/tools/aws_lambda.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/tools/aws_lambda.ts",
"repo_id": "langchainjs",
"token_count": 1158
} | 968 |
<!--Copyright 2020 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/model_doc/rembert.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/rembert.md",
"repo_id": "transformers",
"token_count": 1363
} | 485 |
"""Test Anthropic API wrapper."""
from typing import List
import pytest
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.anthropic import (
... | langchain/libs/community/tests/integration_tests/chat_models/test_anthropic.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/chat_models/test_anthropic.py",
"repo_id": "langchain",
"token_count": 1058
} | 317 |
import asyncio
import os
from datetime import datetime, timedelta
from typing import Any, Generator, List
import pytest
from llama_index.legacy.schema import NodeRelationship, RelatedNodeInfo, TextNode
from llama_index.legacy.vector_stores import TimescaleVectorStore
from llama_index.legacy.vector_stores.timescalevect... | llama_index/llama-index-legacy/tests/vector_stores/test_timescalevector.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/vector_stores/test_timescalevector.py",
"repo_id": "llama_index",
"token_count": 3946
} | 1,826 |
from langchain_community.agent_toolkits.powerbi.toolkit import PowerBIToolkit
__all__ = ["PowerBIToolkit"]
| langchain/libs/langchain/langchain/agents/agent_toolkits/powerbi/toolkit.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/powerbi/toolkit.py",
"repo_id": "langchain",
"token_count": 35
} | 462 |
package httpserver
import (
"bytes"
"fmt"
"net/http"
"strconv"
"sync"
"time"
"github.com/gin-gonic/gin"
)
func defaultResponse(c *gin.Context) {
c.String(http.StatusRequestTimeout, "timeout")
}
// BufferPool represents a pool of buffers.
type BufferPool struct {
pool sync.Pool
}
// Get returns a buffer fr... | milvus/internal/distributed/proxy/httpserver/timeout_middleware.go/0 | {
"file_path": "milvus/internal/distributed/proxy/httpserver/timeout_middleware.go",
"repo_id": "milvus",
"token_count": 1648
} | 1,933 |
from langchain.schema.runnable.branch import __all__
EXPECTED_ALL = ["RunnableBranch"]
def test_all_imports() -> None:
assert set(__all__) == set(EXPECTED_ALL)
| langchain/libs/langchain/tests/unit_tests/schema/runnable/test_branch.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/schema/runnable/test_branch.py",
"repo_id": "langchain",
"token_count": 66
} | 606 |
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/tf_xla.md/0 | {
"file_path": "transformers/docs/source/en/tf_xla.md",
"repo_id": "transformers",
"token_count": 2830
} | 503 |
<!--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/image_processor.md/0 | {
"file_path": "diffusers/docs/source/en/api/image_processor.md",
"repo_id": "diffusers",
"token_count": 447
} | 170 |
python_sources()
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dynamodb/llama_index/vector_stores/dynamodb/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dynamodb/llama_index/vector_stores/dynamodb/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,480 |
# 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/src/transformers/utils/doc.py/0 | {
"file_path": "transformers/src/transformers/utils/doc.py",
"repo_id": "transformers",
"token_count": 15528
} | 689 |
# Node Parser Modules
## File-Based Node Parsers
There are several file-based node parsers, that will create nodes based on the type of content that is being parsed (JSON, Markdown, etc.)
The simplest flow is to combine the `FlatFileReader` with the `SimpleFileNodeParser` to automatically use the best node parser fo... | llama_index/docs/module_guides/loading/node_parsers/modules.md/0 | {
"file_path": "llama_index/docs/module_guides/loading/node_parsers/modules.md",
"repo_id": "llama_index",
"token_count": 1892
} | 1,122 |
# 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/deprecated/mctct/configuration_mctct.py/0 | {
"file_path": "transformers/src/transformers/models/deprecated/mctct/configuration_mctct.py",
"repo_id": "transformers",
"token_count": 3646
} | 590 |
"""Evaluate ChatKonko Interface."""
from typing import Any
import pytest
from langchain_core.callbacks import CallbackManager
from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage
from langchain_core.outputs import ChatGeneration, ChatResult, LLMResult
from langchain_community.chat_models.konko... | langchain/libs/community/tests/unit_tests/chat_models/konko.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/chat_models/konko.py",
"repo_id": "langchain",
"token_count": 2336
} | 363 |
<jupyter_start><jupyter_text>Accessing/Customizing Prompts within Higher-Level ModulesLlamaIndex contains a variety of higher-level modules (query engines, response synthesizers, retrievers, etc.), many of which make LLM calls + use prompt templates.This guide shows how you can 1) access the set of prompts for any modu... | llama_index/docs/examples/prompts/prompt_mixin.ipynb/0 | {
"file_path": "llama_index/docs/examples/prompts/prompt_mixin.ipynb",
"repo_id": "llama_index",
"token_count": 2311
} | 1,125 |
from typing import List, Literal
from langchain_core.messages.base import BaseMessage, BaseMessageChunk
class HumanMessage(BaseMessage):
"""Message from a human."""
example: bool = False
"""Whether this Message is being passed in to the model as part of an example
conversation.
"""
typ... | langchain/libs/core/langchain_core/messages/human.py/0 | {
"file_path": "langchain/libs/core/langchain_core/messages/human.py",
"repo_id": "langchain",
"token_count": 364
} | 391 |
#include <metal_stdlib>
METAL_FUNC uint get_strided_index(
uint idx,
constant size_t &num_dims,
constant size_t *dims,
constant size_t *strides
) {
uint strided_i = 0;
for (uint d = 0; d < num_dims; d++) {
uint dim_idx = num_dims - 1 - d;
strided_i += (idx % dims[dim_idx]) * str... | candle/candle-metal-kernels/src/affine.metal/0 | {
"file_path": "candle/candle-metal-kernels/src/affine.metal",
"repo_id": "candle",
"token_count": 1462
} | 59 |
package grpcutils
import "testing"
func TestGrpcConfig_TLSEnabled(t *testing.T) {
// Create a list of configs and expected check result (true/false)
cfgs := []*GrpcConfig{
{
CertPath: "cert",
KeyPath: "key",
CAPath: "ca",
},
{
CertPath: "",
KeyPath: "",
CAPath: "",
},
{
CertPath... | chroma/go/coordinator/internal/grpccoordinator/grpcutils/config_test.go/0 | {
"file_path": "chroma/go/coordinator/internal/grpccoordinator/grpcutils/config_test.go",
"repo_id": "chroma",
"token_count": 324
} | 45 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.string_iterable import StringIterableReader
def test_class():
names_of_base_classes = [b.__name__ for b in StringIterableReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/tests/test_readers_string_iterable.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/tests/test_readers_string_iterable.py",
"repo_id": "llama_index",
"token_count": 92
} | 1,383 |
import sys
import traceback
from importlib.machinery import SourceFileLoader
if __name__ == "__main__":
files = sys.argv[1:]
has_failure = False
for file in files:
try:
SourceFileLoader("x", file).load_module()
except Exception:
has_faillure = True
print(... | langchain/libs/partners/astradb/scripts/check_imports.py/0 | {
"file_path": "langchain/libs/partners/astradb/scripts/check_imports.py",
"repo_id": "langchain",
"token_count": 193
} | 625 |
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/src/transformers/testing_utils.py/0 | {
"file_path": "transformers/src/transformers/testing_utils.py",
"repo_id": "transformers",
"token_count": 32137
} | 711 |
"""Module that contains tests for runnable.astream_events API."""
from itertools import cycle
from typing import Any, AsyncIterator, Dict, List, Sequence, cast
import pytest
from langchain_core.callbacks import CallbackManagerForRetrieverRun, Callbacks
from langchain_core.chat_history import BaseChatMessageHistory
fr... | langchain/libs/core/tests/unit_tests/runnables/test_runnable_events.py/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/runnables/test_runnable_events.py",
"repo_id": "langchain",
"token_count": 19947
} | 433 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.airbyte_gong import AirbyteGongReader
def test_class():
names_of_base_classes = [b.__name__ for b in AirbyteGongReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-gong/tests/test_readers_airbyte_gong.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-gong/tests/test_readers_airbyte_gong.py",
"repo_id": "llama_index",
"token_count": 95
} | 1,309 |
import { Client, DseClientOptions } from "cassandra-driver";
import fs from "node:fs/promises";
import * as path from "node:path";
import * as os from "node:os";
export interface AstraServiceProviderArgs {
datacenterID?: string;
endpoint?: string | URL;
token: string;
regionName?: string;
}
export interface C... | langchainjs/libs/langchain-community/src/utils/cassandra.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/utils/cassandra.ts",
"repo_id": "langchainjs",
"token_count": 2887
} | 975 |
import { AzureChatOpenAI } from "@langchain/azure-openai";
const model = new AzureChatOpenAI({
modelName: "gpt-4",
prefixMessages: [
{
role: "system",
content: "You are a helpful assistant that answers in pirate language",
},
],
maxTokens: 50,
});
const res = await model.invoke(
"What wou... | langchainjs/examples/src/models/chat/integration_azure_chat_openai.ts/0 | {
"file_path": "langchainjs/examples/src/models/chat/integration_azure_chat_openai.ts",
"repo_id": "langchainjs",
"token_count": 137
} | 802 |
python_sources()
| llama_index/llama-index-packs/llama-index-packs-infer-retrieve-rerank/llama_index/packs/infer_retrieve_rerank/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-infer-retrieve-rerank/llama_index/packs/infer_retrieve_rerank/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,793 |
from typing import Any, List
from unittest.mock import patch
from llama_index.legacy.graph_stores import SimpleGraphStore
from llama_index.legacy.indices.knowledge_graph.base import KnowledgeGraphIndex
from llama_index.legacy.indices.knowledge_graph.retrievers import (
KGTableRetriever,
)
from llama_index.legacy.s... | llama_index/llama-index-legacy/tests/indices/knowledge_graph/test_retrievers.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/indices/knowledge_graph/test_retrievers.py",
"repo_id": "llama_index",
"token_count": 2011
} | 1,735 |
# 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/perceiver/convert_perceiver_haiku_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/perceiver/convert_perceiver_haiku_to_pytorch.py",
"repo_id": "transformers",
"token_count": 9000
} | 644 |
import type { Message } from "./Message";
export type LegacyParamatersTemplateInput = {
preprompt?: string;
userMessageToken: string;
userMessageEndToken: string;
assistantMessageToken: string;
assistantMessageEndToken: string;
};
export type ChatTemplateInput = {
messages: Pick<Message, "from" | "content">[];
... | chat-ui/src/lib/types/Template.ts/0 | {
"file_path": "chat-ui/src/lib/types/Template.ts",
"repo_id": "chat-ui",
"token_count": 105
} | 103 |
from langchain_community.chat_models.ernie import ErnieBotChat
__all__ = ["ErnieBotChat"]
| langchain/libs/langchain/langchain/chat_models/ernie.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chat_models/ernie.py",
"repo_id": "langchain",
"token_count": 30
} | 470 |
python_sources()
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/llama_index/embeddings/gemini/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/llama_index/embeddings/gemini/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,361 |
"""Confluence reader."""
import logging
import os
from typing import Dict, List, Optional
from urllib.parse import unquote
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
from retrying import retry
CONFLUENCE_API_TOKEN = "CONFLUENCE_API_TOKEN"
CONFLUENCE_PASSWORD = "... | llama_index/llama-index-integrations/readers/llama-index-readers-confluence/llama_index/readers/confluence/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-confluence/llama_index/readers/confluence/base.py",
"repo_id": "llama_index",
"token_count": 9381
} | 1,276 |
from langchain_community.tools.edenai.edenai_base_tool import EdenaiTool
__all__ = ["EdenaiTool"]
| langchain/libs/langchain/langchain/tools/edenai/edenai_base_tool.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/edenai/edenai_base_tool.py",
"repo_id": "langchain",
"token_count": 34
} | 598 |
"""Test importing the Couchbase document loader."""
def test_couchbase_import() -> None:
"""Test that the Couchbase document loader can be imported."""
from langchain_community.document_loaders import CouchbaseLoader # noqa: F401
| langchain/libs/community/tests/unit_tests/document_loaders/test_couchbase.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_couchbase.py",
"repo_id": "langchain",
"token_count": 67
} | 368 |
import { BufferMemory } from "langchain/memory";
import { DynamoDBChatMessageHistory } from "@langchain/community/stores/message/dynamodb";
import { ChatOpenAI } from "@langchain/openai";
import { ConversationChain } from "langchain/chains";
const memory = new BufferMemory({
chatHistory: new DynamoDBChatMessageHisto... | langchainjs/examples/src/memory/dynamodb-store.ts/0 | {
"file_path": "langchainjs/examples/src/memory/dynamodb-store.ts",
"repo_id": "langchainjs",
"token_count": 384
} | 825 |
[dist_conda]
conda_name_differences = 'torch:pytorch'
channels = pytorch
noarch = True
| pytorch-image-models/setup.cfg/0 | {
"file_path": "pytorch-image-models/setup.cfg",
"repo_id": "pytorch-image-models",
"token_count": 37
} | 380 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.airbyte_salesforce import AirbyteSalesforceReader
def test_class():
names_of_base_classes = [b.__name__ for b in AirbyteSalesforceReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-salesforce/tests/test_readers_airbyte_salesforce.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-salesforce/tests/test_readers_airbyte_salesforce.py",
"repo_id": "llama_index",
"token_count": 96
} | 1,453 |
<!--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/model_doc/align.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/align.md",
"repo_id": "transformers",
"token_count": 2911
} | 512 |
import { DirectoryLoader } from "langchain/document_loaders/fs/directory";
import { PDFLoader } from "langchain/document_loaders/fs/pdf";
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";
/* Load all PDFs within the specified directory */
const directoryLoader = new DirectoryLoader(
"src/docu... | langchainjs/examples/src/document_loaders/pdf_directory.ts/0 | {
"file_path": "langchainjs/examples/src/document_loaders/pdf_directory.ts",
"repo_id": "langchainjs",
"token_count": 234
} | 855 |
"""FLARE schema."""
from dataclasses import dataclass
@dataclass
class QueryTask:
"""Query task."""
query_str: str
start_idx: int
end_idx: int
| llama_index/llama-index-core/llama_index/core/query_engine/flare/schema.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/query_engine/flare/schema.py",
"repo_id": "llama_index",
"token_count": 66
} | 1,168 |
#! /usr/bin/env python3
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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 ... | transformers/examples/research_projects/pplm/run_pplm.py/0 | {
"file_path": "transformers/examples/research_projects/pplm/run_pplm.py",
"repo_id": "transformers",
"token_count": 13423
} | 569 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/storage/chat_store/llama-index-storage-chat-store-redis/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/storage/chat_store/llama-index-storage-chat-store-redis/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,450 |
from typing import List
import pytest
from llama_index.core.schema import (
Document,
NodeRelationship,
RelatedNodeInfo,
TextNode,
)
@pytest.fixture()
def documents() -> List[Document]:
"""Get documents."""
# NOTE: one document for now
doc_text = (
"Hello world.\n"
"This i... | llama_index/llama-index-core/tests/indices/conftest.py/0 | {
"file_path": "llama_index/llama-index-core/tests/indices/conftest.py",
"repo_id": "llama_index",
"token_count": 631
} | 1,155 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.microsoft_sharepoint import SharePointReader
def test_class():
names_of_base_classes = [b.__name__ for b in SharePointReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-sharepoint/tests/test_readers_microsoft_sharepoint.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-sharepoint/tests/test_readers_microsoft_sharepoint.py",
"repo_id": "llama_index",
"token_count": 90
} | 1,387 |
import pytest
import datasets
import datasets.config
# Import fixture modules as plugins
pytest_plugins = ["tests.fixtures.files", "tests.fixtures.hub", "tests.fixtures.fsspec"]
def pytest_collection_modifyitems(config, items):
# Mark tests as "unit" by default if not marked as "integration" (or already marked... | datasets/tests/conftest.py/0 | {
"file_path": "datasets/tests/conftest.py",
"repo_id": "datasets",
"token_count": 957
} | 162 |
"""JSON Reader."""
import re
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import Dict, List, Optional
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
def _get_leaf_nodes_up_to_level(root: ET.Element, level: int) -> List[ET.Element]:
""... | llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/xml/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/xml/base.py",
"repo_id": "llama_index",
"token_count": 1155
} | 1,442 |
// 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/querynodev2/delegator/distribution.go/0 | {
"file_path": "milvus/internal/querynodev2/delegator/distribution.go",
"repo_id": "milvus",
"token_count": 3754
} | 1,769 |
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
import { ChainValues } from "@langchain/core/utils/types";
import { PromptTemplate } from "@langchain/core/prompts";
import { QA_PROMPT } from "./prompt.js";
import { LLMChain, LLMChainInput } from "../../chains/llm_chain.js";
expo... | langchainjs/langchain/src/evaluation/qa/eval_chain.ts/0 | {
"file_path": "langchainjs/langchain/src/evaluation/qa/eval_chain.ts",
"repo_id": "langchainjs",
"token_count": 693
} | 955 |
use super::with_tracing::{layer_norm, linear, LayerNorm, Linear};
use candle::{DType, Device, Result, Tensor};
use candle_nn::{Embedding, Module, VarBuilder};
use serde::Deserialize;
pub const DTYPE: DType = DType::F32;
fn masked_fill(on_false: &Tensor, mask: &Tensor, on_true: f32) -> Result<Tensor> {
let shape =... | candle/candle-transformers/src/models/distilbert.rs/0 | {
"file_path": "candle/candle-transformers/src/models/distilbert.rs",
"repo_id": "candle",
"token_count": 5381
} | 70 |
from langchain_community.vectorstores.dingo import Dingo
__all__ = ["Dingo"]
| langchain/libs/langchain/langchain/vectorstores/dingo.py/0 | {
"file_path": "langchain/libs/langchain/langchain/vectorstores/dingo.py",
"repo_id": "langchain",
"token_count": 25
} | 604 |
from typing import Any, Sequence
from llama_index.core.response_synthesizers import Accumulate
from llama_index.core.types import RESPONSE_TEXT_TYPE
from llama_index.core.utils import temp_set_attrs
class CompactAndAccumulate(Accumulate):
"""Accumulate responses across compact text chunks."""
async def aget... | llama_index/llama-index-core/llama_index/core/response_synthesizers/compact_and_accumulate.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/response_synthesizers/compact_and_accumulate.py",
"repo_id": "llama_index",
"token_count": 814
} | 1,216 |
# Customizing Storage
By default, LlamaIndex hides away the complexities and let you query your data in under 5 lines of code:
```python
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
documents = SimpleDirectoryReader("data").load_data()
index = VectorStoreIndex.from_documents(documents)
query_... | llama_index/docs/module_guides/storing/customization.md/0 | {
"file_path": "llama_index/docs/module_guides/storing/customization.md",
"repo_id": "llama_index",
"token_count": 1344
} | 1,106 |
# 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.py/0 | {
"file_path": "diffusers/tests/pipelines/deepfloyd_if/test_if.py",
"repo_id": "diffusers",
"token_count": 1722
} | 269 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-cassandra/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-cassandra/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,595 |
# coding=utf-8
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | transformers/tests/models/mobilebert/test_modeling_mobilebert.py/0 | {
"file_path": "transformers/tests/models/mobilebert/test_modeling_mobilebert.py",
"repo_id": "transformers",
"token_count": 7069
} | 797 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/util/proxyutil/proxy_watcher.go/0 | {
"file_path": "milvus/internal/util/proxyutil/proxy_watcher.go",
"repo_id": "milvus",
"token_count": 2483
} | 1,802 |
package grpccoordinator
import (
"context"
"errors"
"time"
"github.com/apache/pulsar-client-go/pulsar"
"github.com/chroma/chroma-coordinator/internal/coordinator"
"github.com/chroma/chroma-coordinator/internal/grpccoordinator/grpcutils"
"github.com/chroma/chroma-coordinator/internal/memberlist_manager"
"githu... | chroma/go/coordinator/internal/grpccoordinator/server.go/0 | {
"file_path": "chroma/go/coordinator/internal/grpccoordinator/server.go",
"repo_id": "chroma",
"token_count": 2444
} | 47 |
build_performance:
collections:
-
server:
db_config.primary_path: /test/milvus/db_data_011/sift_10m_128_l2_rhnsw_pq
cache_config.cpu_cache_capacity: 8GB
gpu_resource_config.enable: false
collection_name: sift_10m_128_l2
index_type: rhnsw_pq
index_param:
M: 4... | milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_build_rhnsw.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_build_rhnsw.yaml",
"repo_id": "milvus",
"token_count": 353
} | 1,967 |
// 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/SegmentGrowingImpl.h/0 | {
"file_path": "milvus/internal/core/src/segcore/SegmentGrowingImpl.h",
"repo_id": "milvus",
"token_count": 4094
} | 1,668 |
# langchain-mistralai
This package contains the LangChain integrations for [MistralAI](https://docs.mistral.ai) through their [mistralai](https://pypi.org/project/mistralai/) SDK.
## Installation
```bash
pip install -U langchain-mistralai
```
## Chat Models
This package contains the `ChatMistralAI` class, which is... | langchain/libs/partners/mistralai/README.md/0 | {
"file_path": "langchain/libs/partners/mistralai/README.md",
"repo_id": "langchain",
"token_count": 416
} | 631 |
"""Implement integration tests for Redis storage."""
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from langchain_community.storage.upstash_redis import UpstashRedisByteStore
if TYPE_CHECKING:
from upstash_redis import Redis
pytest.importorskip("upstash_redis")
URL = "<UPST... | langchain/libs/community/tests/integration_tests/storage/test_upstash_redis.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/storage/test_upstash_redis.py",
"repo_id": "langchain",
"token_count": 1242
} | 366 |
python_tests()
| llama_index/llama-index-integrations/llms/llama-index-llms-konko/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-konko/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,310 |
<jupyter_start><jupyter_text>CSVThis notebook shows how to use agents to interact with data in `CSV` format. It is mostly optimized for question answering.**NOTE: this agent calls the Pandas DataFrame agent under the hood, which in turn calls the Python agent, which executes LLM generated Python code - this can be bad ... | langchain/docs/docs/integrations/toolkits/csv.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/toolkits/csv.ipynb",
"repo_id": "langchain",
"token_count": 643
} | 165 |
from llama_index.readers.deeplake.base import DeepLakeReader
__all__ = ["DeepLakeReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-deeplake/llama_index/readers/deeplake/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-deeplake/llama_index/readers/deeplake/__init__.py",
"repo_id": "llama_index",
"token_count": 31
} | 1,282 |
# MEP: Dynamic Configuration
Current state: "Accepted"
ISSUE: https://github.com/milvus-io/milvus/issues/18300
Keywords: config etcd
Released: 2.3.0
## Summary(required)
At present, there are numerous configurations in Milvus that require a restart of Milvus to take effect. This can interrupt service in productio... | milvus/docs/design_docs/20220725-dynamic-config.md/0 | {
"file_path": "milvus/docs/design_docs/20220725-dynamic-config.md",
"repo_id": "milvus",
"token_count": 533
} | 1,643 |
<!--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/tasks/asr.md/0 | {
"file_path": "transformers/docs/source/ja/tasks/asr.md",
"repo_id": "transformers",
"token_count": 7201
} | 552 |
from typing import List, Optional, Sequence
from llama_index.core.base.llms.types import ChatMessage, MessageRole
BOS, EOS = "<s>", "</s>"
B_INST, E_INST = "[INST]", "[/INST]"
B_SYS, E_SYS = "<<SYS>>\n", "\n<</SYS>>\n\n"
DEFAULT_SYSTEM_PROMPT = """\
You are a helpful, respectful and honest assistant. \
Always answer ... | llama_index/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/llama_utils.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/llama_utils.py",
"repo_id": "llama_index",
"token_count": 911
} | 1,304 |
export { GoogleCalendarCreateTool } from "./create.js";
export { GoogleCalendarViewTool } from "./view.js";
export type { GoogleCalendarAgentParams } from "./base.js";
| langchainjs/libs/langchain-community/src/tools/google_calendar/index.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/tools/google_calendar/index.ts",
"repo_id": "langchainjs",
"token_count": 50
} | 1,006 |
# coding=utf-8
# Copyright 2019 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/test_tokenization_utils.py/0 | {
"file_path": "transformers/tests/test_tokenization_utils.py",
"repo_id": "transformers",
"token_count": 4988
} | 847 |
<jupyter_start><jupyter_code>from transformers import AutoModelForSeq2SeqLM
import peft
from peft import get_peft_config, get_peft_model, get_peft_model_state_dict, IA3Config, TaskType
import torch
from datasets import load_dataset
import os
os.environ["TOKENIZERS_PARALLELISM"] = "false"
from transformers import AutoT... | peft/examples/conditional_generation/peft_ia3_seq2seq.ipynb/0 | {
"file_path": "peft/examples/conditional_generation/peft_ia3_seq2seq.ipynb",
"repo_id": "peft",
"token_count": 2685
} | 316 |
<jupyter_start><jupyter_text>Multi-Modal LLM using OpenAI GPT-4V model for image reasoningIn this notebook, we show how to use OpenAI GPT4V MultiModal LLM class/abstraction for image understanding/reasoning.We also show several functions we are now supporting for OpenAI GPT4V LLM:* `complete` (both sync and async): for... | llama_index/docs/examples/multi_modal/openai_multi_modal.ipynb/0 | {
"file_path": "llama_index/docs/examples/multi_modal/openai_multi_modal.ipynb",
"repo_id": "llama_index",
"token_count": 3391
} | 1,201 |
[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 = ["OpenAIQuestionGenerator"]
contains_example = false
import_path = "llama_index.question_ge... | llama_index/llama-index-integrations/question_gen/llama-index-question-gen-openai/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/question_gen/llama-index-question-gen-openai/pyproject.toml",
"repo_id": "llama_index",
"token_count": 677
} | 1,324 |
# Entity memory
Entity Memory remembers given facts about specific entities in a conversation. It extracts information on entities (using an LLM) and builds up its knowledge about that entity over time (also using an LLM).
Let's first walk through using this functionality.
import CodeBlock from "@theme/CodeBlock";
... | langchainjs/docs/core_docs/docs/modules/memory/types/entity_summary_memory.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/memory/types/entity_summary_memory.mdx",
"repo_id": "langchainjs",
"token_count": 236
} | 791 |
# 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/pipelines/stable_diffusion/pipeline_stable_unclip.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py",
"repo_id": "diffusers",
"token_count": 19978
} | 232 |
# Metric Card for XTREME-S
## Metric Description
The XTREME-S metric aims to evaluate model performance on the Cross-lingual TRansfer Evaluation of Multilingual Encoders for Speech (XTREME-S) benchmark.
This benchmark was designed to evaluate speech representations across languages, tasks, domains and data regimes.... | datasets/metrics/xtreme_s/README.md/0 | {
"file_path": "datasets/metrics/xtreme_s/README.md",
"repo_id": "datasets",
"token_count": 2218
} | 127 |
# coding=utf-8
# Copyright 2022 MIT 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/LICENSE-2.0
#
# ... | transformers/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py/0 | {
"file_path": "transformers/src/transformers/models/audio_spectrogram_transformer/modeling_audio_spectrogram_transformer.py",
"repo_id": "transformers",
"token_count": 10667
} | 642 |
import type { basename as BasenameT } from "node:path";
import type { readFile as ReadFileT } from "node:fs/promises";
import { Document } from "@langchain/core/documents";
import { getEnv } from "@langchain/core/utils/env";
import { StringWithAutocomplete } from "@langchain/core/utils/types";
import {
DirectoryLoade... | langchainjs/langchain/src/document_loaders/fs/unstructured.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/fs/unstructured.ts",
"repo_id": "langchainjs",
"token_count": 3587
} | 939 |
python_sources()
| llama_index/llama-index-packs/llama-index-packs-ragatouille-retriever/llama_index/packs/ragatouille_retriever/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-ragatouille-retriever/llama_index/packs/ragatouille_retriever/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,692 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "vectorstores/voy",
});
export * from "@langchain/community/vectorstores/voy";
| langchainjs/langchain/src/vectorstores/voy.ts/0 | {
"file_path": "langchainjs/langchain/src/vectorstores/voy.ts",
"repo_id": "langchainjs",
"token_count": 70
} | 939 |
from typing import Any, List, Optional
import pytest
from langchain.callbacks.manager import (
AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun,
)
from langchain.schema import AIMessage, HumanMessage, SystemMessage
from langchain_core.language_models import LLM
from langchain_experimental.chat_models i... | langchain/libs/experimental/tests/unit_tests/chat_models/test_llm_wrapper_llama2chat.py/0 | {
"file_path": "langchain/libs/experimental/tests/unit_tests/chat_models/test_llm_wrapper_llama2chat.py",
"repo_id": "langchain",
"token_count": 1821
} | 453 |
import pytest
from langchain_core.utils.json_schema import dereference_refs
def test_dereference_refs_no_refs() -> None:
schema = {
"type": "object",
"properties": {
"first_name": {"type": "string"},
},
}
actual = dereference_refs(schema)
assert actual == schema
... | langchain/libs/core/tests/unit_tests/utils/test_json_schema.py/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/utils/test_json_schema.py",
"repo_id": "langchain",
"token_count": 2528
} | 410 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.