text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from langchain_community.vectorstores.analyticdb import ( AnalyticDB, ) __all__ = [ "AnalyticDB", ]
langchain/libs/langchain/langchain/vectorstores/analyticdb.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/analyticdb.py", "repo_id": "langchain", "token_count": 43 }
611
"""Test self-hosted embeddings.""" from typing import Any from langchain_community.embeddings import ( SelfHostedEmbeddings, SelfHostedHuggingFaceEmbeddings, SelfHostedHuggingFaceInstructEmbeddings, ) def get_remote_instance() -> Any: """Get remote instance for testing.""" import runhouse as rh ...
langchain/libs/community/tests/integration_tests/embeddings/test_self_hosted.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_self_hosted.py", "repo_id": "langchain", "token_count": 1162 }
336
stability: collections: - server: db_config.primary_path: /test/milvus/db_data_gpu/sift_50m_1024_128_l2_sq8_8192_stability cache_config.cpu_cache_capacity: 64 cache_config.cache_insert_data: true engine_config.use_blas_threshold: 1100 engine_config.gpu_search_thresho...
milvus/tests/benchmark/milvus_benchmark/suites/cpu_stability_sift50m.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/cpu_stability_sift50m.yaml", "repo_id": "milvus", "token_count": 418 }
1,952
<!--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/es/glossary.md/0
{ "file_path": "transformers/docs/source/es/glossary.md", "repo_id": "transformers", "token_count": 10069 }
533
use candle_metal_kernels::{call_affine, Kernels}; use metal::objc::rc::autoreleasepool; use metal::{Device, MTLResourceOptions}; use rand; use std::any::type_name; use std::time::Instant; fn main() { let device = Device::system_default().unwrap(); let kernels = Kernels::new(); let f32_1k = (0..1000).map(|...
candle/candle-metal-kernels/tmp/affine.rs/0
{ "file_path": "candle/candle-metal-kernels/tmp/affine.rs", "repo_id": "candle", "token_count": 1154 }
54
package dao import ( "context" "github.com/chroma/chroma-coordinator/internal/metastore/db/dbcore" "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel" ) type metaDomain struct{} func NewMetaDomain() *metaDomain { return &metaDomain{} } func (*metaDomain) DatabaseDb(ctx context.Context) dbmodel...
chroma/go/coordinator/internal/metastore/db/dao/common.go/0
{ "file_path": "chroma/go/coordinator/internal/metastore/db/dao/common.go", "repo_id": "chroma", "token_count": 397 }
49
# coding=utf-8 # Copyright 2022 Meta Platforms authors and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
transformers/src/transformers/models/flava/processing_flava.py/0
{ "file_path": "transformers/src/transformers/models/flava/processing_flava.py", "repo_id": "transformers", "token_count": 2767 }
604
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/vit_hybrid.md/0
{ "file_path": "transformers/docs/source/en/model_doc/vit_hybrid.md", "repo_id": "transformers", "token_count": 966 }
521
from __future__ import annotations import concurrent.futures from pathlib import Path from typing import Iterator, Literal, Optional, Sequence, Union from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseBlobParser from langchain_community.document_loaders.blob_loade...
langchain/libs/community/langchain_community/document_loaders/concurrent.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/concurrent.py", "repo_id": "langchain", "token_count": 1362 }
234
package metastore import "testing" func TestAlterType_String(t *testing.T) { tests := []struct { name string t AlterType want string }{ { t: ADD, want: "ADD", }, { t: DELETE, want: "DELETE", }, { t: MODIFY, want: "MODIFY", }, { t: -1, want: "", }, } for...
milvus/internal/metastore/catalog_test.go/0
{ "file_path": "milvus/internal/metastore/catalog_test.go", "repo_id": "milvus", "token_count": 272 }
1,941
from langchain_community.tools.powerbi.tool import ( InfoPowerBITool, ListPowerBITool, QueryPowerBITool, ) __all__ = ["QueryPowerBITool", "InfoPowerBITool", "ListPowerBITool"]
langchain/libs/langchain/langchain/tools/powerbi/tool.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/powerbi/tool.py", "repo_id": "langchain", "token_count": 68 }
596
.PHONY: all clean docs_build docs_clean docs_linkcheck api_docs_build api_docs_clean api_docs_linkcheck # Default target executed when no arguments are given to make. all: help ###################### # DOCUMENTATION ###################### clean: docs_clean api_docs_clean docs_build: docs/.local_build.sh docs_cl...
langchain/Makefile/0
{ "file_path": "langchain/Makefile", "repo_id": "langchain", "token_count": 801 }
74
# 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/examples/legacy/seq2seq/old_test_calculate_rouge.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/old_test_calculate_rouge.py", "repo_id": "transformers", "token_count": 1793 }
524
apiVersion: chaos-mesh.org/v1alpha1 kind: PodChaos metadata: name: test-standalone-pod-failure namespace: chaos-testing spec: selector: namespaces: - chaos-testing labelSelectors: app.kubernetes.io/instance: milvus-chaos component: standalone mode: fixed value: "1" action: pod-fail...
milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_standalone_pod_failure.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_standalone_pod_failure.yaml", "repo_id": "milvus", "token_count": 140 }
1,991
<!--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/optimization/xformers.md/0
{ "file_path": "diffusers/docs/source/en/optimization/xformers.md", "repo_id": "diffusers", "token_count": 447 }
178
from langchain_community.utilities.tavily_search import ( TavilySearchAPIWrapper, ) __all__ = ["TavilySearchAPIWrapper"]
langchain/libs/langchain/langchain/utilities/tavily_search.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/tavily_search.py", "repo_id": "langchain", "token_count": 45 }
569
# coding=utf-8 # 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 requir...
transformers/tests/models/bloom/test_modeling_bloom.py/0
{ "file_path": "transformers/tests/models/bloom/test_modeling_bloom.py", "repo_id": "transformers", "token_count": 16982 }
735
import type { KVNamespace } from "@cloudflare/workers-types"; import { ChatOpenAI } from "@langchain/openai"; import { CloudflareKVCache } from "@langchain/cloudflare"; export interface Env { KV_NAMESPACE: KVNamespace; OPENAI_API_KEY: string; } export default { async fetch(_request: Request, env: Env) { tr...
langchainjs/examples/src/cache/chat_models/cloudflare_kv.ts/0
{ "file_path": "langchainjs/examples/src/cache/chat_models/cloudflare_kv.ts", "repo_id": "langchainjs", "token_count": 341 }
795
"""Embedding utils for queries.""" import heapq import math from typing import Any, Callable, List, Optional, Tuple import numpy as np from llama_index.legacy.core.embeddings.base import similarity as default_similarity_fn from llama_index.legacy.vector_stores.types import VectorStoreQueryMode def get_top_k_embedd...
llama_index/llama-index-legacy/llama_index/legacy/indices/query/embedding_utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/query/embedding_utils.py", "repo_id": "llama_index", "token_count": 2442 }
1,564
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-papers/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-papers/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,355
# Deep Layer Aggregation Extending “shallow” skip connections, **Dense Layer Aggregation (DLA)** incorporates more depth and sharing. The authors introduce two structures for deep layer aggregation (DLA): iterative deep aggregation (IDA) and hierarchical deep aggregation (HDA). These structures are expressed through ...
pytorch-image-models/hfdocs/source/models/dla.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/dla.mdx", "repo_id": "pytorch-image-models", "token_count": 6758 }
373
#!/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/LI...
alignment-handbook/scripts/run_sft.py/0
{ "file_path": "alignment-handbook/scripts/run_sft.py", "repo_id": "alignment-handbook", "token_count": 2671 }
23
# LlamaIndex Llms Integration: Localai
llama_index/llama-index-integrations/llms/llama-index-llms-localai/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-localai/README.md", "repo_id": "llama_index", "token_count": 11 }
1,303
# 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/models/transformers/dual_transformer_2d.py/0
{ "file_path": "diffusers/src/diffusers/models/transformers/dual_transformer_2d.py", "repo_id": "diffusers", "token_count": 3162 }
242
<jupyter_start><jupyter_text>UpTrain Callback HandlerThis notebook showcases the UpTrain callback handler seamlessly integrating into your pipeline, facilitating diverse evaluations. Three additional evaluations for Llamaindex have been introduced, complementing existing ones. These evaluations run automatically, with ...
llama_index/docs/examples/callbacks/UpTrainCallback.ipynb/0
{ "file_path": "llama_index/docs/examples/callbacks/UpTrainCallback.ipynb", "repo_id": "llama_index", "token_count": 3627 }
1,172
// 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_c_api.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_c_api.cpp", "repo_id": "milvus", "token_count": 109000 }
1,675
// 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/tests/integration/insert/insert_test.go/0
{ "file_path": "milvus/tests/integration/insert/insert_test.go", "repo_id": "milvus", "token_count": 1449 }
2,158
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/node_parser/relational/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/node_parser/relational/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,688
# Backed by a Vector Store `VectorStoreRetrieverMemory` stores memories in a vector store and queries the top-K most "salient" docs every time it is called. This differs from most of the other Memory classes in that it doesn't explicitly track the order of interactions. In this case, the "docs" are previous conversa...
langchain/docs/docs/modules/memory/types/vectorstore_retriever_memory.mdx/0
{ "file_path": "langchain/docs/docs/modules/memory/types/vectorstore_retriever_memory.mdx", "repo_id": "langchain", "token_count": 1871 }
196
## 🔥 Model cards now live inside each huggingface.co model repo 🔥 For consistency, ease of use and scalability, `README.md` model cards now live directly inside each model repo on the HuggingFace model hub. ### How to update a model card You can directly update a model card inside any model repo you have **write ...
transformers/model_cards/README.md/0
{ "file_path": "transformers/model_cards/README.md", "repo_id": "transformers", "token_count": 296 }
544
.. _Ref-Indices-VectorStore: Vector Store Index ================== Below we show the vector store index classes. Each vector store index class is a combination of a base vector store index class and a vector store, shown below. .. automodule:: llama_index.core.indices.vector_store.base :members: :inherited-me...
llama_index/docs/api_reference/indices/vector_store.rst/0
{ "file_path": "llama_index/docs/api_reference/indices/vector_store.rst", "repo_id": "llama_index", "token_count": 118 }
1,057
# 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/utils/check_config_attributes.py/0
{ "file_path": "transformers/utils/check_config_attributes.py", "repo_id": "transformers", "token_count": 5635 }
771
from langchain.agents import AgentExecutor, OpenAIFunctionsAgent from langchain_core.messages import SystemMessage from langchain_core.pydantic_v1 import BaseModel from langchain_openai import ChatOpenAI from langchain_robocorp import ActionServerToolkit # Initialize LLM chat model llm = ChatOpenAI(model="gpt-4", temp...
langchain/templates/robocorp-action-server/robocorp_action_server/agent.py/0
{ "file_path": "langchain/templates/robocorp-action-server/robocorp_action_server/agent.py", "repo_id": "langchain", "token_count": 322 }
731
package backend import ( "fmt" "github.com/blang/semver/v4" "github.com/milvus-io/milvus/cmd/tools/migration/configs" "github.com/milvus-io/milvus/cmd/tools/migration/meta" "github.com/milvus-io/milvus/cmd/tools/migration/versions" "github.com/milvus-io/milvus/pkg/util" ) type Backend interface { Load() (*me...
milvus/cmd/tools/migration/backend/backend.go/0
{ "file_path": "milvus/cmd/tools/migration/backend/backend.go", "repo_id": "milvus", "token_count": 401 }
1,840
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-faiss/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-faiss/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,311
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,493
import { KVMap, BaseRun } from "langsmith/schemas"; import type { ChainValues } from "../utils/types.js"; import type { AgentAction, AgentFinish } from "../agents.js"; import type { LLMResult } from "../outputs.js"; import type { BaseMessage } from "../messages/index.js"; import { Serialized } from "../load/serializab...
langchainjs/langchain-core/src/tracers/base.ts/0
{ "file_path": "langchainjs/langchain-core/src/tracers/base.ts", "repo_id": "langchainjs", "token_count": 6551 }
868
"""StackExchange API toolkit."""
langchain/libs/langchain/langchain/tools/stackexchange/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/stackexchange/__init__.py", "repo_id": "langchain", "token_count": 10 }
612
/// Payload validation logic use crate::validation::ValidationError::{BestOfSampling, BestOfSeed, EmptyInput}; use crate::{GenerateParameters, GenerateRequest, GrammarType}; use rand::{thread_rng, Rng}; use text_generation_client::{ GrammarType as ProtoGrammarType, NextTokenChooserParameters, StoppingCriteriaParame...
text-generation-inference/router/src/validation.rs/0
{ "file_path": "text-generation-inference/router/src/validation.rs", "repo_id": "text-generation-inference", "token_count": 12265 }
405
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/selectors/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/selectors/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,600
"""SQL wrapper around SQLDatabase in langchain.""" from typing import Any, Dict, Iterable, List, Optional, Tuple from sqlalchemy import MetaData, create_engine, insert, inspect, text from sqlalchemy.engine import Engine from sqlalchemy.exc import OperationalError, ProgrammingError class SQLDatabase: """SQL Datab...
llama_index/llama-index-core/llama_index/core/utilities/sql_wrapper.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/utilities/sql_wrapper.py", "repo_id": "llama_index", "token_count": 4153 }
1,182
from typing import TYPE_CHECKING from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_k_diffusion_available, is_k_diffusion_version, is_torch_available, is_transformers_available, ) _dummy_objects = {} _import_structure...
diffusers/src/diffusers/pipelines/stable_diffusion_k_diffusion/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_k_diffusion/__init__.py", "repo_id": "diffusers", "token_count": 812 }
251
# Knowledge Base Website Loader This loader is a web crawler and scraper that fetches text content from websites hosting public knowledge bases. Examples are the [Intercom help center](https://www.intercom.com/help/en/) or the [Robinhood help center](https://robinhood.com/us/en/support/). Typically these sites have a ...
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/knowledge_base/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/knowledge_base/README.md", "repo_id": "llama_index", "token_count": 1087 }
1,443
"""Router components.""" from typing import Any, Dict, List from llama_index.legacy.bridge.pydantic import Field, PrivateAttr from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.core.base_selector import BaseSelector from llama_index.legacy.core.query_pipeline.query_component import ...
llama_index/llama-index-legacy/llama_index/legacy/query_pipeline/components/router.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/query_pipeline/components/router.py", "repo_id": "llama_index", "token_count": 2738 }
1,590
import random import uuid from typing import List, Tuple import pytest from langchain_core.documents import Document from langchain_community.retrievers import QdrantSparseVectorRetriever from langchain_community.vectorstores.qdrant import QdrantException def consistent_fake_sparse_encoder( query: str, size: in...
langchain/libs/community/tests/integration_tests/retrievers/test_qdrant_sparse_vector_retriever.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/retrievers/test_qdrant_sparse_vector_retriever.py", "repo_id": "langchain", "token_count": 2084 }
363
import { JsonFormsDispatch, withJsonFormsAnyOfProps } from "@jsonforms/react"; import { rankWith, createCombinatorRenderInfos, JsonSchema, isAnyOfControl, } from "@jsonforms/core"; import { renderers, cells } from "../renderers"; export const CustomAnyOfRenderer = withJsonFormsAnyOfProps((props) => { const a...
langserve/langserve/playground/src/components/CustomAnyOfRenderer.tsx/0
{ "file_path": "langserve/langserve/playground/src/components/CustomAnyOfRenderer.tsx", "repo_id": "langserve", "token_count": 382 }
1,062
from __future__ import annotations import uuid from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, ) if TYPE_CHECKING: import bagel import bagel.config from bagel.api.types import ID, OneOrMany, Where, WhereDocument from lang...
langchain/libs/community/langchain_community/vectorstores/bageldb.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/bageldb.py", "repo_id": "langchain", "token_count": 7222 }
329
// babel.config.js module.exports = { presets: [["@babel/preset-env", { targets: { node: true } }]], };
langchainjs/langchain/babel.config.cjs/0
{ "file_path": "langchainjs/langchain/babel.config.cjs", "repo_id": "langchainjs", "token_count": 43 }
890
# order by contributions reviewers: - czs007 - sunby - godchen0212 - XuanYang-cn - xiaocai2333 - fishpenguin approvers: - maintainers
milvus/internal/kv/OWNERS/0
{ "file_path": "milvus/internal/kv/OWNERS", "repo_id": "milvus", "token_count": 60 }
1,856
import { Document } from "@langchain/core/documents"; import { BasePromptTemplate, PromptTemplate } from "@langchain/core/prompts"; import { RunnableConfig } from "@langchain/core/runnables"; export const DEFAULT_DOCUMENT_SEPARATOR = "\n\n"; export const DOCUMENTS_KEY = "context"; export const INTERMEDIATE_STEPS_KEY ...
langchainjs/langchain/src/chains/combine_documents/base.ts/0
{ "file_path": "langchainjs/langchain/src/chains/combine_documents/base.ts", "repo_id": "langchainjs", "token_count": 349 }
860
import { VectaraStore } from "@langchain/community/vectorstores/vectara"; import { VectaraSummaryRetriever } from "@langchain/community/retrievers/vectara_summary"; import { Document } from "@langchain/core/documents"; // Create the Vectara store. const store = new VectaraStore({ customerId: Number(process.env.VECTA...
langchainjs/examples/src/indexes/vector_stores/vectara.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/vectara.ts", "repo_id": "langchainjs", "token_count": 870 }
821
"""Tool for the Merriam-Webster API.""" from typing import Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.tools import BaseTool from langchain_community.utilities.merriam_webster import MerriamWebsterAPIWrapper class MerriamWebsterQueryRun(BaseTool): """Tool that se...
langchain/libs/community/langchain_community/tools/merriam_webster/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/merriam_webster/tool.py", "repo_id": "langchain", "token_count": 315 }
308
# coding=utf-8 # Copyright 2020 Huggingface # # 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/tests/models/dpr/test_modeling_dpr.py/0
{ "file_path": "transformers/tests/models/dpr/test_modeling_dpr.py", "repo_id": "transformers", "token_count": 5466 }
813
#[cfg(feature = "accelerate")] extern crate accelerate_src; #[cfg(feature = "mkl")] extern crate intel_mkl_src; use anyhow::{Error as E, Result}; use candle::{Device, IndexOp, Tensor}; use candle_nn::{ops::softmax, VarBuilder}; use clap::{Parser, ValueEnum}; use hf_hub::{api::sync::Api, Repo, RepoType}; use rand::{di...
candle/candle-examples/examples/whisper-microphone/main.rs/0
{ "file_path": "candle/candle-examples/examples/whisper-microphone/main.rs", "repo_id": "candle", "token_count": 12127 }
49
<jupyter_start><jupyter_text>LongContextReorderModels struggle to access significant details found in the center of extended contexts. [A study](https://arxiv.org/abs/2307.03172) observed that the best performance typically arises when crucial data is positioned at the start or conclusion of the input context. Addition...
llama_index/docs/examples/node_postprocessor/LongContextReorder.ipynb/0
{ "file_path": "llama_index/docs/examples/node_postprocessor/LongContextReorder.ipynb", "repo_id": "llama_index", "token_count": 1139 }
1,134
#!/usr/bin/env python # coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # Copyright (c) 2020, NVIDIA CORPORATION. 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 a...
transformers/examples/tensorflow/benchmarking/run_benchmark_tf.py/0
{ "file_path": "transformers/examples/tensorflow/benchmarking/run_benchmark_tf.py", "repo_id": "transformers", "token_count": 724 }
622
"""Tools.""" from llama_index.legacy.tools.download import download_tool from llama_index.legacy.tools.function_tool import FunctionTool from llama_index.legacy.tools.query_engine import QueryEngineTool from llama_index.legacy.tools.query_plan import QueryPlanTool from llama_index.legacy.tools.retriever_tool import Re...
llama_index/llama-index-legacy/llama_index/legacy/tools/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/tools/__init__.py", "repo_id": "llama_index", "token_count": 264 }
1,541
import { createOpenAPIChain } from "langchain/chains"; import { ChatOpenAI } from "@langchain/openai"; const chatModel = new ChatOpenAI({ modelName: "gpt-4-0613", temperature: 0 }); const chain = await createOpenAPIChain("https://api.speak.com/openapi.yaml", { llm: chatModel, headers: { authorization: "Bearer...
langchainjs/examples/src/chains/openai_functions_openapi_customization.ts/0
{ "file_path": "langchainjs/examples/src/chains/openai_functions_openapi_customization.ts", "repo_id": "langchainjs", "token_count": 688 }
777
// 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/MinioChunkManager.h/0
{ "file_path": "milvus/internal/core/src/storage/MinioChunkManager.h", "repo_id": "milvus", "token_count": 4016 }
1,757
from llama_index.core.readers.base import BaseReader from llama_index.readers.papers import ArxivReader, PubmedReader def test_class(): names_of_base_classes = [b.__name__ for b in ArxivReader.__mro__] assert BaseReader.__name__ in names_of_base_classes names_of_base_classes = [b.__name__ for b in Pubmed...
llama_index/llama-index-integrations/readers/llama-index-readers-papers/tests/test_readers_papers.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-papers/tests/test_readers_papers.py", "repo_id": "llama_index", "token_count": 142 }
1,534
#!/usr/bin/env bash set -euo pipefail # Absolute path to the toplevel milvus directory. toplevel=$(dirname "$(cd "$(dirname "${0}")"; pwd)") export OS_NAME="${OS_NAME:-ubuntu20.04}" pushd "${toplevel}" if [[ "${1-}" == "pull" ]]; then docker-compose pull --ignore-pull-failures gpubuilder exit 0 fi if [[ "...
milvus/build/builder_gpu.sh/0
{ "file_path": "milvus/build/builder_gpu.sh", "repo_id": "milvus", "token_count": 671 }
1,607
import { XMLOutputParser } from "@langchain/core/output_parsers"; const XML_EXAMPLE = `<?xml version="1.0" encoding="UTF-8"?> <userProfile> <userID>12345</userID> <name>John Doe</name> <email>john.doe@example.com</email> <roles> <role>Admin</role> <role>User</role> </roles> <preferences> <theme...
langchainjs/examples/src/prompts/xml_output_parser.ts/0
{ "file_path": "langchainjs/examples/src/prompts/xml_output_parser.ts", "repo_id": "langchainjs", "token_count": 632 }
849
import { HumanMessage } from "@langchain/core/messages"; import { ChatIflytekXinghuo } from "../iflytek_xinghuo/index.js"; test.skip("Iflytek Xinghuo Call", async () => { const model = new ChatIflytekXinghuo({ iflytekAppid: "", iflytekApiKey: "", iflytekApiSecret: "", }); const messages = [new HumanM...
langchainjs/libs/langchain-community/src/chat_models/tests/chatiflytekxinghuo.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/chat_models/tests/chatiflytekxinghuo.int.test.ts", "repo_id": "langchainjs", "token_count": 148 }
984
// app/api/chat import { MaskingParser, RegexMaskingTransformer, } from "langchain/experimental/masking"; import { ChatOpenAI } from "@langchain/openai"; import { PromptTemplate } from "@langchain/core/prompts"; import { BytesOutputParser } from "@langchain/core/output_parsers"; export const runtime = "edge"; //...
langchainjs/examples/src/experimental/masking/next.ts/0
{ "file_path": "langchainjs/examples/src/experimental/masking/next.ts", "repo_id": "langchainjs", "token_count": 943 }
861
"""Test embaas embeddings.""" import responses from langchain_community.embeddings.embaas import EMBAAS_API_URL, EmbaasEmbeddings def test_embaas_embed_documents() -> None: """Test embaas embeddings with multiple texts.""" texts = ["foo bar", "bar foo", "foo"] embedding = EmbaasEmbeddings() output = ...
langchain/libs/community/tests/integration_tests/embeddings/test_embaas.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_embaas.py", "repo_id": "langchain", "token_count": 660 }
330
import os from typing import Iterable import pytest from llama_index.legacy.schema import NodeRelationship, RelatedNodeInfo, TextNode from llama_index.legacy.vector_stores.astra import AstraDBVectorStore from llama_index.legacy.vector_stores.types import VectorStoreQuery try: import astrapy print(f"astrapy d...
llama_index/llama-index-legacy/tests/vector_stores/test_astra.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/vector_stores/test_astra.py", "repo_id": "llama_index", "token_count": 866 }
1,764
from typing import Iterator, List, Optional from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.utilities.pubmed import PubMedAPIWrapper class PubMedLoader(BaseLoader): """Load from the `PubMed` biomedical library. Attribut...
langchain/libs/community/langchain_community/document_loaders/pubmed.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/pubmed.py", "repo_id": "langchain", "token_count": 475 }
242
"""Text to speech module.""" from abc import ABC, abstractmethod from typing import Any class BaseTTS(ABC): """Base class for text to speech modules.""" def __init__(self) -> None: pass @abstractmethod def generate_audio(self, text: str) -> Any: """Generate audio from text. ...
llama_index/llama-index-legacy/llama_index/legacy/tts/base.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/tts/base.py", "repo_id": "llama_index", "token_count": 234 }
1,527
# Guidance [Guidance](https://github.com/microsoft/guidance) is a guidance language for controlling large language models developed by Microsoft. Guidance programs allow you to interleave generation, prompting, and logical control into a single continuous flow matching how the language model actually processes the te...
llama_index/docs/community/integrations/guidance.md/0
{ "file_path": "llama_index/docs/community/integrations/guidance.md", "repo_id": "llama_index", "token_count": 1096 }
1,039
from typing import Any, Dict, List, Optional from langchain_community.graphs.graph_document import GraphDocument from langchain_community.graphs.graph_store import GraphStore node_properties_query = """ MATCH (n) WITH keys(n) as keys, labels(n) AS labels WITH CASE WHEN keys = [] THEN [NULL] ELSE keys END AS keys, lab...
langchain/libs/community/langchain_community/graphs/falkordb_graph.py/0
{ "file_path": "langchain/libs/community/langchain_community/graphs/falkordb_graph.py", "repo_id": "langchain", "token_count": 2318 }
262
from langchain_community.document_transformers.html2text import Html2TextTransformer __all__ = ["Html2TextTransformer"]
langchain/libs/langchain/langchain/document_transformers/html2text.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_transformers/html2text.py", "repo_id": "langchain", "token_count": 36 }
529
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/tools/llama-index-tools-salesforce/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-salesforce/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,579
<!--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/perf_train_cpu.md/0
{ "file_path": "transformers/docs/source/en/perf_train_cpu.md", "repo_id": "transformers", "token_count": 1267 }
476
# coding=utf-8 # Copyright 2021 The Facebook 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/LI...
transformers/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py/0
{ "file_path": "transformers/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py", "repo_id": "transformers", "token_count": 10427 }
716
# LlamaIndex Llms Integration: Portkey
llama_index/llama-index-integrations/llms/llama-index-llms-portkey/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-portkey/README.md", "repo_id": "llama_index", "token_count": 11 }
1,314
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/examples/text_to_image/test_text_to_image.py/0
{ "file_path": "diffusers/examples/text_to_image/test_text_to_image.py", "repo_id": "diffusers", "token_count": 7411 }
213
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
alignment-handbook/tests/test_configs.py/0
{ "file_path": "alignment-handbook/tests/test_configs.py", "repo_id": "alignment-handbook", "token_count": 697 }
26
from langchain_community.llms.watsonxllm import WatsonxLLM __all__ = ["WatsonxLLM"]
langchain/libs/langchain/langchain/llms/watsonxllm.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/watsonxllm.py", "repo_id": "langchain", "token_count": 33 }
519
<!--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 agreed...
transformers/docs/source/en/model_doc/perceiver.md/0
{ "file_path": "transformers/docs/source/en/model_doc/perceiver.md", "repo_id": "transformers", "token_count": 2762 }
483
// 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/tests/integration/getvector/get_vector_test.go/0
{ "file_path": "milvus/tests/integration/getvector/get_vector_test.go", "repo_id": "milvus", "token_count": 5807 }
1,958
from llama_index.core.llama_pack import BaseLlamaPack from llama_index.packs.gmail_openai_agent import GmailOpenAIAgentPack def test_class(): names_of_base_classes = [b.__name__ for b in GmailOpenAIAgentPack.__mro__] assert BaseLlamaPack.__name__ in names_of_base_classes
llama_index/llama-index-packs/llama-index-packs-gmail-openai-agent/tests/test_packs_gmail_openai_agent.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-gmail-openai-agent/tests/test_packs_gmail_openai_agent.py", "repo_id": "llama_index", "token_count": 103 }
1,585
T__0=1 T__1=2 T__2=3 T__3=4 T__4=5 LT=6 LE=7 GT=8 GE=9 EQ=10 NE=11 LIKE=12 EXISTS=13 ADD=14 SUB=15 MUL=16 DIV=17 MOD=18 POW=19 SHL=20 SHR=21 BAND=22 BOR=23 BXOR=24 AND=25 OR=26 BNOT=27 NOT=28 IN=29 NIN=30 EmptyTerm=31 JSONContains=32 JSONContainsAll=33 JSONContainsAny=34 ArrayContains=35 ArrayContainsAll=36 ArrayContai...
milvus/internal/parser/planparserv2/generated/Plan.tokens/0
{ "file_path": "milvus/internal/parser/planparserv2/generated/Plan.tokens", "repo_id": "milvus", "token_count": 385 }
1,806
import logging import os from typing import List, TextIO, Union from conllu import parse_incr from utils_ner import InputExample, Split, TokenClassificationTask logger = logging.getLogger(__name__) class NER(TokenClassificationTask): def __init__(self, label_idx=-1): # in NER datasets, the last column ...
transformers/examples/legacy/token-classification/tasks.py/0
{ "file_path": "transformers/examples/legacy/token-classification/tasks.py", "repo_id": "transformers", "token_count": 3163 }
528
python_tests()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-typesense/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-typesense/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,546
"""Document summary retrievers. This module contains retrievers for document summary indices. """ import logging from typing import Any, Callable, List, Optional from llama_index.core.base.base_retriever import BaseRetriever from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.core.callb...
llama_index/llama-index-core/llama_index/core/indices/document_summary/retrievers.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/document_summary/retrievers.py", "repo_id": "llama_index", "token_count": 3118 }
1,191
# LlamaIndex Readers Integration: Awadb
llama_index/llama-index-integrations/readers/llama-index-readers-awadb/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-awadb/README.md", "repo_id": "llama_index", "token_count": 11 }
1,266
import { createTaggingChain } from "langchain/chains"; import { ChatOpenAI } from "@langchain/openai"; import type { FunctionParameters } from "langchain/output_parsers"; const schema: FunctionParameters = { type: "object", properties: { sentiment: { type: "string" }, tone: { type: "string" }, language...
langchainjs/examples/src/chains/openai_functions_tagging.ts/0
{ "file_path": "langchainjs/examples/src/chains/openai_functions_tagging.ts", "repo_id": "langchainjs", "token_count": 234 }
802
import pytest DATASET_LOADING_SCRIPT_NAME = "__dummy_dataset1__" DATASET_LOADING_SCRIPT_CODE = """ import json import os import datasets REPO_URL = "https://huggingface.co/datasets/hf-internal-testing/raw_jsonl/resolve/main/" URLS = {"train": REPO_URL + "wikiann-bn-train.jsonl", "validation": REPO_URL + "wikiann-...
datasets/tests/commands/conftest.py/0
{ "file_path": "datasets/tests/commands/conftest.py", "repo_id": "datasets", "token_count": 1193 }
139
[build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] [tool.codespell] check-filenames = true check-hidden = true skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb" [tool.llamahub] classes = ["RemoteDepthReader"] contains_example = false import_path = "llama_index.readers.remote_de...
llama_index/llama-index-integrations/readers/llama-index-readers-remote-depth/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-remote-depth/pyproject.toml", "repo_id": "llama_index", "token_count": 681 }
1,515
poetry_requirements( name="poetry", module_mapping={"arize-phoenix": ["phoenix"], "phoenix": ["arize-phoenix"]} )
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/BUILD", "repo_id": "llama_index", "token_count": 50 }
1,344
#!/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/text_classification.py/0
{ "file_path": "transformers/src/transformers/tools/text_classification.py", "repo_id": "transformers", "token_count": 874 }
692
{ "answer_accuracy": 0.9, "total": 10, "valid": 10, "results": [ { "db": "wta_1", "exec_match": true, "answer_match": true, "gold": { "question": "Find the name of the winner who has the highest rank points and participated in the Australian Open tourney.", "sql_query...
llama_index/benchmarks/struct_indices/spider/spider-0_01-text-davinci-003/dev_eval.json/0
{ "file_path": "llama_index/benchmarks/struct_indices/spider/spider-0_01-text-davinci-003/dev_eval.json", "repo_id": "llama_index", "token_count": 3933 }
1,054
[ { "title": "AI Overlords", "create_time": 3000000000.0, "update_time": 3000000100.0, "mapping": { "msg1": { "id": "msg1", "message": { "id": "msg1", "author": {"role": "AI", "name": "Hal 9000", "met...
langchain/docs/docs/integrations/document_loaders/example_data/fake_conversations.json/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/example_data/fake_conversations.json", "repo_id": "langchain", "token_count": 1885 }
109
--- hide_table_of_contents: true sidebar_label: Conversation summary buffer memory --- # ConversationSummaryBufferMemory `ConversationSummaryBufferMemory` combines the ideas behind [BufferMemory](/docs/modules/memory/types/buffer) and [ConversationSummaryMemory](/docs/modules/memory/types/summary). It keeps a buffer ...
langchainjs/docs/core_docs/docs/modules/memory/types/summary_buffer.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/memory/types/summary_buffer.mdx", "repo_id": "langchainjs", "token_count": 256 }
761
import json import os import shutil import tempfile from copy import deepcopy from typing import Any, Dict, List, Optional from langchain_core.agents import AgentAction, AgentFinish from langchain_core.callbacks import BaseCallbackHandler from langchain_core.outputs import LLMResult from langchain_community.callbacks...
langchain/libs/community/langchain_community/callbacks/sagemaker_callback.py/0
{ "file_path": "langchain/libs/community/langchain_community/callbacks/sagemaker_callback.py", "repo_id": "langchain", "token_count": 4147 }
218
--- sidebar_position: 6 sidebar_label: FAQ --- # Frequently Asked Questions ## Pull Requests (PRs) ### How do I allow maintainers to edit my PR? When you submit a pull request, there may be additional changes necessary before merging it. Oftentimes, it is more efficient for the maintainers to make these changes them...
langchain/docs/docs/contributing/faq.mdx/0
{ "file_path": "langchain/docs/docs/contributing/faq.mdx", "repo_id": "langchain", "token_count": 304 }
82
# flake8: noqa JSON_PREFIX = """You are an agent designed to interact with JSON. Your goal is to return a final answer by interacting with the JSON. You have access to the following tools which help you learn more about the JSON you are interacting with. Only use the below tools. Only use the information returned by t...
langchain/libs/community/langchain_community/agent_toolkits/json/prompt.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/json/prompt.py", "repo_id": "langchain", "token_count": 458 }
206
"""Fake Chat Model wrapper for testing purposes.""" import asyncio import re import time from typing import ( Any, AsyncIterator, Iterator, List, Mapping, Optional, cast, ) from langchain_core.callbacks.manager import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from...
langserve/tests/unit_tests/utils/llms.py/0
{ "file_path": "langserve/tests/unit_tests/utils/llms.py", "repo_id": "langserve", "token_count": 4267 }
1,052
import time from typing import Any, Optional from azure.core.exceptions import ClientAuthenticationError from azure.identity import DefaultAzureCredential def refresh_openai_azuread_token( azure_ad_token: Any = None, ) -> Any: """ Checks the validity of the associated token, if any, and tries to refresh ...
llama_index/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/utils.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/utils.py", "repo_id": "llama_index", "token_count": 472 }
1,250
import type { SupabaseClient } from "@supabase/supabase-js"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { Document } from "@langchain/core/documents"; import { BaseRetriever, type BaseRetrieverInput, } from "@langchain/core/retrievers"; import { CallbackManagerForRetrieverRun, ...
langchainjs/libs/langchain-community/src/retrievers/supabase.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/retrievers/supabase.ts", "repo_id": "langchainjs", "token_count": 2388 }
990