text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-genius/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-genius/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,301
"""Test map_rerank parser""" import pytest from langchain.chains.question_answering.map_rerank_prompt import output_parser GOOD_SCORE = "foo bar answer.\nScore: 80" SCORE_WITH_EXPLANATION = "foo bar answer.\nScore: 80 (fully answers the question, but could provide more detail on the specific error message)" # noqa: ...
langchain/libs/langchain/tests/unit_tests/chains/question_answering/test_map_rerank_prompt.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/chains/question_answering/test_map_rerank_prompt.py", "repo_id": "langchain", "token_count": 202 }
591
import { navigating } from "$app/stores"; import { tick } from "svelte"; import { get } from "svelte/store"; const detachedOffset = 10; /** * @param node element to snap scroll to bottom * @param dependency pass in a dependency to update scroll on changes. */ export const snapScrollToBottom = (node: HTMLElement, d...
chat-ui/src/lib/actions/snapScrollToBottom.ts/0
{ "file_path": "chat-ui/src/lib/actions/snapScrollToBottom.ts", "repo_id": "chat-ui", "token_count": 437 }
93
What does Moses' rod turn into ? Who is Aron? Where did Moses grow up ? What happens at the command of the Moses ? Who manages the Pokémon ? Who owned the Pokémon trademark ? What else include in Pokémon franchise ? How many seasons in Pokémon animme series ?
transformers/examples/research_projects/rag-end2end-retriever/test_run/dummy-train-data/test.source/0
{ "file_path": "transformers/examples/research_projects/rag-end2end-retriever/test_run/dummy-train-data/test.source", "repo_id": "transformers", "token_count": 63 }
612
python_tests()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-milvus/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-milvus/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,664
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/tuners/multitask_prompt_tuning/config.py/0
{ "file_path": "peft/src/peft/tuners/multitask_prompt_tuning/config.py", "repo_id": "peft", "token_count": 883 }
334
# Task templates <Tip warning={true}> The Task API is deprecated in favor of [`train-eval-index`](https://github.com/huggingface/hub-docs/blob/9ab2555e1c146122056aba6f89af404a8bc9a6f1/datasetcard.md?plain=1#L90-L106) and will be removed in the next major release. </Tip> The tasks supported by [`Dataset.prepare_for_...
datasets/docs/source/package_reference/task_templates.mdx/0
{ "file_path": "datasets/docs/source/package_reference/task_templates.mdx", "repo_id": "datasets", "token_count": 277 }
123
// console.warn([ // `[WARNING]: The root "langchain/agents/openai/output_parser" entrypoint is deprecated.`, // `Please use either "langchain/agents/openai/output_parser" specific entrypoint instead.` // ].join("\n")); export * from "../openai_functions/output_parser.js"; export * from "../openai_tools/output_pars...
langchainjs/langchain/src/agents/openai/output_parser.ts/0
{ "file_path": "langchainjs/langchain/src/agents/openai/output_parser.ts", "repo_id": "langchainjs", "token_count": 106 }
869
version: '3.4' services: weaviate: command: - --host - 0.0.0.0 - --port - '8080' - --scheme - http image: semitechnologies/weaviate:1.18.2 ports: - 8080:8080 restart: on-failure:0 environment: QUERY_DEFAULTS_LIMIT: 25 AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED...
langchain/libs/community/tests/integration_tests/vectorstores/docker-compose/weaviate.yml/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/docker-compose/weaviate.yml", "repo_id": "langchain", "token_count": 284 }
387
import asyncio import logging import threading from typing import Dict, List, Optional import requests from langchain_core._api.deprecation import deprecated from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, root_validator from langchain_core.runnables.config import run...
langchain/libs/community/langchain_community/embeddings/ernie.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/ernie.py", "repo_id": "langchain", "token_count": 2432 }
269
# LlamaIndex Llms Integration: Predibase
llama_index/llama-index-integrations/llms/llama-index-llms-predibase/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-predibase/README.md", "repo_id": "llama_index", "token_count": 12 }
1,418
"""GitLab Toolkit."""
langchain/libs/langchain/langchain/agents/agent_toolkits/gitlab/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/gitlab/__init__.py", "repo_id": "langchain", "token_count": 9 }
459
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-gradient/llama_index/llms/gradient/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-gradient/llama_index/llms/gradient/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,296
# 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/utils/backbone_utils.py/0
{ "file_path": "transformers/src/transformers/utils/backbone_utils.py", "repo_id": "transformers", "token_count": 6094 }
715
"""Evaluation Helpers.""" from langsmith.evaluation.evaluator import EvaluationResult, RunEvaluator, run_evaluator from langsmith.evaluation.string_evaluator import StringEvaluator __all__ = ["run_evaluator", "EvaluationResult", "RunEvaluator", "StringEvaluator"]
langsmith-sdk/python/langsmith/evaluation/__init__.py/0
{ "file_path": "langsmith-sdk/python/langsmith/evaluation/__init__.py", "repo_id": "langsmith-sdk", "token_count": 88 }
1,069
{ "1": { "body": "BD 2023 SUMMER", "from": "LinkedIn Job", "labels": ["IMPORTANT", "CATEGORY_UPDATES", "INBOX"] }, "2": { "body": "Intern, Treasury and other roles are available", "from": "LinkedIn Job2", "labels": ["IMPORTANT"], "other": { "name": "plop", "surname": "bob" ...
langchainjs/langchain/src/document_loaders/tests/example_data/complex.json/0
{ "file_path": "langchainjs/langchain/src/document_loaders/tests/example_data/complex.json", "repo_id": "langchainjs", "token_count": 157 }
865
"""Opendal file and directory reader. A loader that fetches a file or iterates through a directory on AWS S3 or other compatible service. """ import asyncio import tempfile from pathlib import Path from typing import Any, Dict, List, Optional, Union, cast from llama_index.core.readers import SimpleDirectoryReader fr...
llama_index/llama-index-integrations/readers/llama-index-readers-opendal/llama_index/readers/opendal/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-opendal/llama_index/readers/opendal/base.py", "repo_id": "llama_index", "token_count": 1062 }
1,419
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-graphdb-cypher/llama_index/readers/graphdb_cypher/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-graphdb-cypher/llama_index/readers/graphdb_cypher/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,328
<jupyter_start><jupyter_text>Résumé (TensorFlow) Installez les bibliothèques 🤗 *Datasets* et 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece] !apt install git-lfs<jupyter_output><empty_output><jupyter_text>Vous aurez besoin de configurer git, adaptez votre e...
notebooks/course/fr/chapter7/section5_tf.ipynb/0
{ "file_path": "notebooks/course/fr/chapter7/section5_tf.ipynb", "repo_id": "notebooks", "token_count": 3014 }
272
from typing import Any, Dict, List, Optional from langchain.chains.base import Chain from langchain.chains.llm import LLMChain from langchain.prompts import PromptTemplate from langchain_core.language_models import BaseLanguageModel from langchain_experimental.synthetic_data.prompts import SENTENCE_PROMPT def creat...
langchain/libs/experimental/langchain_experimental/synthetic_data/__init__.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/synthetic_data/__init__.py", "repo_id": "langchain", "token_count": 596 }
455
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,227
import json import os import uuid from typing import Generator, Union import pytest from langchain_community.chat_message_histories import ElasticsearchChatMessageHistory from langchain_core.messages import message_to_dict from langchain.memory import ConversationBufferMemory """ cd tests/integration_tests/memory/do...
langchain/libs/langchain/tests/integration_tests/memory/test_elasticsearch.py/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/memory/test_elasticsearch.py", "repo_id": "langchain", "token_count": 1281 }
585
use crate::Layout; /// An iterator over offset position for items of an N-dimensional arrays stored in a /// flat buffer using some potential strides. #[derive(Debug)] pub struct StridedIndex<'a> { next_storage_index: Option<usize>, multi_index: Vec<usize>, dims: &'a [usize], stride: &'a [usize], } im...
candle/candle-core/src/strided_index.rs/0
{ "file_path": "candle/candle-core/src/strided_index.rs", "repo_id": "candle", "token_count": 1148 }
31
#![warn(clippy::all)] #![allow(clippy::upper_case_acronyms)] // Many false positives with pyo3 it seems &str, and &PyAny get flagged #![allow(clippy::borrow_deref_ref)] extern crate tokenizers as tk; mod decoders; mod encoding; mod error; mod models; mod normalizers; mod pre_tokenizers; mod processors; mod token; mod...
tokenizers/bindings/python/src/lib.rs/0
{ "file_path": "tokenizers/bindings/python/src/lib.rs", "repo_id": "tokenizers", "token_count": 1086 }
417
import { test, expect } from "@jest/globals"; import { Document } from "@langchain/core/documents"; import { FakeEmbeddings } from "@langchain/core/utils/testing"; import { USearch } from "../usearch.js"; test("Test USearch.fromTexts + addVectors", async () => { const vectorStore = await USearch.fromTexts( ["Hel...
langchainjs/libs/langchain-community/src/vectorstores/tests/usearch.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/usearch.int.test.ts", "repo_id": "langchainjs", "token_count": 883 }
1,022
"""Base object types.""" import os import pickle from abc import abstractmethod from typing import Any, Dict, Generic, Optional, Sequence, TypeVar from llama_index.legacy.schema import BaseNode, MetadataMode, TextNode from llama_index.legacy.storage.storage_context import DEFAULT_PERSIST_DIR from llama_index.legacy.u...
llama_index/llama-index-legacy/llama_index/legacy/objects/base_node_mapping.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/objects/base_node_mapping.py", "repo_id": "llama_index", "token_count": 2379 }
1,596
[ { "server": "eros", "suite_params": [ { "suite": "011_insert_data.yaml", "image_type": "cpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/011_data_insert.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/011_data_insert.json", "repo_id": "milvus", "token_count": 132 }
1,962
# coding=utf-8 # Copyright 2022 The HuggingFace Team and Microsoft Research AI4Science. 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/lice...
transformers/src/transformers/models/biogpt/tokenization_biogpt.py/0
{ "file_path": "transformers/src/transformers/models/biogpt/tokenization_biogpt.py", "repo_id": "transformers", "token_count": 6244 }
610
from langchain.agents import AgentType from langchain_experimental.agents import create_pandas_dataframe_agent from langchain.callbacks import StreamlitCallbackHandler from langchain.chat_models import ChatOpenAI import streamlit as st import pandas as pd import os file_formats = { "csv": pd.read_csv, "xls": p...
streamlit-agent/streamlit_agent/chat_pandas_df.py/0
{ "file_path": "streamlit-agent/streamlit_agent/chat_pandas_df.py", "repo_id": "streamlit-agent", "token_count": 1090 }
2,207
<!--- 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 ...
peft/docs/README.md/0
{ "file_path": "peft/docs/README.md", "repo_id": "peft", "token_count": 2889 }
335
import importlib import multiprocessing from typing import Optional, Sequence, List import numpy as np from chromadb.api.types import URI, DataLoader, Image from concurrent.futures import ThreadPoolExecutor class ImageLoader(DataLoader[List[Optional[Image]]]): def __init__(self, max_workers: int = multiprocessing...
chroma/chromadb/utils/data_loaders.py/0
{ "file_path": "chroma/chromadb/utils/data_loaders.py", "repo_id": "chroma", "token_count": 379 }
25
/* eslint-disable no-process-env */ import { test } from "@jest/globals"; import { PromptTemplate } from "../../prompts/prompt.js"; import { FakeLLM } from "../../utils/testing/index.js"; import { CallbackManager, traceAsGroup, TraceGroup } from "../manager.js"; import { StringOutputParser } from "../../output_parsers...
langchainjs/langchain-core/src/callbacks/tests/manager.int.test.ts/0
{ "file_path": "langchainjs/langchain-core/src/callbacks/tests/manager.int.test.ts", "repo_id": "langchainjs", "token_count": 485 }
872
from typing import List, Tuple from langchain_core.agents import AgentAction from langchain_core.messages import AIMessage, BaseMessage, HumanMessage def format_log_to_messages( intermediate_steps: List[Tuple[AgentAction, str]], template_tool_response: str = "{observation}", ) -> List[BaseMessage]: """Co...
langchain/libs/langchain/langchain/agents/format_scratchpad/log_to_messages.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/format_scratchpad/log_to_messages.py", "repo_id": "langchain", "token_count": 239 }
486
"""Test AnthropicFunctions""" import unittest from langchain_community.chat_models.anthropic import ChatAnthropic from langchain_community.chat_models.bedrock import BedrockChat from langchain_experimental.llms.anthropic_functions import AnthropicFunctions class TestAnthropicFunctions(unittest.TestCase): """ ...
langchain/libs/experimental/tests/integration_tests/llms/test_anthropic_functions.py/0
{ "file_path": "langchain/libs/experimental/tests/integration_tests/llms/test_anthropic_functions.py", "repo_id": "langchain", "token_count": 2243 }
457
from llama_index.core.tools.tool_spec.base import BaseToolSpec from llama_index.tools.arxiv import ArxivToolSpec def test_class(): names_of_base_classes = [b.__name__ for b in ArxivToolSpec.__mro__] assert BaseToolSpec.__name__ in names_of_base_classes
llama_index/llama-index-integrations/tools/llama-index-tools-arxiv/tests/test_tools_arxiv.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-arxiv/tests/test_tools_arxiv.py", "repo_id": "llama_index", "token_count": 97 }
1,430
<jupyter_start><jupyter_text>MiniMax[MiniMax](https://api.minimax.chat/document/guides/embeddings?id=6464722084cdc277dfaa966a) offers an embeddings service.This example goes over how to use LangChain to interact with MiniMax Inference for text embedding.<jupyter_code>import os os.environ["MINIMAX_GROUP_ID"] = "MINIMAX...
langchain/docs/docs/integrations/text_embedding/minimax.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/text_embedding/minimax.ipynb", "repo_id": "langchain", "token_count": 360 }
164
# 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/models/clvp/test_feature_extraction_clvp.py/0
{ "file_path": "transformers/tests/models/clvp/test_feature_extraction_clvp.py", "repo_id": "transformers", "token_count": 4543 }
807
import json import os import pickle import tempfile from unittest.mock import patch import pytest import torch from parameterized import parameterized from torch.utils.data import DataLoader, TensorDataset from accelerate import DistributedType, infer_auto_device_map, init_empty_weights, load_checkpoint_and_dispatch ...
accelerate/tests/test_accelerator.py/0
{ "file_path": "accelerate/tests/test_accelerator.py", "repo_id": "accelerate", "token_count": 7706 }
15
from langchain_community.chat_message_histories.singlestoredb import ( SingleStoreDBChatMessageHistory, ) __all__ = ["SingleStoreDBChatMessageHistory"]
langchain/libs/langchain/langchain/memory/chat_message_histories/singlestoredb.py/0
{ "file_path": "langchain/libs/langchain/langchain/memory/chat_message_histories/singlestoredb.py", "repo_id": "langchain", "token_count": 47 }
548
"""Chain that takes in an input and produces an action and action input.""" from __future__ import annotations import asyncio import json import logging import time from abc import abstractmethod from pathlib import Path from typing import ( Any, AsyncIterator, Callable, Dict, Iterator, List, ...
langchain/libs/langchain/langchain/agents/agent.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent.py", "repo_id": "langchain", "token_count": 24601 }
477
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "document_transformers/html_to_text", }); export * from "@langchain/community/document_transformers/html_to_text";
langchainjs/langchain/src/document_transformers/html_to_text.ts/0
{ "file_path": "langchainjs/langchain/src/document_transformers/html_to_text.ts", "repo_id": "langchainjs", "token_count": 82 }
978
from pathlib import Path from llama_index.core.readers import download_loader from llama_index.core.llama_pack import download_llama_pack # download and install dependencies AutoMergingRetrieverPack = download_llama_pack( "AutoMergingRetrieverPack", "./auto_merging_retriever_pack" ) PDFReader = download_loader("PD...
llama_index/llama-index-packs/llama-index-packs-auto-merging-retriever/examples/example.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-auto-merging-retriever/examples/example.py", "repo_id": "llama_index", "token_count": 222 }
1,834
import os from typing import List, Optional from langchain.chains.query_constructor.schema import AttributeInfo from langchain.retrievers import SelfQueryRetriever from langchain.schema import Document, StrOutputParser from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.llms import Bas...
langchain/templates/self-query-qdrant/self_query_qdrant/chain.py/0
{ "file_path": "langchain/templates/self-query-qdrant/self_query_qdrant/chain.py", "repo_id": "langchain", "token_count": 1155 }
755
import { describe, expect, test, jest } from "@jest/globals"; import { InMemoryRecordManager } from "../memory.js"; describe("MemoryRecordmanagerTest", () => { let recordManager: InMemoryRecordManager; beforeAll(async () => { recordManager = new InMemoryRecordManager(); await recordManager.createSchema();...
langchainjs/libs/langchain-community/src/indexes/tests/memory.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/indexes/tests/memory.test.ts", "repo_id": "langchainjs", "token_count": 1961 }
970
import logging from typing import Any, Dict, List, Mapping, Optional from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.pydantic_v1 import Extra, Field, SecretStr, root_validator from langchain_core.utils import convert_to_secret_str, g...
langchain/libs/community/langchain_community/llms/petals.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/petals.py", "repo_id": "langchain", "token_count": 2203 }
267
python_sources()
llama_index/llama-index-packs/llama-index-packs-streamlit-chatbot/llama_index/packs/streamlit_chatbot/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-streamlit-chatbot/llama_index/packs/streamlit_chatbot/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,731
version: 1 disable_existing_loggers: False formatters: simple: format: "[%(asctime)-15s] [%(levelname)8s] - %(message)s (%(name)s:%(lineno)s)" handlers: console: class: logging.StreamHandler level: DEBUG formatter: simple stream: ext://sys.stdout info_file_handler: ...
milvus/tests/benchmark/milvus_benchmark/logs/logging.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/logs/logging.yaml", "repo_id": "milvus", "token_count": 395 }
1,990
""" GitHub API client for issues. """ import os from typing import Any, Dict, Optional, Protocol class BaseGitHubIssuesClient(Protocol): def get_all_endpoints(self) -> Dict[str, str]: ... async def request( self, endpoint: str, method: str, headers: Dict[str, Any] = {...
llama_index/llama-index-integrations/readers/llama-index-readers-github/llama_index/readers/github/issues/github_client.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-github/llama_index/readers/github/issues/github_client.py", "repo_id": "llama_index", "token_count": 3061 }
1,499
#![allow(unused)] #[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::Result; use clap::{Parser, Subcommand}; mod gym_env; mod vec_gym_env; mod ddpg; mod policy_gradient; #[derive(Parser)] struct Args { #[command(subcommand)] command:...
candle/candle-examples/examples/reinforcement-learning/main.rs/0
{ "file_path": "candle/candle-examples/examples/reinforcement-learning/main.rs", "repo_id": "candle", "token_count": 252 }
54
# coding=utf-8 # Copyright 2022 Facebook 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-...
transformers/src/transformers/models/vit_msn/modeling_vit_msn.py/0
{ "file_path": "transformers/src/transformers/models/vit_msn/modeling_vit_msn.py", "repo_id": "transformers", "token_count": 12349 }
694
# Chroma >[Chroma](https://docs.trychroma.com/getting-started) is a database for building AI applications with embeddings. ## Installation and Setup ```bash pip install chromadb ``` ## VectorStore There exists a wrapper around Chroma vector databases, allowing you to use it as a vectorstore, whether for semantic ...
langchain/docs/docs/integrations/providers/chroma.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/chroma.mdx", "repo_id": "langchain", "token_count": 201 }
143
// 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 t...
milvus/internal/core/src/storage/Util.cpp/0
{ "file_path": "milvus/internal/core/src/storage/Util.cpp", "repo_id": "milvus", "token_count": 13415 }
1,945
package tencent import ( "testing" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" "github.com/stretchr/testify/assert" ) func Test_NewMinioClient(t *testing.T) { t.Run("ak sk ok", func(t *testing.T) { minioCli, err := NewMinioClient("xxx.cos.ap-beijing.myqcloud.com", &minio.Opti...
milvus/internal/storage/tencent/tencent_test.go/0
{ "file_path": "milvus/internal/storage/tencent/tencent_test.go", "repo_id": "milvus", "token_count": 269 }
1,796
# 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/marian/convert_marian_tatoeba_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/marian/convert_marian_tatoeba_to_pytorch.py", "repo_id": "transformers", "token_count": 22808 }
694
<script lang="ts"> import Modal from "./Modal.svelte"; import CarbonClose from "~icons/carbon/close"; import CarbonBlockchain from "~icons/carbon/blockchain"; export let preprompt: string; let isOpen = false; </script> <button type="button" class="mx-auto flex items-center gap-1.5 rounded-full border border-g...
chat-ui/src/lib/components/SystemPromptModal.svelte/0
{ "file_path": "chat-ui/src/lib/components/SystemPromptModal.svelte", "repo_id": "chat-ui", "token_count": 508 }
87
from llama_index.llms.watsonx.base import WatsonX __all__ = ["WatsonX"]
llama_index/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/__init__.py", "repo_id": "llama_index", "token_count": 29 }
1,337
--- hide_table_of_contents: true --- # IMSDB This example goes over how to load data from the internet movie script database website, using Cheerio. One document will be created for each page. ## Setup ```bash npm2yarn npm install cheerio ``` ## Usage ```typescript import { IMSDBLoader } from "langchain/document_...
langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/imsdb.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/web_loaders/imsdb.mdx", "repo_id": "langchainjs", "token_count": 153 }
728
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # Copyright 2018 Amazon.com, Inc. or its affiliates. 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 # # ht...
transformers/src/transformers/time_series_utils.py/0
{ "file_path": "transformers/src/transformers/time_series_utils.py", "repo_id": "transformers", "token_count": 2916 }
690
# Scripts A train, validation, inference, and checkpoint cleaning script included in the github root folder. Scripts are not currently packaged in the pip release. The training and validation scripts evolved from early versions of the [PyTorch Imagenet Examples](https://github.com/pytorch/examples). I have added signi...
pytorch-image-models/docs/scripts.md/0
{ "file_path": "pytorch-image-models/docs/scripts.md", "repo_id": "pytorch-image-models", "token_count": 511 }
371
# 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/nezha/test_modeling_nezha.py/0
{ "file_path": "transformers/tests/models/nezha/test_modeling_nezha.py", "repo_id": "transformers", "token_count": 9040 }
741
def is_interactive_env() -> bool: """Determine if running within IPython or Jupyter.""" import sys return hasattr(sys, "ps2")
langchain/libs/core/langchain_core/utils/interactive_env.py/0
{ "file_path": "langchain/libs/core/langchain_core/utils/interactive_env.py", "repo_id": "langchain", "token_count": 52 }
423
# 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/pipelines/test_pipelines_mask_generation.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_mask_generation.py", "repo_id": "transformers", "token_count": 3309 }
830
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/tests/integration/meta_watcher_test.go/0
{ "file_path": "milvus/tests/integration/meta_watcher_test.go", "repo_id": "milvus", "token_count": 3878 }
1,981
python_sources()
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-presidio/llama_index/postprocessor/presidio/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-presidio/llama_index/postprocessor/presidio/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,317
// 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/src/segcore/SegmentSealed.h/0
{ "file_path": "milvus/internal/core/src/segcore/SegmentSealed.h", "repo_id": "milvus", "token_count": 595 }
1,884
<jupyter_start><jupyter_text>Selecting LLMs based on Context LengthDifferent LLMs have different context lengths. As a very immediate an practical example, OpenAI has two versions of GPT-3.5-Turbo: one with 4k context, another with 16k context. This notebook shows how to route between them based on input.<jupyter_code>...
langchain/cookbook/selecting_llms_based_on_context_length.ipynb/0
{ "file_path": "langchain/cookbook/selecting_llms_based_on_context_length.ipynb", "repo_id": "langchain", "token_count": 441 }
80
from langchain_community.document_loaders.lakefs import ( LakeFSClient, LakeFSLoader, UnstructuredLakeFSLoader, ) __all__ = ["LakeFSClient", "LakeFSLoader", "UnstructuredLakeFSLoader"]
langchain/libs/langchain/langchain/document_loaders/lakefs.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/lakefs.py", "repo_id": "langchain", "token_count": 77 }
517
__global__ void fast_hash_ver1_cuda_kernel( int *mask, // [batch_size, num_vector] float *vector, // [batch_size, num_vector, vector_dim] int *Dmat, // [3, num_part, vector_dim] int *hash_code, // [batch_size, num_vector, num_hash_f] int batch_size, int num_vector, int vector_dim, int...
transformers/src/transformers/kernels/yoso/fast_lsh_cumulation_cuda.h/0
{ "file_path": "transformers/src/transformers/kernels/yoso/fast_lsh_cumulation_cuda.h", "repo_id": "transformers", "token_count": 2369 }
559
- name: minio volume docker_volume: name: minio_volume - name: "minio" docker_container: name: minio image: minio/minio:RELEASE.2023-03-20T20-16-18Z env: MINIO_ACCESS_KEY: minioadmin MINIO_SECRET_KEY: minioadmin volumes: - minio_volume:/data command: minio server /data --c...
milvus/deployments/docker/cluster-distributed-deployment/roles/deploy-minio/tasks/main.yml/0
{ "file_path": "milvus/deployments/docker/cluster-distributed-deployment/roles/deploy-minio/tasks/main.yml", "repo_id": "milvus", "token_count": 256 }
1,902
import { MinimaxEmbeddings } from "@langchain/community/embeddings/minimax"; export const run = async () => { /* Embed queries */ const embeddings = new MinimaxEmbeddings(); const res = await embeddings.embedQuery("Hello world"); console.log(res); /* Embed documents */ const documentRes = await embeddings....
langchainjs/examples/src/models/embeddings/minimax.ts/0
{ "file_path": "langchainjs/examples/src/models/embeddings/minimax.ts", "repo_id": "langchainjs", "token_count": 134 }
828
# flake8: noqa from typing import Any, AsyncIterator, Dict, Iterator, List, Optional, Union from langchain_core.pydantic_v1 import root_validator from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.language_models.llms import LLM from langchain_c...
langchain/libs/community/langchain_community/llms/deepsparse.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/deepsparse.py", "repo_id": "langchain", "token_count": 3898 }
286
import { FaissStore } from "@langchain/community/vectorstores/faiss"; import { OpenAIEmbeddings } from "@langchain/openai"; // Create a vector store through any method, here from texts as an example const vectorStore = await FaissStore.fromTexts( ["Hello world", "Bye bye", "hello nice world"], [{ id: 2 }, { id: 1 ...
langchainjs/examples/src/indexes/vector_stores/faiss_saveload.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/faiss_saveload.ts", "repo_id": "langchainjs", "token_count": 224 }
816
from __future__ import annotations import logging from typing import Any, Callable, Dict, List, Optional import requests from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, Extra, SecretStr, root_validator from langchain_core.utils import convert_to_secret_str, get_from_...
langchain/libs/community/langchain_community/embeddings/minimax.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/minimax.py", "repo_id": "langchain", "token_count": 2066 }
271
from llama_index.readers.airbyte_cdk.base import AirbyteCDKReader __all__ = ["AirbyteCDKReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-cdk/llama_index/readers/airbyte_cdk/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-cdk/llama_index/readers/airbyte_cdk/__init__.py", "repo_id": "llama_index", "token_count": 36 }
1,258
from langchain.retrievers import CohereRagRetriever from langchain_community.chat_models import ChatCohere rag = CohereRagRetriever(llm=ChatCohere()) def get_docs_message(message): docs = rag.get_relevant_documents(message) message_doc = next( (x for x in docs if x.metadata.get("type") == "model_resp...
langchain/templates/cohere-librarian/cohere_librarian/rag.py/0
{ "file_path": "langchain/templates/cohere-librarian/cohere_librarian/rag.py", "repo_id": "langchain", "token_count": 160 }
660
#!/usr/bin/env python # coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
transformers/examples/tensorflow/language-modeling-tpu/run_mlm.py/0
{ "file_path": "transformers/examples/tensorflow/language-modeling-tpu/run_mlm.py", "repo_id": "transformers", "token_count": 4384 }
596
from llama_index.core.tools.tool_spec.base import BaseToolSpec from llama_index.tools.weather import OpenWeatherMapToolSpec def test_class(): names_of_base_classes = [b.__name__ for b in OpenWeatherMapToolSpec.__mro__] assert BaseToolSpec.__name__ in names_of_base_classes
llama_index/llama-index-integrations/tools/llama-index-tools-weather/tests/test_tools_weather.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-weather/tests/test_tools_weather.py", "repo_id": "llama_index", "token_count": 95 }
1,586
// 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/metrics/indexnode_metrics.go/0
{ "file_path": "milvus/pkg/metrics/indexnode_metrics.go", "repo_id": "milvus", "token_count": 1432 }
2,090
import type { AxiosRequestConfig } from "axios"; import { EventSourceMessage } from "@langchain/community/utils/event_source_parse"; export interface StreamingAxiosRequestConfig extends AxiosRequestConfig { responseType: "stream"; /** * Called when a message is received. NOTE: Unlike the default browser * E...
langchainjs/langchain/src/util/axios-types.ts/0
{ "file_path": "langchainjs/langchain/src/util/axios-types.ts", "repo_id": "langchainjs", "token_count": 159 }
959
# 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/tests/test_feature_extraction_models.py/0
{ "file_path": "peft/tests/test_feature_extraction_models.py", "repo_id": "peft", "token_count": 3356 }
351
from langchain_community.utilities.spark_sql import SparkSQL __all__ = ["SparkSQL"]
langchain/libs/langchain/langchain/utilities/spark_sql.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/spark_sql.py", "repo_id": "langchain", "token_count": 28 }
596
export * from "./trajectory.js";
langchainjs/langchain/src/evaluation/agents/index.ts/0
{ "file_path": "langchainjs/langchain/src/evaluation/agents/index.ts", "repo_id": "langchainjs", "token_count": 12 }
876
import { OpenAI } from "@langchain/openai"; import { loadSummarizationChain } from "langchain/chains"; import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; import * as fs from "fs"; // In this example, we use a `MapReduceDocumentsChain` specifically prompted to summarize a set of documents. const ...
langchainjs/examples/src/chains/summarization_map_reduce.ts/0
{ "file_path": "langchainjs/examples/src/chains/summarization_map_reduce.ts", "repo_id": "langchainjs", "token_count": 368 }
781
#!/usr/bin/env python # coding=utf-8 # Copyright 2024 The LCM team 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.apach...
diffusers/examples/consistency_distillation/train_lcm_distill_lora_sdxl.py/0
{ "file_path": "diffusers/examples/consistency_distillation/train_lcm_distill_lora_sdxl.py", "repo_id": "diffusers", "token_count": 27390 }
218
# Create an audio dataset You can share a dataset with your team or with anyone in the community by creating a dataset repository on the Hugging Face Hub: ```py from datasets import load_dataset dataset = load_dataset("<username>/my_dataset") ``` There are several methods for creating and sharing an audio dataset: ...
datasets/docs/source/audio_dataset.mdx/0
{ "file_path": "datasets/docs/source/audio_dataset.mdx", "repo_id": "datasets", "token_count": 9843 }
110
# coding=utf-8 # Copyright 2022 The Fairseq 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/modeling_tf_opt.py/0
{ "file_path": "transformers/src/transformers/models/opt/modeling_tf_opt.py", "repo_id": "transformers", "token_count": 21486 }
641
import { ChatOpenAI } from "@langchain/openai"; import { ToolMessage } from "@langchain/core/messages"; // Mocked out function, could be a database/API call in production function getCurrentWeather(location: string, _unit?: string) { if (location.toLowerCase().includes("tokyo")) { return JSON.stringify({ locatio...
langchainjs/examples/src/models/chat/integration_openai_tool_calls.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/integration_openai_tool_calls.ts", "repo_id": "langchainjs", "token_count": 1237 }
848
import { JSDOM } from "jsdom"; import { Document } from "@langchain/core/documents"; import { AsyncCaller } from "@langchain/core/utils/async_caller"; import { BaseDocumentLoader, DocumentLoader } from "../base.js"; export interface RecursiveUrlLoaderOptions { excludeDirs?: string[]; extractor?: (text: string) => ...
langchainjs/langchain/src/document_loaders/web/recursive_url.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/web/recursive_url.ts", "repo_id": "langchainjs", "token_count": 2263 }
977
import base64 import pytest from langchain_core.documents import Document from pytest_mock import MockerFixture from langchain_community.document_loaders.github import ( GithubFileLoader, GitHubIssuesLoader, ) def test_initialization() -> None: loader = GitHubIssuesLoader(repo="repo", access_token="acce...
langchain/libs/community/tests/unit_tests/document_loaders/test_github.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_github.py", "repo_id": "langchain", "token_count": 3321 }
373
<jupyter_start><jupyter_text>Stable Diffusion Textual Inversion - Concept Library navigation and usageNavigate through the [public library of concepts](https://huggingface.co/sd-concepts-library) and use Stable Diffusion with custom concepts. 🤗 Hugging Face [🧨 Diffusers library](https://github.com/huggingface/diffuse...
notebooks/diffusers/stable_diffusion_textual_inversion_library_navigator.ipynb/0
{ "file_path": "notebooks/diffusers/stable_diffusion_textual_inversion_library_navigator.ipynb", "repo_id": "notebooks", "token_count": 5285 }
304
import { Client } from "../client.js"; import { RunTree, RunTreeConfig, convertToDottedOrderFormat, } from "../run_trees.js"; async function toArray<T>(iterable: AsyncIterable<T>): Promise<T[]> { const result: T[] = []; for await (const item of iterable) { result.push(item); } return result; } async...
langsmith-sdk/js/src/tests/run_trees.int.test.ts/0
{ "file_path": "langsmith-sdk/js/src/tests/run_trees.int.test.ts", "repo_id": "langsmith-sdk", "token_count": 2916 }
1,027
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "embeddings/ollama", }); export * from "@langchain/community/embeddings/ollama";
langchainjs/langchain/src/embeddings/ollama.ts/0
{ "file_path": "langchainjs/langchain/src/embeddings/ollama.ts", "repo_id": "langchainjs", "token_count": 74 }
952
#!/usr/bin/env python # 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 # # Unles...
accelerate/src/accelerate/commands/env.py/0
{ "file_path": "accelerate/src/accelerate/commands/env.py", "repo_id": "accelerate", "token_count": 1090 }
8
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/llms/llama-index-llms-langchain/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-langchain/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,226
from typing import TYPE_CHECKING from ..utils import DIFFUSERS_SLOW_IMPORT, _LazyModule, deprecate from ..utils.import_utils import is_peft_available, is_torch_available, is_transformers_available def text_encoder_lora_state_dict(text_encoder): deprecate( "text_encoder_load_state_dict in `models`", ...
diffusers/src/diffusers/loaders/__init__.py/0
{ "file_path": "diffusers/src/diffusers/loaders/__init__.py", "repo_id": "diffusers", "token_count": 1557 }
232
<jupyter_start><jupyter_text>PipelineAI>[PipelineAI](https://pipeline.ai) allows you to run your ML models at scale in the cloud. It also provides API access to [several LLM models](https://pipeline.ai).This notebook goes over how to use Langchain with [PipelineAI](https://docs.pipeline.ai/docs). PipelineAI example[Thi...
langchain/docs/docs/integrations/llms/pipelineai.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/pipelineai.ipynb", "repo_id": "langchain", "token_count": 723 }
122
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/es/bertology.md/0
{ "file_path": "transformers/docs/source/es/bertology.md", "repo_id": "transformers", "token_count": 761 }
527
# 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/tests/regression/test_regression.py/0
{ "file_path": "peft/tests/regression/test_regression.py", "repo_id": "peft", "token_count": 9644 }
350
<!--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 to...
diffusers/docs/source/en/api/pipelines/shap_e.md/0
{ "file_path": "diffusers/docs/source/en/api/pipelines/shap_e.md", "repo_id": "diffusers", "token_count": 594 }
185
"""Math utils.""" import logging from typing import List, Optional, Tuple, Union import numpy as np logger = logging.getLogger(__name__) Matrix = Union[List[List[float]], List[np.ndarray], np.ndarray] def cosine_similarity(X: Matrix, Y: Matrix) -> np.ndarray: """Row-wise cosine similarity between two equal-wid...
langchain/libs/community/langchain_community/utils/math.py/0
{ "file_path": "langchain/libs/community/langchain_community/utils/math.py", "repo_id": "langchain", "token_count": 1183 }
311