text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
// Code generated by mockery v2.32.4. DO NOT EDIT. package mocks import ( context "context" commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" grpc "google.golang.org/grpc" internalpb "github.com/milvus-io/milvus/internal/proto/internalpb" milvuspb "github.com/milvus-io/milvus-proto/go-api/v2/mi...
milvus/internal/mocks/mock_rootcoord_client.go/0
{ "file_path": "milvus/internal/mocks/mock_rootcoord_client.go", "repo_id": "milvus", "token_count": 51239 }
1,814
// 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/datacoord/kv_catalog.go/0
{ "file_path": "milvus/internal/metastore/kv/datacoord/kv_catalog.go", "repo_id": "milvus", "token_count": 8271 }
1,797
# coding=utf-8 # Copyright 2022 The OpenAI Authors and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/L...
transformers/src/transformers/models/whisper/modeling_whisper.py/0
{ "file_path": "transformers/src/transformers/models/whisper/modeling_whisper.py", "repo_id": "transformers", "token_count": 45504 }
718
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/big_models.md/0
{ "file_path": "transformers/docs/source/en/big_models.md", "repo_id": "transformers", "token_count": 1718 }
478
CREATE TABLE table1 ( name TEXT PRIMARY KEY );
chroma/chromadb/test/db/migrations/00001-migration-1.psql.sql/0
{ "file_path": "chroma/chromadb/test/db/migrations/00001-migration-1.psql.sql", "repo_id": "chroma", "token_count": 19 }
22
# 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/funnel/__init__.py/0
{ "file_path": "transformers/src/transformers/models/funnel/__init__.py", "repo_id": "transformers", "token_count": 1742 }
606
package lifetime import ( "testing" "github.com/stretchr/testify/suite" "github.com/milvus-io/milvus/pkg/util/typeutil" ) type SafeChanSuite struct { suite.Suite } func (s *SafeChanSuite) TestClose() { sc := NewSafeChan() s.False(sc.IsClosed(), "IsClosed() shall return false before Close()") s.False(typeut...
milvus/pkg/util/lifetime/safe_chan_test.go/0
{ "file_path": "milvus/pkg/util/lifetime/safe_chan_test.go", "repo_id": "milvus", "token_count": 367 }
2,060
# LlamaIndex Readers Integration: Dashvector
llama_index/llama-index-integrations/readers/llama-index-readers-dashvector/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-dashvector/README.md", "repo_id": "llama_index", "token_count": 10 }
1,348
import { test } from "@jest/globals"; import { GithubRepoLoader } from "../web/github.js"; test("Test GithubRepoLoader", async () => { const loader = new GithubRepoLoader( "https://github.com/langchain-ai/langchainjs", { branch: "main", recursive: false, unknown: "warn" } ); const documents = await loade...
langchainjs/langchain/src/document_loaders/tests/github.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/tests/github.int.test.ts", "repo_id": "langchainjs", "token_count": 1352 }
866
# PDF Table Loader This loader reads the tables included in the PDF. Users can input the PDF `file` and the `pages` from which they want to extract tables, and they can read the tables included on those pages. ## Usage Here's an example usage of the PDFTableReader. `pages` parameter is the same as camelot's `pages`...
llama_index/llama-index-integrations/readers/llama-index-readers-pdf-table/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-pdf-table/README.md", "repo_id": "llama_index", "token_count": 265 }
1,365
<jupyter_start><jupyter_text>USearch>[USearch](https://unum-cloud.github.io/usearch/) is a Smaller & Faster Single-File Vector Search Engine>USearch's base functionality is identical to FAISS, and the interface should look familiar if you have ever investigated Approximate Nearest Neigbors search. FAISS is a widely rec...
langchain/docs/docs/integrations/vectorstores/usearch.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/usearch.ipynb", "repo_id": "langchain", "token_count": 748 }
193
from langchain_core.callbacks.base import ( AsyncCallbackHandler, BaseCallbackHandler, BaseCallbackManager, CallbackManagerMixin, Callbacks, ChainManagerMixin, LLMManagerMixin, RetrieverManagerMixin, RunManagerMixin, ToolManagerMixin, ) from langchain_core.callbacks.manager impor...
langchain/libs/core/langchain_core/callbacks/__init__.py/0
{ "file_path": "langchain/libs/core/langchain_core/callbacks/__init__.py", "repo_id": "langchain", "token_count": 654 }
410
"""Google Jobs API Toolkit.""" from langchain_community.tools.google_jobs.tool import GoogleJobsQueryRun __all__ = ["GoogleJobsQueryRun"]
langchain/libs/langchain/langchain/tools/google_jobs/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/google_jobs/__init__.py", "repo_id": "langchain", "token_count": 43 }
579
from typing import List, Optional, Sequence, Tuple, Union, cast from uuid import UUID from overrides import overrides from chromadb.config import DEFAULT_DATABASE, DEFAULT_TENANT, System from chromadb.db.base import NotFoundError, UniqueConstraintError from chromadb.db.system import SysDB from chromadb.proto.convert im...
chroma/chromadb/db/impl/grpc/client.py/0
{ "file_path": "chroma/chromadb/db/impl/grpc/client.py", "repo_id": "chroma", "token_count": 4416 }
15
import pytest from time import sleep from collections import defaultdict from pymilvus import connections from chaos.checker import (InsertChecker, UpsertChecker, FlushChecker, SearchChecker, QueryChecker, ...
milvus/tests/python_client/chaos/testcases/test_verify_all_collections.py/0
{ "file_path": "milvus/tests/python_client/chaos/testcases/test_verify_all_collections.py", "repo_id": "milvus", "token_count": 1753 }
2,176
import { expect, test } from "@jest/globals"; import { AIMessage, BaseMessageLike, HumanMessage, MessageContentComplex, MessageContentText, SystemMessage, } from "@langchain/core/messages"; import { ChatGoogleBase, ChatGoogleBaseInput } from "../chat_models.js"; import { authOptions, MockClient, MockClientA...
langchainjs/libs/langchain-google-common/src/tests/chat_models.test.ts/0
{ "file_path": "langchainjs/libs/langchain-google-common/src/tests/chat_models.test.ts", "repo_id": "langchainjs", "token_count": 2804 }
1,025
python_tests()
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-uptrain/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-uptrain/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,172
<jupyter_start><jupyter_text>Run TemplateIn `server.py`, set -```add_routes(app, chain_rag_conv, path="/rag-chroma-multi-modal-multi-vector")```<jupyter_code>from langserve.client import RemoteRunnable rag_app = RemoteRunnable("http://localhost:8001/rag-chroma-multi-modal-multi-vector") rag_app.invoke("What is the pro...
langchain/templates/rag-chroma-multi-modal-multi-vector/rag_chroma_multi_modal_multi_vector.ipynb/0
{ "file_path": "langchain/templates/rag-chroma-multi-modal-multi-vector/rag_chroma_multi_modal_multi_vector.ipynb", "repo_id": "langchain", "token_count": 146 }
658
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-myscale/llama_index/readers/myscale/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-myscale/llama_index/readers/myscale/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,407
"""Test Graph Database Chain.""" from typing import Any from langchain_community.graphs import ArangoGraph from langchain_community.graphs.arangodb_graph import get_arangodb_client from langchain_community.llms.openai import OpenAI from langchain.chains.graph_qa.arangodb import ArangoGraphQAChain def populate_arang...
langchain/libs/langchain/tests/integration_tests/chains/test_graph_database_arangodb.py/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/chains/test_graph_database_arangodb.py", "repo_id": "langchain", "token_count": 1162 }
611
# coding=utf-8 # Copyright 2020 The HuggingFace Inc. team, The Microsoft Research team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
transformers/tests/models/prophetnet/test_modeling_prophetnet.py/0
{ "file_path": "transformers/tests/models/prophetnet/test_modeling_prophetnet.py", "repo_id": "transformers", "token_count": 25713 }
729
from typing import Dict, Tuple from langchain.chains.query_constructor.ir import ( Comparator, Comparison, Operation, Operator, StructuredQuery, ) from langchain.retrievers.self_query.pinecone import PineconeTranslator DEFAULT_TRANSLATOR = PineconeTranslator() def test_visit_comparison() -> None...
langchain/libs/langchain/tests/unit_tests/retrievers/self_query/test_pinecone.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/retrievers/self_query/test_pinecone.py", "repo_id": "langchain", "token_count": 907 }
647
# 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/lora/model.py/0
{ "file_path": "peft/src/peft/tuners/lora/model.py", "repo_id": "peft", "token_count": 14496 }
325
--- - name: Install Docker Dependencies yum: name={{ item }} state=latest update_cache=yes with_items: - yum-utils - device-mapper-persistent-data - lvm2 when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' - name: Add Docker Yum Repo get_url: url: https...
milvus/deployments/docker/cluster-distributed-deployment/roles/docker-installation/tasks/main.yml/0
{ "file_path": "milvus/deployments/docker/cluster-distributed-deployment/roles/docker-installation/tasks/main.yml", "repo_id": "milvus", "token_count": 668 }
1,638
# BagelDB > [BagelDB](https://www.bageldb.ai/) (`Open Vector Database for AI`), is like GitHub for AI data. It is a collaborative platform where users can create, share, and manage vector datasets. It can support private projects for independent developers, internal collaborations for enterprises, and public contribut...
langchain/docs/docs/integrations/providers/bageldb.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/bageldb.mdx", "repo_id": "langchain", "token_count": 151 }
138
# Glossary [[glossary]] This is a community-created glossary. Contributions are welcomed! ### Agent An agent learns to **make decisions by trial and error, with rewards and punishments from the surroundings**. ### Environment An environment is a simulated world **where an agent can learn by interacting with it**. ...
deep-rl-class/units/en/unit1/glossary.mdx/0
{ "file_path": "deep-rl-class/units/en/unit1/glossary.mdx", "repo_id": "deep-rl-class", "token_count": 775 }
150
"""Test `Javelin AI Gateway` chat models""" import pytest from langchain_core.pydantic_v1 import SecretStr from langchain_community.chat_models import ChatJavelinAIGateway @pytest.mark.requires("javelin_sdk") def test_api_key_is_secret_string() -> None: llm = ChatJavelinAIGateway( gateway_uri="<javelin-...
langchain/libs/community/tests/unit_tests/chat_models/test_javelin_ai_gateway.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/chat_models/test_javelin_ai_gateway.py", "repo_id": "langchain", "token_count": 472 }
394
<!--- 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 ...
transformers/examples/flax/language-modeling/README.md/0
{ "file_path": "transformers/examples/flax/language-modeling/README.md", "repo_id": "transformers", "token_count": 6820 }
537
"""MyScale reader.""" import logging from typing import Any, List, Optional from llama_index.legacy.readers.base import BaseReader from llama_index.legacy.schema import Document logger = logging.getLogger(__name__) def escape_str(value: str) -> str: BS = "\\" must_escape = (BS, "'") return ( ""...
llama_index/llama-index-legacy/llama_index/legacy/readers/myscale.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/myscale.py", "repo_id": "llama_index", "token_count": 2492 }
1,636
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { Document } from "@langchain/core/documents"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import axiosMod, { AxiosRequestConfig, AxiosStatic } from "axios"; import * as cheerio from "cheerio"; impo...
langchainjs/langchain/src/tools/webbrowser.ts/0
{ "file_path": "langchainjs/langchain/src/tools/webbrowser.ts", "repo_id": "langchainjs", "token_count": 3055 }
997
import pg, { PoolConfig, Pool } from "pg"; import { ListKeyOptions, RecordManagerInterface, UpdateOptions, } from "./base.js"; export type PostgresRecordManagerOptions = { postgresConnectionOptions: PoolConfig; tableName?: string; }; export class PostgresRecordManager implements RecordManagerInterface { l...
langchainjs/libs/langchain-community/src/indexes/postgres.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/indexes/postgres.ts", "repo_id": "langchainjs", "token_count": 2128 }
999
# Neo4j This page covers how to use the Neo4j ecosystem within LangChain. What is Neo4j? **Neo4j in a nutshell:** - Neo4j is an open-source database management system that specializes in graph database technology. - Neo4j allows you to represent and store data in nodes and edges, making it ideal for handling connec...
langchain/docs/docs/integrations/providers/neo4j.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/neo4j.mdx", "repo_id": "langchain", "token_count": 603 }
154
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import type { ToolInterface } from "@langchain/core/tools"; import { Toolkit } from "@langchain/community/agents/toolkits/base"; import { renderTemplate } from "@langchain/core/prompts"; import { InfoSqlTool, ListTablesSqlTool, ...
langchainjs/langchain/src/agents/toolkits/sql/sql.ts/0
{ "file_path": "langchainjs/langchain/src/agents/toolkits/sql/sql.ts", "repo_id": "langchainjs", "token_count": 881 }
920
// 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/mq/msgdispatcher/client.go/0
{ "file_path": "milvus/pkg/mq/msgdispatcher/client.go", "repo_id": "milvus", "token_count": 1248 }
1,917
# De-detoxifying language models To run this code, do the following: ```shell ACCELERATE_LOG_LEVEL=info accelerate launch --config_file {CONFIG} examples/research_projects/toxicity/scripts/gpt-j-6b-toxicity.py --log_with wandb ```
trl/examples/research_projects/toxicity/README.md/0
{ "file_path": "trl/examples/research_projects/toxicity/README.md", "repo_id": "trl", "token_count": 79 }
869
use yew_agent::PublicWorker; fn main() { console_error_panic_hook::set_once(); candle_wasm_example_llama2::Worker::register(); }
candle/candle-wasm-examples/llama2-c/src/bin/worker.rs/0
{ "file_path": "candle/candle-wasm-examples/llama2-c/src/bin/worker.rs", "repo_id": "candle", "token_count": 54 }
88
# coding=utf-8 # Copyright 2022 Apple Inc. and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
transformers/src/transformers/models/mobilevit/modeling_tf_mobilevit.py/0
{ "file_path": "transformers/src/transformers/models/mobilevit/modeling_tf_mobilevit.py", "repo_id": "transformers", "token_count": 24329 }
643
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; const pythonCode = `def hello_world(): print("Hello, World!") # Call the function hello_world()`; const splitter = RecursiveCharacterTextSplitter.fromLanguage("python", { chunkSize: 32, chunkOverlap: 0, }); const pythonOutput = await spl...
langchainjs/examples/src/indexes/python_text_splitter.ts/0
{ "file_path": "langchainjs/examples/src/indexes/python_text_splitter.ts", "repo_id": "langchainjs", "token_count": 293 }
782
#!/usr/bin/env python3 # coding=utf-8 # Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
peft/tests/test_custom_models.py/0
{ "file_path": "peft/tests/test_custom_models.py", "repo_id": "peft", "token_count": 35761 }
310
# 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...
datasets/utils/release.py/0
{ "file_path": "datasets/utils/release.py", "repo_id": "datasets", "token_count": 1359 }
171
import gc import random import tempfile import unittest import numpy as np import torch from transformers import ( CLIPImageProcessor, CLIPVisionConfig, CLIPVisionModelWithProjection, ) import diffusers from diffusers import ( AutoencoderKLTemporalDecoder, EulerDiscreteScheduler, StableVideoDi...
diffusers/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py/0
{ "file_path": "diffusers/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py", "repo_id": "diffusers", "token_count": 9422 }
294
import { OpenAIEmbeddings } from "@langchain/openai"; const model = new OpenAIEmbeddings(); const res = await model.embedQuery( "What would be a good company name a company that makes colorful socks?" ); console.log({ res });
langchainjs/examples/src/embeddings/openai.ts/0
{ "file_path": "langchainjs/examples/src/embeddings/openai.ts", "repo_id": "langchainjs", "token_count": 67 }
771
search_performance: collections: - milvus: db_config.primary_path: /test/milvus/db_data_011/sift_1b_128_l2_sq8 cache_config.cpu_cache_capacity: 150GB engine_config.use_blas_threshold: 0 engine_config.gpu_search_threshold: 200 gpu_resource_config.enable: true g...
milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search.yaml", "repo_id": "milvus", "token_count": 4088 }
1,943
python_tests( skip_tests=True, )
llama_index/llama-index-cli/tests/BUILD/0
{ "file_path": "llama_index/llama-index-cli/tests/BUILD", "repo_id": "llama_index", "token_count": 17 }
1,159
"""Faiss Vector store index. An index that is built on top of an existing vector store. """ import logging import os from typing import Any, List, Optional, cast import fsspec import numpy as np from fsspec.implementations.local import LocalFileSystem from llama_index.core.bridge.pydantic import PrivateAttr from ll...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-faiss/llama_index/vector_stores/faiss/base.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-faiss/llama_index/vector_stores/faiss/base.py", "repo_id": "llama_index", "token_count": 2725 }
1,517
<jupyter_start><jupyter_text>If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers as well as some other libraries. Uncomment the following cell and run it.<jupyter_code># Install !pip install -q biopython transformers datasets huggingface_hub accelerate peft<jupyter_output> ...
notebooks/examples/nucleotide_transformer_dna_sequence_modelling_with_peft.ipynb/0
{ "file_path": "notebooks/examples/nucleotide_transformer_dna_sequence_modelling_with_peft.ipynb", "repo_id": "notebooks", "token_count": 8292 }
306
// 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/storage/LocalChunkManager.h/0
{ "file_path": "milvus/internal/core/src/storage/LocalChunkManager.h", "repo_id": "milvus", "token_count": 1280 }
1,665
import { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput, } from "./transform.js"; import { Operation, compare } from "../utils/json_patch.js"; import { sax } from "../utils/sax-js/sax.js"; import { ChatGeneration, Generation } from "../outputs.js"; export const XML_FORMAT_INSTRUCTION...
langchainjs/langchain-core/src/output_parsers/xml.ts/0
{ "file_path": "langchainjs/langchain-core/src/output_parsers/xml.ts", "repo_id": "langchainjs", "token_count": 1824 }
828
import * as uuid from "uuid"; import { Document } from "@langchain/core/documents"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; import { VectorStore } from "@langchain/core/vectorstores"; import { BaseCallbackConfig, Call...
langchainjs/libs/langchain-community/src/vectorstores/vectara.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/vectara.ts", "repo_id": "langchainjs", "token_count": 7539 }
1,003
#!/usr/bin/env python # 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 # # U...
accelerate/examples/by_feature/megatron_lm_gpt_pretraining.py/0
{ "file_path": "accelerate/examples/by_feature/megatron_lm_gpt_pretraining.py", "repo_id": "accelerate", "token_count": 12432 }
8
from abc import ABC from typing import Any, Dict, Optional, Tuple from langchain_community.chat_message_histories.in_memory import ChatMessageHistory from langchain_core.chat_history import BaseChatMessageHistory from langchain_core.memory import BaseMemory from langchain_core.messages import AIMessage, HumanMessage f...
langchain/libs/langchain/langchain/memory/chat_memory.py/0
{ "file_path": "langchain/libs/langchain/langchain/memory/chat_memory.py", "repo_id": "langchain", "token_count": 883 }
546
from langchain_community.utilities.zapier import ZapierNLAWrapper __all__ = ["ZapierNLAWrapper"]
langchain/libs/langchain/langchain/utilities/zapier.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/zapier.py", "repo_id": "langchain", "token_count": 35 }
579
"""Vector-store based data structures.""" from llama_index.legacy.indices.vector_store.base import ( GPTVectorStoreIndex, VectorStoreIndex, ) from llama_index.legacy.indices.vector_store.retrievers import ( VectorIndexAutoRetriever, VectorIndexRetriever, ) __all__ = [ "VectorStoreIndex", "Vect...
llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/__init__.py", "repo_id": "llama_index", "token_count": 154 }
1,607
--- sidebar_label: Retrieval sidebar_position: 1 sidebar_class_name: hidden --- # Retrieval Many LLM applications require user-specific data that is not part of the model's training set. The primary way of accomplishing this is through Retrieval Augmented Generation (RAG). In this process, external data is _retrieved...
langchainjs/docs/core_docs/docs/modules/data_connection/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/index.mdx", "repo_id": "langchainjs", "token_count": 864 }
757
<jupyter_start><jupyter_text>Connect to templateIn `server.py`, set -```add_routes(app, chain_ext, path="/rag_singlestore")```<jupyter_code>from langserve.client import RemoteRunnable rag_app_singlestore = RemoteRunnable("http://0.0.0.0:8001/rag_singlestore") rag_app_singlestore.invoke("How does agent memory work?")<j...
langchain/templates/rag-singlestoredb/rag_singlestoredb.ipynb/0
{ "file_path": "langchain/templates/rag-singlestoredb/rag_singlestoredb.ipynb", "repo_id": "langchain", "token_count": 133 }
668
// 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_reduce.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_reduce.cpp", "repo_id": "milvus", "token_count": 2549 }
1,904
# coding=utf-8 # Copyright 2020 The Facebook AI Research Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
transformers/src/transformers/models/fsmt/modeling_fsmt.py/0
{ "file_path": "transformers/src/transformers/models/fsmt/modeling_fsmt.py", "repo_id": "transformers", "token_count": 25668 }
636
# Introduction to 🤗 Diffusers <CourseFloatingBanner unit={1} classNames="absolute z-10 right-0 top-0" notebooks={[ {label: "Introduction to Diffusers", value: "https://colab.research.google.com/github/huggingface/diffusion-models-class/blob/main/units/en/unit1/introduction_to_diffusers.ipynb"}, {label: "I...
diffusion-models-class/units/en/unit1/2.mdx/0
{ "file_path": "diffusion-models-class/units/en/unit1/2.mdx", "repo_id": "diffusion-models-class", "token_count": 8144 }
294
# 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/detr/__init__.py/0
{ "file_path": "transformers/src/transformers/models/detr/__init__.py", "repo_id": "transformers", "token_count": 915 }
650
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/rootcoord/dml_channels_test.go/0
{ "file_path": "milvus/internal/rootcoord/dml_channels_test.go", "repo_id": "milvus", "token_count": 3653 }
1,783
import csv from io import TextIOWrapper from typing import Any, Dict, List, Optional, Sequence from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.document_loaders.helpers import detect_file_encodings from langchain_community.document...
langchain/libs/community/langchain_community/document_loaders/csv_loader.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/csv_loader.py", "repo_id": "langchain", "token_count": 2594 }
253
import pytest import torch from copy import copy from transformers import AutoTokenizer from text_generation_server.pb import generate_pb2 from text_generation_server.models.causal_lm import CausalLM, CausalLMBatch @pytest.fixture(scope="session") def default_causal_lm(): return CausalLM("gpt2") @pytest.fixtu...
text-generation-inference/server/tests/models/test_causal_lm.py/0
{ "file_path": "text-generation-inference/server/tests/models/test_causal_lm.py", "repo_id": "text-generation-inference", "token_count": 5345 }
419
# Zilliz >[Zilliz Cloud](https://zilliz.com/doc/quick_start) is a fully managed service on cloud for `LF AI Milvus®`, ## Installation and Setup Install the Python SDK: ```bash pip install pymilvus ``` ## Vectorstore A wrapper around Zilliz indexes allows you to use it as a vectorstore, whether for semantic search...
langchain/docs/docs/integrations/providers/zilliz.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/zilliz.mdx", "repo_id": "langchain", "token_count": 160 }
155
# coding=utf-8 # Copyright 2023 Meta AI, EleutherAI and the HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX # and OPT implementations in this library. It has been modified from its # original forms to accommodate minor architectural differences compar...
transformers/src/transformers/models/llama/modeling_flax_llama.py/0
{ "file_path": "transformers/src/transformers/models/llama/modeling_flax_llama.py", "repo_id": "transformers", "token_count": 12889 }
691
"""Test MyScale indexes.""" from typing import List, cast import pytest from llama_index.legacy.indices.vector_store.base import VectorStoreIndex from llama_index.legacy.storage.storage_context import StorageContext try: import clickhouse_connect except ImportError: clickhouse_connect = None # type: ignore ...
llama_index/llama-index-legacy/tests/indices/vector_store/test_myscale.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/vector_store/test_myscale.py", "repo_id": "llama_index", "token_count": 1549 }
1,624
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/mluke/convert_mluke_original_pytorch_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/mluke/convert_mluke_original_pytorch_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 4002 }
694
# Hazy Research This page covers how to use the Hazy Research ecosystem within LangChain. It is broken into two parts: installation and setup, and then references to specific Hazy Research wrappers. ## Installation and Setup - To use the `manifest`, install it with `pip install manifest-ml` ## Wrappers ### LLM The...
langchain/docs/docs/integrations/providers/hazy_research.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/hazy_research.mdx", "repo_id": "langchain", "token_count": 160 }
148
"""Wrapper around Epsilla vector database.""" from __future__ import annotations import logging import uuid from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Type from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstores import Vecto...
langchain/libs/community/langchain_community/vectorstores/epsilla.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/epsilla.py", "repo_id": "langchain", "token_count": 6631 }
325
import enum import inspect import warnings from functools import wraps from typing import Callable, Optional from .logging import get_logger _emitted_deprecation_warnings = set() logger = get_logger(__name__) def deprecated(help_message: Optional[str] = None): """Decorator to mark a class or a function as depr...
datasets/src/datasets/utils/deprecation_utils.py/0
{ "file_path": "datasets/src/datasets/utils/deprecation_utils.py", "repo_id": "datasets", "token_count": 1426 }
149
import importlib import shutil import textwrap import pytest from datasets import ClassLabel, DownloadManager, Features, Value from datasets.data_files import DataFilesDict, get_data_patterns from datasets.download.streaming_download_manager import StreamingDownloadManager from datasets.packaged_modules.folder_based_...
datasets/tests/packaged_modules/test_folder_based_builder.py/0
{ "file_path": "datasets/tests/packaged_modules/test_folder_based_builder.py", "repo_id": "datasets", "token_count": 8915 }
147
# Semantic Chunking Llama Pack This LlamaPack implements the semantic chunking algorithm first proposed by Greg Kamradt in his [Five Levels of Text Splitting](https://github.com/FullStackRetrieval-com/RetrievalTutorials/blob/main/5_Levels_Of_Text_Splitting.ipynb) tutorial. How it works: - Split text into sentences. ...
llama_index/llama-index-packs/llama-index-packs-node-parser-semantic-chunking/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-node-parser-semantic-chunking/README.md", "repo_id": "llama_index", "token_count": 334 }
1,683
// 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/event_manager_test.go/0
{ "file_path": "milvus/internal/datanode/event_manager_test.go", "repo_id": "milvus", "token_count": 5954 }
1,801
#!/usr/bin/env python # 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/L...
transformers/src/transformers/tools/image_captioning.py/0
{ "file_path": "transformers/src/transformers/tools/image_captioning.py", "repo_id": "transformers", "token_count": 564 }
783
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-azureaisearch/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-azureaisearch/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,508
--- hide_table_of_contents: true --- import CodeBlock from "@theme/CodeBlock"; # Firestore Chat Memory For longer-term persistence across chat sessions, you can swap out the default in-memory `chatHistory` that backs chat memory classes like `BufferMemory` for a firestore. ## Setup First, install the Firebase admi...
langchainjs/docs/core_docs/docs/integrations/chat_memory/firestore.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat_memory/firestore.mdx", "repo_id": "langchainjs", "token_count": 922 }
755
# pip install openrlbenchmark==0.2.1a5 # see https://github.com/openrlbenchmark/openrlbenchmark#get-started for documentation echo "we deal with $TAGS_STRING" python -m openrlbenchmark.rlops_multi_metrics \ --filters '?we=huggingface&wpn=trl&xaxis=_step&ceik=trl_ppo_trainer_config.value.reward_model&cen=trl_ppo_tr...
trl/benchmark/benchmark_level2_plot.sh/0
{ "file_path": "trl/benchmark/benchmark_level2_plot.sh", "repo_id": "trl", "token_count": 632 }
804
# 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/tests/models/chinese_clip/test_image_processing_chinese_clip.py/0
{ "file_path": "transformers/tests/models/chinese_clip/test_image_processing_chinese_clip.py", "repo_id": "transformers", "token_count": 2634 }
711
python_sources()
llama_index/llama-index-packs/llama-index-packs-llama-dataset-metadata/llama_index/packs/llama_dataset_metadata/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-llama-dataset-metadata/llama_index/packs/llama_dataset_metadata/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,572
python_sources()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lantern/llama_index/vector_stores/lantern/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lantern/llama_index/vector_stores/lantern/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,526
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querynodev2/segments/result.go/0
{ "file_path": "milvus/internal/querynodev2/segments/result.go", "repo_id": "milvus", "token_count": 5704 }
1,912
# coding=utf-8 # Copyright 2024 Harutatsu Akiyama and 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 b...
diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_instruction_pix2pix.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_instruction_pix2pix.py", "repo_id": "diffusers", "token_count": 3114 }
288
import time import pytest import json from time import sleep from pymilvus import connections from chaos.checker import (InsertChecker, UpsertChecker, FlushChecker, SearchChecker, QueryChecker, ...
milvus/tests/python_client/chaos/testcases/test_concurrent_operation.py/0
{ "file_path": "milvus/tests/python_client/chaos/testcases/test_concurrent_operation.py", "repo_id": "milvus", "token_count": 2058 }
2,117
from typing import Any, Sequence from langchain_core.documents import BaseDocumentTransformer, Document class Html2TextTransformer(BaseDocumentTransformer): """Replace occurrences of a particular search pattern with a replacement string Arguments: ignore_links: Whether links should be ignored; defau...
langchain/libs/community/langchain_community/document_transformers/html2text.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_transformers/html2text.py", "repo_id": "langchain", "token_count": 739 }
254
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/utils/peft_utils.py/0
{ "file_path": "diffusers/src/diffusers/utils/peft_utils.py", "repo_id": "diffusers", "token_count": 4355 }
277
from langchain_experimental.autonomous_agents.baby_agi.baby_agi import BabyAGI from langchain_experimental.autonomous_agents.baby_agi.task_creation import ( TaskCreationChain, ) from langchain_experimental.autonomous_agents.baby_agi.task_execution import ( TaskExecutionChain, ) from langchain_experimental.auton...
langchain/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/__init__.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/__init__.py", "repo_id": "langchain", "token_count": 177 }
415
import logging from typing import Dict, Optional, Tuple import pytest from chromadb.api import AdminAPI import chromadb.api.types as types from chromadb.api.client import AdminClient, Client from chromadb.config import DEFAULT_DATABASE, DEFAULT_TENANT from chromadb.test.property.test_collections import CollectionStateM...
chroma/chromadb/test/property/test_collections_with_database_tenant.py/0
{ "file_path": "chroma/chromadb/test/property/test_collections_with_database_tenant.py", "repo_id": "chroma", "token_count": 1597 }
26
[tool.poetry] name = "anthropic-iterative-search" version = "0.0.1" description = "A virtual research assistant with the ability to search Wikipedia and answer questions" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" anthropic = "^0.5.0" wikipedia = "^1.4.0" [...
langchain/templates/anthropic-iterative-search/pyproject.toml/0
{ "file_path": "langchain/templates/anthropic-iterative-search/pyproject.toml", "repo_id": "langchain", "token_count": 270 }
701
from transformers import Wav2Vec2FeatureExtractor class CustomFeatureExtractor(Wav2Vec2FeatureExtractor): pass
transformers/utils/test_module/custom_feature_extraction.py/0
{ "file_path": "transformers/utils/test_module/custom_feature_extraction.py", "repo_id": "transformers", "token_count": 37 }
871
# 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/multitask_prompt_tuning/model.py/0
{ "file_path": "peft/src/peft/tuners/multitask_prompt_tuning/model.py", "repo_id": "peft", "token_count": 2093 }
337
/* eslint-disable no-process-env */ import { ChatOpenAI } from "@langchain/openai"; import { SerpAPI } from "@langchain/community/tools/serpapi"; import { PlanAndExecuteAgentExecutor } from "../agent_executor.js"; import { Calculator } from "../../../tools/calculator.js"; test.skip("Run agent on a simple input", async...
langchainjs/langchain/src/experimental/plan_and_execute/tests/plan_and_execute.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/plan_and_execute/tests/plan_and_execute.int.test.ts", "repo_id": "langchainjs", "token_count": 625 }
941
"""Init params."""
llama_index/llama-index-legacy/tests/output_parsers/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/output_parsers/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,809
<jupyter_start><jupyter_text>OpenAI agent: specifying a forced function call If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-agent-openai %pip install llama-index-llms-openai !pip install llama-index import json from typing import Sequence...
llama_index/docs/examples/agent/openai_forced_function_call.ipynb/0
{ "file_path": "llama_index/docs/examples/agent/openai_forced_function_call.ipynb", "repo_id": "llama_index", "token_count": 587 }
1,089
import time import copy import logging from milvus_benchmark import parser from milvus_benchmark.runners import utils from milvus_benchmark.runners.base import BaseRunner logger = logging.getLogger("milvus_benchmark.runners.insert") class InsertRunner(BaseRunner): """run insert""" name = "insert_performance"...
milvus/tests/benchmark/milvus_benchmark/runners/insert.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/runners/insert.py", "repo_id": "milvus", "token_count": 4760 }
1,927
// Code generated by mockery v2.32.4. DO NOT EDIT. package io import ( context "context" mock "github.com/stretchr/testify/mock" ) // MockBinlogIO is an autogenerated mock type for the BinlogIO type type MockBinlogIO struct { mock.Mock } type MockBinlogIO_Expecter struct { mock *mock.Mock } func (_m *MockBinl...
milvus/internal/datanode/io/mock_binlogio.go/0
{ "file_path": "milvus/internal/datanode/io/mock_binlogio.go", "repo_id": "milvus", "token_count": 2141 }
1,776
<jupyter_start><jupyter_text>SVM>[Support vector machines (SVMs)](https://scikit-learn.org/stable/modules/svm.htmlsupport-vector-machines) are a set of supervised learning methods used for classification, regression and outliers detection.This notebook goes over how to use a retriever that under the hood uses an `SVM` ...
langchain/docs/docs/integrations/retrievers/svm.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/retrievers/svm.ipynb", "repo_id": "langchain", "token_count": 422 }
172
<jupyter_start><jupyter_text>Guardrails Output Parsing If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-openai %pip install llama-index-output-parsers-guardrails !pip install guardrails-ai<jupyter_output><empty_output><jupyter_text>Dow...
llama_index/docs/examples/output_parsing/GuardrailsDemo.ipynb/0
{ "file_path": "llama_index/docs/examples/output_parsing/GuardrailsDemo.ipynb", "repo_id": "llama_index", "token_count": 1694 }
1,077
import pytest from llama_index.legacy.data_structs.data_structs import IndexGraph from llama_index.legacy.storage.index_store.firestore_indexstore import ( FirestoreIndexStore, ) from llama_index.legacy.storage.kvstore.firestore_kvstore import FirestoreKVStore try: from google.cloud import firestore_v1 as fire...
llama_index/llama-index-legacy/tests/storage/index_store/test_firestore_indexstore.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/storage/index_store/test_firestore_indexstore.py", "repo_id": "llama_index", "token_count": 307 }
1,680
""" EdgeNeXt Paper: `EdgeNeXt: Efficiently Amalgamated CNN-Transformer Architecture for Mobile Vision Applications` - https://arxiv.org/abs/2206.10589 Original code and weights from https://github.com/mmaaz60/EdgeNeXt Modifications and additions for timm by / Copyright 2022, Ross Wightman """ import math from colle...
pytorch-image-models/timm/models/edgenext.py/0
{ "file_path": "pytorch-image-models/timm/models/edgenext.py", "repo_id": "pytorch-image-models", "token_count": 11040 }
376
.. _Ref-Indices-Tree: Tree Index ========== Building the Tree Index .. automodule:: llama_index.core.indices.tree :members: :inherited-members:
llama_index/docs/api_reference/indices/tree.rst/0
{ "file_path": "llama_index/docs/api_reference/indices/tree.rst", "repo_id": "llama_index", "token_count": 57 }
1,080
from langchain_core.runnables.fallbacks import RunnableWithFallbacks __all__ = ["RunnableWithFallbacks"]
langchain/libs/langchain/langchain/schema/runnable/fallbacks.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/runnable/fallbacks.py", "repo_id": "langchain", "token_count": 34 }
543