text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, 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.or...
transformers/src/transformers/models/distilbert/configuration_distilbert.py/0
{ "file_path": "transformers/src/transformers/models/distilbert/configuration_distilbert.py", "repo_id": "transformers", "token_count": 2693 }
634
"""Test LLM reranker.""" from typing import Any, List from unittest.mock import patch from llama_index.core.llms.mock import MockLLM from llama_index.core.postprocessor.llm_rerank import LLMRerank from llama_index.core.prompts import BasePromptTemplate from llama_index.core.schema import BaseNode, NodeWithScore, Quer...
llama_index/llama-index-core/tests/postprocessor/test_llm_rerank.py/0
{ "file_path": "llama_index/llama-index-core/tests/postprocessor/test_llm_rerank.py", "repo_id": "llama_index", "token_count": 1085 }
1,164
# coding=utf-8 # Copyright 2023 Meta Platforms Inc. and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
transformers/src/transformers/models/convnextv2/modeling_tf_convnextv2.py/0
{ "file_path": "transformers/src/transformers/models/convnextv2/modeling_tf_convnextv2.py", "repo_id": "transformers", "token_count": 11969 }
651
from langchain_community.agent_toolkits.playwright.toolkit import ( PlayWrightBrowserToolkit, ) __all__ = ["PlayWrightBrowserToolkit"]
langchain/libs/langchain/langchain/agents/agent_toolkits/playwright/toolkit.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/playwright/toolkit.py", "repo_id": "langchain", "token_count": 47 }
437
# An Introduction to Unity ML-Agents [[introduction-to-ml-agents]] <img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/thumbnail.png" alt="thumbnail"/> One of the challenges in Reinforcement Learning is **creating environments**. Fortunately for us, we can use game...
deep-rl-class/units/en/unit5/introduction.mdx/0
{ "file_path": "deep-rl-class/units/en/unit5/introduction.mdx", "repo_id": "deep-rl-class", "token_count": 696 }
156
use crate::{Error, Tensor}; use std::ops::{ Bound, Range, RangeBounds, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive, }; impl Tensor { /// Intended to be use by the trait `.i()` /// /// ``` /// # use candle_core::{Tensor, DType, Device, IndexOp}; /// let a = Tensor::zeros((2, ...
candle/candle-core/src/indexer.rs/0
{ "file_path": "candle/candle-core/src/indexer.rs", "repo_id": "candle", "token_count": 2652 }
39
import { ChatOpenAI } from "@langchain/openai"; import { HumanMessage } from "@langchain/core/messages"; const chat = new ChatOpenAI({}); // Pass in a list of messages to `call` to start a conversation. In this simple example, we only pass in one message. const response = await chat.call([ new HumanMessage( "Wha...
langchainjs/examples/src/models/chat/chat_quick_start.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/chat_quick_start.ts", "repo_id": "langchainjs", "token_count": 135 }
819
""" Copyright © 2017 Marcel Dancak <dancakm@gmail.com> This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details. Adapted from https://github.com/marcel-dancak/lz-string-p...
langserve/langserve/lzstring.py/0
{ "file_path": "langserve/langserve/lzstring.py", "repo_id": "langserve", "token_count": 7960 }
1,043
#!/usr/bin/env python # coding=utf-8 # Copyright The HuggingFace 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.ap...
transformers/examples/pytorch/translation/run_translation.py/0
{ "file_path": "transformers/examples/pytorch/translation/run_translation.py", "repo_id": "transformers", "token_count": 12252 }
556
from langchain_community.tools.gmail.create_draft import ( CreateDraftSchema, GmailCreateDraft, ) __all__ = ["CreateDraftSchema", "GmailCreateDraft"]
langchain/libs/langchain/langchain/tools/gmail/create_draft.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/gmail/create_draft.py", "repo_id": "langchain", "token_count": 53 }
551
from langchain_community.embeddings.azure_openai import AzureOpenAIEmbeddings __all__ = ["AzureOpenAIEmbeddings"]
langchain/libs/langchain/langchain/embeddings/azure_openai.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/azure_openai.py", "repo_id": "langchain", "token_count": 40 }
530
from langchain_community.chat_models.jinachat import ( JinaChat, ) __all__ = [ "JinaChat", ]
langchain/libs/langchain/langchain/chat_models/jinachat.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/jinachat.py", "repo_id": "langchain", "token_count": 44 }
471
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion.py", "repo_id": "diffusers", "token_count": 6721 }
289
from __future__ import annotations import asyncio import logging import time from typing import ( TYPE_CHECKING, Any, AsyncIterator, Dict, Iterator, List, Optional, Tuple, Union, ) from langchain_core.agents import ( AgentAction, AgentFinish, AgentStep, ) from langchain...
langchain/libs/langchain/langchain/agents/agent_iterator.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_iterator.py", "repo_id": "langchain", "token_count": 6930 }
462
// 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/datacoord/compaction_trigger.go/0
{ "file_path": "milvus/internal/datacoord/compaction_trigger.go", "repo_id": "milvus", "token_count": 12561 }
1,961
# HRNet **HRNet**, or **High-Resolution Net**, is a general purpose convolutional neural network for tasks like semantic segmentation, object detection and image classification. It is able to maintain high resolution representations through the whole process. We start from a high-resolution convolution stream, gradual...
pytorch-image-models/docs/models/hrnet.md/0
{ "file_path": "pytorch-image-models/docs/models/hrnet.md", "repo_id": "pytorch-image-models", "token_count": 5046 }
353
--- sidebar_position: 0 --- # Text Splitters Once you've loaded documents, you'll often want to transform them to better suit your application. The simplest example is you may want to split a long document into smaller chunks that can fit into your model's context window. LangChain has a number of built-in document t...
langchainjs/docs/core_docs/docs/modules/data_connection/document_transformers/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/document_transformers/index.mdx", "repo_id": "langchainjs", "token_count": 2248 }
762
from __future__ import annotations import logging from typing import Any, Callable, Dict, List, Optional from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, root_validator from langchain_core.utils import get_from_dict_or_env from tenacity import ( before_sleep_log, ...
langchain/libs/community/langchain_community/embeddings/google_palm.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/google_palm.py", "repo_id": "langchain", "token_count": 1388 }
257
use candle::{Result, Tensor}; pub struct Batcher<I> { inner: I, batch_size: usize, return_last_incomplete_batch: bool, } impl<I> Batcher<I> { fn new(inner: I) -> Self { Self { inner, batch_size: 16, return_last_incomplete_batch: false, } } p...
candle/candle-datasets/src/batcher.rs/0
{ "file_path": "candle/candle-datasets/src/batcher.rs", "repo_id": "candle", "token_count": 2660 }
37
#!/usr/bin/env python # 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-...
transformers/examples/flax/language-modeling/run_mlm_flax.py/0
{ "file_path": "transformers/examples/flax/language-modeling/run_mlm_flax.py", "repo_id": "transformers", "token_count": 17080 }
513
// 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/datacoord/index_meta.go/0
{ "file_path": "milvus/internal/datacoord/index_meta.go", "repo_id": "milvus", "token_count": 8658 }
1,912
export { GenerativeAgentMemory } from "./generative_agent_memory.js"; export { GenerativeAgent } from "./generative_agent.js";
langchainjs/langchain/src/experimental/generative_agents/index.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/generative_agents/index.ts", "repo_id": "langchainjs", "token_count": 37 }
959
"""Query for KeywordTableIndex.""" import logging from abc import abstractmethod from collections import defaultdict from typing import Any, Dict, List, Optional from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.core.base_retriever import BaseRetriever from llama_index.legacy.indic...
llama_index/llama-index-legacy/llama_index/legacy/indices/keyword_table/retrievers.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/keyword_table/retrievers.py", "repo_id": "llama_index", "token_count": 2530 }
1,715
// 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/local_chunk_manager_test.go/0
{ "file_path": "milvus/internal/storage/local_chunk_manager_test.go", "repo_id": "milvus", "token_count": 7560 }
1,793
[ { "server": "idc-sh002", "suite_params": [ { "suite": "2_locust_search.yaml", "image_type": "cpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/locust_search.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/locust_search.json", "repo_id": "milvus", "token_count": 136 }
1,860
compute_environment: LOCAL_MACHINE debug: false distributed_type: MULTI_GPU downcast_bf16: 'no' gpu_ids: all machine_rank: 0 main_training_function: main mixed_precision: 'bf16' num_machines: 1 num_processes: 8 rdzv_backend: static same_network: true tpu_env: [] tpu_use_cluster: false tpu_use_sudo: false use_cpu: false...
trl/examples/accelerate_configs/multi_gpu.yaml/0
{ "file_path": "trl/examples/accelerate_configs/multi_gpu.yaml", "repo_id": "trl", "token_count": 130 }
780
# Copyright 2020 The HuggingFace Datasets Authors. # # 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 ...
datasets/metrics/squad_v2/squad_v2.py/0
{ "file_path": "datasets/metrics/squad_v2/squad_v2.py", "repo_id": "datasets", "token_count": 2564 }
136
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/bert/convert_bert_pytorch_checkpoint_to_original_tf.py/0
{ "file_path": "transformers/src/transformers/models/bert/convert_bert_pytorch_checkpoint_to_original_tf.py", "repo_id": "transformers", "token_count": 1657 }
605
import { test } from "@jest/globals"; import { ChatPromptTemplate } from "@langchain/core/prompts"; import { FakeRetriever } from "@langchain/core/utils/testing"; import { Document } from "@langchain/core/documents"; import { FakeListLLM } from "../../llms/fake.js"; import { createHistoryAwareRetriever } from "../histo...
langchainjs/langchain/src/chains/tests/history_aware_retriever.test.ts/0
{ "file_path": "langchainjs/langchain/src/chains/tests/history_aware_retriever.test.ts", "repo_id": "langchainjs", "token_count": 379 }
869
from __module_name__.chain import chain __all__ = ["chain"]
langchain/libs/cli/langchain_cli/package_template/package_template/__init__.py/0
{ "file_path": "langchain/libs/cli/langchain_cli/package_template/package_template/__init__.py", "repo_id": "langchain", "token_count": 20 }
219
import os import pytest from langchain_openai import OpenAIEmbeddings os.environ["OPENAI_API_KEY"] = "foo" def test_openai_invalid_model_kwargs() -> None: with pytest.raises(ValueError): OpenAIEmbeddings(model_kwargs={"model": "foo"}) def test_openai_incorrect_field() -> None: with pytest.warns(m...
langchain/libs/partners/openai/tests/unit_tests/embeddings/test_base.py/0
{ "file_path": "langchain/libs/partners/openai/tests/unit_tests/embeddings/test_base.py", "repo_id": "langchain", "token_count": 177 }
654
from llama_index.vector_stores.txtai.base import TxtaiVectorStore __all__ = ["TxtaiVectorStore"]
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-txtai/llama_index/vector_stores/txtai/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-txtai/llama_index/vector_stores/txtai/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,498
{ "modelname": "BrandNewBERT", "uppercase_modelname": "BRAND_NEW_BERT", "lowercase_modelname": "brand_new_bert", "camelcase_modelname": "BrandNewBert", "authors": "The HuggingFace Team", "checkpoint_identifier": "brand-new-bert-base-cased", "tokenizer_type": ["Based on BERT", "Based on BART", "Standalone"...
transformers/templates/adding_a_new_model/cookiecutter.json/0
{ "file_path": "transformers/templates/adding_a_new_model/cookiecutter.json", "repo_id": "transformers", "token_count": 245 }
695
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/examples/community/stable_diffusion_repaint.py/0
{ "file_path": "diffusers/examples/community/stable_diffusion_repaint.py", "repo_id": "diffusers", "token_count": 21143 }
203
<!--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/kandinsky.md/0
{ "file_path": "diffusers/docs/source/en/api/pipelines/kandinsky.md", "repo_id": "diffusers", "token_count": 850 }
179
# coding=utf-8 # Copyright (c) 2021 THUML @ Tsinghua University # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. # 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 ...
transformers/src/transformers/models/autoformer/modeling_autoformer.py/0
{ "file_path": "transformers/src/transformers/models/autoformer/modeling_autoformer.py", "repo_id": "transformers", "token_count": 44796 }
582
<!--⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be rendered properly in your Markdown viewer. --> # Using pipelines for a webserver <Tip> Creating an inference engine is a complex topic, and the "best" solution will most likely depend on your pr...
transformers/docs/source/en/pipeline_webserver.md/0
{ "file_path": "transformers/docs/source/en/pipeline_webserver.md", "repo_id": "transformers", "token_count": 1771 }
472
from typing import Any, Dict, List, Tuple from langchain_core.prompt_values import PromptValue from langchain_core.prompts.base import BasePromptTemplate from langchain_core.prompts.chat import BaseChatPromptTemplate from langchain_core.pydantic_v1 import root_validator def _get_inputs(inputs: dict, input_variables:...
langchain/libs/core/langchain_core/prompts/pipeline.py/0
{ "file_path": "langchain/libs/core/langchain_core/prompts/pipeline.py", "repo_id": "langchain", "token_count": 977 }
405
from typing import Any, Dict, List from langchain_core.messages import BaseMessage, get_buffer_string from langchain_core.pydantic_v1 import root_validator from langchain.memory.chat_memory import BaseChatMemory from langchain.memory.summary import SummarizerMixin class ConversationSummaryBufferMemory(BaseChatMemor...
langchain/libs/langchain/langchain/memory/summary_buffer.py/0
{ "file_path": "langchain/libs/langchain/langchain/memory/summary_buffer.py", "repo_id": "langchain", "token_count": 1225 }
572
#!/bin/bash # 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 applica...
milvus/tests/scripts/uninstall_milvus.sh/0
{ "file_path": "milvus/tests/scripts/uninstall_milvus.sh", "repo_id": "milvus", "token_count": 1357 }
2,013
# 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/roberta_prelayernorm/test_modeling_tf_roberta_prelayernorm.py/0
{ "file_path": "transformers/tests/models/roberta_prelayernorm/test_modeling_tf_roberta_prelayernorm.py", "repo_id": "transformers", "token_count": 12806 }
819
python_sources()
llama_index/llama-index-packs/llama-index-packs-fuzzy-citation/llama_index/packs/fuzzy_citation/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-fuzzy-citation/llama_index/packs/fuzzy_citation/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,788
from langchain_ibm.llms import WatsonxLLM __all__ = ["WatsonxLLM"]
langchain/libs/partners/ibm/langchain_ibm/__init__.py/0
{ "file_path": "langchain/libs/partners/ibm/langchain_ibm/__init__.py", "repo_id": "langchain", "token_count": 28 }
655
""" MangaDex info reader. Retrieves data about a particular manga by title. """ import logging from typing import List import requests from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document logger = logging.getLogger(__name__) class MangaDexReader(BaseReader): def __...
llama_index/llama-index-integrations/readers/llama-index-readers-mangadex/llama_index/readers/mangadex/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mangadex/llama_index/readers/mangadex/base.py", "repo_id": "llama_index", "token_count": 2297 }
1,476
<!--- 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 ...
transformers/docs/source/de/contributing.md/0
{ "file_path": "transformers/docs/source/de/contributing.md", "repo_id": "transformers", "token_count": 8257 }
489
import argparse import sys sys.path.append(".") from base_classes import InpaintingBenchmark # noqa: E402 if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--ckpt", type=str, default="runwayml/stable-diffusion-v1-5", choices=[ "r...
diffusers/benchmarks/benchmark_sd_inpainting.py/0
{ "file_path": "diffusers/benchmarks/benchmark_sd_inpainting.py", "repo_id": "diffusers", "token_count": 362 }
179
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; export const run = async () => { const text = `Hi.\n\nI'm Harrison.\n\nHow? Are? You?\nOkay then f f f f. This is a weird text to write, but gotta test the splittingggg some how.\n\n Bye!\n\n-H.`; const splitter = new RecursiveCharac...
langchainjs/examples/src/indexes/recursive_text_splitter.ts/0
{ "file_path": "langchainjs/examples/src/indexes/recursive_text_splitter.ts", "repo_id": "langchainjs", "token_count": 166 }
870
<jupyter_start><jupyter_text>Custom Agent with PlugIn RetrievalThis notebook combines two concepts in order to build a custom agent that can interact with AI Plugins:1. [Custom Agent with Tool Retrieval](/docs/modules/agents/how_to/custom_agent_with_tool_retrieval.html): This introduces the concept of retrieving many t...
langchain/cookbook/custom_agent_with_plugin_retrieval.ipynb/0
{ "file_path": "langchain/cookbook/custom_agent_with_plugin_retrieval.ipynb", "repo_id": "langchain", "token_count": 3067 }
70
<jupyter_start><jupyter_text>Google Drive>[Google Drive](https://en.wikipedia.org/wiki/Google_Drive) is a file storage and synchronization service developed by Google.This notebook covers how to load documents from `Google Drive`. Currently, only `Google Docs` are supported. Prerequisites1. Create a Google Cloud projec...
langchain/docs/docs/integrations/document_loaders/google_drive.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/google_drive.ipynb", "repo_id": "langchain", "token_count": 3765 }
103
# Supabase (Postgres) >[Supabase](https://supabase.com/docs) is an open-source `Firebase` alternative. > `Supabase` is built on top of `PostgreSQL`, which offers strong `SQL` > querying capabilities and enables a simple interface with already-existing tools and frameworks. >[PostgreSQL](https://en.wikipedia.org/wik...
langchain/docs/docs/integrations/providers/supabase.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/supabase.mdx", "repo_id": "langchain", "token_count": 212 }
149
# 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/tests/pipelines/test_pipelines_summarization.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_summarization.py", "repo_id": "transformers", "token_count": 3529 }
762
{ "imports": { "http/": "https://deno.land/std@0.177.0/http/", "@supabase/supabase-js": "https://esm.sh/@supabase/supabase-js@2.15.0", "langchain/": "https://esm.sh/langchain@0.0.52/" } }
langchain-template-supabase/supabase/functions/import_map.json/0
{ "file_path": "langchain-template-supabase/supabase/functions/import_map.json", "repo_id": "langchain-template-supabase", "token_count": 101 }
71
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/llms/llama-index-llms-everlyai/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-everlyai/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,222
import json import zipfile from pathlib import Path from typing import Dict, List, Optional from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader class SlackDirectoryLoader(BaseLoader): """Load from a `Slack` directory dump.""" def __init__(self, zip...
langchain/libs/community/langchain_community/document_loaders/slack_directory.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/slack_directory.py", "repo_id": "langchain", "token_count": 1860 }
268
# Cloud storage 🤗 Datasets supports access to cloud storage providers through a `fsspec` FileSystem implementations. You can save and load datasets from any cloud storage in a Pythonic way. Take a look at the following table for some example of supported cloud storage providers: | Storage provider | Filesystem i...
datasets/docs/source/filesystems.mdx/0
{ "file_path": "datasets/docs/source/filesystems.mdx", "repo_id": "datasets", "token_count": 2640 }
112
import { expect, test } from "@jest/globals"; import { simpleValue, complexValue, GoogleVertexAIStream, } from "../googlevertexai-connection.js"; describe("VertexAI Connection", () => { describe("complexValue", () => { test("int_val", () => { const result = complexValue(1); expect(result).toEqu...
langchainjs/langchain/src/util/tests/googlevertexai-connection.test.ts/0
{ "file_path": "langchainjs/langchain/src/util/tests/googlevertexai-connection.test.ts", "repo_id": "langchainjs", "token_count": 5122 }
979
// 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/proxy/accesslog/info_test.go/0
{ "file_path": "milvus/internal/proxy/accesslog/info_test.go", "repo_id": "milvus", "token_count": 1846 }
1,811
from llama_index.postprocessor.rankgpt_rerank.base import RankGPTRerank __all__ = ["RankGPTRerank"]
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-rankgpt-rerank/llama_index/postprocessor/rankgpt_rerank/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-rankgpt-rerank/llama_index/postprocessor/rankgpt_rerank/__init__.py", "repo_id": "llama_index", "token_count": 37 }
1,355
from functools import update_wrapper, wraps import torch from torch import Tensor from torch.optim.optimizer import Optimizer try: from torch.optim.optimizer import _use_grad_for_differentiable, _default_to_fused_or_foreach has_recent_pt = True except ImportError: has_recent_pt = False from typing import L...
pytorch-image-models/timm/optim/sgdw.py/0
{ "file_path": "pytorch-image-models/timm/optim/sgdw.py", "repo_id": "pytorch-image-models", "token_count": 4501 }
387
<jupyter_start><jupyter_code># Setup OpenAI Agent import openai openai.api_key = "sk-your-key" from llama_index.agent import OpenAIAgent # Import and initialize our tool spec from llama_index.tools.notion.base import NotionToolSpec notion_token = "secret_your-key" tool_spec = NotionToolSpec(integration_token=notion_t...
llama_index/llama-index-integrations/tools/llama-index-tools-notion/examples/notion.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-notion/examples/notion.ipynb", "repo_id": "llama_index", "token_count": 360 }
1,491
# Archived Changes ### Nov 22, 2021 * A number of updated weights anew new model defs * `eca_halonext26ts` - 79.5 @ 256 * `resnet50_gn` (new) - 80.1 @ 224, 81.3 @ 288 * `resnet50` - 80.7 @ 224, 80.9 @ 288 (trained at 176, not replacing current a1 weights as default since these don't scale as well to higher res, ...
pytorch-image-models/docs/archived_changes.md/0
{ "file_path": "pytorch-image-models/docs/archived_changes.md", "repo_id": "pytorch-image-models", "token_count": 9335 }
333
python_tests( interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-packs/llama-index-packs-ragatouille-retriever/tests/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-ragatouille-retriever/tests/BUILD", "repo_id": "llama_index", "token_count": 29 }
1,866
use crate::decoders::Decoder; use crate::encoding::{JsEncoding, JsTruncationDirection, JsTruncationStrategy}; use crate::models::Model; use crate::normalizers::Normalizer; use crate::pre_tokenizers::PreTokenizer; use crate::processors::Processor; use crate::tasks::tokenizer::{DecodeBatchTask, DecodeTask, EncodeBatchTas...
tokenizers/bindings/node/src/tokenizer.rs/0
{ "file_path": "tokenizers/bindings/node/src/tokenizer.rs", "repo_id": "tokenizers", "token_count": 5701 }
443
pub(crate) mod assignment_policy; pub(crate) mod config; mod rendezvous_hash;
chroma/rust/worker/src/assignment/mod.rs/0
{ "file_path": "chroma/rust/worker/src/assignment/mod.rs", "repo_id": "chroma", "token_count": 27 }
60
import { OpenAIChat } from "@langchain/openai"; import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import type { Generation, LLMResult } from "@langchain/core/outputs"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; import { promptLayerTrackRequest } from "../util/prompt...
langchainjs/langchain/src/llms/openai-chat.ts/0
{ "file_path": "langchainjs/langchain/src/llms/openai-chat.ts", "repo_id": "langchainjs", "token_count": 1052 }
890
# ModelScope >[ModelScope](https://www.modelscope.cn/home) is a big repository of the models and datasets. This page covers how to use the modelscope ecosystem within LangChain. It is broken into two parts: installation and setup, and then references to specific modelscope wrappers. ## Installation and Setup Instal...
langchain/docs/docs/integrations/providers/modelscope.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/modelscope.mdx", "repo_id": "langchain", "token_count": 164 }
152
import pytest from langchain.prompts.few_shot import FewShotPromptTemplate from langchain.pydantic_v1 import BaseModel from langchain_community.chat_models import ChatOpenAI from langchain_experimental.tabular_synthetic_data.base import SyntheticDataGenerator from langchain_experimental.tabular_synthetic_data.openai i...
langchain/libs/experimental/tests/integration_tests/chains/test_synthetic_data_openai.py/0
{ "file_path": "langchain/libs/experimental/tests/integration_tests/chains/test_synthetic_data_openai.py", "repo_id": "langchain", "token_count": 1335 }
427
"""Eleven Labs Services Tools.""" from langchain_community.tools.eleven_labs.text2speech import ElevenLabsText2SpeechTool __all__ = ["ElevenLabsText2SpeechTool"]
langchain/libs/community/langchain_community/tools/eleven_labs/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/eleven_labs/__init__.py", "repo_id": "langchain", "token_count": 54 }
285
@ECHO OFF pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set SOURCEDIR=. set BUILDDIR=_build %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the ...
llama_index/docs/make.bat/0
{ "file_path": "llama_index/docs/make.bat", "repo_id": "llama_index", "token_count": 317 }
1,152
package deletebuffer import ( "github.com/samber/lo" "github.com/milvus-io/milvus/internal/storage" ) // Item wraps cache item as `timed`. type Item struct { Ts uint64 Data []BufferItem } // Timestamp implements `timed`. func (item *Item) Timestamp() uint64 { return item.Ts } // Size implements `timed`. fun...
milvus/internal/querynodev2/delegator/deletebuffer/delete_item.go/0
{ "file_path": "milvus/internal/querynodev2/delegator/deletebuffer/delete_item.go", "repo_id": "milvus", "token_count": 304 }
1,986
from llama_index.readers.youtube_transcript.base import YoutubeTranscriptReader __all__ = ["YoutubeTranscriptReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/llama_index/readers/youtube_transcript/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/llama_index/readers/youtube_transcript/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,546
from langchain_community.chat_models.baidu_qianfan_endpoint import ( QianfanChatEndpoint, ) __all__ = ["QianfanChatEndpoint"]
langchain/libs/langchain/langchain/chat_models/baidu_qianfan_endpoint.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/baidu_qianfan_endpoint.py", "repo_id": "langchain", "token_count": 49 }
503
#!/usr/bin/env python # 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...
diffusers/src/diffusers/commands/diffusers_cli.py/0
{ "file_path": "diffusers/src/diffusers/commands/diffusers_cli.py", "repo_id": "diffusers", "token_count": 411 }
238
<jupyter_start><jupyter_text>Human-in-the-loopIn this example we will build a chat executor that has a human in the loop. We will use the human to approve specific actions.This examples builds off the base chat executor. It is highly recommended you learn about that executor before going through this notebook. You can ...
langgraph/examples/chat_agent_executor_with_function_calling/human-in-the-loop.ipynb/0
{ "file_path": "langgraph/examples/chat_agent_executor_with_function_calling/human-in-the-loop.ipynb", "repo_id": "langgraph", "token_count": 2937 }
1,115
import time import copy import logging from milvus_benchmark import parser from milvus_benchmark.runners import utils from milvus_benchmark.runners.base import BaseRunner logger = logging.getLogger("milvus_benchmark.runners.get") def get_ids(length, size): ids_list = [] step = size // length for i in ran...
milvus/tests/benchmark/milvus_benchmark/runners/get.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/runners/get.py", "repo_id": "milvus", "token_count": 2127 }
1,936
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/src/transformers/models/tvlt/feature_extraction_tvlt.py/0
{ "file_path": "transformers/src/transformers/models/tvlt/feature_extraction_tvlt.py", "repo_id": "transformers", "token_count": 4436 }
663
# 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/speech_to_text/test_modeling_speech_to_text.py/0
{ "file_path": "transformers/tests/models/speech_to_text/test_modeling_speech_to_text.py", "repo_id": "transformers", "token_count": 15739 }
841
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, 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.or...
transformers/src/transformers/models/distilbert/modeling_distilbert.py/0
{ "file_path": "transformers/src/transformers/models/distilbert/modeling_distilbert.py", "repo_id": "transformers", "token_count": 26578 }
624
<jupyter_start><jupyter_text>Cassandra >[Apache Cassandra®](https://cassandra.apache.org) is a `NoSQL`, row-oriented, highly scalable and highly available database, well suited for storing large amounts of data.>`Cassandra` is a good choice for storing chat message history because it is easy to scale and can handle a l...
langchain/docs/docs/integrations/memory/cassandra_chat_message_history.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/memory/cassandra_chat_message_history.ipynb", "repo_id": "langchain", "token_count": 949 }
121
python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/finetuning/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/finetuning/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,529
from langchain_community.tools.ainetwork.app import ( AINAppOps, AppOperationType, AppSchema, ) __all__ = ["AppOperationType", "AppSchema", "AINAppOps"]
langchain/libs/langchain/langchain/tools/ainetwork/app.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/ainetwork/app.py", "repo_id": "langchain", "token_count": 64 }
569
export interface WebSocketConnection< T extends Uint8Array | string = Uint8Array | string > { readable: ReadableStream<T>; writable: WritableStream<T>; protocol: string; extensions: string; } export interface WebSocketCloseInfo { code?: number; reason?: string; } export interface WebSocketStreamOptions ...
langchainjs/libs/langchain-community/src/utils/iflytek_websocket_stream.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/utils/iflytek_websocket_stream.ts", "repo_id": "langchainjs", "token_count": 1049 }
990
# Metric Card for Google BLEU (GLEU) ## Metric Description The BLEU score has some undesirable properties when used for single sentences, as it was designed to be a corpus measure. The Google BLEU score, also known as GLEU score, is designed to limit these undesirable properties when used for single sentences. To ca...
datasets/metrics/google_bleu/README.md/0
{ "file_path": "datasets/metrics/google_bleu/README.md", "repo_id": "datasets", "token_count": 3361 }
118
import type { BaseRetrieverInterface } from "@langchain/core/retrievers"; import { type Runnable, RunnableSequence, type RunnableInterface, RunnablePassthrough, } from "@langchain/core/runnables"; import type { BaseMessage } from "@langchain/core/messages"; import type { DocumentInterface, Document } from "@lan...
langchainjs/langchain/src/chains/retrieval.ts/0
{ "file_path": "langchainjs/langchain/src/chains/retrieval.ts", "repo_id": "langchainjs", "token_count": 1280 }
855
from langchain_community.llms.self_hosted_hugging_face import ( SelfHostedHuggingFaceLLM, ) __all__ = [ "SelfHostedHuggingFaceLLM", ]
langchain/libs/langchain/langchain/llms/self_hosted_hugging_face.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/self_hosted_hugging_face.py", "repo_id": "langchain", "token_count": 60 }
542
"""Embeddings.""" import os from typing import Any, List from unittest.mock import patch from llama_index.legacy.core.embeddings.base import SimilarityMode, mean_agg from llama_index.legacy.embeddings.openai import OpenAIEmbedding from tests.conftest import CachedOpenAIApiKeys def mock_get_text_embedding(text: str...
llama_index/llama-index-legacy/tests/embeddings/test_base.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/embeddings/test_base.py", "repo_id": "llama_index", "token_count": 1667 }
1,658
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-snscrape-twitter/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-snscrape-twitter/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,526
"""Wrapper around TileDB vector database.""" from __future__ import annotations import pickle import random import sys from typing import Any, Dict, Iterable, List, Mapping, Optional, Tuple import numpy as np from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain...
langchain/libs/community/langchain_community/vectorstores/tiledb.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/tiledb.py", "repo_id": "langchain", "token_count": 14127 }
320
python_sources()
llama_index/llama-index-legacy/tests/mock_utils/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/mock_utils/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,748
import json 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, root_validator from langchain_core.utils import get_from_dict_or_env from langchain_communit...
langchain/libs/community/langchain_community/llms/huggingface_hub.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/huggingface_hub.py", "repo_id": "langchain", "token_count": 2262 }
269
from typing import Any, Dict, List, Optional from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, Extra, Field, root_validator class LlamaCppEmbeddings(BaseModel, Embeddings): """llama.cpp embedding models. To use, you should have the llama-cpp-python library in...
langchain/libs/community/langchain_community/embeddings/llamacpp.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/llamacpp.py", "repo_id": "langchain", "token_count": 1749 }
257
import asyncio import uuid from abc import abstractmethod from typing import Callable, Dict, List, Optional, TypedDict, Union, cast try: from pydantic.v1 import BaseModel, Field, ValidationError # type: ignore[import] except ImportError: from pydantic import BaseModel, Field, ValidationError from functools i...
langsmith-sdk/python/langsmith/evaluation/evaluator.py/0
{ "file_path": "langsmith-sdk/python/langsmith/evaluation/evaluator.py", "repo_id": "langsmith-sdk", "token_count": 2348 }
1,048
"""Tests RocksetChatMessageHistory by creating a collection for message history, adding to it, and clearing it. To run these tests, make sure you have the ROCKSET_API_KEY and ROCKSET_REGION environment variables set. """ import json import os from langchain_community.chat_message_histories import RocksetChatMessageH...
langchain/libs/langchain/tests/integration_tests/memory/test_rockset.py/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/memory/test_rockset.py", "repo_id": "langchain", "token_count": 810 }
595
from pathlib import Path from typing import Sequence, Union import pytest from langchain_community.document_loaders import ( AmazonTextractPDFLoader, MathpixPDFLoader, PDFMinerLoader, PDFMinerPDFasHTMLLoader, PyMuPDFLoader, PyPDFium2Loader, PyPDFLoader, UnstructuredPDFLoader, ) def t...
langchain/libs/community/tests/integration_tests/document_loaders/test_pdf.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_pdf.py", "repo_id": "langchain", "token_count": 3183 }
326
# 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/segformer/test_modeling_segformer.py/0
{ "file_path": "transformers/tests/models/segformer/test_modeling_segformer.py", "repo_id": "transformers", "token_count": 7796 }
822
import logging import re from typing import List, Optional, Sequence, Union from urllib.parse import urljoin, urlparse logger = logging.getLogger(__name__) PREFIXES_TO_IGNORE = ("javascript:", "mailto:", "#") SUFFIXES_TO_IGNORE = ( ".css", ".js", ".ico", ".png", ".jpg", ".jpeg", ".gif", ...
langchain/libs/core/langchain_core/utils/html.py/0
{ "file_path": "langchain/libs/core/langchain_core/utils/html.py", "repo_id": "langchain", "token_count": 1593 }
440
// 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/AckResponder.h/0
{ "file_path": "milvus/internal/core/src/segcore/AckResponder.h", "repo_id": "milvus", "token_count": 967 }
1,665
from llama_index.readers.feishu_docs.base import FeishuDocsReader __all__ = ["FeishuDocsReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-feishu-docs/llama_index/readers/feishu_docs/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-feishu-docs/llama_index/readers/feishu_docs/__init__.py", "repo_id": "llama_index", "token_count": 38 }
1,313
import { NodeHandler, ASTParser } from "./base.js"; import { MemberExpressionType } from "./types.js"; /** * Handles member expressions in the LangChain Expression Language (LCEL). * Extends the NodeHandler base class. */ export class MemberExpressionHandler extends NodeHandler { /** * Checks if a given node i...
langchainjs/langchain/src/output_parsers/expression_type_handlers/member_expression_handler.ts/0
{ "file_path": "langchainjs/langchain/src/output_parsers/expression_type_handlers/member_expression_handler.ts", "repo_id": "langchainjs", "token_count": 817 }
1,002
import * as fs from "node:fs"; import * as path from "node:path"; import * as os from "node:os"; import { BlobServiceClient } from "@azure/storage-blob"; import { BaseDocumentLoader } from "../base.js"; import { UnstructuredLoader, UnstructuredLoaderOptions, } from "../fs/unstructured.js"; /** * Interface represe...
langchainjs/langchain/src/document_loaders/web/azure_blob_storage_file.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/web/azure_blob_storage_file.ts", "repo_id": "langchainjs", "token_count": 1137 }
947