text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
search_performance: collections: # - # server: # db_config.primary_path: /test/milvus/db_data_8/sift_1b_2048_128_l2_sq8_wal # cache_config.cpu_cache_capacity: 150GB # engine_config.use_blas_threshold: 0 # engine_config.gpu_search_threshold: 200 # gpu_resource_config.enable: ...
milvus/tests/benchmark/milvus_benchmark/suites/debug.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/debug.yaml", "repo_id": "milvus", "token_count": 1646 }
1,942
from langchain.indexes import VectorstoreIndexCreator from langchain_community.document_loaders import CSVLoader from langchain_community.vectorstores import FAISS loader = CSVLoader("/Users/harrisonchase/Downloads/titanic.csv") docs = loader.load() index_creator = VectorstoreIndexCreator(vectorstore_cls=FAISS) inde...
langchain/templates/csv-agent/ingest.py/0
{ "file_path": "langchain/templates/csv-agent/ingest.py", "repo_id": "langchain", "token_count": 123 }
645
from typing import Any, List, Optional from unittest.mock import MagicMock import pytest from llama_index.legacy.schema import NodeRelationship, RelatedNodeInfo, TextNode from llama_index.legacy.vector_stores.azureaisearch import ( AzureAISearchVectorStore, IndexManagement, ) try: from azure.search.docume...
llama_index/llama-index-legacy/tests/vector_stores/test_azureaisearch.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/vector_stores/test_azureaisearch.py", "repo_id": "llama_index", "token_count": 1670 }
1,684
// Adapted from turboderp exllama: https://github.com/turboderp/exllama #ifndef _cuda_compat_cuh #define _cuda_compat_cuh // atomicAdd for half types, to support CC < 7.x __device__ __forceinline__ void atomicAdd_half(half* address, half val) { unsigned int * address_as_ui = (unsigned int *) ((char *)address - (...
text-generation-inference/server/exllama_kernels/exllama_kernels/cu_compat.cuh/0
{ "file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/cu_compat.cuh", "repo_id": "text-generation-inference", "token_count": 692 }
419
[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 = ["ZendeskReader"] contains_example = false import_path = "llama_index.readers.zendesk" [to...
llama_index/llama-index-integrations/readers/llama-index-readers-zendesk/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-zendesk/pyproject.toml", "repo_id": "llama_index", "token_count": 697 }
1,479
<jupyter_start><jupyter_text>Knowledge Distillation For Fine-Tuning A GPT-3.5 Judge (Correctness)This notebook has to do with fine-tuning an LLM Judge that evaluates the responses of another LLM to a user query. More specifically, we demonstrate how to use the `llama_index` library to distill knowledge from a GPT-4 Jud...
llama_index/docs/examples/finetuning/llm_judge/correctness/finetune_llm_judge_single_grading_correctness.ipynb/0
{ "file_path": "llama_index/docs/examples/finetuning/llm_judge/correctness/finetune_llm_judge_single_grading_correctness.ipynb", "repo_id": "llama_index", "token_count": 4700 }
1,120
from llama_index.llms.huggingface.base import HuggingFaceInferenceAPI, HuggingFaceLLM __all__ = ["HuggingFaceLLM", "HuggingFaceInferenceAPI"]
llama_index/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/__init__.py", "repo_id": "llama_index", "token_count": 50 }
1,398
import unittest import pytest from langchain_community.document_loaders.parsers.language.typescript import ( TypeScriptSegmenter, ) @pytest.mark.requires("tree_sitter", "tree_sitter_languages") class TestTypeScriptSegmenter(unittest.TestCase): def setUp(self) -> None: self.example_code = """function...
langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_typescript.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_typescript.py", "repo_id": "langchain", "token_count": 764 }
367
import os import torch from loguru import logger from text_generation_server.utils.import_utils import IS_CUDA_SYSTEM, IS_ROCM_SYSTEM if os.getenv("USE_FLASH_ATTENTION", "").lower() == "false": raise ImportError("`USE_FLASH_ATTENTION` is false.") if not torch.cuda.is_available(): raise ImportError("CUDA is ...
text-generation-inference/server/text_generation_server/utils/flash_attn.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/utils/flash_attn.py", "repo_id": "text-generation-inference", "token_count": 2911 }
445
use std::f32::consts::E; use crate::chroma_proto; use crate::chroma_proto::{ GetVectorsRequest, GetVectorsResponse, QueryVectorsRequest, QueryVectorsResponse, }; use crate::config::{Configurable, WorkerConfig}; use crate::errors::ChromaError; use crate::segment::SegmentManager; use crate::types::ScalarEncoding; us...
chroma/rust/worker/src/server.rs/0
{ "file_path": "chroma/rust/worker/src/server.rs", "repo_id": "chroma", "token_count": 3371 }
62
# Introduction to Q-Learning [[introduction-q-learning]] <img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit3/thumbnail.jpg" alt="Unit 2 thumbnail" width="100%"> In the first unit of this class, we learned about Reinforcement Learning (RL), the RL process, and the ...
deep-rl-class/units/en/unit2/introduction.mdx/0
{ "file_path": "deep-rl-class/units/en/unit2/introduction.mdx", "repo_id": "deep-rl-class", "token_count": 466 }
162
import json from typing import Any, Callable, Iterator, List, Mapping, Optional from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document RecordHandler = Callable[[Any, Optional[str]], Document] class AirbyteCDKReader(BaseReader): """AirbyteCDKReader reader. Retrieve...
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-cdk/llama_index/readers/airbyte_cdk/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-cdk/llama_index/readers/airbyte_cdk/base.py", "repo_id": "llama_index", "token_count": 792 }
1,448
from langchain_core.outputs import ( ChatGeneration, ChatGenerationChunk, ChatResult, Generation, GenerationChunk, LLMResult, RunInfo, ) __all__ = [ "Generation", "GenerationChunk", "ChatGeneration", "ChatGenerationChunk", "RunInfo", "ChatResult", "LLMResult", ]
langchain/libs/langchain/langchain/schema/output.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/output.py", "repo_id": "langchain", "token_count": 139 }
548
// 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/querycoordv2/meta/resource_manager.go/0
{ "file_path": "milvus/internal/querycoordv2/meta/resource_manager.go", "repo_id": "milvus", "token_count": 6791 }
1,862
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use anyhow::Error as E; use clap::{Parser, ValueEnum}; use candle::{DType, Tensor}; use candle_examples::token_output_stream::TokenOutputStream; use candle_nn::VarBuilder; use candle_transformers::models::...
candle/candle-examples/examples/marian-mt/main.rs/0
{ "file_path": "candle/candle-examples/examples/marian-mt/main.rs", "repo_id": "candle", "token_count": 2385 }
42
--- hide_table_of_contents: true --- # Docx files This example goes over how to load data from docx files. # Setup ```bash npm2yarn npm install mammoth ``` # Usage ```typescript import { DocxLoader } from "langchain/document_loaders/fs/docx"; const loader = new DocxLoader( "src/document_loaders/tests/example_d...
langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/docx.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/docx.mdx", "repo_id": "langchainjs", "token_count": 137 }
701
from langchain_community.tools.google_lens.tool import GoogleLensQueryRun __all__ = ["GoogleLensQueryRun"]
langchain/libs/langchain/langchain/tools/google_lens/tool.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/google_lens/tool.py", "repo_id": "langchain", "token_count": 32 }
561
import { test } from "@jest/globals"; test("Test chat model", async () => { // Your test here });
langchainjs/libs/create-langchain-integration/template/src/tests/chat_models.test.ts/0
{ "file_path": "langchainjs/libs/create-langchain-integration/template/src/tests/chat_models.test.ts", "repo_id": "langchainjs", "token_count": 34 }
1,039
"""Utilities for GPT indices.""" import logging import re from typing import Dict, List, Optional, Sequence, Set, Tuple from llama_index.legacy.embeddings.base import BaseEmbedding from llama_index.legacy.embeddings.multi_modal_base import MultiModalEmbedding from llama_index.legacy.schema import BaseNode, ImageNode,...
llama_index/llama-index-legacy/llama_index/legacy/indices/utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/utils.py", "repo_id": "llama_index", "token_count": 3484 }
1,724
"""BabyAGI agent.""" from collections import deque from typing import Any, Dict, List, Optional from langchain.callbacks.manager import CallbackManagerForChainRun from langchain.chains.base import Chain from langchain_core.language_models import BaseLanguageModel from langchain_core.vectorstores import VectorStore f...
langchain/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/baby_agi.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/baby_agi.py", "repo_id": "langchain", "token_count": 3981 }
426
import os import pytest from unittest.mock import patch, MagicMock import chromadb from chromadb.db.impl.sqlite import SqliteDB from chromadb.config import System, Settings @pytest.mark.parametrize("migrations_hash_algorithm", [None, "md5", "sha256"]) @patch("chromadb.api.fastapi.FastAPI") @patch.dict(os.environ, {}...
chroma/chromadb/test/db/test_hash.py/0
{ "file_path": "chroma/chromadb/test/db/test_hash.py", "repo_id": "chroma", "token_count": 1615 }
23
from langchain.prompts.prompt import PromptTemplate sentence_template = """Given the following fields, create a sentence about them. Make the sentence detailed and interesting. Use every given field. If any additional preferences are given, use them during sentence construction as well. Fields: {fields} Preferences: ...
langchain/libs/experimental/langchain_experimental/synthetic_data/prompts.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/synthetic_data/prompts.py", "repo_id": "langchain", "token_count": 126 }
449
"""Utils for LLM Compiler.""" import ast import re from typing import Any, Dict, List, Sequence, Tuple, Union from llama_index.core.tools.function_tool import FunctionTool from llama_index.core.tools.types import BaseTool, adapt_to_async_tool from .schema import ( LLMCompilerParseResult, LLMCompilerTask, ) #...
llama_index/llama-index-packs/llama-index-packs-agents-llm-compiler/llama_index/packs/agents_llm_compiler/utils.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-agents-llm-compiler/llama_index/packs/agents_llm_compiler/utils.py", "repo_id": "llama_index", "token_count": 2042 }
1,690
// 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/querycoordv2/handlers.go/0
{ "file_path": "milvus/internal/querycoordv2/handlers.go", "repo_id": "milvus", "token_count": 5096 }
1,975
package common import ( "reflect" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) type KeyDataPairs []*commonpb.KeyDataPair func (pairs KeyDataPairs) Clone() KeyDataPairs { clone := make(KeyDataPairs, 0, len(pairs)) for _, pair := range pairs { clone = append(clone, &commonpb.KeyDataPair{ Key: pa...
milvus/pkg/common/key_data_pairs.go/0
{ "file_path": "milvus/pkg/common/key_data_pairs.go", "repo_id": "milvus", "token_count": 315 }
1,879
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/hubert/test_modeling_hubert.py/0
{ "file_path": "transformers/tests/models/hubert/test_modeling_hubert.py", "repo_id": "transformers", "token_count": 18040 }
819
// Code generated by mockery v2.33.3. DO NOT EDIT. package mocks import ( dbmodel "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel" mock "github.com/stretchr/testify/mock" ) // INotificationDb is an autogenerated mock type for the INotificationDb type type INotificationDb struct { mock.Mock } ...
chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/INotificationDb.go/0
{ "file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/INotificationDb.go", "repo_id": "chroma", "token_count": 1121 }
51
# Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
accelerate/examples/complete_cv_example.py/0
{ "file_path": "accelerate/examples/complete_cv_example.py", "repo_id": "accelerate", "token_count": 5356 }
5
<jupyter_start><jupyter_text>Rerank can speed up an LLM query without sacrificing accuracy (and in fact, probably improving it). It does so by pruning away irrelevant nodes from the context. If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-...
llama_index/docs/examples/node_postprocessor/FlagEmbeddingReranker.ipynb/0
{ "file_path": "llama_index/docs/examples/node_postprocessor/FlagEmbeddingReranker.ipynb", "repo_id": "llama_index", "token_count": 1476 }
1,070
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
weblangchain/nextjs/postcss.config.js/0
{ "file_path": "weblangchain/nextjs/postcss.config.js", "repo_id": "weblangchain", "token_count": 38 }
1,997
- sections: - local: index title: 🤗 Transformers - local: quicktour title: Quick tour - local: installation title: Installation title: Get started - sections: - local: pipeline_tutorial title: Run inference with pipelines - local: autoclass_tutorial title: Write portable code with AutoC...
transformers/docs/source/en/_toctree.yml/0
{ "file_path": "transformers/docs/source/en/_toctree.yml", "repo_id": "transformers", "token_count": 10798 }
491
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
trl/tests/test_iterative_sft_trainer.py/0
{ "file_path": "trl/tests/test_iterative_sft_trainer.py", "repo_id": "trl", "token_count": 1898 }
790
import sys from typing import Any, AsyncIterator, Iterator import pytest from syrupy import SnapshotAssertion from langchain_core.load import dumps from langchain_core.prompts import PromptTemplate from langchain_core.runnables import ( Runnable, RunnableGenerator, RunnableLambda, RunnableParallel, ...
langchain/libs/core/tests/unit_tests/runnables/test_fallbacks.py/0
{ "file_path": "langchain/libs/core/tests/unit_tests/runnables/test_fallbacks.py", "repo_id": "langchain", "token_count": 3715 }
419
from llama_index.core.readers.base import BaseReader from llama_index.readers.semanticscholar import SemanticScholarReader def test_class(): names_of_base_classes = [b.__name__ for b in SemanticScholarReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-semanticscholar/tests/test_readers_semanticscholar.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-semanticscholar/tests/test_readers_semanticscholar.py", "repo_id": "llama_index", "token_count": 94 }
1,521
// Copyright (C) 2019-2023 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/src/simd/hook.cpp/0
{ "file_path": "milvus/internal/core/src/simd/hook.cpp", "repo_id": "milvus", "token_count": 9710 }
1,887
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_prior_emb2emb.py/0
{ "file_path": "diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_prior_emb2emb.py", "repo_id": "diffusers", "token_count": 3478 }
252
from typing import Any, List, Literal from langchain_core.messages.base import ( BaseMessage, BaseMessageChunk, merge_content, ) class ChatMessage(BaseMessage): """Message that can be assigned an arbitrary speaker (i.e. role).""" role: str """The speaker / role of the Message.""" type: ...
langchain/libs/core/langchain_core/messages/chat.py/0
{ "file_path": "langchain/libs/core/langchain_core/messages/chat.py", "repo_id": "langchain", "token_count": 886 }
417
[tool.poetry] name = "rag-singlestoredb" version = "0.0.1" description = "RAG using SingleStoreDB" authors = [ "Alex Peng <apeng@singlestore.com>" ] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" openai = "<2" singlestoredb = ">=0.8.1" tiktoken = "^0.5.1" [tool.poetry.g...
langchain/templates/rag-singlestoredb/pyproject.toml/0
{ "file_path": "langchain/templates/rag-singlestoredb/pyproject.toml", "repo_id": "langchain", "token_count": 312 }
689
from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Sequence, Union from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader if TYPE_CHECKING: import tweepy from tweepy import OAuth2BearerHandler, OAu...
langchain/libs/community/langchain_community/document_loaders/twitter.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/twitter.py", "repo_id": "langchain", "token_count": 1547 }
246
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, 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 cop...
transformers/examples/legacy/token-classification/run_ner.py/0
{ "file_path": "transformers/examples/legacy/token-classification/run_ner.py", "repo_id": "transformers", "token_count": 5023 }
560
""" Test Amazon Bedrock API wrapper and services i.e 'Guardrails for Amazon Bedrock'. You can get a list of models from the bedrock client by running 'bedrock_models()' """ import os from typing import Any import pytest from langchain_core.callbacks import AsyncCallbackHandler from langchain_community.llms.bedrock ...
langchain/libs/community/tests/integration_tests/llms/test_bedrock.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_bedrock.py", "repo_id": "langchain", "token_count": 1878 }
356
import { MaskingParser, RegexMaskingTransformer, } from "langchain/experimental/masking"; // A simple hash function for demonstration purposes function simpleHash(input: string): string { let hash = 0; for (let i = 0; i < input.length; i += 1) { const char = input.charCodeAt(i); hash = (hash << 5) - ha...
langchainjs/examples/src/experimental/masking/kitchen_sink.ts/0
{ "file_path": "langchainjs/examples/src/experimental/masking/kitchen_sink.ts", "repo_id": "langchainjs", "token_count": 1270 }
775
// 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/querycoordv2/task/scheduler.go/0
{ "file_path": "milvus/internal/querycoordv2/task/scheduler.go", "repo_id": "milvus", "token_count": 9357 }
2,037
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor. # # 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....
datasets/metrics/precision/precision.py/0
{ "file_path": "datasets/metrics/precision/precision.py", "repo_id": "datasets", "token_count": 2663 }
123
include LICENSE include src/diffusers/utils/model_card_template.md
diffusers/MANIFEST.in/0
{ "file_path": "diffusers/MANIFEST.in", "repo_id": "diffusers", "token_count": 20 }
178
from langchain_community.tools.e2b_data_analysis.tool import ( E2BDataAnalysisTool, E2BDataAnalysisToolArguments, UploadedFile, ) __all__ = [ "UploadedFile", "E2BDataAnalysisToolArguments", "E2BDataAnalysisTool", ]
langchain/libs/langchain/langchain/tools/e2b_data_analysis/tool.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/e2b_data_analysis/tool.py", "repo_id": "langchain", "token_count": 98 }
552
# HuggingFace Inference This Embeddings integration uses the HuggingFace Inference API to generate embeddings for a given text using by default the `sentence-transformers/distilbert-base-nli-mean-tokens` model. You can pass a different model name to the constructor to use a different model. ```bash npm2yarn npm insta...
langchainjs/docs/core_docs/docs/integrations/text_embedding/hugging_face_inference.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/text_embedding/hugging_face_inference.mdx", "repo_id": "langchainjs", "token_count": 189 }
769
import json import os import re import string from collections import Counter from shutil import rmtree from typing import Any, Dict, List, Optional, Tuple import requests import tqdm from llama_index.core.base.base_query_engine import BaseQueryEngine from llama_index.core.base.base_retriever import BaseRetriever from...
llama_index/llama-index-core/llama_index/core/evaluation/benchmarks/hotpotqa.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/evaluation/benchmarks/hotpotqa.py", "repo_id": "llama_index", "token_count": 3380 }
1,145
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/readers/redis/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/redis/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,706
# coding=utf-8 # Copyright 2022 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_upscale.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_upscale.py", "repo_id": "diffusers", "token_count": 3918 }
282
"""Finetuning modules.""" from llama_index.legacy.finetuning.embeddings.adapter import ( EmbeddingAdapterFinetuneEngine, ) from llama_index.legacy.finetuning.embeddings.common import ( EmbeddingQAFinetuneDataset, generate_qa_embedding_pairs, ) from llama_index.legacy.finetuning.embeddings.sentence_transfor...
llama_index/llama-index-legacy/llama_index/legacy/finetuning/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/finetuning/__init__.py", "repo_id": "llama_index", "token_count": 410 }
1,653
from llama_index.embeddings.cohere.base import CohereEmbedding __all__ = ["CohereEmbedding"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-cohere/llama_index/embeddings/cohere/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-cohere/llama_index/embeddings/cohere/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,225
import pytest from llama_index.legacy.embeddings.elasticsearch import ElasticsearchEmbedding try: import elasticsearch except ImportError: elasticsearch = None # type: ignore @pytest.fixture() def model_id() -> str: # Replace with your actual model_id return "your_model_id" @pytest.fixture() def e...
llama_index/llama-index-legacy/tests/embeddings/test_elasticsearch.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/embeddings/test_elasticsearch.py", "repo_id": "llama_index", "token_count": 386 }
1,617
# Using MKL
candle/candle-book/src/advanced/mkl.md/0
{ "file_path": "candle/candle-book/src/advanced/mkl.md", "repo_id": "candle", "token_count": 5 }
21
from llama_index.callbacks.openinference.base import OpenInferenceCallbackHandler __all__ = ["OpenInferenceCallbackHandler"]
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-openinference/llama_index/callbacks/openinference/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-openinference/llama_index/callbacks/openinference/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,230
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/src/transformers/models/musicgen/convert_musicgen_transformers.py/0
{ "file_path": "transformers/src/transformers/models/musicgen/convert_musicgen_transformers.py", "repo_id": "transformers", "token_count": 3641 }
636
<!--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/clip.md/0
{ "file_path": "transformers/docs/source/en/model_doc/clip.md", "repo_id": "transformers", "token_count": 2696 }
486
from typing import Any, Dict, Type from llama_index.legacy.readers.base import BasePydanticReader from llama_index.legacy.readers.discord_reader import DiscordReader from llama_index.legacy.readers.elasticsearch import ElasticsearchReader from llama_index.legacy.readers.google_readers.gdocs import GoogleDocsReader fro...
llama_index/llama-index-legacy/llama_index/legacy/readers/loading.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/loading.py", "repo_id": "llama_index", "token_count": 741 }
1,635
from langchain_community.llms.volcengine_maas import ( VolcEngineMaasBase, VolcEngineMaasLLM, ) __all__ = ["VolcEngineMaasBase", "VolcEngineMaasLLM"]
langchain/libs/langchain/langchain/llms/volcengine_maas.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/volcengine_maas.py", "repo_id": "langchain", "token_count": 66 }
517
"""Office365 toolkit."""
langchain/libs/community/langchain_community/agent_toolkits/office365/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/office365/__init__.py", "repo_id": "langchain", "token_count": 8 }
230
<jupyter_start><jupyter_text>iMessageThis notebook shows how to use the iMessage chat loader. This class helps convert iMessage conversations to LangChain chat messages.On MacOS, iMessage stores conversations in a sqlite database at `~/Library/Messages/chat.db` (at least for macOS Ventura 13.4). The `IMessageChatLoader...
langchain/docs/docs/integrations/chat_loaders/imessage.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/chat_loaders/imessage.ipynb", "repo_id": "langchain", "token_count": 2103 }
94
<jupyter_start><jupyter_text>YouTube audioBuilding chat or QA applications on YouTube videos is a topic of high interest.Below we show how to easily go from a `YouTube url` to `audio of the video` to `text` to `chat`!We wil use the `OpenAIWhisperParser`, which will use the OpenAI Whisper API to transcribe audio to text...
langchain/docs/docs/integrations/document_loaders/youtube_audio.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/youtube_audio.ipynb", "repo_id": "langchain", "token_count": 1055 }
113
import torch import torch.distributed from typing import List, Optional, Tuple from transformers import ( AutoTokenizer, AutoConfig, AutoProcessor, ) from text_generation_server.models.custom_modeling.idefics_config import IdeficsConfig from text_generation_server.models.custom_modeling.idefics_processin...
text-generation-inference/server/text_generation_server/models/idefics.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/idefics.py", "repo_id": "text-generation-inference", "token_count": 1306 }
404
""" This module maintains the list of transformations that are supported by the system. """ from enum import Enum from typing import Generic, Sequence, Type, TypeVar from llama_index.core.bridge.pydantic import BaseModel, Field, GenericModel from llama_index.core.extractors import ( KeywordExtractor, Question...
llama_index/llama-index-core/llama_index/core/ingestion/transformations.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/ingestion/transformations.py", "repo_id": "llama_index", "token_count": 4769 }
1,184
# Copyright 2024 Harutatsu Akiyama, Jinbin Bai, and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
diffusers/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py", "repo_id": "diffusers", "token_count": 39925 }
244
"""Init file.""" from llama_index.readers.papers.arxiv.base import ArxivReader from llama_index.readers.papers.pubmed.base import PubmedReader __all__ = ["ArxivReader", "PubmedReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-papers/llama_index/readers/papers/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-papers/llama_index/readers/papers/__init__.py", "repo_id": "llama_index", "token_count": 65 }
1,399
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/electra.md/0
{ "file_path": "transformers/docs/source/en/model_doc/electra.md", "repo_id": "transformers", "token_count": 2211 }
474
from abc import ABC, abstractmethod from typing import List from langchain_core.runnables.config import run_in_executor class Embeddings(ABC): """Interface for embedding models.""" @abstractmethod def embed_documents(self, texts: List[str]) -> List[List[float]]: """Embed search docs.""" @ab...
langchain/libs/core/langchain_core/embeddings.py/0
{ "file_path": "langchain/libs/core/langchain_core/embeddings.py", "repo_id": "langchain", "token_count": 286 }
399
import { test, expect } from "@jest/globals"; import { SystemMessage, HumanMessage } from "@langchain/core/messages"; import { ChatAlibabaTongyi } from "../alibaba_tongyi.js"; interface TestConfig { modelName: string | undefined; config: { description?: string; temperature?: number; topP?: number; ...
langchainjs/libs/langchain-community/src/chat_models/tests/chatalitongyi.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/chat_models/tests/chatalitongyi.int.test.ts", "repo_id": "langchainjs", "token_count": 1271 }
978
# coding=utf-8 # Copyright 2020 Microsoft and the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
transformers/src/transformers/models/deberta_v2/tokenization_deberta_v2.py/0
{ "file_path": "transformers/src/transformers/models/deberta_v2/tokenization_deberta_v2.py", "repo_id": "transformers", "token_count": 9944 }
669
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-bitbucket/llama_index/readers/bitbucket/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-bitbucket/llama_index/readers/bitbucket/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,328
import os import argparse from transformers import ( AutoModelForCausalLM, AutoTokenizer, set_seed, default_data_collator, BitsAndBytesConfig, Trainer, TrainingArguments, ) from datasets import load_from_disk import torch from peft import PeftConfig, PeftModel def parse_arge(): """Pars...
notebooks/sagemaker/28_train_llms_with_qlora/scripts/run_clm.py/0
{ "file_path": "notebooks/sagemaker/28_train_llms_with_qlora/scripts/run_clm.py", "repo_id": "notebooks", "token_count": 2378 }
331
// TODO: Add an offline mode. #[cfg(feature = "accelerate")] extern crate accelerate_src; #[cfg(feature = "mkl")] extern crate intel_mkl_src; use anyhow::{Error as E, Result}; use candle::{DType, Device, Tensor}; use candle_nn::VarBuilder; use candle_transformers::generation::LogitsProcessor; use clap::Parser; use h...
candle/candle-examples/examples/falcon/main.rs/0
{ "file_path": "candle/candle-examples/examples/falcon/main.rs", "repo_id": "candle", "token_count": 2723 }
37
python_tests()
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-llm-rails/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-llm-rails/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,251
# Fireworks This page covers how to use [Fireworks](https://app.fireworks.ai/) models within Langchain. ## Installation and setup - Install the Fireworks client library. ``` pip install fireworks-ai ``` - Get a Fireworks API key by signing up at [app.fireworks.ai](https://app.fireworks.ai). - Authenticate by...
langchain/docs/docs/integrations/providers/fireworks.md/0
{ "file_path": "langchain/docs/docs/integrations/providers/fireworks.md", "repo_id": "langchain", "token_count": 404 }
140
from langchain_community.llms.titan_takeoff_pro import TitanTakeoffPro __all__ = ["TitanTakeoffPro"]
langchain/libs/langchain/langchain/llms/titan_takeoff_pro.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/titan_takeoff_pro.py", "repo_id": "langchain", "token_count": 35 }
566
<jupyter_start><jupyter_text>IntroductionIn this notebook, we will learn how to use [LoRA](https://arxiv.org/abs/2106.09685) from 🤗 PEFT to fine-tune an image classification model by ONLY using **0.77%** of the original trainable parameters of the model. LoRA adds low-rank "update matrices" to certain blocks in the un...
peft/examples/image_classification/image_classification_peft_lora.ipynb/0
{ "file_path": "peft/examples/image_classification/image_classification_peft_lora.ipynb", "repo_id": "peft", "token_count": 6369 }
327
import { GoogleAbstractedClient, GoogleBaseLLM, GoogleBaseLLMInput, } from "@langchain/google-common"; import { GoogleAuthOptions } from "google-auth-library"; import { GAuthClient } from "./auth.js"; /** * Input to LLM class. */ export interface GoogleLLMInput extends GoogleBaseLLMInput<GoogleAuthOptions> {} ...
langchainjs/libs/langchain-google-gauth/src/llms.ts/0
{ "file_path": "langchainjs/libs/langchain-google-gauth/src/llms.ts", "repo_id": "langchainjs", "token_count": 257 }
1,098
from abc import abstractmethod class Reader: def __init__(self): pass @abstractmethod def _filename(self, index, basename=False, absolute=False): pass def filename(self, index, basename=False, absolute=False): return self._filename(index, basename=basename, absolute=absolute)...
pytorch-image-models/timm/data/readers/reader.py/0
{ "file_path": "pytorch-image-models/timm/data/readers/reader.py", "repo_id": "pytorch-image-models", "token_count": 171 }
359
from llama_index.core.llama_pack import BaseLlamaPack from llama_index.packs.rag_fusion_query_pipeline import RAGFusionPipelinePack def test_class(): names_of_base_classes = [b.__name__ for b in RAGFusionPipelinePack.__mro__] assert BaseLlamaPack.__name__ in names_of_base_classes
llama_index/llama-index-packs/llama-index-packs-rag-fusion-query-pipeline/tests/test_packs_query.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-rag-fusion-query-pipeline/tests/test_packs_query.py", "repo_id": "llama_index", "token_count": 111 }
1,691
from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.embeddings.cohere import CohereEmbedding def test_anyscale_class(): emb = CohereEmbedding(cohere_api_key="fake_key") assert isinstance(emb, BaseEmbedding)
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-cohere/tests/test_embeddings_cohere.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-cohere/tests/test_embeddings_cohere.py", "repo_id": "llama_index", "token_count": 89 }
1,271
[tool.poetry] name = "bedrock-jcvd" version = "0.1.0" description = "LangChain template that behaves like JCVD using Anthropic's Claude on Amazon Bedrock" authors = ["JGalego <jgalego1990@gmail.com>"] readme = "README.md" [tool.poetry.dependencies] python = "^3.11" uvicorn = "^0.23.2" langserve = {extras = ["server"],...
langchain/templates/bedrock-jcvd/pyproject.toml/0
{ "file_path": "langchain/templates/bedrock-jcvd/pyproject.toml", "repo_id": "langchain", "token_count": 304 }
629
# LlamaIndex Callbacks Integration: OpenInference
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-openinference/README.md/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-openinference/README.md", "repo_id": "llama_index", "token_count": 12 }
1,247
<jupyter_start><jupyter_text>Anyscale[Anyscale](https://www.anyscale.com/) is a fully-managed [Ray](https://www.ray.io/) platform, on which you can build, deploy, and manage scalable AI and Python applicationsThis example goes over how to use LangChain to interact with [Anyscale Endpoint](https://app.endpoints.anyscale...
langchain/docs/docs/integrations/llms/anyscale.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/anyscale.ipynb", "repo_id": "langchain", "token_count": 622 }
111
[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 = ["SpotifyReader"] contains_example = false import_path = "llama_index.readers.spotify" [to...
llama_index/llama-index-integrations/readers/llama-index-readers-spotify/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-spotify/pyproject.toml", "repo_id": "llama_index", "token_count": 664 }
1,445
"""Golden API toolkit.""" from langchain_community.tools.golden_query.tool import GoldenQueryRun __all__ = [ "GoldenQueryRun", ]
langchain/libs/langchain/langchain/tools/golden_query/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/golden_query/__init__.py", "repo_id": "langchain", "token_count": 46 }
556
<!--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/zh/serialization.md/0
{ "file_path": "transformers/docs/source/zh/serialization.md", "repo_id": "transformers", "token_count": 4917 }
516
python_sources()
llama_index/llama-index-integrations/retrievers/llama-index-retrievers-bm25/llama_index/retrievers/bm25/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/retrievers/llama-index-retrievers-bm25/llama_index/retrievers/bm25/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,456
use crate::models::with_tracing::QMatMul; use crate::quantized_nn::{layer_norm, linear, Embedding, Linear}; pub use crate::quantized_var_builder::VarBuilder; use candle::{Module, Result, Tensor, D}; use candle_nn::LayerNorm; pub type Config = super::blip_text::Config; #[derive(Debug, Clone)] struct TextEmbeddings { ...
candle/candle-transformers/src/models/quantized_blip_text.rs/0
{ "file_path": "candle/candle-transformers/src/models/quantized_blip_text.rs", "repo_id": "candle", "token_count": 7022 }
66
"""Utilities for loading configurations from langchain_core-hub.""" import os import re import tempfile from pathlib import Path, PurePosixPath from typing import Any, Callable, Optional, Set, TypeVar, Union from urllib.parse import urljoin import requests DEFAULT_REF = os.environ.get("LANGCHAIN_HUB_DEFAULT_REF", "m...
langchain/libs/core/langchain_core/utils/loading.py/0
{ "file_path": "langchain/libs/core/langchain_core/utils/loading.py", "repo_id": "langchain", "token_count": 759 }
401
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/core/src/exec/operator/FilterBits.cpp/0
{ "file_path": "milvus/internal/core/src/exec/operator/FilterBits.cpp", "repo_id": "milvus", "token_count": 932 }
1,925
import itertools import warnings from dataclasses import InitVar, dataclass from io import StringIO from typing import Optional import pyarrow as pa import datasets from datasets.features.features import require_storage_cast from datasets.table import table_cast logger = datasets.utils.logging.get_logger(__name__) ...
datasets/src/datasets/packaged_modules/text/text.py/0
{ "file_path": "datasets/src/datasets/packaged_modules/text/text.py", "repo_id": "datasets", "token_count": 3042 }
146
# coding=utf-8 # Copyright 2022 Meta Platforms, 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...
transformers/src/transformers/models/levit/modeling_levit.py/0
{ "file_path": "transformers/src/transformers/models/levit/modeling_levit.py", "repo_id": "transformers", "token_count": 12814 }
681
package compressor import ( "bytes" "fmt" "io" "strings" "sync" "testing" "github.com/klauspost/compress/zstd" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus/pkg/util/hardware" ) func TestZstdCompress(t *testing.T) { data := "hello zstd algorithm!" compressed := new(bytes.Buffer) orig...
milvus/pkg/util/compressor/compressor_test.go/0
{ "file_path": "milvus/pkg/util/compressor/compressor_test.go", "repo_id": "milvus", "token_count": 1695 }
1,897
import { initializeAgentExecutorWithOptions } from "langchain/agents"; import { OpenAI } from "@langchain/openai"; import { GmailCreateDraft, GmailGetMessage, GmailGetThread, GmailSearch, GmailSendMessage, } from "@langchain/community/tools/gmail"; import { StructuredTool } from "@langchain/core/tools"; expo...
langchainjs/examples/src/tools/gmail.ts/0
{ "file_path": "langchainjs/examples/src/tools/gmail.ts", "repo_id": "langchainjs", "token_count": 725 }
823
""" EvoNorm in PyTorch Based on `Evolving Normalization-Activation Layers` - https://arxiv.org/abs/2004.02967 @inproceedings{NEURIPS2020, author = {Liu, Hanxiao and Brock, Andy and Simonyan, Karen and Le, Quoc}, booktitle = {Advances in Neural Information Processing Systems}, editor = {H. Larochelle and M. Ranzato ...
pytorch-image-models/timm/layers/evo_norm.py/0
{ "file_path": "pytorch-image-models/timm/layers/evo_norm.py", "repo_id": "pytorch-image-models", "token_count": 6684 }
344
reviewers: - binbinlv - ThreadDao - wangting0128 - yanliang567 - zhuwenxing approvers: - maintainers labels: - area/test - sig/testing
milvus/tests/OWNERS/0
{ "file_path": "milvus/tests/OWNERS", "repo_id": "milvus", "token_count": 66 }
1,849
from rag_aws_bedrock.chain import chain if __name__ == "__main__": query = "What is this data about?" print(chain.invoke(query)) # noqa: T201
langchain/templates/rag-aws-bedrock/main.py/0
{ "file_path": "langchain/templates/rag-aws-bedrock/main.py", "repo_id": "langchain", "token_count": 56 }
711
[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 = ["GuruReader"] contains_example = false import_path = "llama_index.readers.guru" [tool.myp...
llama_index/llama-index-integrations/readers/llama-index-readers-guru/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-guru/pyproject.toml", "repo_id": "llama_index", "token_count": 661 }
1,332
// 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/eventlog/logger.go/0
{ "file_path": "milvus/pkg/eventlog/logger.go", "repo_id": "milvus", "token_count": 495 }
1,817