text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
# Using TGI CLI You can use TGI command-line interface (CLI) to download weights, serve and quantize models, or get information on serving parameters. To install the CLI, please refer to [the installation section](../installation#install-cli). `text-generation-server` lets you download the model with `download-weight...
text-generation-inference/docs/source/basic_tutorials/using_cli.md/0
{ "file_path": "text-generation-inference/docs/source/basic_tutorials/using_cli.md", "repo_id": "text-generation-inference", "token_count": 329 }
396
<jupyter_start><jupyter_text>Arcee RetrieverThis notebook demonstrates how to use the `ArceeRetriever` class to retrieve relevant document(s) for Arcee's Domain Adapted Language Models (DALMs). SetupBefore using `ArceeRetriever`, make sure the Arcee API key is set as `ARCEE_API_KEY` environment variable. You can also ...
langchain/docs/docs/integrations/retrievers/arcee.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/retrievers/arcee.ipynb", "repo_id": "langchain", "token_count": 844 }
166
package model import ( "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" ) type Field struct { FieldID int64 Name string IsPrimaryKey bool Description string DataType schemapb....
milvus/internal/metastore/model/field.go/0
{ "file_path": "milvus/internal/metastore/model/field.go", "repo_id": "milvus", "token_count": 1825 }
1,862
from langchain_community.docstore.arbitrary_fn import DocstoreFn __all__ = ["DocstoreFn"]
langchain/libs/langchain/langchain/docstore/arbitrary_fn.py/0
{ "file_path": "langchain/libs/langchain/langchain/docstore/arbitrary_fn.py", "repo_id": "langchain", "token_count": 32 }
473
// 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/pkg/util/paramtable/grpc_param.go/0
{ "file_path": "milvus/pkg/util/paramtable/grpc_param.go", "repo_id": "milvus", "token_count": 5462 }
1,839
# LlamaIndex Llms Integration: Openllm
llama_index/llama-index-integrations/llms/llama-index-llms-openllm/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openllm/README.md", "repo_id": "llama_index", "token_count": 12 }
1,240
/* eslint-disable no-process-env */ import { expect, test } from "@jest/globals"; import { HUMAN_PROMPT } from "@anthropic-ai/sdk"; import { ChatPromptValue } from "@langchain/core/prompt_values"; import { ChatMessage, HumanMessage } from "@langchain/core/messages"; import { PromptTemplate, ChatPromptTemplate, A...
langchainjs/langchain/src/chat_models/tests/chatanthropic.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/chat_models/tests/chatanthropic.int.test.ts", "repo_id": "langchainjs", "token_count": 3331 }
873
import { AIMessage, BaseMessage } from "@langchain/core/messages"; import { ChatResult } from "@langchain/core/outputs"; import { BaseChatModel, BaseChatModelParams, } from "@langchain/core/language_models/chat_models"; import { SystemMessagePromptTemplate } from "@langchain/core/prompts"; import { BaseFunctionCall...
langchainjs/langchain/src/experimental/chat_models/ollama_functions.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/chat_models/ollama_functions.ts", "repo_id": "langchainjs", "token_count": 1810 }
923
import type { Message } from "$lib/types/Message"; export function isMessageId(id: string): id is Message["id"] { return id.split("-").length === 5; }
chat-ui/src/lib/utils/tree/isMessageId.ts/0
{ "file_path": "chat-ui/src/lib/utils/tree/isMessageId.ts", "repo_id": "chat-ui", "token_count": 48 }
98
from llama_index.core.postprocessor.types import BaseNodePostprocessor from llama_index.postprocessor.flag_embedding_reranker import FlagEmbeddingReranker def test_class(): names_of_base_classes = [b.__name__ for b in FlagEmbeddingReranker.__mro__] assert BaseNodePostprocessor.__name__ in names_of_base_classe...
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-flag-embedding-reranker/tests/test_postprocessor_flag_embedding_reranker.py/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-flag-embedding-reranker/tests/test_postprocessor_flag_embedding_reranker.py", "repo_id": "llama_index", "token_count": 108 }
1,296
# coding=utf-8 # Copyright 2019-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 a...
transformers/examples/research_projects/distillation/scripts/extract_distilbert.py/0
{ "file_path": "transformers/examples/research_projects/distillation/scripts/extract_distilbert.py", "repo_id": "transformers", "token_count": 1864 }
560
from abc import abstractmethod from typing import List, Sequence from llama_index.core.bridge.pydantic import BaseModel from llama_index.core.prompts.mixin import PromptMixin, PromptMixinType from llama_index.core.schema import QueryBundle from llama_index.core.tools.types import ToolMetadata class SubQuestion(BaseM...
llama_index/llama-index-core/llama_index/core/question_gen/types.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/question_gen/types.py", "repo_id": "llama_index", "token_count": 352 }
1,146
# coding=utf-8 # Copyright 2022 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/table_transformer/convert_table_transformer_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/table_transformer/convert_table_transformer_to_hf.py", "repo_id": "transformers", "token_count": 6591 }
686
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/indices/managed/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/managed/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,518
package distance import ( "math" "math/rand" "testing" "time" "github.com/stretchr/testify/assert" ) const PRECISION = 1e-5 func TestValidateMetricType(t *testing.T) { invalidMetric := []string{"", "aaa"} for _, str := range invalidMetric { _, err := ValidateMetricType(str) assert.Error(t, err) } vali...
milvus/pkg/util/distance/calc_distance_test.go/0
{ "file_path": "milvus/pkg/util/distance/calc_distance_test.go", "repo_id": "milvus", "token_count": 2110 }
1,931
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/ko/using-diffusers/controlling_generation.md/0
{ "file_path": "diffusers/docs/source/ko/using-diffusers/controlling_generation.md", "repo_id": "diffusers", "token_count": 14041 }
206
# Node Postprocessor ## Concept Node postprocessors are a set of modules that take a set of nodes, and apply some kind of transformation or filtering before returning them. In LlamaIndex, node postprocessors are most commonly applied within a query engine, after the node retrieval step and before the response synthe...
llama_index/docs/module_guides/querying/node_postprocessors/root.md/0
{ "file_path": "llama_index/docs/module_guides/querying/node_postprocessors/root.md", "repo_id": "llama_index", "token_count": 1385 }
1,145
from typing import List from llama_index.legacy.extractors import ( KeywordExtractor, QuestionsAnsweredExtractor, SummaryExtractor, TitleExtractor, ) from llama_index.legacy.ingestion import run_transformations from llama_index.legacy.node_parser import SentenceSplitter from llama_index.legacy.schema i...
llama_index/llama-index-legacy/tests/node_parser/metadata_extractor.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/node_parser/metadata_extractor.py", "repo_id": "llama_index", "token_count": 413 }
1,642
from langchain.chat_models.base import __all__ EXPECTED_ALL = [ "BaseChatModel", "SimpleChatModel", "agenerate_from_stream", "generate_from_stream", ] def test_all_imports() -> None: assert set(__all__) == set(EXPECTED_ALL)
langchain/libs/langchain/tests/unit_tests/chat_models/test_base.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/chat_models/test_base.py", "repo_id": "langchain", "token_count": 101 }
594
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
transformers/src/transformers/modeling_tf_utils.py/0
{ "file_path": "transformers/src/transformers/modeling_tf_utils.py", "repo_id": "transformers", "token_count": 72231 }
640
import { CheerioWebBaseLoader } from "langchain/document_loaders/web/cheerio"; import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { Ollama } from "@langchain/community/llms/ollama"; import { HuggingFaceTransformersEmbeddi...
langchainjs/examples/src/use_cases/local_retrieval_qa/chain.ts/0
{ "file_path": "langchainjs/examples/src/use_cases/local_retrieval_qa/chain.ts", "repo_id": "langchainjs", "token_count": 661 }
918
import unittest import numpy as np from transformers import ElectraConfig, is_flax_available from transformers.testing_utils import require_flax, slow from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask if is_flax_available(): from transformers.models.electra.modeli...
transformers/tests/models/electra/test_modeling_flax_electra.py/0
{ "file_path": "transformers/tests/models/electra/test_modeling_flax_electra.py", "repo_id": "transformers", "token_count": 2277 }
799
"""Scoring evaluators. This module contains evaluators for scoring on a 1-10 the output of models, be they LLMs, Chains, or otherwise. This can be based on a variety of criteria and or a reference answer. Example: >>> from langchain_community.chat_models import ChatOpenAI >>> from langchain.evaluation.scoring...
langchain/libs/langchain/langchain/evaluation/scoring/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/evaluation/scoring/__init__.py", "repo_id": "langchain", "token_count": 381 }
513
# LlamaIndex Llms Integration: Gemini
llama_index/llama-index-integrations/llms/llama-index-llms-gemini/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-gemini/README.md", "repo_id": "llama_index", "token_count": 10 }
1,281
#!/usr/bin/env python3 import sys def main() -> int: print("Hello World!") # noqa: T201 return 0 if __name__ == "__main__": sys.exit(main())
langchain/libs/community/tests/examples/hello_world.py/0
{ "file_path": "langchain/libs/community/tests/examples/hello_world.py", "repo_id": "langchain", "token_count": 67 }
315
// 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/querynodev2/pkoracle/pk_oracle.go/0
{ "file_path": "milvus/internal/querynodev2/pkoracle/pk_oracle.go", "repo_id": "milvus", "token_count": 1013 }
2,045
# rag-chroma-multi-modal-multi-vector Multi-modal LLMs enable visual assistants that can perform question-answering about images. This template create a visual assistant for slide decks, which often contain visuals such as graphs or figures. It uses GPT-4V to create image summaries for each slide, embeds the summa...
langchain/templates/rag-chroma-multi-modal-multi-vector/README.md/0
{ "file_path": "langchain/templates/rag-chroma-multi-modal-multi-vector/README.md", "repo_id": "langchain", "token_count": 1429 }
689
# coding=utf-8 # Copyright 2019-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 a...
transformers/examples/research_projects/distillation/train.py/0
{ "file_path": "transformers/examples/research_projects/distillation/train.py", "repo_id": "transformers", "token_count": 5147 }
541
# LlamaIndex Docstore Integration: Mongo DB
llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-mongodb/README.md/0
{ "file_path": "llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-mongodb/README.md", "repo_id": "llama_index", "token_count": 11 }
1,489
"""A Tracer implementation that records to LangChain endpoint.""" from langchain_core.tracers.langchain import ( LangChainTracer, wait_for_all_tracers, ) __all__ = ["LangChainTracer", "wait_for_all_tracers"]
langchain/libs/langchain/langchain/callbacks/tracers/langchain.py/0
{ "file_path": "langchain/libs/langchain/langchain/callbacks/tracers/langchain.py", "repo_id": "langchain", "token_count": 76 }
452
// Code generated by mockery v2.33.3. DO NOT EDIT. package mocks import ( dbmodel "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel" mock "github.com/stretchr/testify/mock" ) // ICollectionMetadataDb is an autogenerated mock type for the ICollectionMetadataDb type type ICollectionMetadataDb struc...
chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ICollectionMetadataDb.go/0
{ "file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ICollectionMetadataDb.go", "repo_id": "chroma", "token_count": 612 }
47
import fs from "fs"; export function makeDir( root: string, options = { recursive: true } ): Promise<string | undefined> { return fs.promises.mkdir(root, options); }
langchainjs/libs/create-langchain-integration/helpers/make-dir.ts/0
{ "file_path": "langchainjs/libs/create-langchain-integration/helpers/make-dir.ts", "repo_id": "langchainjs", "token_count": 55 }
969
[ { "server": "idc-sh005", "deploy_mode": "cluster", "suite_params": [ { "suite": "2_insert_search_sift10m_512.yaml", "image_type": "cpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/debug2.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/debug2.json", "repo_id": "milvus", "token_count": 160 }
1,930
use candle::{Result, Tensor, D}; use candle_nn as nn; use candle_nn::Module; #[derive(Debug)] pub struct TimestepEmbedding { linear_1: nn::Linear, linear_2: nn::Linear, } impl TimestepEmbedding { // act_fn: "silu" pub fn new(vs: nn::VarBuilder, channel: usize, time_embed_dim: usize) -> Result<Self> { ...
candle/candle-transformers/src/models/stable_diffusion/embeddings.rs/0
{ "file_path": "candle/candle-transformers/src/models/stable_diffusion/embeddings.rs", "repo_id": "candle", "token_count": 1008 }
71
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querycoordv2/checkers/index_checker_test.go/0
{ "file_path": "milvus/internal/querycoordv2/checkers/index_checker_test.go", "repo_id": "milvus", "token_count": 2603 }
1,827
from typing import Any, Dict, List, Optional, Sequence 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 convert_to_secret_str, get_from_dict_or_env from langch...
langchain/libs/community/langchain_community/llms/aleph_alpha.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/aleph_alpha.py", "repo_id": "langchain", "token_count": 4324 }
259
from llama_index.core.readers.base import BaseReader from llama_index.readers.deeplake import DeepLakeReader def test_class(): names_of_base_classes = [b.__name__ for b in DeepLakeReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-deeplake/tests/test_readers_deeplake.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-deeplake/tests/test_readers_deeplake.py", "repo_id": "llama_index", "token_count": 90 }
1,358
position: 1
langchainjs/docs/core_docs/docs/modules/experimental/mask/_category_.yml/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/experimental/mask/_category_.yml", "repo_id": "langchainjs", "token_count": 3 }
733
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/core/src/index/VectorDiskIndex.cpp/0
{ "file_path": "milvus/internal/core/src/index/VectorDiskIndex.cpp", "repo_id": "milvus", "token_count": 7765 }
1,740
from typing import List import pytest from langchain_core.utils.iter import batch_iterate @pytest.mark.parametrize( "input_size, input_iterable, expected_output", [ (2, [1, 2, 3, 4, 5], [[1, 2], [3, 4], [5]]), (3, [10, 20, 30, 40, 50], [[10, 20, 30], [40, 50]]), (1, [100, 200, 300], ...
langchain/libs/core/tests/unit_tests/utils/test_iter.py/0
{ "file_path": "langchain/libs/core/tests/unit_tests/utils/test_iter.py", "repo_id": "langchain", "token_count": 260 }
411
import { BufferMemory } from "langchain/memory"; import { PlanetScaleChatMessageHistory } from "@langchain/community/stores/message/planetscale"; import { ChatOpenAI } from "@langchain/openai"; import { ConversationChain } from "langchain/chains"; const memory = new BufferMemory({ chatHistory: new PlanetScaleChatMes...
langchainjs/examples/src/memory/planetscale.ts/0
{ "file_path": "langchainjs/examples/src/memory/planetscale.ts", "repo_id": "langchainjs", "token_count": 320 }
798
python_tests( interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-integrations/readers/llama-index-readers-firebase-realtimedb/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-firebase-realtimedb/tests/BUILD", "repo_id": "llama_index", "token_count": 29 }
1,372
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-notion/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-notion/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,414
import { test } from "@jest/globals"; import { OpenAI, ChatOpenAI } from "@langchain/openai"; import { ChatPromptTemplate, HumanMessagePromptTemplate, PromptTemplate, } from "@langchain/core/prompts"; import { LLMChain } from "../llm_chain.js"; import { BufferMemory } from "../../memory/buffer_memory.js"; test("...
langchainjs/langchain/src/chains/tests/llm_chain.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/chains/tests/llm_chain.int.test.ts", "repo_id": "langchainjs", "token_count": 1481 }
858
# Copyright 2023 The HuggingFace and Baidu 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...
transformers/src/transformers/models/ernie_m/__init__.py/0
{ "file_path": "transformers/src/transformers/models/ernie_m/__init__.py", "repo_id": "transformers", "token_count": 1020 }
641
# 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/loha/layer.py/0
{ "file_path": "peft/src/peft/tuners/loha/layer.py", "repo_id": "peft", "token_count": 7471 }
334
// 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/storage/AliyunCredentialsProvider.cpp/0
{ "file_path": "milvus/internal/core/src/storage/AliyunCredentialsProvider.cpp", "repo_id": "milvus", "token_count": 3278 }
1,742
from llama_index.packs.rag_cli_local.base import LocalRAGCLIPack __all__ = ["LocalRAGCLIPack"]
llama_index/llama-index-packs/llama-index-packs-rag-cli-local/llama_index/packs/rag_cli_local/__init__.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-rag-cli-local/llama_index/packs/rag_cli_local/__init__.py", "repo_id": "llama_index", "token_count": 35 }
1,688
"""Init file.""" from llama_index.core.response_synthesizers.accumulate import Accumulate from llama_index.core.response_synthesizers.base import BaseSynthesizer from llama_index.core.response_synthesizers.compact_and_refine import ( CompactAndRefine, ) from llama_index.core.response_synthesizers.factory import ge...
llama_index/llama-index-core/llama_index/core/response_synthesizers/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/response_synthesizers/__init__.py", "repo_id": "llama_index", "token_count": 326 }
1,140
# Helicone This page covers how to use the [Helicone](https://helicone.ai) within LangChain. ## What is Helicone? Helicone is an [open source](https://github.com/Helicone/helicone) observability platform that proxies your OpenAI traffic and provides you key insights into your spend, latency and usage. ![Helicone](/...
langchainjs/docs/core_docs/docs/ecosystem/integrations/helicone.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/ecosystem/integrations/helicone.mdx", "repo_id": "langchainjs", "token_count": 599 }
723
import torch import torch.nn as nn from timm.layers import create_act_layer, set_layer_config import importlib import os torch_backend = os.environ.get('TORCH_BACKEND') if torch_backend is not None: importlib.import_module(torch_backend) torch_device = os.environ.get('TORCH_DEVICE', 'cpu') class MLP(nn.Module):...
pytorch-image-models/tests/test_layers.py/0
{ "file_path": "pytorch-image-models/tests/test_layers.py", "repo_id": "pytorch-image-models", "token_count": 871 }
360
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet_img2img.py/0
{ "file_path": "diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet_img2img.py", "repo_id": "diffusers", "token_count": 4656 }
271
from rag_google_cloud_vertexai_search.chain import chain __all__ = ["chain"]
langchain/templates/rag-google-cloud-vertexai-search/rag_google_cloud_vertexai_search/__init__.py/0
{ "file_path": "langchain/templates/rag-google-cloud-vertexai-search/rag_google_cloud_vertexai_search/__init__.py", "repo_id": "langchain", "token_count": 26 }
698
""" Normalization layers and wrappers Norm layer definitions that support fast norm and consistent channel arg order (always first arg). Hacked together by / Copyright 2022 Ross Wightman """ import numbers from typing import Tuple import torch import torch.nn as nn import torch.nn.functional as F from .fast_norm im...
pytorch-image-models/timm/layers/norm.py/0
{ "file_path": "pytorch-image-models/timm/layers/norm.py", "repo_id": "pytorch-image-models", "token_count": 2520 }
377
# Hands-on [[hands-on]] Now that you've learned to use Optuna, here are some ideas to apply what you've learned: 1️⃣ **Beat your LunarLander-v2 agent results**, by using Optuna to find a better set of hyperparameters. You can also try with another environment, such as MountainCar-v0 and CartPole-v1. 2️⃣ **Beat your ...
deep-rl-class/units/en/unitbonus2/hands-on.mdx/0
{ "file_path": "deep-rl-class/units/en/unitbonus2/hands-on.mdx", "repo_id": "deep-rl-class", "token_count": 207 }
185
version: "3" services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:8.10.0 # https://www.docker.elastic.co/r/elasticsearch/elasticsearch environment: - discovery.type=single-node - xpack.security.enabled=false # security has been disabled, so no login or password is require...
llama_index/llama-index-core/tests/docker-compose.yml/0
{ "file_path": "llama_index/llama-index-core/tests/docker-compose.yml", "repo_id": "llama_index", "token_count": 464 }
1,226
<jupyter_start><jupyter_text>Milvus>[Milvus](https://milvus.io/docs/overview.md) is a database that stores, indexes, and manages massive embedding vectors generated by deep neural networks and other machine learning (ML) models.In the walkthrough, we'll demo the `SelfQueryRetriever` with a `Milvus` vector store. Creat...
langchain/docs/docs/integrations/retrievers/self_query/milvus_self_query.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/retrievers/self_query/milvus_self_query.ipynb", "repo_id": "langchain", "token_count": 1724 }
163
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/zh/main_classes/logging.md/0
{ "file_path": "transformers/docs/source/zh/main_classes/logging.md", "repo_id": "transformers", "token_count": 2154 }
571
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, root_validator from langchain_core.utils import get_from_dict_or_env from langchai...
langchain/libs/community/langchain_community/llms/bananadev.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/bananadev.py", "repo_id": "langchain", "token_count": 2060 }
278
# 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/trainer/test_trainer_callback.py/0
{ "file_path": "transformers/tests/trainer/test_trainer_callback.py", "repo_id": "transformers", "token_count": 4143 }
771
apiVersion: v1 kind: Pod metadata: labels: app: milvus-test namespace: chaos-testing spec: containers: - name: main image: harbor.milvus.io/qa/krte:dev-4 command: - cat tty: true resources: limits: memory: 6Gi cpu: 2.0 requests: memory: 4Gi cpu...
milvus/build/ci/jenkins/pod/chaos-test.yaml/0
{ "file_path": "milvus/build/ci/jenkins/pod/chaos-test.yaml", "repo_id": "milvus", "token_count": 267 }
1,692
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/config/env_source.go/0
{ "file_path": "milvus/pkg/config/env_source.go", "repo_id": "milvus", "token_count": 745 }
2,030
from langchain_community.llms.edenai import EdenAI __all__ = ["EdenAI"]
langchain/libs/langchain/langchain/llms/edenai.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/edenai.py", "repo_id": "langchain", "token_count": 26 }
560
export { BufferMemory, type BufferMemoryInput } from "./buffer_memory.js"; export { BaseMemory, getInputValue, getOutputValue, getBufferString, type InputValues, type OutputValues, type MemoryVariables, } from "./base.js"; export { ConversationSummaryMemory, type ConversationSummaryMemoryInput, Base...
langchainjs/langchain/src/memory/index.ts/0
{ "file_path": "langchainjs/langchain/src/memory/index.ts", "repo_id": "langchainjs", "token_count": 382 }
918
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/es/tasks/asr.md/0
{ "file_path": "transformers/docs/source/es/tasks/asr.md", "repo_id": "transformers", "token_count": 6032 }
535
from langchain_core.utils.pydantic import get_pydantic_major_version __all__ = ["get_pydantic_major_version"]
langchain/libs/langchain/langchain/utils/pydantic.py/0
{ "file_path": "langchain/libs/langchain/langchain/utils/pydantic.py", "repo_id": "langchain", "token_count": 39 }
578
from rag_chroma.chain import chain __all__ = ["chain"]
langchain/templates/rag-chroma/rag_chroma/__init__.py/0
{ "file_path": "langchain/templates/rag-chroma/rag_chroma/__init__.py", "repo_id": "langchain", "token_count": 19 }
670
"use client"; import { toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import { ChatWindowMessage } from '@/schema/ChatWindowMessage'; import { useState, type FormEvent } from "react"; import { Feedback } from 'langsmith'; export function ChatMessageBubble(props: { message: ChatWindow...
langsmith-cookbook/feedback-examples/nextjs/components/ChatMessageBubble.tsx/0
{ "file_path": "langsmith-cookbook/feedback-examples/nextjs/components/ChatMessageBubble.tsx", "repo_id": "langsmith-cookbook", "token_count": 2326 }
1,009
<jupyter_start><jupyter_text>Building a (Very Simple) Vector Store from ScratchIn this tutorial, we show you how to build a simple in-memory vector store that can store documents along with metadata. It will also expose a query interface that can support a variety of queries:- semantic search (with embedding similarity...
llama_index/docs/examples/low_level/vector_store.ipynb/0
{ "file_path": "llama_index/docs/examples/low_level/vector_store.ipynb", "repo_id": "llama_index", "token_count": 5383 }
1,198
<jupyter_start><jupyter_text>Run TemplateIn `server.py`, set -```add_routes(app, chain_rag_conv, path="/rag-gpt-crawler")```<jupyter_code>from langserve.client import RemoteRunnable rag_app = RemoteRunnable("http://localhost:8001/rag-gpt-crawler") rag_app.invoke("How does summarization work?")<jupyter_output><empty_ou...
langchain/templates/rag-gpt-crawler/rag_gpt_crawler.ipynb/0
{ "file_path": "langchain/templates/rag-gpt-crawler/rag_gpt_crawler.ipynb", "repo_id": "langchain", "token_count": 124 }
718
import importlib import os import tempfile from pathlib import Path from typing import Any, Dict, Iterable, List, Optional, Tuple, Union from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import Extra, root_validator from langchain_core.utils ...
langchain/libs/community/langchain_community/vectorstores/thirdai_neuraldb.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/thirdai_neuraldb.py", "repo_id": "langchain", "token_count": 5866 }
333
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/main_classes/processors.md/0
{ "file_path": "transformers/docs/source/en/main_classes/processors.md", "repo_id": "transformers", "token_count": 2073 }
454
use num_bigint::BigInt; use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard, RwLockWriteGuard}; use std::collections::HashMap; use std::sync::atomic::AtomicUsize; use std::sync::Arc; use crate::errors::ChromaError; use crate::index::{HnswIndex, HnswIndexConfig, Index, IndexConfig}; use crate::types::{EmbeddingR...
chroma/rust/worker/src/segment/distributed_hnsw_segment.rs/0
{ "file_path": "chroma/rust/worker/src/segment/distributed_hnsw_segment.rs", "repo_id": "chroma", "token_count": 2771 }
61
import { PromptTemplate } from "@langchain/core/prompts"; import { LLMChain, LLMChainInput } from "./llm_chain.js"; import { BufferMemory } from "../memory/buffer_memory.js"; import { Optional } from "../types/type-utils.js"; export const DEFAULT_TEMPLATE = `The following is a friendly conversation between a human and...
langchainjs/langchain/src/chains/conversation.ts/0
{ "file_path": "langchainjs/langchain/src/chains/conversation.ts", "repo_id": "langchainjs", "token_count": 524 }
889
# coding=utf-8 # Copyright 2022 The OpenBMB 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.apache.org/licenses/LIC...
transformers/src/transformers/models/cpmant/modeling_cpmant.py/0
{ "file_path": "transformers/src/transformers/models/cpmant/modeling_cpmant.py", "repo_id": "transformers", "token_count": 16764 }
585
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/hpo_train.md/0
{ "file_path": "transformers/docs/source/ja/hpo_train.md", "repo_id": "transformers", "token_count": 2841 }
524
<jupyter_start><jupyter_text>**The Stable Diffusion Guide** 🎨 *...using `🧨 diffusers`* **Intro**Stable Diffusion is a [Latent Diffusion model](https://github.com/CompVis/latent-diffusion) developed by researchers from the Machine Vision and Learning group at LMU Munich, *a.k.a* CompVis.Model checkpoints were publicly...
notebooks/diffusers/sd_101_guide.ipynb/0
{ "file_path": "notebooks/diffusers/sd_101_guide.ipynb", "repo_id": "notebooks", "token_count": 5420 }
303
"""Test RetrievalQA functionality.""" from pathlib import Path from langchain_community.document_loaders import TextLoader from langchain_community.embeddings.openai import OpenAIEmbeddings from langchain_community.llms import OpenAI from langchain_community.vectorstores import FAISS from langchain.chains import Retr...
langchain/libs/langchain/tests/integration_tests/chains/test_retrieval_qa.py/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/chains/test_retrieval_qa.py", "repo_id": "langchain", "token_count": 410 }
638
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/perf_train_cpu_many.md/0
{ "file_path": "transformers/docs/source/en/perf_train_cpu_many.md", "repo_id": "transformers", "token_count": 5796 }
462
"""Query Transforms.""" from llama_index.core.indices.query.query_transform.base import ( DecomposeQueryTransform, HyDEQueryTransform, StepDecomposeQueryTransform, ) __all__ = [ "HyDEQueryTransform", "DecomposeQueryTransform", "StepDecomposeQueryTransform", ]
llama_index/llama-index-core/llama_index/core/indices/query/query_transform/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/query/query_transform/__init__.py", "repo_id": "llama_index", "token_count": 103 }
1,266
// Code generated by mockery v2.32.4. DO NOT EDIT. package segments import ( context "context" commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" datapb "github.com/milvus-io/milvus/internal/proto/datapb" mock "github.com/stretchr/testify/mock" msgpb "github.com/milvus-io/milvus-proto/go-api/v2/...
milvus/internal/querynodev2/segments/mock_segment.go/0
{ "file_path": "milvus/internal/querynodev2/segments/mock_segment.go", "repo_id": "milvus", "token_count": 12853 }
2,047
python_tests()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dynamodb/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dynamodb/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,520
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { Document } from "@langchain/core/documents"; import { PromptTemplate, BasePromptTemplate } from "@langchain/core/prompts"; import { StringPromptValue, BasePromptValue, } from "@langchain/core/prompt_values"; import { ...
langchainjs/langchain/src/retrievers/hyde.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/hyde.ts", "repo_id": "langchainjs", "token_count": 1693 }
928
package resource import ( "testing" "time" "github.com/cockroachdb/errors" "github.com/stretchr/testify/assert" ) func TestResourceManager(t *testing.T) { { manager := NewManager(0, 0, nil) manager.Close() } manager := NewManager(500*time.Millisecond, 2*time.Second, map[string]time.Duration{ "test": ti...
milvus/pkg/util/resource/resource_manager_test.go/0
{ "file_path": "milvus/pkg/util/resource/resource_manager_test.go", "repo_id": "milvus", "token_count": 1846 }
1,948
# LlamaIndex Readers Integration: Google
llama_index/llama-index-integrations/readers/llama-index-readers-google/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-google/README.md", "repo_id": "llama_index", "token_count": 9 }
1,358
""" This script requires you to build `LAVIS` from source, since the pip version doesn't have BLIP Diffusion. Follow instructions here: https://github.com/salesforce/LAVIS/tree/main. """ import argparse import os import tempfile import torch from lavis.models import load_model_and_preprocess from transformers import ...
diffusers/scripts/convert_blipdiffusion_to_diffusers.py/0
{ "file_path": "diffusers/scripts/convert_blipdiffusion_to_diffusers.py", "repo_id": "diffusers", "token_count": 5920 }
229
from typing import Any from unittest.mock import Mock, patch from langchain_core.prompts import ChatPromptTemplate from langchain_core.runnables.base import ConfigurableField from langchain.runnables.hub import HubRunnable @patch("langchain.hub.pull") def test_hub_runnable(mock_pull: Mock) -> None: mock_pull.re...
langchain/libs/langchain/tests/unit_tests/runnables/test_hub.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/runnables/test_hub.py", "repo_id": "langchain", "token_count": 929 }
649
import { Comparator, Comparators, Comparison, FilterDirective, Operation, Operator, Operators, } from "./ir.js"; import { CallExpressionType, ExpressionParser, ParsedType, } from "../../output_parsers/expression.js"; /** * A type representing the possible types that can be traversed in an * expre...
langchainjs/langchain/src/chains/query_constructor/parser.ts/0
{ "file_path": "langchainjs/langchain/src/chains/query_constructor/parser.ts", "repo_id": "langchainjs", "token_count": 1716 }
864
#ifndef _qdq_3_cuh #define _qdq_3_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_3BIT == 1 // Permutation: // // v9997775 55333111 u8886664 44222000 (u, v lsb) // vjjjhhhf ffdddbbb uiiiggge eecccaaa // vtttrrrp ppnnnlll usssqqqo oommmkkk __forceinline__ __device__ void shuffle_3bit_32 ( uin...
text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_3.cuh/0
{ "file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_3.cuh", "repo_id": "text-generation-inference", "token_count": 3335 }
417
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/utils/generic.py/0
{ "file_path": "transformers/src/transformers/utils/generic.py", "repo_id": "transformers", "token_count": 9888 }
696
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
transformers/src/transformers/models/xlnet/configuration_xlnet.py/0
{ "file_path": "transformers/src/transformers/models/xlnet/configuration_xlnet.py", "repo_id": "transformers", "token_count": 4437 }
744
<jupyter_start><jupyter_text>Rockset>[Rockset](https://rockset.com/) is a real-time search and analytics database built for the cloud. Rockset uses a [Converged Index™](https://rockset.com/blog/converged-indexing-the-secret-sauce-behind-rocksets-fast-queries/) with an efficient store for vector embeddings to serve low ...
langchain/docs/docs/integrations/vectorstores/rockset.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/rockset.ipynb", "repo_id": "langchain", "token_count": 1813 }
193
from typing import Any, List, Sequence, Tuple, Union from langchain_core._api import deprecated from langchain_core.agents import AgentAction, AgentFinish from langchain_core.callbacks import Callbacks from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts.base import BasePromptTempla...
langchain/libs/langchain/langchain/agents/xml/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/xml/base.py", "repo_id": "langchain", "token_count": 2995 }
472
import fs from "fs/promises"; import { rollup } from "rollup"; const packageJson = JSON.parse(await fs.readFile("package.json", "utf-8")); export function listEntrypoints() { const exports = packageJson.exports; const entrypoints = []; for (const [key, value] of Object.entries(exports)) { if (key === "./pa...
langchainjs/libs/langchain-scripts/scripts/check-tree-shaking.js/0
{ "file_path": "langchainjs/libs/langchain-scripts/scripts/check-tree-shaking.js", "repo_id": "langchainjs", "token_count": 699 }
1,021
# 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/speecht5/convert_speecht5_original_pytorch_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/speecht5/convert_speecht5_original_pytorch_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 7959 }
680
# 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_2/test_stable_diffusion_inpaint.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_inpaint.py", "repo_id": "diffusers", "token_count": 4789 }
294
<!--⚠️ 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. --> # Models [`PeftModel`] is the base model class for specifying the base Transformer model and configuration to apply a PEFT method to. The base `Peft...
peft/docs/source/package_reference/peft_model.md/0
{ "file_path": "peft/docs/source/package_reference/peft_model.md", "repo_id": "peft", "token_count": 540 }
307
import asyncio from functools import partial from typing import Any, List, Optional, Tuple, cast from ai21.models import ChatMessage, Penalty, RoleType from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.language_models.chat_models import BaseCh...
langchain/libs/partners/ai21/langchain_ai21/chat_models.py/0
{ "file_path": "langchain/libs/partners/ai21/langchain_ai21/chat_models.py", "repo_id": "langchain", "token_count": 2090 }
658
import abc import codecs import json from typing import TYPE_CHECKING if TYPE_CHECKING: from botocore.response import StreamingBody from llama_index.core.bridge.pydantic import BaseModel, Field class BaseIOHandler(BaseModel, metaclass=abc.ABCMeta): content_type: str = Field( description="The MIME ty...
llama_index/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/utils.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/utils.py", "repo_id": "llama_index", "token_count": 1008 }
1,422
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/rootcoord/show_partition_task.go/0
{ "file_path": "milvus/internal/rootcoord/show_partition_task.go", "repo_id": "milvus", "token_count": 891 }
2,059