text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from langchain_core.embeddings import Embeddings __all__ = ["Embeddings"]
langchain/libs/langchain/langchain/schema/embeddings.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/embeddings.py", "repo_id": "langchain", "token_count": 25 }
589
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "chat_models/bedrock", }); export * from "@langchain/community/chat_models/bedrock";
langchainjs/langchain/src/chat_models/bedrock/index.ts/0
{ "file_path": "langchainjs/langchain/src/chat_models/bedrock/index.ts", "repo_id": "langchainjs", "token_count": 75 }
860
# coding=utf-8 # Copyright 2023 MetaAI 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.0...
transformers/src/transformers/models/code_llama/tokenization_code_llama.py/0
{ "file_path": "transformers/src/transformers/models/code_llama/tokenization_code_llama.py", "repo_id": "transformers", "token_count": 10023 }
635
// 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/kv/tikv/txn_tikv.go/0
{ "file_path": "milvus/internal/kv/tikv/txn_tikv.go", "repo_id": "milvus", "token_count": 9644 }
1,724
# Chapter 1
candle/candle-book/src/chapter_1.md/0
{ "file_path": "candle/candle-book/src/chapter_1.md", "repo_id": "candle", "token_count": 4 }
28
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/googlevertexai", }); export * from "@langchain/community/vectorstores/googlevertexai";
langchainjs/langchain/src/vectorstores/googlevertexai.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/googlevertexai.ts", "repo_id": "langchainjs", "token_count": 76 }
950
pub const NAMES: [&str; 80] = [ "person", "bicycle", "car", "motorbike", "aeroplane", "bus", "train", "truck", "boat", "traffic light", "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", ...
candle/candle-examples/src/coco_classes.rs/0
{ "file_path": "candle/candle-examples/src/coco_classes.rs", "repo_id": "candle", "token_count": 648 }
52
import { v4 as uuidv4 } from "uuid"; import { AgentAction, AgentFinish } from "../agents.js"; import type { ChainValues } from "../utils/types.js"; import { LLMResult } from "../outputs.js"; import { BaseCallbackHandler, CallbackHandlerMethods, HandleLLMNewTokenCallbackFields, NewTokenIndices, } from "./base.js...
langchainjs/langchain-core/src/callbacks/manager.ts/0
{ "file_path": "langchainjs/langchain-core/src/callbacks/manager.ts", "repo_id": "langchainjs", "token_count": 13611 }
823
# Introduction [[introduction]] <img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit9/thumbnail.png" alt="Unit 8"/> In Unit 6, we learned about Advantage Actor Critic (A2C), a hybrid architecture combining value-based and policy-based methods that helps to stabilize ...
deep-rl-class/units/en/unit8/introduction.mdx/0
{ "file_path": "deep-rl-class/units/en/unit8/introduction.mdx", "repo_id": "deep-rl-class", "token_count": 533 }
184
from langchain_community.llms.ctransformers import CTransformers __all__ = ["CTransformers"]
langchain/libs/langchain/langchain/llms/ctransformers.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/ctransformers.py", "repo_id": "langchain", "token_count": 29 }
536
import json import logging from typing import Any, Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_community.tools.slack.base import SlackBaseTool class SlackGetChannel(SlackBaseTool): """Tool that gets Slack channel information.""" name: str = "get_channelid_name_dic...
langchain/libs/community/langchain_community/tools/slack/get_channel.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/slack/get_channel.py", "repo_id": "langchain", "token_count": 502 }
300
from typing import List, Optional, TypedDict from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class BasicAuth(TypedDict): email: str api_token: str server_url: str class Oauth2(TypedDict): cloud_id: str api_token: str class JiraReader(BaseReade...
llama_index/llama-index-integrations/readers/llama-index-readers-jira/llama_index/readers/jira/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-jira/llama_index/readers/jira/base.py", "repo_id": "llama_index", "token_count": 2059 }
1,320
import { browser } from "$app/environment"; export function cookiesAreEnabled(): boolean { if (!browser) return false; if (navigator.cookieEnabled) return navigator.cookieEnabled; // Create cookie document.cookie = "cookietest=1"; const ret = document.cookie.indexOf("cookietest=") != -1; // Delete cookie docum...
chat-ui/src/lib/utils/cookiesAreEnabled.ts/0
{ "file_path": "chat-ui/src/lib/utils/cookiesAreEnabled.ts", "repo_id": "chat-ui", "token_count": 127 }
104
python_sources()
llama_index/llama-index-integrations/tools/llama-index-tools-multion/llama_index/tools/multion/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-multion/llama_index/tools/multion/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,429
"""Test the criteria eval chain.""" import pytest from langchain.evaluation.criteria.eval_chain import ( _SUPPORTED_CRITERIA, Criteria, CriteriaEvalChain, CriteriaResultOutputParser, LabeledCriteriaEvalChain, ) from langchain.evaluation.schema import StringEvaluator from tests.unit_tests.llms.fak...
langchain/libs/langchain/tests/unit_tests/evaluation/criteria/test_eval_chain.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/evaluation/criteria/test_eval_chain.py", "repo_id": "langchain", "token_count": 1378 }
629
<jupyter_start><jupyter_text>Function callingCertain chat models, like [OpenAI's](https://platform.openai.com/docs/guides/function-calling), have a function-calling API that lets you describe functions and their arguments, and have the model return a JSON object with a function to invoke and the inputs to that function...
langchain/docs/docs/modules/model_io/chat/function_calling.ipynb/0
{ "file_path": "langchain/docs/docs/modules/model_io/chat/function_calling.ipynb", "repo_id": "langchain", "token_count": 2545 }
210
-- Create "notifications" table CREATE TABLE "public"."notifications" ( "id" bigserial NOT NULL, "collection_id" text NULL, "type" text NULL, "status" text NULL, PRIMARY KEY ("id") );
chroma/go/coordinator/migrations/20231129183041.sql/0
{ "file_path": "chroma/go/coordinator/migrations/20231129183041.sql", "repo_id": "chroma", "token_count": 67 }
56
# (Tensorflow) Inception v3 **Inception v3** is a convolutional neural network architecture from the Inception family that makes several improvements including using [Label Smoothing](https://paperswithcode.com/method/label-smoothing), Factorized 7 x 7 convolutions, and the use of an [auxiliary classifer](https://pape...
pytorch-image-models/docs/models/tf-inception-v3.md/0
{ "file_path": "pytorch-image-models/docs/models/tf-inception-v3.md", "repo_id": "pytorch-image-models", "token_count": 1953 }
370
from langchain_community.tools.edenai.image_objectdetection import ( EdenAiObjectDetectionTool, ) __all__ = ["EdenAiObjectDetectionTool"]
langchain/libs/langchain/langchain/tools/edenai/image_objectdetection.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/edenai/image_objectdetection.py", "repo_id": "langchain", "token_count": 49 }
575
/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { test, expect } from "@jest/globals"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; import { LlamaCppEmbeddings } from "../llama_cpp.js"; const llamaPath = getEnvironmentVariable("LLAMA_PATH")!; test.skip("Test LlamaCppEmbedd...
langchainjs/libs/langchain-community/src/embeddings/tests/llama_cpp.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/embeddings/tests/llama_cpp.int.test.ts", "repo_id": "langchainjs", "token_count": 474 }
982
# 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...
transformers/tests/models/univnet/test_modeling_univnet.py/0
{ "file_path": "transformers/tests/models/univnet/test_modeling_univnet.py", "repo_id": "transformers", "token_count": 6460 }
818
# coding=utf-8 # Copyright 2024 Google AI 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.0 # #...
transformers/src/transformers/models/siglip/modeling_siglip.py/0
{ "file_path": "transformers/src/transformers/models/siglip/modeling_siglip.py", "repo_id": "transformers", "token_count": 22965 }
693
from __future__ import annotations from enum import Enum, auto from typing import Any, Callable, Dict, Iterator, List, Optional, Union import google.api_core import google.generativeai as genai # type: ignore[import] from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMR...
langchain/libs/partners/google-genai/langchain_google_genai/llms.py/0
{ "file_path": "langchain/libs/partners/google-genai/langchain_google_genai/llms.py", "repo_id": "langchain", "token_count": 5594 }
615
# coding=utf-8 # Copyright 2018 DPR Authors, The Hugging Face 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 a...
transformers/src/transformers/models/dpr/modeling_dpr.py/0
{ "file_path": "transformers/src/transformers/models/dpr/modeling_dpr.py", "repo_id": "transformers", "token_count": 11490 }
609
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/models/convbert/__init__.py/0
{ "file_path": "transformers/src/transformers/models/convbert/__init__.py", "repo_id": "transformers", "token_count": 1714 }
583
# Q&A patterns (Semantic-search)= ## Semantic Search The most basic example usage of LlamaIndex is through semantic search. We provide a simple in-memory vector store for you to get started, but you can also choose to use any one of our [vector store integrations](/community/integrations/vector_stores.md): ```pytho...
llama_index/docs/understanding/putting_it_all_together/q_and_a.md/0
{ "file_path": "llama_index/docs/understanding/putting_it_all_together/q_and_a.md", "repo_id": "llama_index", "token_count": 2780 }
1,187
import type { Pool, RowDataPacket, OkPacket, ResultSetHeader, FieldPacket, PoolOptions, } from "mysql2/promise"; import { format } from "mysql2"; import { createPool } from "mysql2/promise"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { VectorStore } from "@langchain/core/v...
langchainjs/libs/langchain-community/src/vectorstores/singlestore.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/singlestore.ts", "repo_id": "langchainjs", "token_count": 3240 }
980
import logging import time import pytest from pathlib import Path from base.client_base import TestcaseBase from common import common_func as cf from common import common_type as ct from common.milvus_sys import MilvusSys from common.common_type import CaseLabel, CheckTasks from utils.util_k8s import ( get_pod_ip_n...
milvus/tests/python_client/bulk_insert/test_bulk_insert_task_clean.py/0
{ "file_path": "milvus/tests/python_client/bulk_insert/test_bulk_insert_task_clean.py", "repo_id": "milvus", "token_count": 4297 }
2,018
python_tests()
llama_index/llama-index-integrations/llms/llama-index-llms-replicate/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-replicate/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,330
from __future__ import annotations import sys from typing import List from langchain_core.tools import BaseTool from langchain_community.agent_toolkits.base import BaseToolkit from langchain_community.tools.azure_cognitive_services import ( AzureCogsFormRecognizerTool, AzureCogsImageAnalysisTool, AzureCo...
langchain/libs/community/langchain_community/agent_toolkits/azure_cognitive_services.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/azure_cognitive_services.py", "repo_id": "langchain", "token_count": 392 }
208
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-zulip/llama_index/readers/zulip/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-zulip/llama_index/readers/zulip/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,481
import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized, parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface imp...
transformers/tests/sagemaker/test_multi_node_data_parallel.py/0
{ "file_path": "transformers/tests/sagemaker/test_multi_node_data_parallel.py", "repo_id": "transformers", "token_count": 1905 }
802
# coding=utf-8 # 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 requir...
transformers/tests/models/imagegpt/test_modeling_imagegpt.py/0
{ "file_path": "transformers/tests/models/imagegpt/test_modeling_imagegpt.py", "repo_id": "transformers", "token_count": 10627 }
788
# Azure Translate Tool This tool connects to a Azure account and allows an Agent to perform text translation into a variet of different languages You will need to set up an api key and translate instance using Azure, learn more here: https://learn.microsoft.com/en-us/azure/ai-services/translator/translator-overview ...
llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/README.md/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/README.md", "repo_id": "llama_index", "token_count": 378 }
1,415
python_sources()
llama_index/llama-index-packs/llama-index-packs-auto-merging-retriever/llama_index/packs/auto_merging_retriever/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-auto-merging-retriever/llama_index/packs/auto_merging_retriever/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,774
from __future__ import annotations import warnings from typing import Any, Iterator, List, Optional from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel def _chunk(texts: List[str], size: int) -> Iterator[List[str]]: for i in range(0, len(texts), size): yield...
langchain/libs/community/langchain_community/embeddings/mlflow_gateway.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/mlflow_gateway.py", "repo_id": "langchain", "token_count": 1108 }
269
use serde::Deserialize; #[derive(Deserialize)] pub(crate) struct IngestConfig { pub(crate) queue_size: usize, }
chroma/rust/worker/src/ingest/config.rs/0
{ "file_path": "chroma/rust/worker/src/ingest/config.rs", "repo_id": "chroma", "token_count": 49 }
60
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/unittest/test_offset_ordered_array.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_offset_ordered_array.cpp", "repo_id": "milvus", "token_count": 1507 }
1,783
# Yahoo Finance Tool This tool connects to Yahoo Finance and allows an Agent to access stock, news, and financial data of a company. ## Usage Here's an example of how to use this tool: ```python from llama_index.tools.yahoo_finance import YahooFinanceToolSpec from llama_index.agent import OpenAIAgent tool_spec = Y...
llama_index/llama-index-integrations/tools/llama-index-tools-yahoo-finance/README.md/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-yahoo-finance/README.md", "repo_id": "llama_index", "token_count": 326 }
1,538
import logging import os import uuid from langchain_core.documents import Document from langchain_community.vectorstores.rocksetdb import Rockset from tests.integration_tests.vectorstores.fake_embeddings import ( ConsistentFakeEmbeddings, fake_texts, ) logger = logging.getLogger(__name__) # To run these te...
langchain/libs/community/tests/integration_tests/vectorstores/test_rocksetdb.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_rocksetdb.py", "repo_id": "langchain", "token_count": 2967 }
387
"""Test Vertex AI embeddings API wrapper. """ from langchain_community.embeddings import VertexAIEmbeddings def test_split_by_punctuation() -> None: parts = VertexAIEmbeddings._split_by_punctuation( "Hello, my friend!\nHow are you?\nI have 2 news:\n\n\t- Good,\n\t- Bad." ) assert parts == [ ...
langchain/libs/community/tests/unit_tests/embeddings/test_vertexai.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/embeddings/test_vertexai.py", "repo_id": "langchain", "token_count": 788 }
414
# coding=utf-8 # Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
transformers/tests/models/data2vec/test_modeling_data2vec_audio.py/0
{ "file_path": "transformers/tests/models/data2vec/test_modeling_data2vec_audio.py", "repo_id": "transformers", "token_count": 13305 }
755
poetry_requirements( name="poetry", ) python_requirements( name="reqs", ) python_sources( interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-packs/llama-index-packs-vanna/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-vanna/BUILD", "repo_id": "llama_index", "token_count": 73 }
1,878
<!--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/it/add_new_model.md/0
{ "file_path": "transformers/docs/source/it/add_new_model.md", "repo_id": "transformers", "token_count": 17333 }
506
import re import warnings from typing import ( Any, AsyncIterator, Callable, Dict, Iterator, List, Mapping, Optional, ) from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.language_models import BaseLanguageModel ...
langchain/libs/community/langchain_community/llms/anthropic.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/anthropic.py", "repo_id": "langchain", "token_count": 5487 }
277
# What are these scripts? All scripts in this folder originate from the `nlp_example.py` file, as it is a very simplistic NLP training example using Accelerate with zero extra features. From there, each further script adds in just **one** feature of Accelerate, showing how you can quickly modify your own scripts to i...
accelerate/examples/by_feature/README.md/0
{ "file_path": "accelerate/examples/by_feature/README.md", "repo_id": "accelerate", "token_count": 1218 }
5
from typing import Dict, Sequence from llama_index.core.base.llms.types import ChatMessage, MessageRole HUMAN_PREFIX = "\n\nHuman:" ASSISTANT_PREFIX = "\n\nAssistant:" CLAUDE_MODELS: Dict[str, int] = { "claude-instant-1": 100000, "claude-instant-1.2": 100000, "claude-2": 100000, "claude-2.0": 100000...
llama_index/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/utils.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/utils.py", "repo_id": "llama_index", "token_count": 713 }
1,300
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/tutorials/basic_training.md/0
{ "file_path": "diffusers/docs/source/en/tutorials/basic_training.md", "repo_id": "diffusers", "token_count": 6186 }
183
# Vector stores as tools This notebook covers how to combine agents and vector stores. The use case for this is that you’ve ingested your data into a vector store and want to interact with it in an agentic manner. The recommended method for doing so is to create a VectorDBQAChain and then use that as a tool in the ov...
langchainjs/docs/core_docs/docs/modules/agents/tools/how_to/agents_with_vectorstores.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/agents/tools/how_to/agents_with_vectorstores.mdx", "repo_id": "langchainjs", "token_count": 1016 }
756
"""An agent designed to hold a conversation in addition to using tools."""
langchain/libs/langchain/langchain/agents/conversational_chat/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/conversational_chat/__init__.py", "repo_id": "langchain", "token_count": 16 }
466
import { PromptTemplate } from "@langchain/core/prompts"; import { LLMChain, LLMChainInput } from "../../chains/llm_chain.js"; /** Chain to execute tasks. */ export class TaskExecutionChain extends LLMChain { static lc_name() { return "TaskExecutionChain"; } /** * A static factory method that creates an ...
langchainjs/langchain/src/experimental/babyagi/task_execution.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/babyagi/task_execution.ts", "repo_id": "langchainjs", "token_count": 388 }
935
#[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/trocr/main.rs/0
{ "file_path": "candle/candle-examples/examples/trocr/main.rs", "repo_id": "candle", "token_count": 2160 }
51
// 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/storage/unsafe.go/0
{ "file_path": "milvus/internal/storage/unsafe.go", "repo_id": "milvus", "token_count": 600 }
2,068
# SemaDB >[SemaDB](https://semafind.com/) is a no fuss vector similarity search engine. It provides a low-cost cloud hosted version to help you build AI applications with ease. With SemaDB Cloud, our hosted version, no fuss means no pod size calculations, no schema definitions, no partition settings, no parameter tun...
langchain/docs/docs/integrations/providers/semadb.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/semadb.mdx", "repo_id": "langchain", "token_count": 261 }
156
from llama_index.core.evaluation.base import BaseEvaluator from llama_index.evaluation.tonic_validate import ( AnswerConsistencyEvaluator, AnswerConsistencyBinaryEvaluator, AnswerSimilarityEvaluator, AugmentationAccuracyEvaluator, AugmentationPrecisionEvaluator, RetrievalPrecisionEvaluator, ...
llama_index/llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/tests/test_evaluation_tonic_validate.py/0
{ "file_path": "llama_index/llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/tests/test_evaluation_tonic_validate.py", "repo_id": "llama_index", "token_count": 555 }
1,278
<jupyter_start><jupyter_text>Nomic EmbeddingsNomic has released a new embedding model with strong performance for long context retrieval (8k context window).The cookbook walks through the process of building and deploying (via LangServe) a RAG app using Nomic embeddings. SignupGet your API token, then run:```! nomic lo...
langchain/cookbook/nomic_embedding_rag.ipynb/0
{ "file_path": "langchain/cookbook/nomic_embedding_rag.ipynb", "repo_id": "langchain", "token_count": 1229 }
74
package syncmgr import ( "context" "github.com/cockroachdb/errors" "github.com/samber/lo" "go.uber.org/zap" "github.com/milvus-io/milvus/internal/datanode/broker" "github.com/milvus-io/milvus/internal/datanode/metacache" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/pkg/log...
milvus/internal/datanode/syncmgr/meta_writer.go/0
{ "file_path": "milvus/internal/datanode/syncmgr/meta_writer.go", "repo_id": "milvus", "token_count": 3044 }
1,978
from typing import List, Optional, Tuple, Union import torch from diffusers import DiffusionPipeline from diffusers.configuration_utils import ConfigMixin from diffusers.pipelines.pipeline_utils import ImagePipelineOutput from diffusers.schedulers.scheduling_utils import SchedulerMixin class IADBScheduler(Scheduler...
diffusers/examples/community/iadb.py/0
{ "file_path": "diffusers/examples/community/iadb.py", "repo_id": "diffusers", "token_count": 2510 }
186
## API This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: Environment * Node.js * Webpack * Browserify Language level * ES5 - you must have a Promises/A+ library installed * ES6 Module sy...
chroma/clients/js/src/generated/README.md/0
{ "file_path": "chroma/clients/js/src/generated/README.md", "repo_id": "chroma", "token_count": 263 }
35
"""Google sheets reader.""" import logging import os from typing import Any, List import googleapiclient.discovery as discovery from google_auth_oauthlib.flow import InstalledAppFlow from llama_index.core.readers.base import BasePydanticReader from llama_index.core.schema import Document from google.auth.transport.r...
llama_index/llama-index-integrations/readers/llama-index-readers-google/llama_index/readers/google/sheets/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-google/llama_index/readers/google/sheets/base.py", "repo_id": "llama_index", "token_count": 2250 }
1,501
# 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/sew/test_modeling_sew.py/0
{ "file_path": "transformers/tests/models/sew/test_modeling_sew.py", "repo_id": "transformers", "token_count": 10134 }
770
[ { "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 1, "logprob": null, "text": "<s>" }, { "id": 3735, "logprob": -12.9140625, "text": "Test" ...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_mistral/test_flash_mistral_load.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_mistral/test_flash_mistral_load.json", "repo_id": "text-generation-inference", "token_count": 4897 }
421
# LlamaIndex Readers Integration: Obsidian
llama_index/llama-index-integrations/readers/llama-index-readers-obsidian/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-obsidian/README.md", "repo_id": "llama_index", "token_count": 10 }
1,393
<jupyter_start><jupyter_text>JSONThis notebook showcases an agent interacting with large `JSON/dict` objects. This is useful when you want to answer questions about a JSON blob that's too large to fit in the context window of an LLM. The agent is able to iteratively explore the blob to find what it needs to answer the ...
langchain/docs/docs/integrations/toolkits/json.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/toolkits/json.ipynb", "repo_id": "langchain", "token_count": 816 }
178
--- hide_table_of_contents: true --- import CodeBlock from "@theme/CodeBlock"; # Weaviate Weaviate is an open source vector database that stores both objects and vectors, allowing for combining vector search with structured filtering. LangChain connects to Weaviate via the `weaviate-ts-client` package, the official ...
langchainjs/docs/core_docs/docs/integrations/vectorstores/weaviate.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/weaviate.mdx", "repo_id": "langchainjs", "token_count": 554 }
798
from langchain_community.tools.ainetwork.rule import AINRuleOps, RuleSchema __all__ = ["RuleSchema", "AINRuleOps"]
langchain/libs/langchain/langchain/tools/ainetwork/rule.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/ainetwork/rule.py", "repo_id": "langchain", "token_count": 39 }
544
<jupyter_start><jupyter_text>Beautiful Soup>[Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/) is a Python package for parsing > HTML and XML documents (including having malformed markup, i.e. non-closed tags, so named after tag soup). > It creates a parse tree for parsed pages that can be used to extract...
langchain/docs/docs/integrations/document_transformers/beautiful_soup.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_transformers/beautiful_soup.ipynb", "repo_id": "langchain", "token_count": 429 }
113
<jupyter_start><jupyter_text>Google ScholarThis notebook goes through how to use Google Scholar Tool<jupyter_code>%pip install --upgrade --quiet google-search-results import os from langchain_community.tools.google_scholar import GoogleScholarQueryRun from langchain_community.utilities.google_scholar import GoogleSch...
langchain/docs/docs/integrations/tools/google_scholar.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/google_scholar.ipynb", "repo_id": "langchain", "token_count": 150 }
174
# ruff: noqa: E501 # fmt: off template = ( """ Transform the narrative_input into an SQL expression. If you are unsure, then do not guess, instead add a llm_error_msg that explains why you are unsure. {format_instructions} narrative_input: how much money will boris have? # JSON: {{ "narrative_i...
langchain/libs/experimental/langchain_experimental/cpal/templates/univariate/query.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/cpal/templates/univariate/query.py", "repo_id": "langchain", "token_count": 1814 }
441
version: '3.9' networks: net: driver: bridge services: server: image: ghcr.io/chroma-core/chroma:latest environment: - IS_PERSISTENT=TRUE volumes: # Default configuration for persist_directory in chromadb/config.py # Currently it's located in "/chroma/chroma/" - chroma-data:...
chroma/docker-compose.server.example.yml/0
{ "file_path": "chroma/docker-compose.server.example.yml", "repo_id": "chroma", "token_count": 186 }
37
import { OpenAIEmbeddings } from "@langchain/openai"; import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { PromptTemplate, FewShotPromptTemplate } from "@langchain/core/prompts"; import { SemanticSimilarityExampleSelector } from "@langchain/core/example_selectors"; // Create a prompt template ...
langchainjs/examples/src/prompts/semantic_similarity_example_selector.ts/0
{ "file_path": "langchainjs/examples/src/prompts/semantic_similarity_example_selector.ts", "repo_id": "langchainjs", "token_count": 533 }
909
# coding=utf-8 # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/depth_anything/test_modeling_depth_anything.py/0
{ "file_path": "transformers/tests/models/depth_anything/test_modeling_depth_anything.py", "repo_id": "transformers", "token_count": 3846 }
795
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/util/importutilv2/parquet/util.go/0
{ "file_path": "milvus/internal/util/importutilv2/parquet/util.go", "repo_id": "milvus", "token_count": 2334 }
2,077
# coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
transformers/tests/models/electra/test_modeling_tf_electra.py/0
{ "file_path": "transformers/tests/models/electra/test_modeling_tf_electra.py", "repo_id": "transformers", "token_count": 10994 }
783
from langchain_core.output_parsers.list import ( CommaSeparatedListOutputParser, ListOutputParser, MarkdownListOutputParser, NumberedListOutputParser, ) __all__ = [ "ListOutputParser", "CommaSeparatedListOutputParser", "NumberedListOutputParser", "MarkdownListOutputParser", ]
langchain/libs/langchain/langchain/output_parsers/list.py/0
{ "file_path": "langchain/libs/langchain/langchain/output_parsers/list.py", "repo_id": "langchain", "token_count": 113 }
526
"""Query transform.""" import dataclasses from abc import abstractmethod from typing import Any, Dict, Optional, cast from llama_index.core.base.query_pipeline.query import ( ChainableMixin, InputKeys, OutputKeys, QueryComponent, validate_and_convert_stringable, ) from llama_index.core.base.respon...
llama_index/llama-index-core/llama_index/core/indices/query/query_transform/base.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/query/query_transform/base.py", "repo_id": "llama_index", "token_count": 5115 }
1,220
import logging from typing import Any, List, NamedTuple, Optional, Type from llama_index.legacy.bridge.pydantic import PrivateAttr from llama_index.legacy.schema import BaseNode, MetadataMode, TextNode from llama_index.legacy.vector_stores.types import ( BasePydanticVectorStore, MetadataFilters, VectorStor...
llama_index/llama-index-legacy/llama_index/legacy/vector_stores/lantern.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/lantern.py", "repo_id": "llama_index", "token_count": 10394 }
1,623
fn main() -> Result<(), Box<dyn std::error::Error>> { // Compile the protobuf files in the chromadb proto directory. tonic_build::configure().compile( &[ "../../idl/chromadb/proto/chroma.proto", "../../idl/chromadb/proto/coordinator.proto", ], &["../../idl/"], ...
chroma/rust/worker/build.rs/0
{ "file_path": "chroma/rust/worker/build.rs", "repo_id": "chroma", "token_count": 547 }
56
python_sources()
llama_index/llama-index-packs/llama-index-packs-arize-phoenix-query-engine/llama_index/packs/arize_phoenix_query_engine/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-arize-phoenix-query-engine/llama_index/packs/arize_phoenix_query_engine/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,832
<jupyter_start><jupyter_text>Step-Back Prompting (Question-Answering)You can also run this notebook online [on Noteable.io](https://app.noteable.io/published/ff04b7ba-efaf-48d5-ba4d-b6bff0359ceb).One prompting technique called "Step-Back" prompting can improve performance on complex questions by first asking a "step ba...
langchainjs/cookbook/step_back.ipynb/0
{ "file_path": "langchainjs/cookbook/step_back.ipynb", "repo_id": "langchainjs", "token_count": 1371 }
719
search_performance_concurrents: collections: - server: cache_config.cpu_cache_capacity: 16 engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: true gpu_resource_config.cache_capacity: 4 gpu_resource_config.s...
milvus/tests/benchmark/milvus_benchmark/suites/qps.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/qps.yaml", "repo_id": "milvus", "token_count": 408 }
1,945
--- sidebar_class_name: node-only --- # Cassandra :::tip Compatibility Only available on Node.js. ::: [Apache Cassandra®](https://cassandra.apache.org/_/index.html) is a NoSQL, row-oriented, highly scalable and highly available database. The [latest version](<https://cwiki.apache.org/confluence/display/CASSANDRA/CE...
langchainjs/docs/core_docs/docs/integrations/vectorstores/cassandra.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/cassandra.mdx", "repo_id": "langchainjs", "token_count": 2816 }
741
import { test, expect } from "@jest/globals"; import { GooglePaLMEmbeddings } from "../googlepalm.js"; import { HNSWLib } from "../../vectorstores/hnswlib.js"; test.skip("Test GooglePalmEmbeddings.embedQuery", async () => { const embeddings = new GooglePaLMEmbeddings({ maxRetries: 1, }); const res = await em...
langchainjs/libs/langchain-community/src/embeddings/tests/googlepalm.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/embeddings/tests/googlepalm.int.test.ts", "repo_id": "langchainjs", "token_count": 647 }
941
import datetime import pathlib from langchain_community.chat_loaders import imessage, utils def test_imessage_chat_loader_upgrade_osx11() -> None: chat_path = ( pathlib.Path(__file__).parent / "data" / "imessage_chat_upgrade_osx_11.db" ) loader = imessage.IMessageChatLoader(str(chat_path)) c...
langchain/libs/community/tests/unit_tests/chat_loaders/test_imessage.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/chat_loaders/test_imessage.py", "repo_id": "langchain", "token_count": 1092 }
362
package httpserver import ( "bytes" "encoding/binary" "encoding/json" "fmt" "math" "reflect" "strconv" "strings" "github.com/cockroachdb/errors" "github.com/gin-gonic/gin" "github.com/golang/protobuf/proto" "github.com/spf13/cast" "github.com/tidwall/gjson" "go.uber.org/zap" "github.com/milvus-io/milv...
milvus/internal/distributed/proxy/httpserver/utils.go/0
{ "file_path": "milvus/internal/distributed/proxy/httpserver/utils.go", "repo_id": "milvus", "token_count": 14088 }
1,851
# coding=utf-8 # Copyright 2022 The Metaseq Authors and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
transformers/src/transformers/models/opt/configuration_opt.py/0
{ "file_path": "transformers/src/transformers/models/opt/configuration_opt.py", "repo_id": "transformers", "token_count": 2762 }
702
from llama_index.core.multi_modal_llms.base import MultiModalLLM from llama_index.multi_modal_llms.gemini import GeminiMultiModal def test_embedding_class(): names_of_base_classes = [b.__name__ for b in GeminiMultiModal.__mro__] assert MultiModalLLM.__name__ in names_of_base_classes
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-gemini/tests/test_multi-modal-llms_gemini.py/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-gemini/tests/test_multi-modal-llms_gemini.py", "repo_id": "llama_index", "token_count": 109 }
1,324
from llama_index.embeddings.text_embeddings_inference.base import ( TextEmbeddingsInference, ) __all__ = ["TextEmbeddingsInference"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-text-embeddings-inference/llama_index/embeddings/text_embeddings_inference/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-text-embeddings-inference/llama_index/embeddings/text_embeddings_inference/__init__.py", "repo_id": "llama_index", "token_count": 50 }
1,273
<jupyter_start><jupyter_code>import openai openai.api_key = "sk-your-key" from llama_index.agent import OpenAIAgent from llama_index.tools import QueryEngineTool, ToolMetadata # define query engine over paul graham's essay from llama_index import SimpleDirectoryReader, VectorStoreIndex import requests # download paul...
llama_index/llama-index-integrations/tools/llama-index-tools-text-to-image/examples/text_to_image-pg.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-text-to-image/examples/text_to_image-pg.ipynb", "repo_id": "llama_index", "token_count": 1042 }
1,458
# 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/src/transformers/configuration_utils.py/0
{ "file_path": "transformers/src/transformers/configuration_utils.py", "repo_id": "transformers", "token_count": 23255 }
558
# NVIDIA > [NVIDIA AI Foundation Endpoints](https://www.nvidia.com/en-us/ai-data-science/foundation-models/) give users easy access to NVIDIA hosted API endpoints for NVIDIA AI Foundation Models like Mixtral 8x7B, Llama 2, Stable Diffusion, etc. These models, hosted on the [NVIDIA NGC catalog](https://catalog.ngc.nvid...
langchain/docs/docs/integrations/providers/nvidia.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/nvidia.mdx", "repo_id": "langchain", "token_count": 650 }
144
[ "../../langchain/src/load.ts", "../../langchain/src/load/serializable.ts", "../../langchain/src/agents/toolkits/connery.ts", "../../langchain/src/tools/aws_lambda.ts", "../../langchain/src/tools/aws_sfn.ts", "../../langchain/src/tools/connery.ts", "../../langchain/src/tools/gmail.ts", "../../langchain...
langchainjs/docs/api_refs/blacklisted-entrypoints.json/0
{ "file_path": "langchainjs/docs/api_refs/blacklisted-entrypoints.json", "repo_id": "langchainjs", "token_count": 2615 }
711
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/api/pipelines/controlnet.md/0
{ "file_path": "diffusers/docs/source/en/api/pipelines/controlnet.md", "repo_id": "diffusers", "token_count": 1146 }
177
--- hide_table_of_contents: true --- # Zep Memory [Zep](https://github.com/getzep/zep) is a memory server that stores, summarizes, embeds, indexes, and enriches conversational AI chat histories, autonomous agent histories, document Q&A histories and exposes them via simple, low-latency APIs. Key Features: - Long-te...
langchainjs/docs/core_docs/docs/integrations/chat_memory/zep_memory.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat_memory/zep_memory.mdx", "repo_id": "langchainjs", "token_count": 380 }
756
<jupyter_start><jupyter_text>Split codeCodeTextSplitter allows you to split your code with multiple languages supported. Import enum `Language` and specify the language.<jupyter_code>from langchain.text_splitter import ( Language, RecursiveCharacterTextSplitter, ) # Full list of supported languages [e.value for...
langchain/docs/docs/modules/data_connection/document_transformers/code_splitter.ipynb/0
{ "file_path": "langchain/docs/docs/modules/data_connection/document_transformers/code_splitter.ipynb", "repo_id": "langchain", "token_count": 2056 }
191
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/tuners/adalora/config.py/0
{ "file_path": "peft/src/peft/tuners/adalora/config.py", "repo_id": "peft", "token_count": 860 }
332
use std::sync::{Arc, RwLock}; use crate::utils::PyChar; use crate::utils::PyPattern; use pyo3::exceptions; use pyo3::prelude::*; use pyo3::types::*; use serde::de::Error; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use tk::decoders::bpe::BPEDecoder; use tk::decoders::byte_fallback::ByteFallback; use...
tokenizers/bindings/python/src/decoders.rs/0
{ "file_path": "tokenizers/bindings/python/src/decoders.rs", "repo_id": "tokenizers", "token_count": 9016 }
444
# coding=utf-8 # Copyright 2023 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/tools/test_agent_types.py/0
{ "file_path": "transformers/tests/tools/test_agent_types.py", "repo_id": "transformers", "token_count": 1583 }
769
{ "fp16": { "enabled": true, "loss_scale": 0, "loss_scale_window": 1000, "initial_scale_power": 16, "hysteresis": 2, "min_loss_scale": 1 }, "optimizer": { "type": "AdamW", "params": { "lr": "auto", "weight_decay": "auto"...
accelerate/examples/deepspeed_config_templates/zero_stage3_config.json/0
{ "file_path": "accelerate/examples/deepspeed_config_templates/zero_stage3_config.json", "repo_id": "accelerate", "token_count": 657 }
6
# rag-google-cloud-vertexai-search This template is an application that utilizes Google Vertex AI Search, a machine learning powered search service, and PaLM 2 for Chat (chat-bison). The application uses a Retrieval chain to answer questions based on your documents. For more context on building RAG applications with ...
langchain/templates/rag-google-cloud-vertexai-search/README.md/0
{ "file_path": "langchain/templates/rag-google-cloud-vertexai-search/README.md", "repo_id": "langchain", "token_count": 991 }
657