text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
from llama_index.core.storage.docstore.keyval_docstore import KVDocumentStore
from llama_index.storage.docstore.postgres import PostgresDocumentStore
def test_class():
names_of_base_classes = [b.__name__ for b in PostgresDocumentStore.__mro__]
assert KVDocumentStore.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-postgres/tests/test_storage_docstore_postgres.py/0 | {
"file_path": "llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-postgres/tests/test_storage_docstore_postgres.py",
"repo_id": "llama_index",
"token_count": 102
} | 1,415 |
#!/usr/bin/env python3
# coding=utf-8
# Copyright 2023-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | peft/tests/test_low_level_api.py/0 | {
"file_path": "peft/tests/test_low_level_api.py",
"repo_id": "peft",
"token_count": 1280
} | 311 |
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "callbacks/handlers/log_stream",
newEntrypointName: "tracers/log_stream",
newPackageName: "@langchain/core",
});
export * from "@langchain/core/tracers/log_stre... | langchainjs/langchain/src/callbacks/handlers/log_stream.ts/0 | {
"file_path": "langchainjs/langchain/src/callbacks/handlers/log_stream.ts",
"repo_id": "langchainjs",
"token_count": 105
} | 923 |
# Datadog Tracing
>[ddtrace](https://github.com/DataDog/dd-trace-py) is a Datadog application performance monitoring (APM) library which provides an integration to monitor your LangChain application.
Key features of the ddtrace integration for LangChain:
- Traces: Capture LangChain requests, parameters, prompt-comple... | langchain/docs/docs/integrations/providers/datadog.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/datadog.mdx",
"repo_id": "langchain",
"token_count": 1263
} | 133 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-elasticsearch/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-elasticsearch/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,461 |
# coding=utf-8
# 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 r... | transformers/tests/models/bart/test_modeling_tf_bart.py/0 | {
"file_path": "transformers/tests/models/bart/test_modeling_tf_bart.py",
"repo_id": "transformers",
"token_count": 30096
} | 719 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/llms/llama-index-llms-bedrock/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-bedrock/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,251 |
"""Test AzureOpenAI wrapper."""
import os
from typing import Any, Generator
import pytest
from langchain_core.callbacks import CallbackManager
from langchain_core.outputs import LLMResult
from langchain_openai import AzureOpenAI
from tests.unit_tests.fake.callbacks import FakeCallbackHandler
OPENAI_API_VERSION = os.... | langchain/libs/partners/openai/tests/integration_tests/llms/test_azure.py/0 | {
"file_path": "langchain/libs/partners/openai/tests/integration_tests/llms/test_azure.py",
"repo_id": "langchain",
"token_count": 2119
} | 653 |
# 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/swinv2/test_modeling_swinv2.py/0 | {
"file_path": "transformers/tests/models/swinv2/test_modeling_swinv2.py",
"repo_id": "transformers",
"token_count": 8749
} | 773 |
<jupyter_start><jupyter_text>Kay.ai> Data API built for RAG 🕵️ We are curating the world's largest datasets as high-quality embeddings so your AI agents can retrieve context on the fly. Latest models, fast retrieval, and zero infra.This notebook shows you how to retrieve datasets supported by [Kay](https://kay.ai/). Y... | langchain/docs/docs/integrations/retrievers/kay.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/retrievers/kay.ipynb",
"repo_id": "langchain",
"token_count": 1076
} | 165 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/rootcoord/describe_collection_task_test.go/0 | {
"file_path": "milvus/internal/rootcoord/describe_collection_task_test.go",
"repo_id": "milvus",
"token_count": 1467
} | 1,861 |
# coding=utf-8
# Copyright 2021 The Fairseq Authors 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/LICE... | transformers/src/transformers/models/xglm/modeling_tf_xglm.py/0 | {
"file_path": "transformers/src/transformers/models/xglm/modeling_tf_xglm.py",
"repo_id": "transformers",
"token_count": 20055
} | 771 |
// 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/core/src/exec/Task.cpp/0 | {
"file_path": "milvus/internal/core/src/exec/Task.cpp",
"repo_id": "milvus",
"token_count": 3907
} | 1,783 |
<jupyter_start><jupyter_text>Run TemplateIn `server.py`, set -```add_routes(app, chain_rag_conv, path="/rag-semi-structured")```<jupyter_code>from langserve.client import RemoteRunnable
rag_app = RemoteRunnable("http://localhost:8001/rag-semi-structured")
rag_app.invoke("How does agent memory work?")<jupyter_output><e... | langchain/templates/rag-semi-structured/rag_semi_structured.ipynb/0 | {
"file_path": "langchain/templates/rag-semi-structured/rag_semi_structured.ipynb",
"repo_id": "langchain",
"token_count": 124
} | 667 |
"""LLama Kibela Reader."""
from typing import Dict, Generic, List, Optional, TypeVar
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
from pydantic import BaseModel, parse_obj_as
from pydantic.generics import GenericModel
NodeType = TypeVar("NodeType")
class Edge(Gen... | llama_index/llama-index-integrations/readers/llama-index-readers-kibela/llama_index/readers/kibela/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-kibela/llama_index/readers/kibela/base.py",
"repo_id": "llama_index",
"token_count": 1492
} | 1,400 |
import { test } from "@jest/globals";
import { GoogleLLM } from "../llms.js";
describe("GAuth LLM", () => {
test("platform", async () => {
const model = new GoogleLLM();
expect(model.platform).toEqual("gcp");
});
test("call", async () => {
const model = new GoogleLLM();
try {
const res = a... | langchainjs/libs/langchain-google-gauth/src/tests/llms.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-google-gauth/src/tests/llms.int.test.ts",
"repo_id": "langchainjs",
"token_count": 1121
} | 1,034 |
from llama_index.core.vector_stores.types import VectorStore
from llama_index.vector_stores.bagel import BagelVectorStore
def test_class():
names_of_base_classes = [b.__name__ for b in BagelVectorStore.__mro__]
assert VectorStore.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/tests/test_vector_stores_bagel.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/tests/test_vector_stores_bagel.py",
"repo_id": "llama_index",
"token_count": 92
} | 1,452 |
<jupyter_start><jupyter_text>CompositionLangChain provides a user friendly interface for composing different parts of prompts together. You can do this with either string prompts or chat prompts. Constructing prompts this way allows for easy reuse of components. String prompt compositionWhen working with string prompt... | langchain/docs/docs/modules/model_io/prompts/composition.ipynb/0 | {
"file_path": "langchain/docs/docs/modules/model_io/prompts/composition.ipynb",
"repo_id": "langchain",
"token_count": 755
} | 198 |
import asyncio
from inspect import signature
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Optional, Type
if TYPE_CHECKING:
from llama_index.legacy.bridge.langchain import StructuredTool, Tool
from llama_index.legacy.bridge.pydantic import BaseModel
from llama_index.legacy.tools.types import AsyncBas... | llama_index/llama-index-legacy/llama_index/legacy/tools/function_tool.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/tools/function_tool.py",
"repo_id": "llama_index",
"token_count": 1883
} | 1,779 |
<jupyter_start><jupyter_text>Llamafile[Llamafile](https://github.com/Mozilla-Ocho/llamafile) lets you distribute and run LLMs with a single file.Llamafile does this by combining [llama.cpp](https://github.com/ggerganov/llama.cpp) with [Cosmopolitan Libc](https://github.com/jart/cosmopolitan) into one framework that col... | langchain/docs/docs/integrations/llms/llamafile.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/llms/llamafile.ipynb",
"repo_id": "langchain",
"token_count": 1109
} | 116 |
# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/tests/models/bark/test_processor_bark.py/0 | {
"file_path": "transformers/tests/models/bark/test_processor_bark.py",
"repo_id": "transformers",
"token_count": 1928
} | 784 |
"""KG-based data structures."""
from llama_index.legacy.indices.knowledge_graph.base import (
GPTKnowledgeGraphIndex,
KnowledgeGraphIndex,
)
from llama_index.legacy.indices.knowledge_graph.retrievers import (
KGTableRetriever,
KnowledgeGraphRAGRetriever,
)
__all__ = [
"KnowledgeGraphIndex",
"K... | llama_index/llama-index-legacy/llama_index/legacy/indices/knowledge_graph/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/knowledge_graph/__init__.py",
"repo_id": "llama_index",
"token_count": 160
} | 1,561 |
{
"index_store/data": {
"e50844ae-da94-431e-b1c8-b212161fb74f": {
"__type__": "list",
"__data__": "{\"index_id\": \"e50844ae-da94-431e-b1c8-b212161fb74f\", \"summary\": null, \"nodes\": [\"73b98f2c-4691-4bdd-8329-c3e61e87231e\", \"8877079a-2b28-4a1a-8791-a43f3f190013\", \"05063e50-12f3-4f4e-9e92-62a3a... | llama_index/llama-index-core/storage/index_store.json/0 | {
"file_path": "llama_index/llama-index-core/storage/index_store.json",
"repo_id": "llama_index",
"token_count": 200
} | 1,224 |
# 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/text_to_video_synthesis/test_text_to_video_zero.py/0 | {
"file_path": "diffusers/tests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py",
"repo_id": "diffusers",
"token_count": 559
} | 290 |
from langchain import document_transformers
from tests.unit_tests import assert_all_importable
EXPECTED_ALL = [
"BeautifulSoupTransformer",
"DoctranQATransformer",
"DoctranTextTranslator",
"DoctranPropertyExtractor",
"EmbeddingsClusteringFilter",
"EmbeddingsRedundantFilter",
"GoogleTranslat... | langchain/libs/langchain/tests/unit_tests/document_transformers/test_imports.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/document_transformers/test_imports.py",
"repo_id": "langchain",
"token_count": 234
} | 654 |
package connection
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
func Test_getIdentifierFromContext(t *testing.T) {
t.Run("metadata not found", func(t *testing.T) {
ctx := context.TODO()
_, err := GetIdentifierFromContext(ctx)... | milvus/internal/proxy/connection/util_test.go/0 | {
"file_path": "milvus/internal/proxy/connection/util_test.go",
"repo_id": "milvus",
"token_count": 671
} | 1,959 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/timm_backbone/modeling_timm_backbone.py/0 | {
"file_path": "transformers/src/transformers/models/timm_backbone/modeling_timm_backbone.py",
"repo_id": "transformers",
"token_count": 2548
} | 662 |
<!--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/de/accelerate.md/0 | {
"file_path": "transformers/docs/source/de/accelerate.md",
"repo_id": "transformers",
"token_count": 1929
} | 469 |
"""Test Xata vector store functionality.
Before running this test, please create a Xata database by following
the instructions from:
https://python.langchain.com/docs/integrations/vectorstores/xata
"""
import os
from langchain_core.documents import Document
from langchain_community.embeddings.openai import OpenAIEm... | langchain/libs/community/tests/integration_tests/vectorstores/test_xata.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_xata.py",
"repo_id": "langchain",
"token_count": 903
} | 359 |
{
"ASTForAudioClassification": {
"tokenizer_classes": [],
"processor_classes": [
"ASTFeatureExtractor"
],
"model_classes": [
"ASTForAudioClassification"
],
"sha": "83d6e076db7768a3645401bad3204624985e1d08"
},
"ASTModel": {
"toke... | transformers/tests/utils/tiny_model_summary.json/0 | {
"file_path": "transformers/tests/utils/tiny_model_summary.json",
"repo_id": "transformers",
"token_count": 116904
} | 843 |
// Code generated by mockery v2.32.4. DO NOT EDIT.
package mocks
import (
context "context"
commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
datapb "github.com/milvus-io/milvus/internal/proto/datapb"
grpc "google.golang.org/grpc"
indexpb "github.com/milvus-io/milvus/internal/proto/indexpb"
i... | milvus/internal/mocks/mock_datacoord_client.go/0 | {
"file_path": "milvus/internal/mocks/mock_datacoord_client.go",
"repo_id": "milvus",
"token_count": 49321
} | 1,723 |
from __future__ import annotations
import re
from abc import abstractmethod
from collections import deque
from typing import AsyncIterator, Deque, Iterator, List, TypeVar, Union
from langchain_core.messages import BaseMessage
from langchain_core.output_parsers.transform import BaseTransformOutputParser
T = TypeVar("... | langchain/libs/core/langchain_core/output_parsers/list.py/0 | {
"file_path": "langchain/libs/core/langchain_core/output_parsers/list.py",
"repo_id": "langchain",
"token_count": 2566
} | 415 |
"""Integration test for DallE API Wrapper."""
from langchain_community.utilities.dalle_image_generator import DallEAPIWrapper
def test_call() -> None:
"""Test that call returns a URL in the output."""
search = DallEAPIWrapper()
output = search.run("volcano island")
assert "https://oaidalleapi" in outp... | langchain/libs/langchain/tests/integration_tests/test_dalle.py/0 | {
"file_path": "langchain/libs/langchain/tests/integration_tests/test_dalle.py",
"repo_id": "langchain",
"token_count": 106
} | 597 |
import CodeBlock from "@theme/CodeBlock";
import InMemoryExample from "@examples/embeddings/cache_backed_in_memory.ts";
import ConvexExample from "@examples/embeddings/convex/cache_backed_convex.ts";
import RedisExample from "@examples/embeddings/cache_backed_redis.ts";
# Caching
Embeddings can be stored or temporari... | langchainjs/docs/core_docs/docs/modules/data_connection/text_embedding/caching_embeddings.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/text_embedding/caching_embeddings.mdx",
"repo_id": "langchainjs",
"token_count": 849
} | 733 |
<!--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/tasks/text-to-speech.md/0 | {
"file_path": "transformers/docs/source/en/tasks/text-to-speech.md",
"repo_id": "transformers",
"token_count": 7353
} | 499 |
"""Document summary index.
A data structure where LlamaIndex stores the summary per document, and maps
the summary to the underlying Nodes.
This summary can be used for retrieval.
"""
import logging
from collections import defaultdict
from enum import Enum
from typing import Any, Dict, List, Optional, Sequence, Union... | llama_index/llama-index-core/llama_index/core/indices/document_summary/base.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/indices/document_summary/base.py",
"repo_id": "llama_index",
"token_count": 4959
} | 1,215 |
<jupyter_start><jupyter_text>JinaChatThis notebook covers how to get started with JinaChat chat models.<jupyter_code>from langchain.prompts.chat import (
ChatPromptTemplate,
HumanMessagePromptTemplate,
SystemMessagePromptTemplate,
)
from langchain.schema import HumanMessage, SystemMessage
from langchain_com... | langchain/docs/docs/integrations/chat/jinachat.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/chat/jinachat.ipynb",
"repo_id": "langchain",
"token_count": 550
} | 99 |
# 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/musicldm/test_musicldm.py/0 | {
"file_path": "diffusers/tests/pipelines/musicldm/test_musicldm.py",
"repo_id": "diffusers",
"token_count": 7995
} | 288 |
<!--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/ko/tasks/image_captioning.md/0 | {
"file_path": "transformers/docs/source/ko/tasks/image_captioning.md",
"repo_id": "transformers",
"token_count": 5078
} | 562 |
# coding=utf-8
# Copyright 2022 The Google Research 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
#
# Unless required by applicab... | transformers/examples/research_projects/self-training-text-classification/finetuning.py/0 | {
"file_path": "transformers/examples/research_projects/self-training-text-classification/finetuning.py",
"repo_id": "transformers",
"token_count": 14689
} | 600 |
# coding=utf-8
# Copyright 2018 Google AI, Google Brain 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
#
# U... | transformers/src/transformers/models/albert/modeling_albert.py/0 | {
"file_path": "transformers/src/transformers/models/albert/modeling_albert.py",
"repo_id": "transformers",
"token_count": 25504
} | 561 |
import html
from typing import Any, Dict, Literal
from langchain_core.pydantic_v1 import BaseModel, Field, root_validator
class StackExchangeAPIWrapper(BaseModel):
"""Wrapper for Stack Exchange API."""
client: Any #: :meta private:
max_results: int = 3
"""Max number of results to include in output.... | langchain/libs/community/langchain_community/utilities/stackexchange.py/0 | {
"file_path": "langchain/libs/community/langchain_community/utilities/stackexchange.py",
"repo_id": "langchain",
"token_count": 1147
} | 303 |
# 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/vit_mae/test_modeling_vit_mae.py/0 | {
"file_path": "transformers/tests/models/vit_mae/test_modeling_vit_mae.py",
"repo_id": "transformers",
"token_count": 5325
} | 832 |
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "stores/message/mongodb",
});
export * from "@langchain/community/stores/message/mongodb";
| langchainjs/langchain/src/stores/message/mongodb.ts/0 | {
"file_path": "langchainjs/langchain/src/stores/message/mongodb.ts",
"repo_id": "langchainjs",
"token_count": 77
} | 939 |
<!--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/ko/using-diffusers/other-formats.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/other-formats.md",
"repo_id": "diffusers",
"token_count": 6827
} | 207 |
# Required Environment Variables: OPENAI_API_KEY
from llama_index.core.llama_pack import download_llama_pack
from llama_index.core import SimpleDirectoryReader
# download and install dependencies
QueryRewritingRetrieverPack = download_llama_pack(
"QueryRewritingRetrieverPack", "./query_rewriting_pack"
)
# load d... | llama_index/llama-index-packs/llama-index-packs-fusion-retriever/examples/query_rewrite/example.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-fusion-retriever/examples/query_rewrite/example.py",
"repo_id": "llama_index",
"token_count": 204
} | 1,670 |
import sys
sys.path.append("..")
from check.func_check import ResponseChecker
from utils.api_request import api_request
from pymilvus import CollectionSchema, FieldSchema
class ApiCollectionSchemaWrapper:
collection_schema = None
def init_collection_schema(self, fields, description="", check_task=None, chec... | milvus/tests/python_client/base/schema_wrapper.py/0 | {
"file_path": "milvus/tests/python_client/base/schema_wrapper.py",
"repo_id": "milvus",
"token_count": 1273
} | 1,984 |
import os
import sys
import warnings
from dataclasses import dataclass, field
from typing import Literal, Optional
from ..core import flatten_dict
from ..import_utils import is_bitsandbytes_available, is_torchvision_available
@dataclass
class DDPOConfig:
"""
Configuration class for DDPOTrainer
"""
#... | trl/trl/trainer/ddpo_config.py/0 | {
"file_path": "trl/trl/trainer/ddpo_config.py",
"repo_id": "trl",
"token_count": 1776
} | 781 |
mod pre_tokenizer;
mod scripts;
// Re-export the PreTokenizer
pub use pre_tokenizer::UnicodeScripts;
| tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/mod.rs/0 | {
"file_path": "tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/mod.rs",
"repo_id": "tokenizers",
"token_count": 35
} | 439 |
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "schema/runnable",
newEntrypointName: "runnables",
newPackageName: "@langchain/core",
});
export * from "@langchain/core/runnables";
| langchainjs/langchain/src/schema/runnable/index.ts/0 | {
"file_path": "langchainjs/langchain/src/schema/runnable/index.ts",
"repo_id": "langchainjs",
"token_count": 97
} | 987 |
import re
from filelock import FileLock
try:
import nltk
NLTK_AVAILABLE = True
except (ImportError, ModuleNotFoundError):
NLTK_AVAILABLE = False
if NLTK_AVAILABLE:
with FileLock(".lock") as lock:
nltk.download("punkt", quiet=True)
def add_newline_to_end_of_each_sentence(x: str) -> str:
... | transformers/examples/research_projects/seq2seq-distillation/sentence_splitter.py/0 | {
"file_path": "transformers/examples/research_projects/seq2seq-distillation/sentence_splitter.py",
"repo_id": "transformers",
"token_count": 247
} | 590 |
<jupyter_start><jupyter_code># Setup OpenAI Agent
import openai
openai.api_key = "sk-your-api-key"
from llama_index.agent import OpenAIAgent
# Load the OpenAPI spec for OpenAI
import requests
import yaml
f = requests.get(
"https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/openai.com/1.2.0/op... | llama_index/llama-index-integrations/tools/llama-index-tools-openapi/examples/openapi_and_requests.ipynb/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-openapi/examples/openapi_and_requests.ipynb",
"repo_id": "llama_index",
"token_count": 826
} | 1,490 |
import type { CheerioAPI } from "cheerio";
import { Document } from "@langchain/core/documents";
import { CheerioWebBaseLoader } from "./cheerio.js";
/**
* A class that extends the CheerioWebBaseLoader class. It represents a
* loader for loading web pages from the Hacker News website.
*/
export class HNLoader exten... | langchainjs/langchain/src/document_loaders/web/hn.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/web/hn.ts",
"repo_id": "langchainjs",
"token_count": 944
} | 948 |
package segments
import (
"context"
"github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/proto/segcorepb"
"github.com/milvus-io/milvus/internal/util/funcutil"
)
type cntReducer struct{}
func (r *cntReducer) Reduce(ctx context.Context, results []*internalpb.RetrieveResult... | milvus/internal/querynodev2/segments/count_reducer.go/0 | {
"file_path": "milvus/internal/querynodev2/segments/count_reducer.go",
"repo_id": "milvus",
"token_count": 379
} | 1,774 |
# Big Transfer (BiT)
**Big Transfer (BiT)** is a type of pretraining recipe that pre-trains on a large supervised source dataset, and fine-tunes the weights on the target task. Models are trained on the JFT-300M dataset. The finetuned models contained in this collection are finetuned on ImageNet.
## How do I use thi... | pytorch-image-models/docs/models/big-transfer.md/0 | {
"file_path": "pytorch-image-models/docs/models/big-transfer.md",
"repo_id": "pytorch-image-models",
"token_count": 4098
} | 363 |
# 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/modeling.py/0 | {
"file_path": "accelerate/src/accelerate/utils/modeling.py",
"repo_id": "accelerate",
"token_count": 32442
} | 20 |
//! Helper functions for the tinystories dataset. This uses the pre-tokenized version as generated
//! by the tools from https://github.com/karpathy/llama2.c
use candle::{Device, Result, Tensor};
pub struct Dataset {
valid_tokens: Vec<memmap2::Mmap>,
train_tokens: Vec<memmap2::Mmap>,
}
fn mmap_file(p: &std::p... | candle/candle-datasets/src/nlp/tinystories.rs/0 | {
"file_path": "candle/candle-datasets/src/nlp/tinystories.rs",
"repo_id": "candle",
"token_count": 2097
} | 40 |
package model
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
pb "github.com/milvus-io/milvus/internal/proto/etcdpb"
"github.com/milvus-io/milvus/pkg/common"
)
var (
colID int64 = 1
col... | milvus/internal/metastore/model/collection_test.go/0 | {
"file_path": "milvus/internal/metastore/model/collection_test.go",
"repo_id": "milvus",
"token_count": 5171
} | 1,799 |
from langchain_community.embeddings.huggingface_hub import (
HuggingFaceHubEmbeddings,
)
__all__ = ["HuggingFaceHubEmbeddings"]
| langchain/libs/langchain/langchain/embeddings/huggingface_hub.py/0 | {
"file_path": "langchain/libs/langchain/langchain/embeddings/huggingface_hub.py",
"repo_id": "langchain",
"token_count": 48
} | 498 |
<jupyter_start><jupyter_text>Data anonymization with Microsoft Presidio[](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/guides/privacy/presidio_data_anonymization/index.ipynb)>[Presidio](https://microsoft.github.io/presidio/) (Origin from Latin praesidium ‘protection, garrison’) ... | langchain/docs/docs/guides/privacy/presidio_data_anonymization/index.ipynb/0 | {
"file_path": "langchain/docs/docs/guides/privacy/presidio_data_anonymization/index.ipynb",
"repo_id": "langchain",
"token_count": 2935
} | 93 |
"""Astra DB - based chat message history, based on astrapy."""
from __future__ import annotations
import json
import time
from typing import TYPE_CHECKING, List, Optional, Sequence
from langchain_community.utilities.astradb import (
SetupMode,
_AstraDBCollectionEnvironment,
)
if TYPE_CHECKING:
from astra... | langchain/libs/community/langchain_community/chat_message_histories/astradb.py/0 | {
"file_path": "langchain/libs/community/langchain_community/chat_message_histories/astradb.py",
"repo_id": "langchain",
"token_count": 2465
} | 234 |
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/model_doc/mask2former.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/mask2former.md",
"repo_id": "transformers",
"token_count": 1219
} | 480 |
python_requirements(
name="reqs",
)
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/unstructured_web/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/unstructured_web/BUILD",
"repo_id": "llama_index",
"token_count": 24
} | 1,393 |
"""Embeddings Components Derived from NVEModel/Embeddings"""
from typing import List, Literal, Optional
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import Field
from langchain_nvidia_ai_endpoints._common import _NVIDIAClient
class NVIDIAEmbeddings(_NVIDIAClient, Embeddings):
... | langchain/libs/partners/nvidia-ai-endpoints/langchain_nvidia_ai_endpoints/embeddings.py/0 | {
"file_path": "langchain/libs/partners/nvidia-ai-endpoints/langchain_nvidia_ai_endpoints/embeddings.py",
"repo_id": "langchain",
"token_count": 1050
} | 657 |
<jupyter_start><jupyter_text>Baidu QianfanBaidu AI Cloud Qianfan Platform is a one-stop large model development and service operation platform for enterprise developers. Qianfan not only provides including the model of Wenxin Yiyan (ERNIE-Bot) and the third-party open-source models, but also provides various AI develop... | langchain/docs/docs/integrations/llms/baidu_qianfan_endpoint.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/llms/baidu_qianfan_endpoint.ipynb",
"repo_id": "langchain",
"token_count": 1172
} | 124 |
from llama_index.vector_stores.myscale.base import MyScaleVectorStore
__all__ = ["MyScaleVectorStore"]
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-myscale/llama_index/vector_stores/myscale/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-myscale/llama_index/vector_stores/myscale/__init__.py",
"repo_id": "llama_index",
"token_count": 33
} | 1,528 |
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
input,
textarea,
select {
background: transparent;
}
/* clash between MUI and Tailwind */
input:focus,
textarea:focus,
select:focus {
box-shadow: none;
outline: none;
}
:root {
--popover: 0 0% 100%;
--bac... | langserve/langserve/playground/src/App.css/0 | {
"file_path": "langserve/langserve/playground/src/App.css",
"repo_id": "langserve",
"token_count": 910
} | 1,128 |
import asyncio
import logging
from typing import Iterator, List
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
logger = logging.getLogger(__name__)
class AsyncChromiumLoader(BaseLoader):
"""Scrape HTML pages from URLs using a
headless instance... | langchain/libs/community/langchain_community/document_loaders/chromium.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/chromium.py",
"repo_id": "langchain",
"token_count": 1155
} | 247 |
# Evaluating and Tracking with TruLens
This page covers how to use [TruLens](https://trulens.org) to evaluate and track LLM apps built on Llama-Index.
## What is TruLens?
TruLens is an [opensource](https://github.com/truera/trulens) package that provides instrumentation and evaluation tools for large language model ... | llama_index/docs/community/integrations/trulens.md/0 | {
"file_path": "llama_index/docs/community/integrations/trulens.md",
"repo_id": "llama_index",
"token_count": 554
} | 1,089 |
# HuggingFaceInference
Here's an example of calling a HugggingFaceInference model as an LLM:
```bash npm2yarn
npm install @huggingface/inference@2
```
```typescript
import { HuggingFaceInference } from "langchain/llms/hf";
const model = new HuggingFaceInference({
model: "gpt2",
apiKey: "YOUR-API-KEY", // In Nod... | langchainjs/docs/core_docs/docs/integrations/llms/huggingface_inference.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/llms/huggingface_inference.mdx",
"repo_id": "langchainjs",
"token_count": 162
} | 732 |
/* eslint-disable no-process-env */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { test, expect } from "@jest/globals";
import Metal from "@getmetal/metal-sdk";
import { MetalRetriever } from "../metal.js";
test("MetalRetriever", async () => {
const MetalSDK = Metal;
const client = new Met... | langchainjs/libs/langchain-community/src/retrievers/tests/metal.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/retrievers/tests/metal.int.test.ts",
"repo_id": "langchainjs",
"token_count": 221
} | 1,067 |
# 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/wuerstchen/pipeline_wuerstchen_combined.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/wuerstchen/pipeline_wuerstchen_combined.py",
"repo_id": "diffusers",
"token_count": 6898
} | 273 |
# Use with PyTorch
This document is a quick introduction to using `datasets` with PyTorch, with a particular focus on how to get
`torch.Tensor` objects out of our datasets, and how to use a PyTorch `DataLoader` and a Hugging Face `Dataset`
with the best performance.
## Dataset format
By default, datasets return regu... | datasets/docs/source/use_with_pytorch.mdx/0 | {
"file_path": "datasets/docs/source/use_with_pytorch.mdx",
"repo_id": "datasets",
"token_count": 3104
} | 121 |
// 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/indexbuilder/IndexFactory.h/0 | {
"file_path": "milvus/internal/core/src/indexbuilder/IndexFactory.h",
"repo_id": "milvus",
"token_count": 1690
} | 1,741 |
# coding=utf-8
# Copyright 2023 Google LLC 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/umt5/convert_umt5_checkpoint_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/umt5/convert_umt5_checkpoint_to_pytorch.py",
"repo_id": "transformers",
"token_count": 5299
} | 742 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-opendal/llama_index/readers/opendal/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-opendal/llama_index/readers/opendal/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,530 |
<jupyter_start><jupyter_text>LLMRails>[LLMRails](https://www.llmrails.com/) is a API platform for building GenAI applications. It provides an easy-to-use API for document indexing and querying that is managed by LLMRails and is optimized for performance and accuracy. See the [LLMRails API documentation ](https://docs.l... | langchain/docs/docs/integrations/vectorstores/llm_rails.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/llm_rails.ipynb",
"repo_id": "langchain",
"token_count": 1560
} | 191 |
{
"extends": "@tsconfig/recommended",
"compilerOptions": {
"outDir": "dist",
"lib": [
"ES2021",
"ES2022.Object",
"DOM"
],
"target": "ES2021",
"module": "nodenext",
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "./src",
"declaration": true,
... | langchainjs/examples/tsconfig.json/0 | {
"file_path": "langchainjs/examples/tsconfig.json",
"repo_id": "langchainjs",
"token_count": 275
} | 829 |
import type { InputValues } from "@langchain/core/utils/types";
import {
type ParsedFStringNode,
PromptTemplate,
type PromptTemplateInput,
TypedPromptInputValues,
} from "@langchain/core/prompts";
export type CustomFormatPromptTemplateInput<RunInput extends InputValues> =
Omit<PromptTemplateInput<RunInput, s... | langchainjs/langchain/src/experimental/prompts/custom_format.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/prompts/custom_format.ts",
"repo_id": "langchainjs",
"token_count": 1160
} | 927 |
export function getHref(
url: URL | string,
modifications: {
newKeys?: Record<string, string | undefined | null>;
existingKeys?: { behaviour: "delete_except" | "delete"; keys: string[] };
}
) {
const newUrl = new URL(url);
const { newKeys, existingKeys } = modifications;
// exsiting keys logic
if (existingK... | chat-ui/src/lib/utils/getHref.ts/0 | {
"file_path": "chat-ui/src/lib/utils/getHref.ts",
"repo_id": "chat-ui",
"token_count": 373
} | 112 |
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Document {
id String @id @default(cuid())
content ... | langchainjs/examples/src/indexes/vector_stores/prisma_vectorstore/prisma/schema.prisma/0 | {
"file_path": "langchainjs/examples/src/indexes/vector_stores/prisma_vectorstore/prisma/schema.prisma",
"repo_id": "langchainjs",
"token_count": 175
} | 821 |
import builtins
import json
from typing import List, Optional, Type, Union
from langchain_core.callbacks import AsyncCallbackManagerForToolRun
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_community.tools.ainetwork.base import AINBaseTool, OperationType
class RuleSchema(BaseModel):
"""S... | langchain/libs/community/langchain_community/tools/ainetwork/owner.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/ainetwork/owner.py",
"repo_id": "langchain",
"token_count": 1802
} | 290 |
CREATE TABLE collections (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
topic TEXT NOT NULL,
UNIQUE (name)
);
CREATE TABLE collection_metadata (
collection_id TEXT REFERENCES collections(id) ON DELETE CASCADE,
key TEXT NOT NULL,
str_value TEXT,
int_value INTEGER,
float_value REAL,
P... | chroma/chromadb/migrations/sysdb/00001-collections.sqlite.sql/0 | {
"file_path": "chroma/chromadb/migrations/sysdb/00001-collections.sqlite.sql",
"repo_id": "chroma",
"token_count": 135
} | 17 |
from llama_index.core.vector_stores.types import VectorStore
from llama_index.vector_stores.singlestoredb import SingleStoreVectorStore
def test_class():
names_of_base_classes = [b.__name__ for b in SingleStoreVectorStore.__mro__]
assert VectorStore.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-singlestoredb/tests/test_vector_stores_singlestoredb.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-singlestoredb/tests/test_vector_stores_singlestoredb.py",
"repo_id": "llama_index",
"token_count": 94
} | 1,537 |
"""Simple tool wrapper around VectorDBQA chain."""
| langchain/libs/langchain/langchain/tools/vectorstore/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/vectorstore/__init__.py",
"repo_id": "langchain",
"token_count": 13
} | 613 |
from neo4j_cypher_memory.chain import chain
__all__ = ["chain"]
| langchain/templates/neo4j-cypher-memory/neo4j_cypher_memory/__init__.py/0 | {
"file_path": "langchain/templates/neo4j-cypher-memory/neo4j_cypher_memory/__init__.py",
"repo_id": "langchain",
"token_count": 23
} | 648 |
# 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... | trl/tests/test_reward_trainer.py/0 | {
"file_path": "trl/tests/test_reward_trainer.py",
"repo_id": "trl",
"token_count": 7653
} | 825 |
import { test, expect } from "@jest/globals";
import { z } from "zod";
import { ChatOpenAI } from "@langchain/openai";
import {
ChatPromptTemplate,
SystemMessagePromptTemplate,
HumanMessagePromptTemplate,
} from "@langchain/core/prompts";
import { createStructuredOutputChainFromZod } from "../structured_output.j... | langchainjs/langchain/src/chains/openai_functions/tests/structured_output.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/chains/openai_functions/tests/structured_output.int.test.ts",
"repo_id": "langchainjs",
"token_count": 718
} | 956 |
# flake8: noqa
from langchain_core.prompts.prompt import PromptTemplate
PROMPT_SUFFIX = """Only use the following Elasticsearch indices:
{indices_info}
Question: {input}
ESQuery:"""
DEFAULT_DSL_TEMPLATE = """Given an input question, create a syntactically correct Elasticsearch query to run. Unless the user specifies... | langchain/libs/langchain/langchain/chains/elasticsearch_database/prompts.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/elasticsearch_database/prompts.py",
"repo_id": "langchain",
"token_count": 382
} | 488 |
<jupyter_start><jupyter_text>Azure OpenAI Azure openAI resources unfortunately differ from standard openAI resources as you can't generate embeddings unless you use an embedding model. The regions where these models are available can be found here: https://learn.microsoft.com/en-us/azure/cognitive-services/openai/conce... | llama_index/docs/examples/customization/llms/AzureOpenAI.ipynb/0 | {
"file_path": "llama_index/docs/examples/customization/llms/AzureOpenAI.ipynb",
"repo_id": "llama_index",
"token_count": 1257
} | 1,095 |
# Comparing Preference Alignment Algorithms
This directory contains various comparisons for three algorithms: DPO, IPO, and KTO. Each algorithm has been run in different hyperparameter configurations to study their performance. Two different models and datasets have been used to compare the performance of each algorith... | alignment-handbook/recipes/pref_align_scan/README.md/0 | {
"file_path": "alignment-handbook/recipes/pref_align_scan/README.md",
"repo_id": "alignment-handbook",
"token_count": 690
} | 21 |
<jupyter_start><jupyter_text>Router RetrieverIn this guide, we define a custom router retriever that selects one or more candidate retrievers in order to execute a given query.The router (`BaseSelector`) module uses the LLM to dynamically make decisions on which underlying retrieval tools to use. This can be helpful to... | llama_index/docs/examples/retrievers/router_retriever.ipynb/0 | {
"file_path": "llama_index/docs/examples/retrievers/router_retriever.ipynb",
"repo_id": "llama_index",
"token_count": 2105
} | 1,128 |
# coding=utf-8
# Copyright 2020 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/convbert/convert_convbert_original_tf1_checkpoint_to_pytorch_and_tf2.py/0 | {
"file_path": "transformers/src/transformers/models/convbert/convert_convbert_original_tf1_checkpoint_to_pytorch_and_tf2.py",
"repo_id": "transformers",
"token_count": 749
} | 650 |
/** @type {import('tailwindcss').Config} */
export default {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {
colors: {
popover: {
DEFAULT: "hsl(var(--popover))",
},
background: {
DEFAULT: "hsl(var(--background))",
},
l... | langserve/langserve/playground/tailwind.config.js/0 | {
"file_path": "langserve/langserve/playground/tailwind.config.js",
"repo_id": "langserve",
"token_count": 459
} | 1,033 |
import { htmlToText } from "html-to-text";
import { Document } from "@langchain/core/documents";
import { BaseDocumentLoader } from "../base.js";
/**
* Interface representing the parameters for configuring the
* ConfluencePagesLoader.
*/
export interface ConfluencePagesLoaderParams {
baseUrl: string;
spaceKey: ... | langchainjs/langchain/src/document_loaders/web/confluence.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/web/confluence.ts",
"repo_id": "langchainjs",
"token_count": 2191
} | 898 |
# coding=utf-8
# Copyright 2021 The Open AI 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/models/clip/tokenization_clip_fast.py/0 | {
"file_path": "transformers/src/transformers/models/clip/tokenization_clip_fast.py",
"repo_id": "transformers",
"token_count": 3006
} | 619 |
from pathlib import Path
import pytest
from langchain_community.document_loaders.python import PythonLoader
@pytest.mark.parametrize("filename", ["default-encoding.py", "non-utf8-encoding.py"])
def test_python_loader(filename: str) -> None:
"""Test Python loader."""
file_path = Path(__file__).parent.parent ... | langchain/libs/community/tests/integration_tests/document_loaders/test_python.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_python.py",
"repo_id": "langchain",
"token_count": 175
} | 357 |
- name: pulsar volume
docker_volume:
name: pulsar_conf
- name: pulsar volume
docker_volume:
name: pulsar_data
- name: "pulsar"
docker_container:
name: pulsar
image: apachepulsar/pulsar:2.8.2
env:
# bin/apply-config-from-env.py script will modify the configuration file based on the envi... | milvus/deployments/docker/cluster-distributed-deployment/roles/deploy-pulsar/tasks/main.yml/0 | {
"file_path": "milvus/deployments/docker/cluster-distributed-deployment/roles/deploy-pulsar/tasks/main.yml",
"repo_id": "milvus",
"token_count": 417
} | 1,762 |
"""LLM Compiler agent pack."""
from typing import Any, Dict, List, Optional
from llama_index.core.agent import AgentRunner
from llama_index.core.callbacks import CallbackManager
from llama_index.core.llama_pack.base import BaseLlamaPack
from llama_index.core.llms.llm import LLM
from llama_index.core.tools.types impor... | llama_index/llama-index-packs/llama-index-packs-agents-llm-compiler/llama_index/packs/agents_llm_compiler/base.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-agents-llm-compiler/llama_index/packs/agents_llm_compiler/base.py",
"repo_id": "llama_index",
"token_count": 828
} | 1,642 |
{
"name": "langchain",
"version": "0.1.19",
"description": "Typescript bindings for langchain",
"type": "module",
"engines": {
"node": ">=18"
},
"main": "./index.js",
"types": "./index.d.ts",
"files": [
"dist/",
"load.cjs",
"load.js",
"load.d.ts",
"load.d.cts",
"load/serial... | langchainjs/langchain/package.json/0 | {
"file_path": "langchainjs/langchain/package.json",
"repo_id": "langchainjs",
"token_count": 70258
} | 848 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.