text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [0.13.2] - Python only changes ## [0.13.1] - [#1072] Fixing ...
tokenizers/tokenizers/CHANGELOG.md/0
{ "file_path": "tokenizers/tokenizers/CHANGELOG.md", "repo_id": "tokenizers", "token_count": 3388 }
459
<!--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/barthez.md/0
{ "file_path": "transformers/docs/source/en/model_doc/barthez.md", "repo_id": "transformers", "token_count": 818 }
484
// 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/util/tsoutil/tso.go/0
{ "file_path": "milvus/pkg/util/tsoutil/tso.go", "repo_id": "milvus", "token_count": 1019 }
1,852
import time import jax import jax.numpy as jnp import numpy as np from flax.jax_utils import replicate from jax import pmap # Let's cache the model compilation, so that it doesn't take as long the next time around. from jax.experimental.compilation_cache import compilation_cache as cc from diffusers import FlaxStabl...
diffusers/examples/research_projects/sdxl_flax/sdxl_single_aot.py/0
{ "file_path": "diffusers/examples/research_projects/sdxl_flax/sdxl_single_aot.py", "repo_id": "diffusers", "token_count": 1969 }
220
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-packs/llama-index-packs-retry-engine-weaviate/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-retry-engine-weaviate/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,673
"""All unit tests (lightweight tests).""" from typing import Any def assert_all_importable(module: Any) -> None: for attr in module.__all__: getattr(module, attr)
langchain/libs/langchain/tests/unit_tests/__init__.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/__init__.py", "repo_id": "langchain", "token_count": 63 }
644
from pymilvus import DataType from milvus_benchmark.runners.locust_user import locust_executor from milvus_benchmark.client import MilvusClient if __name__ == "__main__": connection_type = "single" host = "127.0.0.1" port = 19530 collection_name = "sift_1m_128_l2" run_params = {"tasks": {"insert":...
milvus/tests/benchmark/milvus_benchmark/tests/locust_user_test.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/tests/locust_user_test.py", "repo_id": "milvus", "token_count": 251 }
1,946
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/core/response/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/core/response/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,488
#!/bin/bash # 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...
milvus/tests/scripts/e2e-k8s.sh/0
{ "file_path": "milvus/tests/scripts/e2e-k8s.sh", "repo_id": "milvus", "token_count": 5060 }
1,907
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,377
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-preprocess/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-preprocess/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,367
<jupyter_start><jupyter_text>Baichuan Text EmbeddingsAs of today (Jan 25th, 2024) BaichuanTextEmbeddings ranks 1 in C-MTEB (Chinese Multi-Task Embedding Benchmark) leaderboard. Leaderboard (Under Overall -> Chinese section): https://huggingface.co/spaces/mteb/leaderboard Official Website: https://platform.baichuan-ai.c...
langchain/docs/docs/integrations/text_embedding/baichuan.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/text_embedding/baichuan.ipynb", "repo_id": "langchain", "token_count": 403 }
170
# Installation You can install TRL either from pypi or from source: ## pypi Install the library with pip: ```bash pip install trl ``` ### Source You can also install the latest version from source. First clone the repo and then run the installation with `pip`: ```bash git clone https://github.com/huggingface/trl.gi...
trl/docs/source/installation.mdx/0
{ "file_path": "trl/docs/source/installation.mdx", "repo_id": "trl", "token_count": 147 }
864
import logging import re from typing import List, Optional from langchain_community.document_loaders import AsyncHtmlLoader from langchain_community.document_transformers import Html2TextTransformer from langchain_community.llms import LlamaCpp from langchain_community.utilities import GoogleSearchAPIWrapper from lang...
langchain/libs/langchain/langchain/retrievers/web_research.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/web_research.py", "repo_id": "langchain", "token_count": 3294 }
562
from langchain_core.utils.formatting import StrictFormatter __all__ = ["StrictFormatter"]
langchain/libs/langchain/langchain/utils/formatting.py/0
{ "file_path": "langchain/libs/langchain/langchain/utils/formatting.py", "repo_id": "langchain", "token_count": 28 }
600
--- hide_table_of_contents: true --- import CodeBlock from "@theme/CodeBlock"; # Tavily Search Tavily Search is a robust search API tailored specifically for LLM Agents. It seamlessly integrates with diverse data sources to ensure a superior, relevant search experience. ## Setup Set up an API key [here](https://ap...
langchainjs/docs/core_docs/docs/integrations/tools/tavily_search.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/tools/tavily_search.mdx", "repo_id": "langchainjs", "token_count": 237 }
726
import tempfile import torch from diffusers import ( DEISMultistepScheduler, DPMSolverMultistepScheduler, DPMSolverSinglestepScheduler, UniPCMultistepScheduler, ) from .test_schedulers import SchedulerCommonTest class DPMSolverMultistepSchedulerTest(SchedulerCommonTest): scheduler_classes = (DP...
diffusers/tests/schedulers/test_scheduler_dpm_multi.py/0
{ "file_path": "diffusers/tests/schedulers/test_scheduler_dpm_multi.py", "repo_id": "diffusers", "token_count": 6367 }
274
from langchain_community.tools.slack.base import SlackBaseTool __all__ = ["SlackBaseTool"]
langchain/libs/langchain/langchain/tools/slack/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/slack/base.py", "repo_id": "langchain", "token_count": 29 }
566
ARG BASE_DOCKER_IMAGE FROM $BASE_DOCKER_IMAGE LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive # Use login shell to read variables from `~/.profile` (to pass dynamic created variables between RUN commands) SHELL ["sh", "-lc"] RUN apt update RUN apt install -y git libsndfile1-dev tesseract-ocr espea...
transformers/docker/transformers-past-gpu/Dockerfile/0
{ "file_path": "transformers/docker/transformers-past-gpu/Dockerfile", "repo_id": "transformers", "token_count": 886 }
467
<jupyter_start><jupyter_code>import argparse import os import torch from torch.optim import AdamW from torch.utils.data import DataLoader from peft import ( get_peft_config, get_peft_model, get_peft_model_state_dict, set_peft_model_state_dict, PeftType, PrefixTuningConfig, PromptEncoderConf...
peft/examples/sequence_classification/prefix_tuning.ipynb/0
{ "file_path": "peft/examples/sequence_classification/prefix_tuning.ipynb", "repo_id": "peft", "token_count": 2008 }
329
"""Test Nebula API wrapper.""" from langchain_community.llms.symblai_nebula import Nebula def test_symblai_nebula_call() -> None: """Test valid call to Nebula.""" conversation = """Sam: Good morning, team! Let's keep this standup concise. We'll go in the usual order: what you did yesterday, what you...
langchain/libs/community/tests/integration_tests/llms/test_symblai_nebula.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_symblai_nebula.py", "repo_id": "langchain", "token_count": 612 }
360
python_tests()
llama_index/llama-index-integrations/indices/llama-index-indices-managed-zilliz/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-zilliz/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,288
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/config/source.go/0
{ "file_path": "milvus/pkg/config/source.go", "repo_id": "milvus", "token_count": 851 }
1,912
# Type of tasks [[tasks]] A task is an **instance** of a Reinforcement Learning problem. We can have two types of tasks: **episodic** and **continuing**. ## Episodic task [[episodic-task]] In this case, we have a starting point and an ending point **(a terminal state). This creates an episode**: a list of States, Ac...
deep-rl-class/units/en/unit1/tasks.mdx/0
{ "file_path": "deep-rl-class/units/en/unit1/tasks.mdx", "repo_id": "deep-rl-class", "token_count": 436 }
161
"""Test functionality related to prompt utils.""" from langchain_core.example_selectors import sorted_values def test_sorted_vals() -> None: """Test sorted values from dictionary.""" test_dict = {"key2": "val2", "key1": "val1"} expected_response = ["val1", "val2"] assert sorted_values(test_dict) == ex...
langchain/libs/core/tests/unit_tests/prompts/test_utils.py/0
{ "file_path": "langchain/libs/core/tests/unit_tests/prompts/test_utils.py", "repo_id": "langchain", "token_count": 108 }
407
"""Keyword Table Index Data Structures.""" # indices from llama_index.core.indices.keyword_table.base import ( GPTKeywordTableIndex, KeywordTableIndex, ) from llama_index.core.indices.keyword_table.rake_base import ( GPTRAKEKeywordTableIndex, RAKEKeywordTableIndex, ) from llama_index.core.indices.keywo...
llama_index/llama-index-core/llama_index/core/indices/keyword_table/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/keyword_table/__init__.py", "repo_id": "llama_index", "token_count": 343 }
1,216
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/detr/convert_detr_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/detr/convert_detr_to_pytorch.py", "repo_id": "transformers", "token_count": 9079 }
605
from langchain_core.callbacks.base import ( AsyncCallbackHandler, BaseCallbackHandler, BaseCallbackManager, CallbackManagerMixin, ChainManagerMixin, LLMManagerMixin, RetrieverManagerMixin, RunManagerMixin, ToolManagerMixin, ) __all__ = [ "RetrieverManagerMixin", "LLMManagerM...
langchain/libs/langchain/langchain/schema/callbacks/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/callbacks/base.py", "repo_id": "langchain", "token_count": 197 }
539
import os import torch import torch.nn as nn import transformers from datasets import load_dataset from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig from peft import LoraConfig, get_peft_model os.environ["CUDA_VISIBLE_DEVICES"] = "0" # -*- coding: utf-8 -*- """Finetune-opt-bnb-peft.i...
peft/examples/fp4_finetuning/finetune_fp4_opt_bnb_peft.py/0
{ "file_path": "peft/examples/fp4_finetuning/finetune_fp4_opt_bnb_peft.py", "repo_id": "peft", "token_count": 2309 }
338
# LlamaIndex Embeddings Integration: Huggingface Optimum
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum/README.md/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum/README.md", "repo_id": "llama_index", "token_count": 15 }
1,310
"""Test the Nebula model by Symbl.ai""" from langchain_core.pydantic_v1 import SecretStr from pytest import CaptureFixture, MonkeyPatch from langchain_community.llms.symblai_nebula import Nebula def test_api_key_is_secret_string() -> None: llm = Nebula(nebula_api_key="secret-api-key") assert isinstance(llm....
langchain/libs/community/tests/unit_tests/llms/test_symblai_nebula.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/llms/test_symblai_nebula.py", "repo_id": "langchain", "token_count": 392 }
410
"""Loads Microsoft Excel files.""" from typing import Any, List from langchain_community.document_loaders.unstructured import ( UnstructuredFileLoader, validate_unstructured_version, ) class UnstructuredExcelLoader(UnstructuredFileLoader): """Load Microsoft Excel files using `Unstructured`. Like oth...
langchain/libs/community/langchain_community/document_loaders/excel.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/excel.py", "repo_id": "langchain", "token_count": 607 }
255
"""Evaluation modules.""" from llama_index.core.evaluation.answer_relevancy import AnswerRelevancyEvaluator from llama_index.core.evaluation.base import ( BaseEvaluator, EvaluationResult, ) from llama_index.core.evaluation.batch_runner import BatchEvalRunner from llama_index.core.evaluation.context_relevancy i...
llama_index/llama-index-core/llama_index/core/evaluation/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/evaluation/__init__.py", "repo_id": "llama_index", "token_count": 1021 }
1,169
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/serialization.md/0
{ "file_path": "transformers/docs/source/ja/serialization.md", "repo_id": "transformers", "token_count": 4831 }
488
from langchain_core.prompts.loading import ( _load_examples, _load_few_shot_prompt, _load_output_parser, _load_prompt, _load_prompt_from_file, _load_template, load_prompt, load_prompt_from_config, ) from langchain_core.utils.loading import try_load_from_hub __all__ = [ "load_prompt_...
langchain/libs/langchain/langchain/prompts/loading.py/0
{ "file_path": "langchain/libs/langchain/langchain/prompts/loading.py", "repo_id": "langchain", "token_count": 238 }
529
python_sources()
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-uptrain/llama_index/callbacks/uptrain/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-uptrain/llama_index/callbacks/uptrain/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,263
# coding=utf-8 # Copyright 2022 Google AI and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
transformers/src/transformers/models/bit/modeling_bit.py/0
{ "file_path": "transformers/src/transformers/models/bit/modeling_bit.py", "repo_id": "transformers", "token_count": 13873 }
650
<jupyter_start><jupyter_text>Tracing without LangChain[](https://colab.research.google.com/github/langchain-ai/langsmith-cookbook/blob/main/tracing-examples/traceable/tracing_without_langchain.ipynb)LangSmith lets you instrument **any LLM application,** no LangChain required. This aids in debugging, evaluating, and mon...
langsmith-cookbook/tracing-examples/traceable/tracing_without_langchain.ipynb/0
{ "file_path": "langsmith-cookbook/tracing-examples/traceable/tracing_without_langchain.ipynb", "repo_id": "langsmith-cookbook", "token_count": 3784 }
1,142
// 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/target_manager.go/0
{ "file_path": "milvus/internal/querycoordv2/meta/target_manager.go", "repo_id": "milvus", "token_count": 5706 }
2,033
"""Leaf query mechanism.""" import logging from typing import Any, Dict, List, Optional, cast from llama_index.core.base.base_retriever import BaseRetriever from llama_index.core.base.response.schema import Response from llama_index.core.callbacks.base import CallbackManager from llama_index.core.indices.query.schema...
llama_index/llama-index-core/llama_index/core/indices/tree/select_leaf_retriever.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/tree/select_leaf_retriever.py", "repo_id": "llama_index", "token_count": 7657 }
1,126
from llama_index.core.readers.base import BaseReader from llama_index.readers.remote import RemoteReader def test_class(): names_of_base_classes = [b.__name__ for b in RemoteReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-remote/tests/test_readers_remote.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-remote/tests/test_readers_remote.py", "repo_id": "llama_index", "token_count": 85 }
1,452
#!/usr/bin/env python # coding=utf-8 # Copyright 2024 Custom Diffusion authors and the HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
diffusers/examples/custom_diffusion/train_custom_diffusion.py/0
{ "file_path": "diffusers/examples/custom_diffusion/train_custom_diffusion.py", "repo_id": "diffusers", "token_count": 26550 }
214
// Code generated by mockery v2.32.4. DO NOT EDIT. package proxyutil import ( context "context" milvuspb "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" mock "github.com/stretchr/testify/mock" proxypb "github.com/milvus-io/milvus/internal/proto/proxypb" sessionutil "github.com/milvus-io/milvus/internal...
milvus/internal/util/proxyutil/mock_proxy_client_manager.go/0
{ "file_path": "milvus/internal/util/proxyutil/mock_proxy_client_manager.go", "repo_id": "milvus", "token_count": 7300 }
1,906
<jupyter_start><jupyter_text>IntroThis notebook will show you an example of how to use DocstringWalker from Llama Hub, combined with Llama Index and LLM of your choice. Lib install for Collab<jupyter_code>!pip install llama_index !pip install llama_hub<jupyter_output><empty_output><jupyter_text>For this exercise we wi...
llama_index/llama-index-integrations/readers/llama-index-readers-docstring-walker/examples/docstringwalker_example.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-docstring-walker/examples/docstringwalker_example.ipynb", "repo_id": "llama_index", "token_count": 1416 }
1,425
/* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable no-process-env */ import { expect, test } from "@jest/globals"; import { AudioSubtitleLoader, AudioTranscriptLoader, AudioTranscriptParagraphsLoader, AudioTranscriptSentencesLoader, } from "../web/assemblyai.js"; const transcriptId...
langchainjs/langchain/src/document_loaders/tests/assemblyai.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/tests/assemblyai.int.test.ts", "repo_id": "langchainjs", "token_count": 1826 }
918
package planparserv2 import ( "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/planpb" ) type ExprWithType struct { expr *planpb.Expr dataType schemapb.DataType // ExprWithType can be a node only when nodeDependent is set to false. // For example, a column e...
milvus/internal/parser/planparserv2/node_ret.go/0
{ "file_path": "milvus/internal/parser/planparserv2/node_ret.go", "repo_id": "milvus", "token_count": 339 }
1,807
from typing import Any, List, Optional from llama_index.core.base.base_query_engine import BaseQueryEngine from llama_index.core.base.base_retriever import BaseRetriever from llama_index.core.base.response.schema import RESPONSE_TYPE, Response from llama_index.core.callbacks.base import CallbackManager from llama_inde...
llama_index/llama-index-integrations/indices/llama-index-indices-managed-vectara/llama_index/indices/managed/vectara/query.py/0
{ "file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-vectara/llama_index/indices/managed/vectara/query.py", "repo_id": "llama_index", "token_count": 2255 }
1,296
# Output Parsing Modules LlamaIndex supports integrations with output parsing modules offered by other frameworks. These output parsing modules can be used in the following ways: - To provide formatting instructions for any prompt / query (through `output_parser.format`) - To provide "parsing" for LLM outputs (throug...
llama_index/docs/module_guides/querying/structured_outputs/output_parser.md/0
{ "file_path": "llama_index/docs/module_guides/querying/structured_outputs/output_parser.md", "repo_id": "llama_index", "token_count": 1253 }
1,182
from llama_index.core.readers.base import BaseReader from llama_index.readers.firestore import FirestoreReader def test_class(): names_of_base_classes = [b.__name__ for b in FirestoreReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-firestore/tests/test_readers_firestore.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-firestore/tests/test_readers_firestore.py", "repo_id": "llama_index", "token_count": 88 }
1,374
from langchain_community.utilities.google_places_api import GooglePlacesAPIWrapper __all__ = ["GooglePlacesAPIWrapper"]
langchain/libs/langchain/langchain/utilities/google_places_api.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/google_places_api.py", "repo_id": "langchain", "token_count": 36 }
617
from langchain_community.utilities.twilio import TwilioAPIWrapper __all__ = ["TwilioAPIWrapper"]
langchain/libs/langchain/langchain/utilities/twilio.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/twilio.py", "repo_id": "langchain", "token_count": 34 }
608
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/llms/llama-index-llms-predibase/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-predibase/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,242
import { Document } from "@langchain/core/documents"; import { ChainValues } from "@langchain/core/utils/types"; import { CallbackManagerForChainRun } from "@langchain/core/callbacks/manager"; import { BasePromptTemplate, PromptTemplate } from "@langchain/core/prompts"; import type { SerializedStuffDocumentsChain, ...
langchainjs/langchain/src/chains/combine_docs_chain.ts/0
{ "file_path": "langchainjs/langchain/src/chains/combine_docs_chain.ts", "repo_id": "langchainjs", "token_count": 4760 }
888
export const PROMPT_TEMPLATE = ( noOutputStr: string ) => `Given the following question and context, extract any part of the context *AS IS* that is relevant to answer the question. If none of the context is relevant return ${noOutputStr}. Remember, *DO NOT* edit the extracted parts of the context. > Question: {que...
langchainjs/langchain/src/retrievers/document_compressors/chain_extract_prompt.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/document_compressors/chain_extract_prompt.ts", "repo_id": "langchainjs", "token_count": 106 }
1,008
# 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/tests/models/vipllava/test_modeling_vipllava.py/0
{ "file_path": "transformers/tests/models/vipllava/test_modeling_vipllava.py", "repo_id": "transformers", "token_count": 4119 }
776
import { collections } from "$lib/server/database"; import { error, type RequestHandler } from "@sveltejs/kit"; import { ObjectId } from "mongodb"; export const GET: RequestHandler = async ({ params }) => { const assistant = await collections.assistants.findOne({ _id: new ObjectId(params.assistantId), }); if (!a...
chat-ui/src/routes/settings/assistants/[assistantId]/avatar.jpg/+server.ts/0
{ "file_path": "chat-ui/src/routes/settings/assistants/[assistantId]/avatar.jpg/+server.ts", "repo_id": "chat-ui", "token_count": 385 }
111
"""Main entrypoint for the app.""" import asyncio from typing import Optional, Union from uuid import UUID import langsmith from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from langserve import add_routes from langsmith import Client from pydantic import BaseModel from chain import Chat...
chat-langchain/main.py/0
{ "file_path": "chat-langchain/main.py", "repo_id": "chat-langchain", "token_count": 1142 }
7
import json from typing import Dict, List, Optional import requests from langchain_core.pydantic_v1 import BaseModel, root_validator from langchain_core.utils.env import get_from_dict_or_env from langchain_community.tools.connery.models import Action from langchain_community.tools.connery.tool import ConneryAction ...
langchain/libs/community/langchain_community/tools/connery/service.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/connery/service.py", "repo_id": "langchain", "token_count": 2490 }
298
"""Init file."""
llama_index/llama-index-core/tests/readers/__init__.py/0
{ "file_path": "llama_index/llama-index-core/tests/readers/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,157
from langchain_community.embeddings.embaas import ( EmbaasEmbeddings, ) __all__ = [ "EmbaasEmbeddings", ]
langchain/libs/langchain/langchain/embeddings/embaas.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/embaas.py", "repo_id": "langchain", "token_count": 50 }
497
reviewers: - czs007 - LoveEachDay approvers: - maintainers
milvus/build/OWNERS/0
{ "file_path": "milvus/build/OWNERS", "repo_id": "milvus", "token_count": 26 }
1,743
from langchain.schema.messages import __all__ EXPECTED_ALL = [ "AIMessage", "AIMessageChunk", "BaseMessage", "BaseMessageChunk", "ChatMessage", "ChatMessageChunk", "FunctionMessage", "FunctionMessageChunk", "HumanMessage", "HumanMessageChunk", "SystemMessage", "SystemMes...
langchain/libs/langchain/tests/unit_tests/schema/test_messages.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/schema/test_messages.py", "repo_id": "langchain", "token_count": 272 }
642
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/faiss", }); export * from "@langchain/community/vectorstores/faiss";
langchainjs/langchain/src/vectorstores/faiss.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/faiss.ts", "repo_id": "langchainjs", "token_count": 72 }
965
[ { "kind": "Kubernetes", "clusterName": "primary", "podSubnet": "10.10.0.0/16", "svcSubnet": "10.255.10.0/24", "network": "network-1" }, { "kind": "Kubernetes", "clusterName": "remote", "podSubnet": "10.20.0.0/16", "svcSubnet": "10.255.20.0/24", "network": "network-1", ...
milvus/build/config/topology/multicluster.json/0
{ "file_path": "milvus/build/config/topology/multicluster.json", "repo_id": "milvus", "token_count": 297 }
1,745
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import type { StructuredToolInterface } from "@langchain/core/tools"; import { ChatOpenAI } from "@langchain/openai"; import { BaseChatModel } from "@langchain/core/language_models/chat_models"; import { CriteriaLike, CriteriaEv...
langchainjs/langchain/src/evaluation/loader.ts/0
{ "file_path": "langchainjs/langchain/src/evaluation/loader.ts", "repo_id": "langchainjs", "token_count": 1245 }
983
"""Athena Reader.""" import warnings from typing import Optional import boto3 from llama_index.core.readers.base import BaseReader from sqlalchemy.engine import create_engine class AthenaReader(BaseReader): """Athena reader. Follow AWS best practices for security. AWS discourages hardcoding credentials ...
llama_index/llama-index-integrations/readers/llama-index-readers-athena/llama_index/readers/athena/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-athena/llama_index/readers/athena/base.py", "repo_id": "llama_index", "token_count": 1333 }
1,466
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/rootcoord/show_partition_task_test.go/0
{ "file_path": "milvus/internal/rootcoord/show_partition_task_test.go", "repo_id": "milvus", "token_count": 1749 }
2,005
# 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/fastspeech2_conformer/convert_model_with_hifigan.py/0
{ "file_path": "transformers/src/transformers/models/fastspeech2_conformer/convert_model_with_hifigan.py", "repo_id": "transformers", "token_count": 1299 }
605
"""SQL Vector query engine.""" import logging from typing import Any, Optional, Union from llama_index.core.callbacks.base import CallbackManager from llama_index.core.indices.struct_store.sql_query import ( BaseSQLTableQueryEngine, NLSQLTableQueryEngine, ) from llama_index.core.indices.vector_store.retriever...
llama_index/llama-index-core/llama_index/core/query_engine/sql_vector_query_engine.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/query_engine/sql_vector_query_engine.py", "repo_id": "llama_index", "token_count": 2850 }
1,199
import { test, expect } from "@jest/globals"; import { ChatOpenAI } from "@langchain/openai"; import type { ChatPromptTemplate } from "@langchain/core/prompts"; import { TavilySearchResults } from "@langchain/community/tools/tavily_search"; import { pull } from "../../hub.js"; import { AgentExecutor, createOpenAIToolsA...
langchainjs/langchain/src/agents/tests/create_openai_tools_agent.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/agents/tests/create_openai_tools_agent.int.test.ts", "repo_id": "langchainjs", "token_count": 391 }
945
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-remote-depth/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-remote-depth/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,424
# coding=utf-8 # Copyright 2020 Google Research 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 re...
transformers/src/transformers/models/tapas/modeling_tapas.py/0
{ "file_path": "transformers/src/transformers/models/tapas/modeling_tapas.py", "repo_id": "transformers", "token_count": 46174 }
729
from langchain_community.document_loaders.gitbook import GitbookLoader __all__ = ["GitbookLoader"]
langchain/libs/langchain/langchain/document_loaders/gitbook.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/gitbook.py", "repo_id": "langchain", "token_count": 30 }
528
# coding=utf-8 # Copyright 2022 ABEJA, Inc. and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
transformers/src/transformers/models/gpt_neox_japanese/tokenization_gpt_neox_japanese.py/0
{ "file_path": "transformers/src/transformers/models/gpt_neox_japanese/tokenization_gpt_neox_japanese.py", "repo_id": "transformers", "token_count": 8502 }
614
from llama_index.core.readers.base import BaseReader from llama_index.readers.astra_db import AstraDBReader def test_class(): names_of_base_classes = [b.__name__ for b in AstraDBReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-astra-db/tests/test_readers_astra_db.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-astra-db/tests/test_readers_astra_db.py", "repo_id": "llama_index", "token_count": 92 }
1,465
use candle::{test_device, Device, IndexOp, Result, Tensor}; use candle_core as candle; fn contiguous(device: &Device) -> Result<()> { let tensor = Tensor::arange(0u32, 24u32, device)?.reshape((2, 3, 4))?; assert_eq!( tensor.to_vec3::<u32>()?, &[ [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 1...
candle/candle-core/tests/layout_tests.rs/0
{ "file_path": "candle/candle-core/tests/layout_tests.rs", "repo_id": "candle", "token_count": 2556 }
40
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
accelerate/src/accelerate/utils/offload.py/0
{ "file_path": "accelerate/src/accelerate/utils/offload.py", "repo_id": "accelerate", "token_count": 3177 }
17
package indexparamcheck import ( "strconv" "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/util/metric" ) func Test_diskannChecker_CheckTrain(t *testing.T) { validParams := map[string]string{ DIM: strconv.Itoa(128), ...
milvus/pkg/util/indexparamcheck/diskann_checker_test.go/0
{ "file_path": "milvus/pkg/util/indexparamcheck/diskann_checker_test.go", "repo_id": "milvus", "token_count": 1437 }
1,937
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/src/transformers/models/donut/modeling_donut_swin.py/0
{ "file_path": "transformers/src/transformers/models/donut/modeling_donut_swin.py", "repo_id": "transformers", "token_count": 18061 }
678
<jupyter_start><jupyter_text>If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets as well as other dependencies. Uncomment the following cell and run it. Note the `rouge-score` and `nltk` dependencies - even if you've used 🤗 Transformers before, you may not have t...
notebooks/examples/summarization-tf.ipynb/0
{ "file_path": "notebooks/examples/summarization-tf.ipynb", "repo_id": "notebooks", "token_count": 8798 }
325
import { test } from "@jest/globals"; import { OpenAI, ChatOpenAI } from "@langchain/openai"; import { PromptTemplate } from "@langchain/core/prompts"; import { LLMChain } from "../llm_chain.js"; import { SimpleSequentialChain } from "../sequential_chain.js"; import { BufferMemory } from "../../memory/buffer_memory.js"...
langchainjs/langchain/src/chains/tests/simple_sequential_chain.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/chains/tests/simple_sequential_chain.int.test.ts", "repo_id": "langchainjs", "token_count": 1039 }
898
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/zh/tflite.md/0
{ "file_path": "transformers/docs/source/zh/tflite.md", "repo_id": "transformers", "token_count": 1379 }
572
# Readwise Reader Use Readwise's export API to fetch your highlights from web articles, epubs, pdfs, Kindle, YouTube, and load the resulting text into LLMs. ## Setup 1. Get your Readwise API key from [readwise.io/access_token](https://readwise.io/access_token). ## Usage Here is an example usage of the Readwise Rea...
llama_index/llama-index-integrations/readers/llama-index-readers-readwise/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-readwise/README.md", "repo_id": "llama_index", "token_count": 477 }
1,511
import re from typing import Tuple topic_regex = r"persistent:\/\/(?P<tenant>.+)\/(?P<namespace>.+)\/(?P<topic>.+)" def parse_topic_name(topic_name: str) -> Tuple[str, str, str]: """Parse the topic name into the tenant, namespace and topic name""" match = re.match(topic_regex, topic_name) if not match: ...
chroma/chromadb/ingest/impl/utils.py/0
{ "file_path": "chroma/chromadb/ingest/impl/utils.py", "repo_id": "chroma", "token_count": 258 }
15
"""Epsilla vector store.""" import logging from typing import Any, List, Optional from llama_index.core.schema import BaseNode, MetadataMode, TextNode from llama_index.core.vector_stores.types import ( DEFAULT_PERSIST_DIR, VectorStore, VectorStoreQuery, VectorStoreQueryMode, VectorStoreQueryResult,...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-epsilla/llama_index/vector_stores/epsilla/base.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-epsilla/llama_index/vector_stores/epsilla/base.py", "repo_id": "llama_index", "token_count": 4113 }
1,655
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-zendesk-support/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-zendesk-support/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,316
import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; import { BufferMemory } from "langchain/memory"; import * as fs from "fs"; import { LLMChain } from "langchain/...
langchainjs/examples/src/use_cases/advanced/conversational_qa.ts/0
{ "file_path": "langchainjs/examples/src/use_cases/advanced/conversational_qa.ts", "repo_id": "langchainjs", "token_count": 2075 }
917
Run the tests with: ```bash RUST_LOG=wasm_bindgen_test_runner wasm-pack test --chrome --headless ``` Or: ```bash wasm-pack test --chrome ``` If you get an "invalid session id" failure in headless mode, check that logs and it may well be that your ChromeDriver is not at the same version as your browser.
candle/candle-wasm-tests/README.md/0
{ "file_path": "candle/candle-wasm-tests/README.md", "repo_id": "candle", "token_count": 98 }
87
--- sidebar_position: 1 sidebar_class_name: hidden --- # Stores In many different applications, having some sort of key-value storage is helpful. In this section, we will look at a few different ways to store key-value pairs using implementations of the `ByteStore` interface. ## Features (natively supported) All `...
langchain/docs/docs/integrations/stores/index.mdx/0
{ "file_path": "langchain/docs/docs/integrations/stores/index.mdx", "repo_id": "langchain", "token_count": 330 }
166
from llama_index.core.llama_pack import BaseLlamaPack from llama_index.packs.evaluator_benchmarker import EvaluatorBenchmarkerPack def test_class(): names_of_base_classes = [b.__name__ for b in EvaluatorBenchmarkerPack.__mro__] assert BaseLlamaPack.__name__ in names_of_base_classes
llama_index/llama-index-packs/llama-index-packs-evaluator-benchmarker/tests/test_packs_evaluator_benchmarker.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-evaluator-benchmarker/tests/test_packs_evaluator_benchmarker.py", "repo_id": "llama_index", "token_count": 106 }
1,785
build_performance: collections: - server: db_config.primary_path: /test/milvus/db_data_011/sift_10m_128_l2_hnsw cache_config.cpu_cache_capacity: 4GB gpu_resource_config.enable: true gpu_resource_config.cache_capacity: 4GB gpu_resource_config.search_resources: ...
milvus/tests/benchmark/milvus_benchmark/suites/011_build_debug.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_build_debug.yaml", "repo_id": "milvus", "token_count": 1621 }
1,966
from typing import Any, List, Optional from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, Extra class ModelScopeEmbeddings(BaseModel, Embeddings): """ModelScopeHub embedding models. To use, you should have the ``modelscope`` python package installed. Exam...
langchain/libs/community/langchain_community/embeddings/modelscope_hub.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/modelscope_hub.py", "repo_id": "langchain", "token_count": 1018 }
259
<!--- 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 ...
transformers/examples/research_projects/README.md/0
{ "file_path": "transformers/examples/research_projects/README.md", "repo_id": "transformers", "token_count": 280 }
529
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/sew/convert_sew_original_pytorch_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/sew/convert_sew_original_pytorch_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 5650 }
729
from datetime import datetime from langchain import LLMChain from langchain.chat_models import ChatOpenAI from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder from langchain.memory import ConversationBufferMemory def get_llm_chain(system_prompt: str, memory: ConversationBufferMemory) -> LLMChain: ...
langsmith-cookbook/feedback-examples/streamlit/vanilla_chain.py/0
{ "file_path": "langsmith-cookbook/feedback-examples/streamlit/vanilla_chain.py", "repo_id": "langsmith-cookbook", "token_count": 397 }
1,011
<!--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/serialization.md/0
{ "file_path": "transformers/docs/source/en/serialization.md", "repo_id": "transformers", "token_count": 2956 }
464
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/speecht5/test_processor_speecht5.py/0
{ "file_path": "transformers/tests/models/speecht5/test_processor_speecht5.py", "repo_id": "transformers", "token_count": 2860 }
814
<jupyter_start><jupyter_text>Transforms EvaluationHere we try out different transformations and evaluate their quality.- First we try out different parsers (PDF, JSON)- Then we try out different extractors<jupyter_code>%pip install llama-index-readers-file %pip install llama-index-llms-openai %pip install llama-index-e...
llama_index/docs/examples/transforms/TransformsEval.ipynb/0
{ "file_path": "llama_index/docs/examples/transforms/TransformsEval.ipynb", "repo_id": "llama_index", "token_count": 3117 }
1,143
python_sources()
llama_index/llama-index-integrations/indices/llama-index-indices-managed-zilliz/llama_index/indices/managed/zilliz/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-zilliz/llama_index/indices/managed/zilliz/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,272
import { test } from "@jest/globals"; import { ChatPromptTemplate } from "@langchain/core/prompts"; import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { Document } from "@langchain/core/documents"; import { StringOutputParser } from "@langchain/core/output_parsers"; import { RunnablePassthrough,...
langchainjs/langchain/src/chains/tests/retrieval_chain.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/chains/tests/retrieval_chain.int.test.ts", "repo_id": "langchainjs", "token_count": 949 }
933