text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/api/models/overview.md/0
{ "file_path": "diffusers/docs/source/en/api/models/overview.md", "repo_id": "diffusers", "token_count": 336 }
171
import pulsar def pulsar_to_int(message_id: pulsar.MessageId) -> int: ledger_id: int = message_id.ledger_id() entry_id: int = message_id.entry_id() batch_index: int = message_id.batch_index() partition: int = message_id.partition() # Convert to offset binary encoding to preserve ordering semantic...
chroma/chromadb/utils/messageid.py/0
{ "file_path": "chroma/chromadb/utils/messageid.py", "repo_id": "chroma", "token_count": 931 }
27
ann_accuracy: collections: - milvus: cache_config.cpu_cache_capacity: 16GB engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: false gpu_resource_config.cache_capacity: 4GB gpu_resource_config.search_resourc...
milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_accuracy_ann.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_accuracy_ann.yaml", "repo_id": "milvus", "token_count": 4101 }
1,871
# coding=utf-8 # Copyright 2021 Google AI, Ross Wightman, 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/license...
transformers/src/transformers/models/vit/modeling_vit.py/0
{ "file_path": "transformers/src/transformers/models/vit/modeling_vit.py", "repo_id": "transformers", "token_count": 15053 }
670
apiVersion: chaos-mesh.org/v1alpha1 kind: NetworkChaos metadata: name: test-minio-network-partition namespace: chaos-testing spec: action: partition mode: all selector: namespaces: - chaos-testing labelSelectors: app.kubernetes.io/instance: chaos-testing app.kubernetes.io/name: milvu...
milvus/tests/python_client/chaos/chaos_objects/network_partition/chaos_minio_network_partition.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/network_partition/chaos_minio_network_partition.yaml", "repo_id": "milvus", "token_count": 213 }
1,956
# Nuclia >[Nuclia](https://nuclia.com) automatically indexes your unstructured data from any internal > and external source, providing optimized search results and generative answers. > It can handle video and audio transcription, image content extraction, and document parsing. >`Nuclia Understanding API` document t...
langchain/docs/docs/integrations/providers/nuclia.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/nuclia.mdx", "repo_id": "langchain", "token_count": 385 }
140
use crate::tokenizer::{NormalizedString, Normalizer, Result}; use crate::utils::macro_rules_attribute; #[derive(Default, Copy, Clone, Debug)] #[macro_rules_attribute(impl_serde_type!)] pub struct NFD; impl Normalizer for NFD { fn normalize(&self, normalized: &mut NormalizedString) -> Result<()> { normalize...
tokenizers/tokenizers/src/normalizers/unicode.rs/0
{ "file_path": "tokenizers/tokenizers/src/normalizers/unicode.rs", "repo_id": "tokenizers", "token_count": 1317 }
467
from langchain_community.utilities.opaqueprompts import desanitize, sanitize __all__ = ["sanitize", "desanitize"]
langchain/libs/langchain/langchain/utilities/opaqueprompts.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/opaqueprompts.py", "repo_id": "langchain", "token_count": 41 }
573
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/bert-generation.md/0
{ "file_path": "transformers/docs/source/en/model_doc/bert-generation.md", "repo_id": "transformers", "token_count": 1314 }
456
# flake8: noqa from .base_environment import TextEnvironment, TextHistory
trl/trl/environment/__init__.py/0
{ "file_path": "trl/trl/environment/__init__.py", "repo_id": "trl", "token_count": 21 }
873
<!--- Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
transformers/examples/research_projects/onnx/summarization/README.md/0
{ "file_path": "transformers/examples/research_projects/onnx/summarization/README.md", "repo_id": "transformers", "token_count": 463 }
567
<!--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/optimization/xformers.md/0
{ "file_path": "diffusers/docs/source/ko/optimization/xformers.md", "repo_id": "diffusers", "token_count": 1049 }
196
# coding=utf-8 # Copyright 2020 The Allen Institute for AI team 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...
transformers/src/transformers/models/longformer/configuration_longformer.py/0
{ "file_path": "transformers/src/transformers/models/longformer/configuration_longformer.py", "repo_id": "transformers", "token_count": 3683 }
659
import pytest from text_generation_server.pb import generate_pb2 @pytest.fixture def default_pb_parameters(): return generate_pb2.NextTokenChooserParameters( temperature=1.0, repetition_penalty=1.0, top_k=0, top_p=1.0, typical_p=1.0, do_sample=False, ) @pytes...
text-generation-inference/server/tests/conftest.py/0
{ "file_path": "text-generation-inference/server/tests/conftest.py", "repo_id": "text-generation-inference", "token_count": 199 }
424
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-maps/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-maps/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,346
# README ## Overview For better tracking and debugging Milvus, the script `export-milvus-log.sh` is provided for exporting all Milvus logs at once. For those pods that have been restarted, this script can export the logs of the running pods and the logs of the previously pods. > Note: This script only works with Mil...
milvus/deployments/export-log/README.md/0
{ "file_path": "milvus/deployments/export-log/README.md", "repo_id": "milvus", "token_count": 1235 }
1,719
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/marian.md/0
{ "file_path": "transformers/docs/source/en/model_doc/marian.md", "repo_id": "transformers", "token_count": 3064 }
509
from langchain_community.vectorstores.weaviate import ( Weaviate, ) __all__ = [ "Weaviate", ]
langchain/libs/langchain/langchain/vectorstores/weaviate.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/weaviate.py", "repo_id": "langchain", "token_count": 43 }
577
from __future__ import annotations import json import logging from hashlib import sha1 from threading import Thread from typing import Any, Dict, Iterable, List, Optional, Tuple from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseSe...
langchain/libs/community/langchain_community/vectorstores/myscale.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/myscale.py", "repo_id": "langchain", "token_count": 10980 }
327
[tool.poetry] name = "rag-multi-index-router" version = "0.0.1" description = "RAG with routing between different domain-specific retrievers" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" openai = "<2" xmltodict = "^0.13.0" kay = "^0.1.2" wikipedia = "^1.4.0" a...
langchain/templates/rag-multi-index-router/pyproject.toml/0
{ "file_path": "langchain/templates/rag-multi-index-router/pyproject.toml", "repo_id": "langchain", "token_count": 344 }
704
package httpserver import "time" // v2 const ( // --- category --- CollectionCategory = "/collections/" EntityCategory = "/entities/" PartitionCategory = "/partitions/" UserCategory = "/users/" RoleCategory = "/roles/" IndexCategory = "/indexes/" AliasCategory = "/aliases/" ImportJ...
milvus/internal/distributed/proxy/httpserver/constant.go/0
{ "file_path": "milvus/internal/distributed/proxy/httpserver/constant.go", "repo_id": "milvus", "token_count": 1733 }
1,985
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/util/importutil/import_wrapper.go/0
{ "file_path": "milvus/internal/util/importutil/import_wrapper.go", "repo_id": "milvus", "token_count": 8231 }
1,937
from llama_index.readers.microsoft_outlook.base import OutlookLocalCalendarReader __all__ = ["OutlookLocalCalendarReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-outlook/llama_index/readers/microsoft_outlook/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-outlook/llama_index/readers/microsoft_outlook/__init__.py", "repo_id": "llama_index", "token_count": 36 }
1,351
# Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
diffusers/src/diffusers/utils/__init__.py/0
{ "file_path": "diffusers/src/diffusers/utils/__init__.py", "repo_id": "diffusers", "token_count": 1482 }
279
# order by contributions reviewers: - bigsheeper - czs007 - XuanYang-cn approvers: - maintainers
milvus/configs/OWNERS/0
{ "file_path": "milvus/configs/OWNERS", "repo_id": "milvus", "token_count": 38 }
1,621
"""Select examples based on length.""" import re from typing import Callable, Dict, List from langchain_core.example_selectors.base import BaseExampleSelector from langchain_core.prompts.prompt import PromptTemplate from langchain_core.pydantic_v1 import BaseModel, validator def _get_length_based(text: str) -> int: ...
langchain/libs/core/langchain_core/example_selectors/length_based.py/0
{ "file_path": "langchain/libs/core/langchain_core/example_selectors/length_based.py", "repo_id": "langchain", "token_count": 932 }
422
# coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
transformers/tests/models/auto/test_modeling_tf_auto.py/0
{ "file_path": "transformers/tests/models/auto/test_modeling_tf_auto.py", "repo_id": "transformers", "token_count": 5870 }
783
# Auto Merging Retriever Pack This LlamaPack provides an example of our auto-merging retriever. This specific template shows the e2e process of building this. It loads a document, builds a hierarchical node graph (with bigger parent nodes and smaller child nodes). Check out the [notebook here](https://github.com/run...
llama_index/llama-index-packs/llama-index-packs-auto-merging-retriever/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-auto-merging-retriever/README.md", "repo_id": "llama_index", "token_count": 601 }
1,644
# candle-falcon Falcon is a general large language model.
candle/candle-examples/examples/falcon/README.md/0
{ "file_path": "candle/candle-examples/examples/falcon/README.md", "repo_id": "candle", "token_count": 17 }
40
from typing import Any, Dict, List, Optional, Type from langchain_community.document_loaders.base import BaseLoader from langchain_community.embeddings.openai import OpenAIEmbeddings from langchain_community.llms.openai import OpenAI from langchain_community.vectorstores.chroma import Chroma from langchain_core.docume...
langchain/libs/langchain/langchain/indexes/vectorstore.py/0
{ "file_path": "langchain/libs/langchain/langchain/indexes/vectorstore.py", "repo_id": "langchain", "token_count": 1287 }
511
import { test, expect } from "@jest/globals"; import { Document } from "@langchain/core/documents"; import { BaseLLM } from "@langchain/core/language_models/llms"; import { LLMResult } from "@langchain/core/outputs"; import { loadQAMapReduceChain } from "../question_answering/load.js"; import { loadSummarizationChain }...
langchainjs/langchain/src/chains/tests/combine_docs_chain.test.ts/0
{ "file_path": "langchainjs/langchain/src/chains/tests/combine_docs_chain.test.ts", "repo_id": "langchainjs", "token_count": 1036 }
857
<jupyter_start><jupyter_text>Fine Tuning Nous-Hermes-2 With Gradient and LlamaIndex<jupyter_code>%pip install llama-index-llms-gradient %pip install llama-index-finetuning !pip install llama-index gradientai -q import os from llama_index.llms.gradient import GradientBaseModelLLM from llama_index.finetuning import Gradi...
llama_index/docs/examples/finetuning/gradient/gradient_fine_tuning.ipynb/0
{ "file_path": "llama_index/docs/examples/finetuning/gradient/gradient_fine_tuning.ipynb", "repo_id": "llama_index", "token_count": 828 }
1,057
# Supabase Hybrid Search Langchain supports hybrid search with a Supabase Postgres database. The hybrid search combines the postgres `pgvector` extension (similarity search) and Full-Text Search (keyword search) to retrieve documents. You can add documents via SupabaseVectorStore `addDocuments` function. SupabaseHybri...
langchainjs/docs/core_docs/docs/integrations/retrievers/supabase-hybrid.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/retrievers/supabase-hybrid.mdx", "repo_id": "langchainjs", "token_count": 727 }
734
<jupyter_start><jupyter_text>Multi-agent authoritarian speaker selectionThis notebook showcases how to implement a multi-agent simulation where a privileged agent decides who to speak.This follows the polar opposite selection scheme as [multi-agent decentralized speaker selection](https://python.langchain.com/en/latest...
langchain/cookbook/multiagent_authoritarian.ipynb/0
{ "file_path": "langchain/cookbook/multiagent_authoritarian.ipynb", "repo_id": "langchain", "token_count": 6642 }
79
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-remote/llama_index/readers/remote/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-remote/llama_index/readers/remote/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,425
# 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/deit/test_modeling_tf_deit.py/0
{ "file_path": "transformers/tests/models/deit/test_modeling_tf_deit.py", "repo_id": "transformers", "token_count": 4573 }
710
// 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/unittest/test_remote_chunk_manager.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_remote_chunk_manager.cpp", "repo_id": "milvus", "token_count": 4000 }
1,685
# candle-stable-lm StableLM-3B-4E1T is a 3 billion parameter decoder-only language model pre-trained on 1 trillion tokens of diverse English and code datasets for 4 epochs. See the [HuggingFace Hub Model Card](https://huggingface.co/stabilityai/stablelm-3b-4e1t). Note that this model is gated so you will have to requ...
candle/candle-examples/examples/stable-lm/README.md/0
{ "file_path": "candle/candle-examples/examples/stable-lm/README.md", "repo_id": "candle", "token_count": 526 }
48
"""Test functionality related to the docstore objects."""
langchain/libs/community/tests/unit_tests/docstore/__init__.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/docstore/__init__.py", "repo_id": "langchain", "token_count": 12 }
363
import asyncio from typing import Any, Dict, Generator, List, Union import pytest from llama_index.core.schema import ( BaseNode, IndexNode, NodeRelationship, RelatedNodeInfo, TextNode, ) from llama_index.core.vector_stores.types import ( ExactMatchFilter, FilterOperator, MetadataFilter...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/tests/test_postgres.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/tests/test_postgres.py", "repo_id": "llama_index", "token_count": 6646 }
1,672
"""Test Modal API wrapper.""" from langchain_community.llms.modal import Modal def test_modal_call() -> None: """Test valid call to Modal.""" llm = Modal() output = llm("Say foo:") assert isinstance(output, str)
langchain/libs/community/tests/integration_tests/llms/test_modal.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_modal.py", "repo_id": "langchain", "token_count": 86 }
337
// 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/common/CDataType.h/0
{ "file_path": "milvus/internal/core/src/common/CDataType.h", "repo_id": "milvus", "token_count": 548 }
1,652
import gc import unittest from parameterized import parameterized from diffusers import FlaxUNet2DConditionModel from diffusers.utils import is_flax_available from diffusers.utils.testing_utils import load_hf_numpy, require_flax, slow if is_flax_available(): import jax import jax.numpy as jnp @slow @requi...
diffusers/tests/models/unets/test_models_unet_2d_flax.py/0
{ "file_path": "diffusers/tests/models/unets/test_models_unet_2d_flax.py", "repo_id": "diffusers", "token_count": 2141 }
266
<jupyter_start><jupyter_text>The `ObjectIndex` ClassThe `ObjectIndex` class is one that allows for the indexing of arbitrary Python objects. As such, it is quite flexible and applicable to a wide-range of use cases. As examples:- [Use an `ObjectIndex` to index Tool objects to then be used by an agent.](https://docs.lla...
llama_index/docs/examples/objects/object_index.ipynb/0
{ "file_path": "llama_index/docs/examples/objects/object_index.ipynb", "repo_id": "llama_index", "token_count": 1485 }
1,119
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/tuners/loha/model.py/0
{ "file_path": "peft/src/peft/tuners/loha/model.py", "repo_id": "peft", "token_count": 1824 }
332
# coding=utf-8 # Copyright 2021 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/examples/flax/test_flax_examples.py/0
{ "file_path": "transformers/examples/flax/test_flax_examples.py", "repo_id": "transformers", "token_count": 4789 }
542
<!--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/video_classification.md/0
{ "file_path": "transformers/docs/source/ko/tasks/video_classification.md", "repo_id": "transformers", "token_count": 13654 }
508
FROM postgres:latest RUN apt update && \ apt install -y git make gcc postgresql-16-pgvector
llama_index/llama-index-legacy/tests/initialization/postgres/Dockerfile/0
{ "file_path": "llama_index/llama-index-legacy/tests/initialization/postgres/Dockerfile", "repo_id": "llama_index", "token_count": 34 }
1,624
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/storage/chat_store/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/chat_store/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,522
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-redis/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-redis/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,674
import json from langchain_community.chat_message_histories import Neo4jChatMessageHistory from langchain_core.messages import message_to_dict from langchain.memory import ConversationBufferMemory def test_memory_with_message_store() -> None: """Test the memory with a message store.""" # setup MongoDB as a ...
langchain/libs/langchain/tests/integration_tests/memory/test_neo4j.py/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/memory/test_neo4j.py", "repo_id": "langchain", "token_count": 356 }
613
from llama_index.core.tools.tool_spec.base import BaseToolSpec from llama_index.tools.exa import ExaToolSpec def test_class(): names_of_base_classes = [b.__name__ for b in ExaToolSpec.__mro__] assert BaseToolSpec.__name__ in names_of_base_classes
llama_index/llama-index-integrations/tools/llama-index-tools-exa/tests/test_tools_exa.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-exa/tests/test_tools_exa.py", "repo_id": "llama_index", "token_count": 94 }
1,479
# Beautiful Soup >[Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/) is a Python package for parsing > HTML and XML documents (including having malformed markup, i.e. non-closed tags, so named after tag soup). > It creates a parse tree for parsed pages that can be used to extract data from HTML,[3] whi...
langchain/docs/docs/integrations/providers/beautiful_soup.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/beautiful_soup.mdx", "repo_id": "langchain", "token_count": 173 }
130
#[cfg(feature = "accelerate")] extern crate accelerate_src; #[cfg(feature = "mkl")] extern crate intel_mkl_src; use anyhow::Result; use candle_core::{Device, Tensor}; fn main() -> Result<()> { let device = Device::new_cuda(0)?; let in_t = Tensor::rand(-1f32, 1f32, (1, 3, 12, 7), &device)?; let k_t = Tens...
candle/candle-core/examples/cuda_basics.rs/0
{ "file_path": "candle/candle-core/examples/cuda_basics.rs", "repo_id": "candle", "token_count": 463 }
33
import { Document } from "@langchain/core/documents"; import { CallbackManagerForRetrieverRun } from "@langchain/core/callbacks/manager"; import { BaseRetriever, type BaseRetrieverInput, } from "@langchain/core/retrievers"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; /** * Options for the ...
langchainjs/libs/langchain-community/src/retrievers/tavily_search_api.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/retrievers/tavily_search_api.ts", "repo_id": "langchainjs", "token_count": 1626 }
978
from langchain_community.agent_toolkits import __all__ EXPECTED_ALL = [ "AINetworkToolkit", "AmadeusToolkit", "AzureCognitiveServicesToolkit", "ConneryToolkit", "FileManagementToolkit", "GmailToolkit", "JiraToolkit", "JsonToolkit", "MultionToolkit", "NasaToolkit", "NLAToolki...
langchain/libs/community/tests/unit_tests/agent_toolkits/test_imports.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/agent_toolkits/test_imports.py", "repo_id": "langchain", "token_count": 353 }
364
from llama_index.llms.gemini.base import Gemini __all__ = ["Gemini"]
llama_index/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/__init__.py", "repo_id": "llama_index", "token_count": 27 }
1,221
# Writing a custom kernel
candle/candle-book/src/inference/cuda/writing.md/0
{ "file_path": "candle/candle-book/src/inference/cuda/writing.md", "repo_id": "candle", "token_count": 6 }
25
<jupyter_start><jupyter_code># Setup OpenAI Agent import openai openai.api_key = "sk-your-key" from llama_index.agent import OpenAIAgent from llama_index.tools.arxiv.base import ArxivToolSpec arxiv_tool = ArxivToolSpec() agent = OpenAIAgent.from_tools( arxiv_tool.to_tool_list(), verbose=True, ) print(agent....
llama_index/llama-index-integrations/tools/llama-index-tools-arxiv/examples/arxiv.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-arxiv/examples/arxiv.ipynb", "repo_id": "llama_index", "token_count": 506 }
1,471
variable "project_id" { type = string description = "The project id to deploy to" } variable "chroma_release" { description = "The chroma release to deploy" type = string default = "0.4.9" } variable "zone" { type = string default = "us-central1-a" } variable "image" { default ...
chroma/examples/deployments/google-cloud-compute/variables.tf/0
{ "file_path": "chroma/examples/deployments/google-cloud-compute/variables.tf", "repo_id": "chroma", "token_count": 1205 }
40
/* eslint-disable no-process-env */ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { test } from "@jest/globals"; import { NotionAPILoader } from "../web/notionapi.js"; test.skip("Test Notion API Loader Page", async () => { const loader = new NotionAPILoader({ clientOptions: { auth: p...
langchainjs/langchain/src/document_loaders/tests/notionapi.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/tests/notionapi.int.test.ts", "repo_id": "langchainjs", "token_count": 1197 }
972
/* eslint-disable no-process-env */ import { test } from "@jest/globals"; import weaviate from "weaviate-ts-client"; import { Document } from "@langchain/core/documents"; import { OpenAIEmbeddings, OpenAI } from "@langchain/openai"; import { WeaviateStore } from "@langchain/community/vectorstores/weaviate"; import { At...
langchainjs/langchain/src/retrievers/self_query/tests/weaviate_self_query.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/self_query/tests/weaviate_self_query.int.test.ts", "repo_id": "langchainjs", "token_count": 4888 }
945
from llama_index.embeddings.clarifai.base import ClarifaiEmbedding __all__ = ["ClarifaiEmbedding"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-clarifai/llama_index/embeddings/clarifai/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-clarifai/llama_index/embeddings/clarifai/__init__.py", "repo_id": "llama_index", "token_count": 38 }
1,191
# ResNeSt A **ResNeSt** is a variant on a [ResNet](https://paperswithcode.com/method/resnet), which instead stacks [Split-Attention blocks](https://paperswithcode.com/method/split-attention). The cardinal group representations are then concatenated along the channel dimension: \\( V = \text{Concat} \\){\\( V^{1},V^{2}...
pytorch-image-models/hfdocs/source/models/resnest.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/resnest.mdx", "repo_id": "pytorch-image-models", "token_count": 5466 }
363
from typing import List from llama_index.core.extractors import ( KeywordExtractor, QuestionsAnsweredExtractor, SummaryExtractor, TitleExtractor, ) from llama_index.core.ingestion import run_transformations from llama_index.core.node_parser import SentenceSplitter from llama_index.core.schema import Do...
llama_index/llama-index-core/tests/node_parser/metadata_extractor.py/0
{ "file_path": "llama_index/llama-index-core/tests/node_parser/metadata_extractor.py", "repo_id": "llama_index", "token_count": 408 }
1,162
// 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/query/ScalarIndex.h/0
{ "file_path": "milvus/internal/core/src/query/ScalarIndex.h", "repo_id": "milvus", "token_count": 882 }
1,742
import type { DocumentInterface } from "@langchain/core/documents"; import { BaseDocumentTransformer } from "@langchain/core/documents"; import { Callbacks } from "@langchain/core/callbacks/manager"; /** * Base Document Compression class. All compressors should extend this class. */ export abstract class BaseDocumen...
langchainjs/langchain/src/retrievers/document_compressors/index.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/document_compressors/index.ts", "repo_id": "langchainjs", "token_count": 926 }
958
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/config/source_test.go/0
{ "file_path": "milvus/pkg/config/source_test.go", "repo_id": "milvus", "token_count": 629 }
1,891
package paramtable import ( "go.uber.org/zap" "github.com/milvus-io/milvus/pkg/config" "github.com/milvus-io/milvus/pkg/log" ) const hookYamlFile = "hook.yaml" type hookConfig struct { hookBase *BaseTable SoPath ParamItem `refreshable:"false"` SoConfig ParamGroup `refreshable:"true"` } func (h *hookConfi...
milvus/pkg/util/paramtable/hook_config.go/0
{ "file_path": "milvus/pkg/util/paramtable/hook_config.go", "repo_id": "milvus", "token_count": 364 }
2,064
--- sidebar_label: Agent with AWS Lambda hide_table_of_contents: true --- # Agent with AWS Lambda Integration Full docs here: https://docs.aws.amazon.com/lambda/index.html **AWS Lambda** is a serverless computing service provided by Amazon Web Services (AWS), designed to allow developers to build and run application...
langchainjs/docs/core_docs/docs/integrations/tools/lambda_agent.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/tools/lambda_agent.mdx", "repo_id": "langchainjs", "token_count": 840 }
792
# coding=utf-8 # Copyright 2024 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...
diffusers/scripts/change_naming_configs_and_checkpoints.py/0
{ "file_path": "diffusers/scripts/change_naming_configs_and_checkpoints.py", "repo_id": "diffusers", "token_count": 1630 }
224
# SE-ResNeXt **SE ResNeXt** is a variant of a [ResNext](https://www.paperswithcode.com/method/resneXt) that employs [squeeze-and-excitation blocks](https://paperswithcode.com/method/squeeze-and-excitation-block) to enable the network to perform dynamic channel-wise feature recalibration. {% include 'code_snippets.md'...
pytorch-image-models/docs/models/.templates/models/seresnext.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/seresnext.md", "repo_id": "pytorch-image-models", "token_count": 1929 }
340
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/rss_news/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/rss_news/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,445
/* eslint-disable no-process-env */ /* eslint-disable import/no-extraneous-dependencies */ import { test, expect } from "@jest/globals"; import { OpenAIEmbeddings } from "@langchain/openai"; import { Document } from "@langchain/core/documents"; import { SingleStoreVectorStore } from "../singlestore.js"; test.skip("Sin...
langchainjs/libs/langchain-community/src/vectorstores/tests/singlestore.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/singlestore.int.test.ts", "repo_id": "langchainjs", "token_count": 2151 }
1,021
# coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
transformers/tests/models/mobilebert/test_modeling_tf_mobilebert.py/0
{ "file_path": "transformers/tests/models/mobilebert/test_modeling_tf_mobilebert.py", "repo_id": "transformers", "token_count": 7017 }
775
from langchain_community.chat_models.ollama import ( ChatOllama, ) __all__ = ["ChatOllama"]
langchain/libs/langchain/langchain/chat_models/ollama.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/ollama.py", "repo_id": "langchain", "token_count": 38 }
472
## 🔑 KeywordTableIndex KeywordTableIndex is a keyword-based table data structure (inspired by "hash tables"). ### Index Construction During index construction, KeywordTableIndex first takes in a dataset of text documents as input, and chunks them up into smaller document chunks. For each text chunk, KeywordTableInd...
llama_index/llama-index-core/llama_index/core/indices/keyword_table/README.md/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/keyword_table/README.md", "repo_id": "llama_index", "token_count": 591 }
1,262
"""Chat prompt template.""" from __future__ import annotations from abc import ABC, abstractmethod from pathlib import Path from typing import ( Any, Dict, List, Optional, Sequence, Set, Tuple, Type, TypedDict, TypeVar, Union, cast, overload, ) from langchain_core....
langchain/libs/core/langchain_core/prompts/chat.py/0
{ "file_path": "langchain/libs/core/langchain_core/prompts/chat.py", "repo_id": "langchain", "token_count": 14344 }
435
import os from typing import Union import pytest from vcr.request import Request # Those environment variables turn on Deep Lake pytest mode. # It significantly makes tests run much faster. # Need to run before `import deeplake` os.environ["BUGGER_OFF"] = "true" os.environ["DEEPLAKE_DOWNLOAD_PATH"] = "./testing/local...
langchain/libs/community/tests/integration_tests/vectorstores/conftest.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/conftest.py", "repo_id": "langchain", "token_count": 583 }
352
import { TogetherAI } from "@langchain/community/llms/togetherai"; import { PromptTemplate } from "@langchain/core/prompts"; const model = new TogetherAI({ modelName: "mistralai/Mixtral-8x7B-Instruct-v0.1", }); const prompt = PromptTemplate.fromTemplate(`System: You are a helpful assistant. User: {input}. Assistant:...
langchainjs/examples/src/models/llm/togetherai.ts/0
{ "file_path": "langchainjs/examples/src/models/llm/togetherai.ts", "repo_id": "langchainjs", "token_count": 180 }
856
from langchain_community.utilities.apify import ApifyWrapper __all__ = ["ApifyWrapper"]
langchain/libs/langchain/langchain/utilities/apify.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/apify.py", "repo_id": "langchain", "token_count": 29 }
560
#ifndef CRTP_HPP #define CRTP_HPP namespace fluent { template <typename T, template <typename> class crtpType> struct crtp { constexpr T& underlying() { return static_cast<T&>(*this); } constexpr T const& underlying() const { return static_cast<T const&>(*this); } }; } // name...
milvus/internal/core/thirdparty/NamedType/crtp.hpp/0
{ "file_path": "milvus/internal/core/thirdparty/NamedType/crtp.hpp", "repo_id": "milvus", "token_count": 144 }
1,677
""" A script creating a RAG checkpoint from a generator and a question encoder checkpoints. """ import argparse from pathlib import Path from transformers import AutoConfig, AutoTokenizer, RagConfig, RagSequenceForGeneration, RagTokenForGeneration def consolidate( model_type, generator_name_or_path: str, ...
transformers/examples/research_projects/rag/consolidate_rag_checkpoint.py/0
{ "file_path": "transformers/examples/research_projects/rag/consolidate_rag_checkpoint.py", "repo_id": "transformers", "token_count": 1425 }
534
# LlamaIndex Readers Integration: Chroma
llama_index/llama-index-integrations/readers/llama-index-readers-chroma/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-chroma/README.md", "repo_id": "llama_index", "token_count": 10 }
1,346
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/training/unconditional_training.md/0
{ "file_path": "diffusers/docs/source/en/training/unconditional_training.md", "repo_id": "diffusers", "token_count": 2949 }
185
# 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/hubconf.py/0
{ "file_path": "transformers/hubconf.py", "repo_id": "transformers", "token_count": 3186 }
564
# coding=utf-8 # Copyright 2019 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/utils/test_modeling_tf_core.py/0
{ "file_path": "transformers/tests/utils/test_modeling_tf_core.py", "repo_id": "transformers", "token_count": 9190 }
774
"""Base vector store index query.""" from typing import Any, Dict, List, Optional from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.constants import DEFAULT_SIMILARITY_TOP_K from llama_index.legacy.core.base_retriever import BaseRetriever from llama_index.legacy.data_structs.data_s...
llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/retriever.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/retriever.py", "repo_id": "llama_index", "token_count": 3281 }
1,580
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/agent/react/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/agent/react/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,637
from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.core.embeddings.mock_embed_model import MockEmbedding from llama_index.core.embeddings.multi_modal_base import MultiModalEmbedding from llama_index.core.embeddings.pooling import Pooling from llama_index.core.embeddings.utils import resolv...
llama_index/llama-index-core/llama_index/core/embeddings/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/embeddings/__init__.py", "repo_id": "llama_index", "token_count": 171 }
1,120
# 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/mra/convert_mra_pytorch_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/mra/convert_mra_pytorch_to_pytorch.py", "repo_id": "transformers", "token_count": 1719 }
645
{ "name": "azure-blob-storage", "version-string": "1.0.0", "dependencies": [ "azure-identity-cpp", "azure-storage-blobs-cpp", "gtest" ] }
milvus/internal/core/src/storage/azure-blob-storage/vcpkg.json/0
{ "file_path": "milvus/internal/core/src/storage/azure-blob-storage/vcpkg.json", "repo_id": "milvus", "token_count": 78 }
1,946
from langchain_community.document_loaders.rst import UnstructuredRSTLoader __all__ = ["UnstructuredRSTLoader"]
langchain/libs/langchain/langchain/document_loaders/rst.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/rst.py", "repo_id": "langchain", "token_count": 35 }
524
# Copyright 2022 The HuggingFace Team, the AllenNLP library authors. 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 # ...
accelerate/utils/stale.py/0
{ "file_path": "accelerate/utils/stale.py", "repo_id": "accelerate", "token_count": 1012 }
18
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/llms/llama-index-llms-neutrino/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-neutrino/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,234
import { useEffect, useMemo, useState } from "react"; import { Message } from "./useChatList"; import { StreamState } from "./useStreamState"; async function getMessages(threadId: string) { const { messages, resumeable } = await fetch( `/threads/${threadId}/messages`, { headers: { Accept: "appl...
opengpts/frontend/src/hooks/useChatMessages.ts/0
{ "file_path": "opengpts/frontend/src/hooks/useChatMessages.ts", "repo_id": "opengpts", "token_count": 692 }
2,023
import json import urllib.request from typing import List from langchain_core.documents import Document from langchain_core.utils import stringify_dict from langchain_community.document_loaders.base import BaseLoader SPREEDLY_ENDPOINTS = { "gateways_options": "https://core.spreedly.com/v1/gateways_options.json",...
langchain/libs/community/langchain_community/document_loaders/spreedly.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/spreedly.py", "repo_id": "langchain", "token_count": 816 }
262
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "tools/wolframalpha", }); export * from "@langchain/community/tools/wolframalpha";
langchainjs/langchain/src/tools/wolframalpha.ts/0
{ "file_path": "langchainjs/langchain/src/tools/wolframalpha.ts", "repo_id": "langchainjs", "token_count": 72 }
959
# Copyright 2021 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/models/deit/__init__.py/0
{ "file_path": "transformers/src/transformers/models/deit/__init__.py", "repo_id": "transformers", "token_count": 1438 }
620
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/add_new_pipeline.md/0
{ "file_path": "transformers/docs/source/en/add_new_pipeline.md", "repo_id": "transformers", "token_count": 3395 }
472