text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,301
package datacoord import ( "testing" "github.com/pingcap/log" "github.com/samber/lo" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "go.uber.org/zap" "github.com/milvus-io/milvus/internal/proto/datapb" ) func TestCompactionTriggerManagerSuite(t *testing.T) { suite.Run(t, new(Compacti...
milvus/internal/datacoord/compaction_trigger_v2_test.go/0
{ "file_path": "milvus/internal/datacoord/compaction_trigger_v2_test.go", "repo_id": "milvus", "token_count": 1078 }
1,791
# 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/vit/test_modeling_tf_vit.py/0
{ "file_path": "transformers/tests/models/vit/test_modeling_tf_vit.py", "repo_id": "transformers", "token_count": 3920 }
793
# 🧪 Experimental This section is for experiments, cool ideas, and more! Code here lives outside the base package. If a project is sufficiently interesting and validated, then we will move it into the core abstractions.
llama_index/experimental/README.md/0
{ "file_path": "llama_index/experimental/README.md", "repo_id": "llama_index", "token_count": 50 }
1,189
// Default generic "any" values are for backwards compatibility. // Replace with "string" when we are comfortable with a breaking change. import type { BaseCallbackConfig } from "../callbacks/manager.js"; import { AIMessage, HumanMessage, SystemMessage, BaseMessage, ChatMessage, type BaseMessageLike, coe...
langchainjs/langchain-core/src/prompts/chat.ts/0
{ "file_path": "langchainjs/langchain-core/src/prompts/chat.ts", "repo_id": "langchainjs", "token_count": 11083 }
865
import shutil import tempfile import unittest from langchain_community.graphs import KuzuGraph EXPECTED_SCHEMA = """Node properties: [{'properties': [('name', 'STRING')], 'label': 'Movie'}, {'properties': [('name', 'STRING'), ('birthDate', 'STRING')], 'label': 'Person'}] Relationships properties: [{'properties': [], ...
langchain/libs/community/tests/integration_tests/graphs/test_kuzu.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/graphs/test_kuzu.py", "repo_id": "langchain", "token_count": 1144 }
359
import json import logging import numbers from hashlib import sha1 from typing import Any, Dict, Iterable, List, Optional, Tuple from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstores import VectorStore logger = logging.getLogger() class Aliba...
langchain/libs/community/langchain_community/vectorstores/alibabacloud_opensearch.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/alibabacloud_opensearch.py", "repo_id": "langchain", "token_count": 9327 }
328
from typing import Any from llama_index.legacy.multi_modal_llms.replicate_multi_modal import ( ReplicateMultiModal, ) from llama_index.legacy.schema import ImageDocument from pytest import MonkeyPatch def mock_completion(*args: Any, **kwargs: Any) -> dict: # Example taken from https://replicate.com/ retu...
llama_index/llama-index-legacy/tests/multi_modal_llms/test_replicate_multi_modal.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/multi_modal_llms/test_replicate_multi_modal.py", "repo_id": "llama_index", "token_count": 874 }
1,749
<jupyter_start><jupyter_text>Fine-tuning for Semantic Segmentation with 🤗 TransformersIn this notebook, you'll learn how to fine-tune a pretrained vision model for Semantic Segmentation on a custom dataset in PyTorch. The idea is to add a randomly initialized segmentation head on top of a pre-trained encoder, and fine...
notebooks/examples/semantic_segmentation.ipynb/0
{ "file_path": "notebooks/examples/semantic_segmentation.ipynb", "repo_id": "notebooks", "token_count": 6303 }
283
from langchain_community.document_loaders.pubmed import PubMedLoader __all__ = ["PubMedLoader"]
langchain/libs/langchain/langchain/document_loaders/pubmed.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/pubmed.py", "repo_id": "langchain", "token_count": 28 }
488
"""SQL Structured Store.""" from collections import defaultdict from enum import Enum from typing import Any, Optional, Sequence, Union from sqlalchemy import Table from llama_index.legacy.core.base_query_engine import BaseQueryEngine from llama_index.legacy.core.base_retriever import BaseRetriever from llama_index....
llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/sql.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/sql.py", "repo_id": "llama_index", "token_count": 2534 }
1,577
from __future__ import annotations from enum import Enum from typing import TYPE_CHECKING, List, Optional import requests from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader if TYPE_CHECKING: import assemblyai class TranscriptFormat(Enum): """Tran...
langchain/libs/community/langchain_community/document_loaders/assemblyai.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/assemblyai.py", "repo_id": "langchain", "token_count": 3568 }
249
from langchain_community.llms.fake import FakeListLLM from langchain_core.documents import Document from langchain_core.prompts import PromptTemplate from langchain.chains import create_history_aware_retriever from tests.unit_tests.retrievers.parrot_retriever import FakeParrotRetriever def test_create() -> None: ...
langchain/libs/langchain/tests/unit_tests/chains/test_history_aware_retriever.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/chains/test_history_aware_retriever.py", "repo_id": "langchain", "token_count": 355 }
592
from langchain_community.chat_models.fake import ( FakeListChatModel, FakeMessagesListChatModel, ) __all__ = ["FakeMessagesListChatModel", "FakeListChatModel"]
langchain/libs/langchain/langchain/chat_models/fake.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/fake.py", "repo_id": "langchain", "token_count": 56 }
517
import { IterableReadableStream } from "@langchain/core/utils/stream"; import type { StringWithAutocomplete } from "@langchain/core/utils/types"; import { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base"; export interface OllamaInput { embeddingOnly?: boolean; f16KV?: boolean; frequency...
langchainjs/libs/langchain-community/src/utils/ollama.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/utils/ollama.ts", "repo_id": "langchainjs", "token_count": 1872 }
964
python_tests( interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-packs/llama-index-packs-gmail-openai-agent/tests/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-gmail-openai-agent/tests/BUILD", "repo_id": "llama_index", "token_count": 29 }
1,656
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwred...
milvus/pkg/go.sum/0
{ "file_path": "milvus/pkg/go.sum", "repo_id": "milvus", "token_count": 84336 }
1,951
<script lang="ts"> import { onDestroy } from "svelte"; import { goto, invalidate } from "$app/navigation"; import { page } from "$app/stores"; import "../styles/main.css"; import { base } from "$app/paths"; import { PUBLIC_APP_DESCRIPTION, PUBLIC_ORIGIN, PUBLIC_PLAUSIBLE_SCRIPT_URL, } from "$env/static/pub...
chat-ui/src/routes/+layout.svelte/0
{ "file_path": "chat-ui/src/routes/+layout.svelte", "repo_id": "chat-ui", "token_count": 2419 }
106
# Tavily Research Tool [Tavily](https://app.tavily.com/) is a robust research API tailored specifically for LLM Agents. It seamlessly integrates with diverse data sources to ensure a superior, relevant research experience. To begin, you need to obtain an API key on the [Tavily's developer dashboard](https://app.tavil...
llama_index/llama-index-integrations/tools/llama-index-tools-tavily-research/README.md/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-tavily-research/README.md", "repo_id": "llama_index", "token_count": 635 }
1,456
import { test, expect } from "@jest/globals"; import { AgentAction, AgentFinish } from "@langchain/core/agents"; import { StructuredChatOutputParser } from "../structured_chat/outputParser.js"; test("Can parse JSON with text in front of it", async () => { const testCases = [ { input: 'Here we have ...
langchainjs/langchain/src/agents/tests/structured_chat_output_parser.test.ts/0
{ "file_path": "langchainjs/langchain/src/agents/tests/structured_chat_output_parser.test.ts", "repo_id": "langchainjs", "token_count": 848 }
946
from enum import Enum from typing import Any, Dict, List, Optional, Union import numpy as np from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.retrievers import BaseRetriever from langc...
langchain/libs/community/langchain_community/retrievers/docarray.py/0
{ "file_path": "langchain/libs/community/langchain_community/retrievers/docarray.py", "repo_id": "langchain", "token_count": 2950 }
296
from __future__ import annotations from typing import TYPE_CHECKING, Any, List, Literal, Optional, Tuple from langchain_core.documents import Document from langchain_core.utils import get_from_env from langchain_community.document_loaders.base import BaseLoader if TYPE_CHECKING: from trello import Board, Card, ...
langchain/libs/community/langchain_community/document_loaders/trello.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/trello.py", "repo_id": "langchain", "token_count": 2871 }
251
<jupyter_start><jupyter_text>YAML parserThis output parser allows users to specify an arbitrary schema and query LLMs for outputs that conform to that schema, using YAML to format their response.Keep in mind that large language models are leaky abstractions! You'll have to use an LLM with sufficient capacity to generat...
langchain/docs/docs/modules/model_io/output_parsers/types/yaml.ipynb/0
{ "file_path": "langchain/docs/docs/modules/model_io/output_parsers/types/yaml.ipynb", "repo_id": "langchain", "token_count": 424 }
199
from llama_index.core.vector_stores.types import VectorStore from llama_index.vector_stores.lancedb import LanceDBVectorStore def test_class(): names_of_base_classes = [b.__name__ for b in LanceDBVectorStore.__mro__] assert VectorStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lancedb/tests/test_vector_stores_lancedb.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lancedb/tests/test_vector_stores_lancedb.py", "repo_id": "llama_index", "token_count": 93 }
1,486
"""Json agent.""" from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, List, Optional from langchain_core.callbacks import BaseCallbackManager from langchain_core.language_models import BaseLanguageModel from langchain_community.agent_toolkits.json.prompt import JSON_PREFIX, JSON_SUFFIX fr...
langchain/libs/community/langchain_community/agent_toolkits/json/base.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/json/base.py", "repo_id": "langchain", "token_count": 733 }
211
<jupyter_start><jupyter_text>YandexGPTThis notebook goes over how to use Langchain with [YandexGPT](https://cloud.yandex.com/en/services/yandexgpt) embeddings models.To use, you should have the `yandexcloud` python package installed.<jupyter_code>%pip install --upgrade --quiet yandexcloud<jupyter_output><empty_output>...
langchain/docs/docs/integrations/text_embedding/yandex.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/text_embedding/yandex.ipynb", "repo_id": "langchain", "token_count": 508 }
168
import asyncio import os from typing import Any, List, Optional import httpx import requests from llama_index.core.base.embeddings.base import BaseEmbedding, Embedding from llama_index.core.bridge.pydantic import Field class TogetherEmbedding(BaseEmbedding): api_base: str = Field( default="https://api.to...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-together/llama_index/embeddings/together/base.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-together/llama_index/embeddings/together/base.py", "repo_id": "llama_index", "token_count": 1871 }
1,375
from pathlib import Path from tempfile import TemporaryDirectory from langchain_community.llms.fake import FakeListLLM from langchain_core.tools import Tool from langchain.agents.agent_types import AgentType from langchain.agents.initialize import initialize_agent, load_agent def test_mrkl_serialization() -> None: ...
langchain/libs/langchain/tests/unit_tests/agents/test_serialization.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/agents/test_serialization.py", "repo_id": "langchain", "token_count": 329 }
589
import { ConfigList } from "./ConfigList"; import { Schemas } from "../hooks/useSchemas"; import TypingBox from "./TypingBox"; import { Config } from "./Config"; import { ConfigListProps } from "../hooks/useConfigList"; import { cn } from "../utils/cn"; interface NewChatProps extends ConfigListProps { configSchema: ...
opengpts/frontend/src/components/NewChat.tsx/0
{ "file_path": "opengpts/frontend/src/components/NewChat.tsx", "repo_id": "opengpts", "token_count": 690 }
1,916
"""DeepLake vector store index. An index that is built within DeepLake. """ import logging from typing import Any, List, Optional, cast from llama_index.legacy.bridge.pydantic import PrivateAttr from llama_index.legacy.schema import BaseNode, MetadataMode from llama_index.legacy.vector_stores.types import ( Bas...
llama_index/llama-index-legacy/llama_index/legacy/vector_stores/deeplake.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/deeplake.py", "repo_id": "llama_index", "token_count": 3500 }
1,622
"""Query Transforms.""" from llama_index.legacy.indices.query.query_transform.base import ( DecomposeQueryTransform, HyDEQueryTransform, StepDecomposeQueryTransform, ) __all__ = [ "HyDEQueryTransform", "DecomposeQueryTransform", "StepDecomposeQueryTransform", ]
llama_index/llama-index-legacy/llama_index/legacy/indices/query/query_transform/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/query/query_transform/__init__.py", "repo_id": "llama_index", "token_count": 104 }
1,520
// 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/metastore/kv/rootcoord/suffix_snapshot.go/0
{ "file_path": "milvus/internal/metastore/kv/rootcoord/suffix_snapshot.go", "repo_id": "milvus", "token_count": 6910 }
1,798
# 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/tests/fsdp/test_fsdp.py/0
{ "file_path": "accelerate/tests/fsdp/test_fsdp.py", "repo_id": "accelerate", "token_count": 6988 }
14
"""Download tool from Llama Hub.""" from typing import Optional, Type from llama_index.legacy.download.module import ( LLAMA_HUB_URL, MODULE_TYPE, download_llama_module, track_download, ) from llama_index.legacy.tools.tool_spec.base import BaseToolSpec def download_tool( tool_class: str, lla...
llama_index/llama-index-legacy/llama_index/legacy/tools/download.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/tools/download.py", "repo_id": "llama_index", "token_count": 520 }
1,525
# coding=utf-8 # Copyright 2021 The EleutherAI and HuggingFace Teams. 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/gptj/modeling_gptj.py/0
{ "file_path": "transformers/src/transformers/models/gptj/modeling_gptj.py", "repo_id": "transformers", "token_count": 22144 }
612
# Copyright 2024 Stanford University Team and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
diffusers/examples/community/latent_consistency_img2img.py/0
{ "file_path": "diffusers/examples/community/latent_consistency_img2img.py", "repo_id": "diffusers", "token_count": 16204 }
205
# 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/models/autoencoders/test_models_vq.py/0
{ "file_path": "diffusers/tests/models/autoencoders/test_models_vq.py", "repo_id": "diffusers", "token_count": 1280 }
279
import { TextServiceClient, protos } from "@google-ai/generativelanguage"; import { GoogleAuth } from "google-auth-library"; import { type BaseLLMParams, LLM } from "@langchain/core/language_models/llms"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; /** * Input for Text generation for Google Pa...
langchainjs/libs/langchain-community/src/llms/googlepalm.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/llms/googlepalm.ts", "repo_id": "langchainjs", "token_count": 2107 }
957
<jupyter_start><jupyter_text>Redis>[Redis (Remote Dictionary Server)](https://en.wikipedia.org/wiki/Redis) is an open-source in-memory storage, used as a distributed, in-memory key–value database, cache and message broker, with optional durability. Because it holds all data in memory and because of its design, `Redis` ...
langchain/docs/docs/integrations/memory/redis_chat_message_history.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/memory/redis_chat_message_history.ipynb", "repo_id": "langchain", "token_count": 663 }
122
<!--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/it/perf_train_cpu_many.md/0
{ "file_path": "transformers/docs/source/it/perf_train_cpu_many.md", "repo_id": "transformers", "token_count": 2562 }
484
package msgstream import ( "go.uber.org/zap" "github.com/milvus-io/milvus/internal/mq/mqimpl/rocksmq/server" "github.com/milvus-io/milvus/internal/mq/msgstream/mqwrapper/rmq" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/mq/msgstream" "github.com/milvus-io/milvus/pkg/util/paramtable" ) ...
milvus/internal/mq/msgstream/mq_factory.go/0
{ "file_path": "milvus/internal/mq/msgstream/mq_factory.go", "repo_id": "milvus", "token_count": 393 }
1,816
[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 = ["GeminiEmbedding"] contains_example = false import_path = "llama_index.embeddings.gemini" ...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/pyproject.toml", "repo_id": "llama_index", "token_count": 652 }
1,229
# coding=utf-8 # Copyright 2020 Microsoft and the Hugging Face 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 require...
transformers/src/transformers/models/deberta/modeling_deberta.py/0
{ "file_path": "transformers/src/transformers/models/deberta/modeling_deberta.py", "repo_id": "transformers", "token_count": 25656 }
668
# Wikipedia >[Wikipedia](https://wikipedia.org/) is a multilingual free online encyclopedia written and maintained by a community of volunteers, known as Wikipedians, through open collaboration and using a wiki-based editing system called MediaWiki. `Wikipedia` is the largest and most-read reference work in history. ...
langchain/docs/docs/integrations/providers/wikipedia.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/wikipedia.mdx", "repo_id": "langchain", "token_count": 183 }
150
import { LLM_SUMMERIZATION } from "$env/static/private"; import { generateFromDefaultEndpoint } from "$lib/server/generateFromDefaultEndpoint"; import type { Message } from "$lib/types/Message"; export async function summarize(prompt: string) { if (!LLM_SUMMERIZATION) { return prompt.split(/\s+/g).slice(0, 5).join(...
chat-ui/src/lib/server/summarize.ts/0
{ "file_path": "chat-ui/src/lib/server/summarize.ts", "repo_id": "chat-ui", "token_count": 638 }
107
package dao import ( "database/sql" "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel" "github.com/chroma/chroma-coordinator/internal/types" "github.com/pingcap/log" "go.uber.org/zap" "gorm.io/gorm" ) type segmentDb struct { db *gorm.DB } func (s *segmentDb) DeleteAll() error { return s.db...
chroma/go/coordinator/internal/metastore/db/dao/segment.go/0
{ "file_path": "chroma/go/coordinator/internal/metastore/db/dao/segment.go", "repo_id": "chroma", "token_count": 1932 }
48
import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { ConversationalRetrievalQAChain } from "langchain/chains"; import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { BufferMemory } from "langchain/memory"; const CUSTOM_QUESTION_GENERATOR_CHAIN_PROMPT = `Given the following ...
langchainjs/examples/src/chains/conversation_qa_custom_prompt_legacy.ts/0
{ "file_path": "langchainjs/examples/src/chains/conversation_qa_custom_prompt_legacy.ts", "repo_id": "langchainjs", "token_count": 676 }
759
import pytest from llama_index.core.ingestion.data_sources import ( ConfigurableDataSources, ConfiguredDataSource, ) from llama_index.core.schema import Document @pytest.mark.parametrize("configurable_data_source_type", ConfigurableDataSources) def test_can_generate_schema_for_data_source_component_type( ...
llama_index/llama-index-core/tests/ingestion/test_data_sources.py/0
{ "file_path": "llama_index/llama-index-core/tests/ingestion/test_data_sources.py", "repo_id": "llama_index", "token_count": 668 }
1,153
<!--- 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 ...
transformers/templates/adding_a_missing_tokenization_test/README.md/0
{ "file_path": "transformers/templates/adding_a_missing_tokenization_test/README.md", "repo_id": "transformers", "token_count": 472 }
759
// 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/datanode/channel_checkpoint_updater.go/0
{ "file_path": "milvus/internal/datanode/channel_checkpoint_updater.go", "repo_id": "milvus", "token_count": 700 }
1,692
--- sidebar_position: 3 --- # Toolkits Toolkits are collections of tools that are designed to be used together for specific tasks and have convenient loading methods. For a complete list of these, visit [Integrations](/docs/integrations/toolkits/). All Toolkits expose a `get_tools` method which returns a list of too...
langchain/docs/docs/modules/agents/tools/toolkits.mdx/0
{ "file_path": "langchain/docs/docs/modules/agents/tools/toolkits.mdx", "repo_id": "langchain", "token_count": 155 }
198
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { Tool } from "@langchain/core/tools"; import { SfnConfig, StartExecutionAWSSfnTool, DescribeExecutionAWSSfnTool, SendTaskSuccessAWSSfnTool, } from "../../tools/aws_sfn.js"; import { Toolkit } from "./base.js"; /** ...
langchainjs/libs/langchain-community/src/agents/toolkits/aws_sfn.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/agents/toolkits/aws_sfn.ts", "repo_id": "langchainjs", "token_count": 1043 }
974
# 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/data/processors/squad.py/0
{ "file_path": "transformers/src/transformers/data/processors/squad.py", "repo_id": "transformers", "token_count": 15578 }
559
from llama_index.embeddings.huggingface_optimum.base import OptimumEmbedding __all__ = ["OptimumEmbedding"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum/llama_index/embeddings/huggingface_optimum/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum/llama_index/embeddings/huggingface_optimum/__init__.py", "repo_id": "llama_index", "token_count": 39 }
1,263
from typing import Any, Dict, List, Mapping, Optional from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, Extra, Field, root_validator from langchain_core.utils import get_from_dict_or_env DEFAULT_EMBED_INSTRUCTION = "Represent this input: " DEFAULT_QUERY_INSTRUCTION = "...
langchain/libs/community/langchain_community/embeddings/octoai_embeddings.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/octoai_embeddings.py", "repo_id": "langchain", "token_count": 1625 }
272
import { NextRequest, NextResponse } from "next/server"; import { Message as VercelChatMessage, StreamingTextResponse } from "ai"; import { createClient } from "@supabase/supabase-js"; import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { PromptTemplate } from "@langchain/core/prompts"; import { ...
langchain-nextjs-template/app/api/chat/retrieval/route.ts/0
{ "file_path": "langchain-nextjs-template/app/api/chat/retrieval/route.ts", "repo_id": "langchain-nextjs-template", "token_count": 1879 }
68
[tool.poetry] name = "pii_protected_chatbot" version = "0.0.1" description = "Flag PII before passing it to the LLM" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" openai = "<2" presidio-analyzer = "^2.2.350" [tool.poetry.group.dev.dependencies] langchain-cli =...
langchain/templates/pii-protected-chatbot/pyproject.toml/0
{ "file_path": "langchain/templates/pii-protected-chatbot/pyproject.toml", "repo_id": "langchain", "token_count": 300 }
662
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace Team All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
transformers/examples/flax/language-modeling/run_t5_mlm_flax.py/0
{ "file_path": "transformers/examples/flax/language-modeling/run_t5_mlm_flax.py", "repo_id": "transformers", "token_count": 18636 }
574
"""Test ForefrontAI API wrapper.""" from langchain_community.llms.forefrontai import ForefrontAI def test_forefrontai_call() -> None: """Test valid call to forefrontai.""" llm = ForefrontAI(length=10) output = llm("Say foo:") assert isinstance(output, str)
langchain/libs/community/tests/integration_tests/llms/test_forefrontai.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_forefrontai.py", "repo_id": "langchain", "token_count": 95 }
370
from llama_index.core.llms.base import BaseLLM from llama_index.llms.localai import LocalAI def test_embedding_class(): names_of_base_classes = [b.__name__ for b in LocalAI.__mro__] assert BaseLLM.__name__ in names_of_base_classes
llama_index/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py", "repo_id": "llama_index", "token_count": 91 }
1,304
# coding=utf-8 # Copyright 2023 The Intel Labs Team Authors, The Microsoft Research Team Authors and 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 ...
transformers/src/transformers/models/bridgetower/configuration_bridgetower.py/0
{ "file_path": "transformers/src/transformers/models/bridgetower/configuration_bridgetower.py", "repo_id": "transformers", "token_count": 6247 }
589
"""Cassandra / Astra DB Vector store index. An index based on a DB table with vector search capabilities, powered by the cassIO library """ import logging from typing import Any, Dict, Iterable, List, Optional, TypeVar, cast from cassio.table import ClusteredMetadataVectorCassandraTable from llama_index.core.indice...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-cassandra/llama_index/vector_stores/cassandra/base.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-cassandra/llama_index/vector_stores/cassandra/base.py", "repo_id": "llama_index", "token_count": 5552 }
1,473
import Head from "next/head"; import { Inter } from "next/font/google"; import { fetchEventSource } from "@microsoft/fetch-event-source"; import styles from "@/styles/Home.module.css"; import { useSupabaseClient } from "@supabase/auth-helpers-react"; import { FormEvent, useCallback, useState } from "react"; const inte...
langchain-template-supabase/src/pages/index.tsx/0
{ "file_path": "langchain-template-supabase/src/pages/index.tsx", "repo_id": "langchain-template-supabase", "token_count": 1353 }
71
<!--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/using-diffusers/push_to_hub.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/push_to_hub.md", "repo_id": "diffusers", "token_count": 2083 }
196
import json import os from typing import Dict, Optional class Portkey: """Portkey configuration. Attributes: base: The base URL for the Portkey API. Default: "https://api.portkey.ai/v1/proxy" """ base = "https://api.portkey.ai/v1/proxy" @staticmethod def Config( ap...
langchain/libs/community/langchain_community/utilities/portkey.py/0
{ "file_path": "langchain/libs/community/langchain_community/utilities/portkey.py", "repo_id": "langchain", "token_count": 1096 }
324
//! Represents a tokenization pipeline. //! //! A [`Tokenizer`](struct.Tokenizer.html) is composed of some of the following parts. //! - [`Normalizer`](trait.Normalizer.html): Takes care of the text normalization (like unicode normalization). //! - [`PreTokenizer`](trait.PreTokenizer.html): Takes care of the pre to...
tokenizers/tokenizers/src/tokenizer/mod.rs/0
{ "file_path": "tokenizers/tokenizers/src/tokenizer/mod.rs", "repo_id": "tokenizers", "token_count": 18666 }
485
import type { AgentFinish } from "@langchain/core/agents"; import { OutputParserException } from "@langchain/core/output_parsers"; import { AgentActionOutputParser } from "../types.js"; import { FORMAT_INSTRUCTIONS } from "./prompt.js"; export const FINAL_ANSWER_ACTION = "Final Answer:"; /** * A class that extends th...
langchainjs/langchain/src/agents/chat/outputParser.ts/0
{ "file_path": "langchainjs/langchain/src/agents/chat/outputParser.ts", "repo_id": "langchainjs", "token_count": 1001 }
891
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "chat_models/bedrock/web", }); export * from "@langchain/community/chat_models/bedrock/web";
langchainjs/langchain/src/chat_models/bedrock/web.ts/0
{ "file_path": "langchainjs/langchain/src/chat_models/bedrock/web.ts", "repo_id": "langchainjs", "token_count": 79 }
964
from langchain.chains.structured_output.base import ( create_openai_fn_runnable, create_structured_output_runnable, ) __all__ = ["create_structured_output_runnable", "create_openai_fn_runnable"]
langchain/libs/langchain/langchain/chains/structured_output/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/structured_output/__init__.py", "repo_id": "langchain", "token_count": 77 }
493
""" Util that calls several of Polygon's stock market REST APIs. Docs: https://polygon.io/docs/stocks/getting-started """ import json from typing import Dict, Optional import requests from langchain_core.pydantic_v1 import BaseModel, root_validator from langchain_core.utils import get_from_dict_or_env POLYGON_BASE_UR...
langchain/libs/community/langchain_community/utilities/polygon.py/0
{ "file_path": "langchain/libs/community/langchain_community/utilities/polygon.py", "repo_id": "langchain", "token_count": 612 }
329
<jupyter_start><jupyter_text>Voyage Embeddings If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-embeddings-voyageai !pip install llama-index # imports import os from llama_index.embeddings.voyageai import VoyageEmbedding # get API key and ...
llama_index/docs/examples/embeddings/voyageai.ipynb/0
{ "file_path": "llama_index/docs/examples/embeddings/voyageai.ipynb", "repo_id": "llama_index", "token_count": 232 }
1,116
from langchain_community.embeddings.gpt4all import GPT4AllEmbeddings __all__ = ["GPT4AllEmbeddings"]
langchain/libs/langchain/langchain/embeddings/gpt4all.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/gpt4all.py", "repo_id": "langchain", "token_count": 38 }
501
import math from typing import Any, List import metal_sdk # noqa from llama_index.core.schema import BaseNode, MetadataMode, TextNode from llama_index.core.vector_stores.types import ( MetadataFilters, VectorStore, VectorStoreQuery, VectorStoreQueryResult, ) from llama_index.core.vector_stores.utils i...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-metal/llama_index/vector_stores/metal/base.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-metal/llama_index/vector_stores/metal/base.py", "repo_id": "llama_index", "token_count": 2168 }
1,609
# Graph Database Cypher Loader This loader populates documents from results of Cypher queries from a Graph database endpoint. The user specifies a GraphDB endpoint URL with optional credentials to initialize the reader. By declaring the Cypher query and optional parameters the loader can fetch the nested result docs. ...
llama_index/llama-index-integrations/readers/llama-index-readers-graphdb-cypher/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-graphdb-cypher/README.md", "repo_id": "llama_index", "token_count": 487 }
1,380
from typing import Dict, Iterator, List, Optional, Tuple, Union from tokenizers import AddedToken, Tokenizer, decoders, pre_tokenizers, processors, trainers from tokenizers.models import BPE from tokenizers.normalizers import Lowercase, Sequence, unicode_normalizer_from_str from .base_tokenizer import BaseTokenizer ...
tokenizers/bindings/python/py_src/tokenizers/implementations/byte_level_bpe.py/0
{ "file_path": "tokenizers/bindings/python/py_src/tokenizers/implementations/byte_level_bpe.py", "repo_id": "tokenizers", "token_count": 1978 }
421
// 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/expression/JsonContainsExpr.cpp/0
{ "file_path": "milvus/internal/core/src/exec/expression/JsonContainsExpr.cpp", "repo_id": "milvus", "token_count": 17362 }
1,750
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/tests/conftest.py/0
{ "file_path": "peft/tests/conftest.py", "repo_id": "peft", "token_count": 356 }
353
"""Test Marqo functionality.""" from typing import Dict import pytest from langchain_core.documents import Document from langchain_community.vectorstores.marqo import Marqo DEFAULT_MARQO_URL = "http://localhost:8882" DEFAULT_MARQO_API_KEY = "" INDEX_NAME = "langchain-integration-tests" @pytest.fixture def client()...
langchain/libs/community/tests/integration_tests/vectorstores/test_marqo.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_marqo.py", "repo_id": "langchain", "token_count": 2615 }
360
// 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/common/QueryResult.h/0
{ "file_path": "milvus/internal/core/src/common/QueryResult.h", "repo_id": "milvus", "token_count": 1074 }
1,779
import os import pickle def load_class_map(map_or_filename, root=''): if isinstance(map_or_filename, dict): assert dict, 'class_map dict must be non-empty' return map_or_filename class_map_path = map_or_filename if not os.path.exists(class_map_path): class_map_path = os.path.join(r...
pytorch-image-models/timm/data/readers/class_map.py/0
{ "file_path": "pytorch-image-models/timm/data/readers/class_map.py", "repo_id": "pytorch-image-models", "token_count": 387 }
383
from langchain_core.language_models.chat_models import ( BaseChatModel, SimpleChatModel, agenerate_from_stream, generate_from_stream, ) __all__ = [ "BaseChatModel", "SimpleChatModel", "generate_from_stream", "agenerate_from_stream", ]
langchain/libs/langchain/langchain/chat_models/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/base.py", "repo_id": "langchain", "token_count": 108 }
496
from langchain_community.tools.scenexplain.tool import SceneXplainInput, SceneXplainTool __all__ = ["SceneXplainInput", "SceneXplainTool"]
langchain/libs/langchain/langchain/tools/scenexplain/tool.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/scenexplain/tool.py", "repo_id": "langchain", "token_count": 43 }
565
from threading import Thread from typing import TYPE_CHECKING, Any, Callable, Generator, Optional, Sequence if TYPE_CHECKING: from langchain.base_language import BaseLanguageModel from llama_index.legacy.bridge.pydantic import PrivateAttr from llama_index.legacy.callbacks import CallbackManager from llama_index.l...
llama_index/llama-index-legacy/llama_index/legacy/llms/langchain.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/langchain.py", "repo_id": "llama_index", "token_count": 3449 }
1,577
# 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/swin/configuration_swin.py/0
{ "file_path": "transformers/src/transformers/models/swin/configuration_swin.py", "repo_id": "transformers", "token_count": 3174 }
682
import { IEmbeddingFunction } from "./IEmbeddingFunction"; export class JinaEmbeddingFunction implements IEmbeddingFunction { private model_name: string; private api_url: string; private headers: { [key: string]: string }; constructor({ jinaai_api_key, model_name }: { jinaai_api_key: string; model_name?: stri...
chroma/clients/js/src/embeddings/JinaEmbeddingFunction.ts/0
{ "file_path": "chroma/clients/js/src/embeddings/JinaEmbeddingFunction.ts", "repo_id": "chroma", "token_count": 595 }
32
#include <stdint.h> #include "reduction_utils.cuh" template <typename scalar_t> __device__ void rms_norm_kernel(scalar_t *__restrict__ out, // [num_tokens, hidden_size] const scalar_t *__restrict__ input, // [num_tokens, hidden_size] const float epsilon, const uint32_t num_token...
candle/candle-examples/examples/custom-ops/kernels/layernorm_kernels.cu/0
{ "file_path": "candle/candle-examples/examples/custom-ops/kernels/layernorm_kernels.cu", "repo_id": "candle", "token_count": 561 }
39
// 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/InsertRecord.h/0
{ "file_path": "milvus/internal/core/src/segcore/InsertRecord.h", "repo_id": "milvus", "token_count": 10434 }
1,798
# coding=utf-8 # Copyright 2023 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/mobilevitv2/convert_mlcvnets_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/mobilevitv2/convert_mlcvnets_to_pytorch.py", "repo_id": "transformers", "token_count": 5873 }
717
from pathlib import Path from langchain_community.document_loaders import JSONLoader def test_json_loader() -> None: """Test unstructured loader.""" file_path = Path(__file__).parent.parent / "examples/example.json" loader = JSONLoader(str(file_path), ".messages[].content") docs = loader.load() ...
langchain/libs/community/tests/integration_tests/document_loaders/test_json_loader.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_json_loader.py", "repo_id": "langchain", "token_count": 160 }
349
# 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/seamless_m4t/configuration_seamless_m4t.py/0
{ "file_path": "transformers/src/transformers/models/seamless_m4t/configuration_seamless_m4t.py", "repo_id": "transformers", "token_count": 9594 }
665
import torch from transformers import AutoModel class FSNERModel(torch.nn.Module): """ The FSNER model implements a few-shot named entity recognition method from the paper `Example-Based Named Entity Recognition <https://arxiv.org/abs/2008.10570>`__ by Morteza Ziyadi, Yuting Sun, Abhishek Goswami, Jade H...
transformers/examples/research_projects/fsner/src/fsner/model.py/0
{ "file_path": "transformers/examples/research_projects/fsner/src/fsner/model.py", "repo_id": "transformers", "token_count": 1436 }
586
# Res2Net **Res2Net** is an image model that employs a variation on bottleneck residual blocks, [Res2Net Blocks](https://paperswithcode.com/method/res2net-block). The motivation is to be able to represent features at multiple scales. This is achieved through a novel building block for CNNs that constructs hierarchical...
pytorch-image-models/hfdocs/source/models/res2net.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/res2net.mdx", "repo_id": "pytorch-image-models", "token_count": 3950 }
380
from dataclasses import dataclass from enum import Enum from typing import TYPE_CHECKING, List, Optional, Union import numpy as np import PIL from PIL import Image from ...utils import ( DIFFUSERS_SLOW_IMPORT, BaseOutput, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is...
diffusers/src/diffusers/pipelines/stable_diffusion_safe/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_safe/__init__.py", "repo_id": "diffusers", "token_count": 1237 }
264
# Retriever ## Concept Retrievers are responsible for fetching the most relevant context given a user query (or chat message). It can be built on top of [indexes](/module_guides/indexing/indexing.md), but can also be defined independently. It is used as a key building block in [query engines](/module_guides/deployin...
llama_index/docs/module_guides/querying/retriever/root.md/0
{ "file_path": "llama_index/docs/module_guides/querying/retriever/root.md", "repo_id": "llama_index", "token_count": 793 }
1,098
<jupyter_start><jupyter_text>Semi-structured and Multi-modal RAGMany documents contain a mixture of content types, including text, tables, and images. Semi-structured data can be challenging for conventional RAG for at least two reasons: * Text splitting may break up tables, corrupting the data in retrieval* Embedding ...
langchain/cookbook/Semi_structured_and_multi_modal_RAG.ipynb/0
{ "file_path": "langchain/cookbook/Semi_structured_and_multi_modal_RAG.ipynb", "repo_id": "langchain", "token_count": 4227 }
75
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 14402, "logprob": null, "text": "Test" }, { "id": 2581, "logprob": -11.6171875, "text": " request" } ], "see...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_phi/test_flash_phi.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_phi/test_flash_phi.json", "repo_id": "text-generation-inference", "token_count": 1003 }
364
# 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/models/deberta/__init__.py/0
{ "file_path": "transformers/src/transformers/models/deberta/__init__.py", "repo_id": "transformers", "token_count": 1512 }
586
# coding=utf-8 # Copyright 2022 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/models/poolformer/test_image_processing_poolformer.py/0
{ "file_path": "transformers/tests/models/poolformer/test_image_processing_poolformer.py", "repo_id": "transformers", "token_count": 1773 }
728
"""PII postprocessor.""" import json from copy import deepcopy from typing import Callable, Dict, List, Optional, Tuple from llama_index.core.llms.llm import LLM from llama_index.core.postprocessor.types import BaseNodePostprocessor from llama_index.core.prompts.base import PromptTemplate from llama_index.core.schema ...
llama_index/llama-index-core/llama_index/core/postprocessor/pii.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/postprocessor/pii.py", "repo_id": "llama_index", "token_count": 2259 }
1,236
import re import sys from functools import partial from typing import Any, Iterable, Iterator, List, Optional, Tuple if sys.version_info < (3, 8): # noqa: UP036 from typing import Final else: from typing import Final from collections import defaultdict import numpy as np import numpy.typing as npt try: ...
llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/sec_document.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/sec_document.py", "repo_id": "llama_index", "token_count": 7738 }
1,550