text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
pub mod generation; pub mod models; pub mod object_detection; pub mod pipelines; pub mod quantized_nn; pub mod quantized_var_builder; pub mod utils;
candle/candle-transformers/src/lib.rs/0
{ "file_path": "candle/candle-transformers/src/lib.rs", "repo_id": "candle", "token_count": 47 }
70
<!--- 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 ...
transformers/examples/pytorch/image-pretraining/README.md/0
{ "file_path": "transformers/examples/pytorch/image-pretraining/README.md", "repo_id": "transformers", "token_count": 3472 }
549
from dataclasses import dataclass from typing import List, Union import numpy as np import PIL import torch from ...utils import ( BaseOutput, ) @dataclass class TextToVideoSDPipelineOutput(BaseOutput): """ Output class for text-to-video pipelines. Args: frames (`torch.Tensor`, `np.ndarr...
diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_output.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_output.py", "repo_id": "diffusers", "token_count": 260 }
252
- sections: - local: index title: 🧨 Diffusers - local: quicktour title: クイックツアー - local: stable_diffusion title: 有効で効率の良い拡散モデル - local: installation title: インストール title: はじめに - sections: - local: tutorials/tutorial_overview title: 概要 - local: tutorials/autopipeline title: AutoPipe...
diffusers/docs/source/ja/_toctree.yml/0
{ "file_path": "diffusers/docs/source/ja/_toctree.yml", "repo_id": "diffusers", "token_count": 166 }
186
package notification import ( "context" "sync/atomic" "github.com/chroma/chroma-coordinator/internal/common" "github.com/chroma/chroma-coordinator/internal/model" "github.com/pingcap/log" "go.uber.org/zap" ) type NotificationProcessor interface { common.Component Process(ctx context.Context) error Trigger(c...
chroma/go/coordinator/internal/notification/notification_processor.go/0
{ "file_path": "chroma/go/coordinator/internal/notification/notification_processor.go", "repo_id": "chroma", "token_count": 1414 }
50
# 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/comet/comet.py/0
{ "file_path": "datasets/metrics/comet/comet.py", "repo_id": "datasets", "token_count": 2168 }
116
package proxy import ( "context" "fmt" "strconv" "github.com/cockroachdb/errors" "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel" "go.uber.org/zap" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/interna...
milvus/internal/proxy/task_statistic.go/0
{ "file_path": "milvus/internal/proxy/task_statistic.go", "repo_id": "milvus", "token_count": 8438 }
1,747
<jupyter_start><jupyter_text>Automatic Speech Recogntion with Hugging Face's Transformers & Amazon SageMaker Transformer models are changing the world of machine learning, starting with natural language processing, and now, with audio and computer vision. Hugging Face's mission is to democratize good machine learning ...
notebooks/sagemaker/20_automatic_speech_recognition_inference/sagemaker-notebook.ipynb/0
{ "file_path": "notebooks/sagemaker/20_automatic_speech_recognition_inference/sagemaker-notebook.ipynb", "repo_id": "notebooks", "token_count": 2639 }
289
from typing import Any, Callable, Dict, List, Optional, Union import torch from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer from diffusers import ( AutoencoderKL, DDIMScheduler, DiffusionPipeline, LMSDiscreteScheduler, PNDMScheduler, StableDiffusionPipeline, UNet2D...
diffusers/examples/community/stable_diffusion_comparison.py/0
{ "file_path": "diffusers/examples/community/stable_diffusion_comparison.py", "repo_id": "diffusers", "token_count": 7876 }
202
# 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/mbart/test_modeling_tf_mbart.py/0
{ "file_path": "transformers/tests/models/mbart/test_modeling_tf_mbart.py", "repo_id": "transformers", "token_count": 3761 }
756
from langchain_community.utilities.awslambda import LambdaWrapper __all__ = ["LambdaWrapper"]
langchain/libs/langchain/langchain/utilities/awslambda.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/awslambda.py", "repo_id": "langchain", "token_count": 30 }
593
# These kubernetes manifests are UNDER ACTIVE DEVELOPMENT and are not yet ready for production use. # They will be used for the upcoming distributed version of chroma. They are not even ready # for testing yet. Please do not use them unless you are working on the distributed version of chroma. apiVersion: apiextensio...
chroma/k8s/crd/memberlist_crd.yaml/0
{ "file_path": "chroma/k8s/crd/memberlist_crd.yaml", "repo_id": "chroma", "token_count": 521 }
58
import { TextLoader } from "./text.js"; /** * Loads a CSV file into a list of documents. * Each document represents one row of the CSV file. * * When `column` is not specified, each row is converted into a key/value pair * with each key/value pair outputted to a new line in the document's pageContent. * * @exam...
langchainjs/langchain/src/document_loaders/fs/csv.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/fs/csv.ts", "repo_id": "langchainjs", "token_count": 1232 }
901
<!--⚠️ 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. --> # Configuration [`PeftConfigMixin`] is the base configuration class for storing the adapter configuration of a [`PeftModel`], and [`PromptLearningCo...
peft/docs/source/package_reference/config.md/0
{ "file_path": "peft/docs/source/package_reference/config.md", "repo_id": "peft", "token_count": 224 }
314
# 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/mra/configuration_mra.py/0
{ "file_path": "transformers/src/transformers/models/mra/configuration_mra.py", "repo_id": "transformers", "token_count": 2527 }
661
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 1, "logprob": null, "text": "<s>" }, { "id": 338, "logprob": -10.0078125, "text": "is" }, { "id": 2178...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_medusa/test_flash_medusa_all_params.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_medusa/test_flash_medusa_all_params.json", "repo_id": "text-generation-inference", "token_count": 1153 }
400
--- sidebar_position: 4 --- # Trajectory Evaluators Trajectory Evaluators in LangChain provide a more holistic approach to evaluating an agent. These evaluators assess the full sequence of actions taken by an agent and their corresponding responses, which we refer to as the "trajectory". This allows you to better meas...
langchain/docs/docs/guides/evaluation/trajectory/index.mdx/0
{ "file_path": "langchain/docs/docs/guides/evaluation/trajectory/index.mdx", "repo_id": "langchain", "token_count": 358 }
89
# to define environment variables available to docker-compose.yml IMAGE_REPO=milvusdb IMAGE_ARCH=amd64 OS_NAME=ubuntu20.04 # for services.builder.image in docker-compose.yml DATE_VERSION=20231212-4651f89 LATEST_DATE_VERSION=20231212-4651f89 # for services.gpubuilder.image in docker-compose.yml GPU_DATE_VERSION=20231...
milvus/.env/0
{ "file_path": "milvus/.env", "repo_id": "milvus", "token_count": 328 }
1,741
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/vector_stores/docarray/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/docarray/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,610
<!--Copyright 2021 NVIDIA Corporation and The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by a...
transformers/docs/source/en/model_doc/qdqbert.md/0
{ "file_path": "transformers/docs/source/en/model_doc/qdqbert.md", "repo_id": "transformers", "token_count": 1978 }
469
GIT_ROOT ?= $(shell git rev-parse --show-toplevel) help: ## Show all Makefile targets. @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}' format: ## Run code autoformatters (black). git ls-files | black lint: ## Run linters: pre-commit...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/Makefile/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/Makefile", "repo_id": "llama_index", "token_count": 250 }
1,218
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/finetuning/cross_encoders/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/finetuning/cross_encoders/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,593
import type { Conversation } from "$lib/types/Conversation"; import { sha256 } from "$lib/utils/sha256"; import { collections } from "../database"; export async function uploadFile(file: Blob, conv: Conversation): Promise<string> { const sha = await sha256(await file.text()); const upload = collections.bucket.openU...
chat-ui/src/lib/server/files/uploadFile.ts/0
{ "file_path": "chat-ui/src/lib/server/files/uploadFile.ts", "repo_id": "chat-ui", "token_count": 244 }
102
python_sources()
llama_index/llama-index-packs/llama-index-packs-gradio-agent-chat/llama_index/packs/gradio_agent_chat/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-gradio-agent-chat/llama_index/packs/gradio_agent_chat/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,657
"""Embeddings tests.""" from typing import List import pytest from langchain_core.embeddings import Embeddings from langchain.embeddings import CacheBackedEmbeddings from langchain.storage.in_memory import InMemoryStore class MockEmbeddings(Embeddings): def embed_documents(self, texts: List[str]) -> List[List[f...
langchain/libs/langchain/tests/unit_tests/embeddings/test_caching.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/embeddings/test_caching.py", "repo_id": "langchain", "token_count": 977 }
628
import os import textwrap import pyarrow as pa import pytest from datasets import ClassLabel, Features, Image from datasets.packaged_modules.csv.csv import Csv from ..utils import require_pil @pytest.fixture def csv_file(tmp_path): filename = tmp_path / "file.csv" data = textwrap.dedent( """\ ...
datasets/tests/packaged_modules/test_csv.py/0
{ "file_path": "datasets/tests/packaged_modules/test_csv.py", "repo_id": "datasets", "token_count": 1672 }
141
#!/bin/bash # refer to https://github.com/yahoojapan/gongt/blob/master/assets/bench/download.sh function check () { if [ ! -e $1 ]; then curl -LO $2 fi # md5sum -c $1.md5 } # check fashion-mnist-784-euclidean.hdf5 http://vectors.erikbern.com/fashion-mnist-784-euclidean.hdf5 # check glove-25-angula...
milvus/tests/python_client/assets/ann_hdf5/download.sh/0
{ "file_path": "milvus/tests/python_client/assets/ann_hdf5/download.sh", "repo_id": "milvus", "token_count": 381 }
1,983
"""Test SingleStoreDB functionality.""" from typing import List import numpy as np import pytest from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_community.vectorstores.singlestoredb import SingleStoreDB from langchain_community.vectorstores.utils import Di...
langchain/libs/community/tests/integration_tests/vectorstores/test_singlestoredb.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_singlestoredb.py", "repo_id": "langchain", "token_count": 6380 }
380
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/clvp/processing_clvp.py/0
{ "file_path": "transformers/src/transformers/models/clvp/processing_clvp.py", "repo_id": "transformers", "token_count": 1351 }
581
python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/storage/chat_store/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/storage/chat_store/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,648
.. _Ref-Query: Querying an Index ================= This doc shows the classes that are used to query indices. Main Query Classes ^^^^^^^^^^^^^^^^^^ Querying an index involves three main components: - **Retrievers**: A retriever class retrieves a set of Nodes from an index given a query. - **Response Synthesizer**...
llama_index/docs/api_reference/query.rst/0
{ "file_path": "llama_index/docs/api_reference/query.rst", "repo_id": "llama_index", "token_count": 426 }
1,058
from llama_index.core.tools.tool_spec.base import BaseToolSpec from llama_index.tools.chatgpt_plugin import ChatGPTPluginToolSpec def test_class(): names_of_base_classes = [b.__name__ for b in ChatGPTPluginToolSpec.__mro__] assert BaseToolSpec.__name__ in names_of_base_classes
llama_index/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/tests/test_tools_chatgpt_plugin.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-chatgpt-plugin/tests/test_tools_chatgpt_plugin.py", "repo_id": "llama_index", "token_count": 101 }
1,474
"""Struct store schema.""" from dataclasses import dataclass, field from typing import Any, Dict from dataclasses_json import DataClassJsonMixin from llama_index.legacy.data_structs.data_structs import IndexStruct from llama_index.legacy.data_structs.struct_type import IndexStructType @dataclass class StructDatapo...
llama_index/llama-index-legacy/llama_index/legacy/data_structs/table.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/data_structs/table.py", "repo_id": "llama_index", "token_count": 365 }
1,698
# InstructPix2Pix SDXL training example ***This is based on the original InstructPix2Pix training example.*** [Stable Diffusion XL](https://huggingface.co/papers/2307.01952) (or SDXL) is the latest image generation model that is tailored towards more photorealistic outputs with more detailed imagery and composition c...
diffusers/examples/instruct_pix2pix/README_sdxl.md/0
{ "file_path": "diffusers/examples/instruct_pix2pix/README_sdxl.md", "repo_id": "diffusers", "token_count": 3490 }
216
# coding=utf-8 # 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 requir...
alignment-handbook/tests/test_model_utils.py/0
{ "file_path": "alignment-handbook/tests/test_model_utils.py", "repo_id": "alignment-handbook", "token_count": 1782 }
24
"""Test openai embeddings.""" import numpy as np import pytest from langchain_community.embeddings.openai import OpenAIEmbeddings @pytest.mark.scheduled def test_openai_embedding_documents() -> None: """Test openai embeddings.""" documents = ["foo bar"] embedding = OpenAIEmbeddings() output = embeddi...
langchain/libs/community/tests/integration_tests/embeddings/test_openai.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_openai.py", "repo_id": "langchain", "token_count": 1049 }
351
from langchain_community.document_loaders.azlyrics import AZLyricsLoader __all__ = ["AZLyricsLoader"]
langchain/libs/langchain/langchain/document_loaders/azlyrics.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/azlyrics.py", "repo_id": "langchain", "token_count": 32 }
475
// 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/allocator/interface.go/0
{ "file_path": "milvus/internal/allocator/interface.go", "repo_id": "milvus", "token_count": 329 }
1,859
<jupyter_start><jupyter_text>Controllable Agents for RAGAdding agentic capabilities on top of your RAG pipeline can allow you to reason over much more complex questions.But a big pain point for agents is the **lack of steerability/transparency**. An agent may tackle a user query through chain-of-thought/planning, which...
llama_index/docs/examples/agent/agent_runner/agent_runner_rag.ipynb/0
{ "file_path": "llama_index/docs/examples/agent/agent_runner/agent_runner_rag.ipynb", "repo_id": "llama_index", "token_count": 3210 }
1,046
from .aim import AimCallback from .base import CallbackManager from .finetuning_handler import GradientAIFineTuningHandler, OpenAIFineTuningHandler from .llama_debug import LlamaDebugHandler from .open_inference_callback import OpenInferenceCallbackHandler from .schema import CBEvent, CBEventType, EventPayload from .to...
llama_index/llama-index-legacy/llama_index/legacy/callbacks/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/callbacks/__init__.py", "repo_id": "llama_index", "token_count": 268 }
1,580
from abc import ABC, abstractmethod from typing import Sequence, Optional from uuid import UUID from overrides import override from chromadb.config import DEFAULT_DATABASE, DEFAULT_TENANT from chromadb.api.models.Collection import Collection from chromadb.api.types import ( CollectionMetadata, Documents, E...
chroma/chromadb/api/__init__.py/0
{ "file_path": "chroma/chromadb/api/__init__.py", "repo_id": "chroma", "token_count": 7932 }
15
from __future__ import annotations from dataclasses import dataclass, field from typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Type, Union from uuid import uuid4 from langchain_core.pydantic_v1 import BaseModel from langchain_core.runnables.graph_draw import draw if TYPE_CHECKING: from langchain...
langchain/libs/core/langchain_core/runnables/graph.py/0
{ "file_path": "langchain/libs/core/langchain_core/runnables/graph.py", "repo_id": "langchain", "token_count": 2343 }
419
<!--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/en/tasks/zero_shot_image_classification.md/0
{ "file_path": "transformers/docs/source/en/tasks/zero_shot_image_classification.md", "repo_id": "transformers", "token_count": 1757 }
530
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # We need to know an absolute path to our repo root to do things like referencing ./LICENSE.txt file. set(AZ_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") macro(az_vcpkg_integrate) message("Vcpkg integrate step.") # AUTO CMAKE_TOOLCHAIN_FILE: ...
milvus/internal/core/src/storage/azure-blob-storage/cmake-modules/AzureVcpkg.cmake/0
{ "file_path": "milvus/internal/core/src/storage/azure-blob-storage/cmake-modules/AzureVcpkg.cmake", "repo_id": "milvus", "token_count": 2894 }
1,746
"""Tools for interacting with a Power BI dataset.""" import logging from time import perf_counter from typing import Any, Dict, Optional, Tuple from langchain_core.callbacks import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) from langchain_core.pydantic_v1 import Field, validator from langch...
langchain/libs/community/langchain_community/tools/powerbi/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/powerbi/tool.py", "repo_id": "langchain", "token_count": 4821 }
306
apiVersion: chaos-mesh.org/v1alpha1 kind: PodChaos metadata: name: test-querynode-pod-failure namespace: chaos-testing spec: selector: pods: chaos-testing: - milvus-multi-querynode-querynode-bcdc595d9-7vmcj - milvus-multi-querynode-querynode-bcdc595d9-ccxls - milvus-multi-queryno...
milvus/tests/python_client/chaos/chaos_objects/template/pod-failure-by-pod-list.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/template/pod-failure-by-pod-list.yaml", "repo_id": "milvus", "token_count": 186 }
1,899
#ifndef _q_matrix_cuh #define _q_matrix_cuh #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cstdint> #include <cstdio> #define MAX_SUPERGROUPS 16 class QMatrix { public: int device; bool is_gptq; int height; int width; int groups; int gptq_groupsize; int rows_8; int rows...
text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_matrix.cuh/0
{ "file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_matrix.cuh", "repo_id": "text-generation-inference", "token_count": 702 }
422
/// <reference types="@sveltejs/kit" /> /// <reference types="unplugin-icons/types/svelte" /> import type { User } from "$lib/types/User"; // See https://kit.svelte.dev/docs/types#app // for information about these interfaces declare global { namespace App { // interface Error {} interface Locals { sessionId:...
chat-ui/src/app.d.ts/0
{ "file_path": "chat-ui/src/app.d.ts", "repo_id": "chat-ui", "token_count": 145 }
84
from langchain_community.tools.nuclia.tool import NUASchema, NucliaUnderstandingAPI __all__ = ["NUASchema", "NucliaUnderstandingAPI"]
langchain/libs/langchain/langchain/tools/nuclia/tool.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/nuclia/tool.py", "repo_id": "langchain", "token_count": 46 }
607
import { AIMessage, AIMessageChunk, BaseMessage, BaseMessageChunk, MessageContent, MessageContentComplex, MessageContentImageUrl, MessageContentText, SystemMessage, } from "@langchain/core/messages"; import { ChatGeneration, ChatGenerationChunk, ChatResult, Generation, } from "@langchain/core/...
langchainjs/libs/langchain-google-common/src/utils/gemini.ts/0
{ "file_path": "langchainjs/libs/langchain-google-common/src/utils/gemini.ts", "repo_id": "langchainjs", "token_count": 2648 }
979
from typing import Any def __getattr__(name: str = "") -> Any: raise ImportError( "This tool has been moved to langchain experiment. " "This tool has access to a python REPL. " "For best practices make sure to sandbox this tool. " "Read https://github.com/langchain-ai/langchain/blo...
langchain/libs/langchain/langchain/tools/python/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/python/__init__.py", "repo_id": "langchain", "token_count": 177 }
564
# 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/bertscore/bertscore.py/0
{ "file_path": "datasets/metrics/bertscore/bertscore.py", "repo_id": "datasets", "token_count": 3284 }
127
import datetime from copy import deepcopy from typing import Any, Dict, List, Optional, Tuple from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core.pydantic_v1 import Field from langchain_core.retrievers import BaseRetriever from langchain...
langchain/libs/langchain/langchain/retrievers/time_weighted_retriever.py/0
{ "file_path": "langchain/libs/langchain/langchain/retrievers/time_weighted_retriever.py", "repo_id": "langchain", "token_count": 2537 }
586
<!--版权2023年HuggingFace团队保留所有权利。 根据Apache许可证第2.0版(“许可证”)许可;除非符合许可证,否则您不得使用此文件。您可以在以下网址获取许可证的副本: http://www.apache.org/licenses/LICENSE-2.0 除非适用法律要求或书面同意,否则按“按原样”分发的软件,无论是明示还是暗示的,都没有任何担保或条件。请参阅许可证以了解特定语言下的权限和限制。 ⚠️ 请注意,本文件虽然使用Markdown编写,但包含了特定的语法,适用于我们的doc-builder(类似于MDX),可能无法在您的Markdown查看器中正常渲染。 --> # 🤗 加速分布式训练 ...
transformers/docs/source/zh/accelerate.md/0
{ "file_path": "transformers/docs/source/zh/accelerate.md", "repo_id": "transformers", "token_count": 2552 }
532
package grpccoordinator import ( "io" "time" "github.com/chroma/chroma-coordinator/cmd/flag" "github.com/chroma/chroma-coordinator/internal/grpccoordinator" "github.com/chroma/chroma-coordinator/internal/grpccoordinator/grpcutils" "github.com/chroma/chroma-coordinator/internal/utils" "github.com/spf13/cobra" )...
chroma/go/coordinator/cmd/grpccoordinator/cmd.go/0
{ "file_path": "chroma/go/coordinator/cmd/grpccoordinator/cmd.go", "repo_id": "chroma", "token_count": 952 }
43
<jupyter_start><jupyter_text>Simple Directory Reader The `SimpleDirectoryReader` is the most commonly used data connector that _just works_. Simply pass in a input directory or a list of files. It will select the best file reader based on the file extensions. Get Started If you're opening this Notebook on colab, y...
llama_index/docs/examples/data_connectors/simple_directory_reader.ipynb/0
{ "file_path": "llama_index/docs/examples/data_connectors/simple_directory_reader.ipynb", "repo_id": "llama_index", "token_count": 884 }
1,050
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/using-diffusers/stable_diffusion_jax_how_to.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/stable_diffusion_jax_how_to.md", "repo_id": "diffusers", "token_count": 3027 }
201
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/util/importutil/json_handler.go/0
{ "file_path": "milvus/internal/util/importutil/json_handler.go", "repo_id": "milvus", "token_count": 4755 }
1,880
<jupyter_start><jupyter_text>HuggingGPTImplementation of [HuggingGPT](https://github.com/microsoft/JARVIS). HuggingGPT is a system to connect LLMs (ChatGPT) with ML community (Hugging Face).+ 🔥 Paper: https://arxiv.org/abs/2303.17580+ 🚀 Project: https://github.com/microsoft/JARVIS+ 🤗 Space: https://huggingface.co/sp...
langchain/cookbook/hugginggpt.ipynb/0
{ "file_path": "langchain/cookbook/hugginggpt.ipynb", "repo_id": "langchain", "token_count": 687 }
77
// 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/VectorMemIndex.h/0
{ "file_path": "milvus/internal/core/src/index/VectorMemIndex.h", "repo_id": "milvus", "token_count": 1146 }
1,928
python_sources()
llama_index/llama-index-packs/llama-index-packs-auto-merging-retriever/examples/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-auto-merging-retriever/examples/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,576
# coding=utf-8 # Copyright 2021 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 copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
transformers/examples/research_projects/quantization-qdqbert/quant_trainer.py/0
{ "file_path": "transformers/examples/research_projects/quantization-qdqbert/quant_trainer.py", "repo_id": "transformers", "token_count": 5091 }
584
import copy import inspect from dataclasses import dataclass from typing import Callable, List, Optional, Union import numpy as np import PIL.Image import torch import torch.nn.functional as F from torch.nn.functional import grid_sample from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer from .....
diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/text_to_video_synthesis/pipeline_text_to_video_zero.py", "repo_id": "diffusers", "token_count": 19840 }
271
<jupyter_start><jupyter_text>Azure Blob Storage File>[Azure Files](https://learn.microsoft.com/en-us/azure/storage/files/storage-files-introduction) offers fully managed file shares in the cloud that are accessible via the industry standard Server Message Block (`SMB`) protocol, Network File System (`NFS`) protocol, an...
langchain/docs/docs/integrations/document_loaders/azure_blob_storage_file.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/azure_blob_storage_file.ipynb", "repo_id": "langchain", "token_count": 218 }
98
# 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/test_modeling_flax_utils.py/0
{ "file_path": "transformers/tests/test_modeling_flax_utils.py", "repo_id": "transformers", "token_count": 6875 }
846
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/integrations/integration_utils.py/0
{ "file_path": "transformers/src/transformers/integrations/integration_utils.py", "repo_id": "transformers", "token_count": 37496 }
596
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,440
import { OpenAIEmbeddings } from "@langchain/openai"; import { Neo4jVectorStore } from "@langchain/community/vectorstores/neo4j_vector"; /** * `fromExistingGraph` Method: * * Description: * This method initializes a `Neo4jVectorStore` instance using an existing graph in the Neo4j database. * It's designed to work...
langchainjs/examples/src/indexes/vector_stores/neo4j_vector/neo4j_vector_existinggraph.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/neo4j_vector/neo4j_vector_existinggraph.ts", "repo_id": "langchainjs", "token_count": 368 }
819
package indexparamcheck import ( "strconv" "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/util/metric" ) func Test_hnswChecker_CheckTrain(t *testing.T) { validParams := map[string]string{ DIM: strconv.Itoa(128...
milvus/pkg/util/indexparamcheck/hnsw_checker_test.go/0
{ "file_path": "milvus/pkg/util/indexparamcheck/hnsw_checker_test.go", "repo_id": "milvus", "token_count": 1969 }
2,056
import { ChatTogetherAI } from "@langchain/community/chat_models/togetherai"; import { HumanMessage } from "@langchain/core/messages"; const model = new ChatTogetherAI({ temperature: 0.9, // In Node.js defaults to process.env.TOGETHER_AI_API_KEY togetherAIApiKey: "YOUR-API-KEY", }); console.log(await model.invo...
langchainjs/examples/src/models/chat/integration_togetherai.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/integration_togetherai.ts", "repo_id": "langchainjs", "token_count": 118 }
825
# coding=utf-8 # Copyright 2019 The Open AI Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
transformers/src/transformers/models/fsmt/tokenization_fsmt.py/0
{ "file_path": "transformers/src/transformers/models/fsmt/tokenization_fsmt.py", "repo_id": "transformers", "token_count": 9142 }
620
"""Steam Toolkit."""
langchain/libs/langchain/langchain/agents/agent_toolkits/steam/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/steam/__init__.py", "repo_id": "langchain", "token_count": 7 }
483
"""Query for KeywordTableIndex.""" import logging from abc import abstractmethod from collections import defaultdict from typing import Any, Dict, List, Optional from llama_index.core.base.base_retriever import BaseRetriever from llama_index.core.callbacks.base import CallbackManager from llama_index.core.indices.keyw...
llama_index/llama-index-core/llama_index/core/indices/keyword_table/retrievers.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/keyword_table/retrievers.py", "repo_id": "llama_index", "token_count": 3014 }
1,153
.. _Ref-Multi-Modal-LLMs: Multi-Modal LLMs, Vector Stores, Embeddings, Retriever, and Query Engine ==== Multi-Modal large language model (LLM) is a Multi-Modal reasoning engine that can complete text and image chat with users, and follow instructions. Multi-Modal LLM Implementations ^^^^^^^^^^^^^^^^^^^ .. toctree:...
llama_index/docs/api_reference/multi_modal.rst/0
{ "file_path": "llama_index/docs/api_reference/multi_modal.rst", "repo_id": "llama_index", "token_count": 528 }
1,031
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/auto_retriever/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/auto_retriever/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,523
# 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 this fil...
milvus/configs/advanced/etcd.yaml/0
{ "file_path": "milvus/configs/advanced/etcd.yaml", "repo_id": "milvus", "token_count": 1269 }
1,900
"""Memory modules for conversation prompts.""" from langchain.memory.buffer import ( ConversationBufferMemory, ConversationStringBufferMemory, ) from langchain.memory.buffer_window import ConversationBufferWindowMemory from langchain.memory.combined import CombinedMemory from langchain.memory.entity import Con...
langchain/libs/langchain/langchain/chains/conversation/memory.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/conversation/memory.py", "repo_id": "langchain", "token_count": 227 }
481
"""Test few shot prompt template.""" import pytest from langchain_core.prompts.few_shot_with_templates import FewShotPromptWithTemplates from langchain_core.prompts.prompt import PromptTemplate EXAMPLE_PROMPT = PromptTemplate( input_variables=["question", "answer"], template="{question}: {answer}" ) def test_p...
langchain/libs/core/tests/unit_tests/prompts/test_few_shot_with_templates.py/0
{ "file_path": "langchain/libs/core/tests/unit_tests/prompts/test_few_shot_with_templates.py", "repo_id": "langchain", "token_count": 981 }
447
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-deeplake/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-deeplake/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,456
from langchain_community.chat_models import ChatOpenAI from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain_core.pydantic_v1 import BaseModel from langchain_core.runnables import RunnablePassthrough skeleton_generator_template = """[User:] You’r...
langchain/templates/skeleton-of-thought/skeleton_of_thought/chain.py/0
{ "file_path": "langchain/templates/skeleton-of-thought/skeleton_of_thought/chain.py", "repo_id": "langchain", "token_count": 1098 }
677
<jupyter_start><jupyter_text>Tune GPT2 to generate controlled sentiment reviews> Optimise GPT2 to produce IMDB movie reviews with controlled sentiment using a BERT sentiment classifier for rewards.**WARNING:** We often experienced loss spikes in this examples which caused model training to fail or slow down. There is a...
trl/examples/notebooks/gpt2-sentiment-control.ipynb/0
{ "file_path": "trl/examples/notebooks/gpt2-sentiment-control.ipynb", "repo_id": "trl", "token_count": 4606 }
857
--- sidebar_class_name: node-only --- # Llama CPP :::tip Compatibility Only available on Node.js. ::: This module is based on the [node-llama-cpp](https://github.com/withcatai/node-llama-cpp) Node.js bindings for [llama.cpp](https://github.com/ggerganov/llama.cpp), allowing you to work with a locally running LLM. Th...
langchainjs/docs/core_docs/docs/integrations/llms/llama_cpp.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/llms/llama_cpp.mdx", "repo_id": "langchainjs", "token_count": 1769 }
731
//! A crate to extract and inject a OpenTelemetry context from and to a gRPC request. //! Inspired by: https://github.com/open-telemetry/opentelemetry-rust gRPC examples use opentelemetry::global; use opentelemetry::propagation::{Extractor, Injector}; use tracing_opentelemetry::OpenTelemetrySpanExt; /// Extract conte...
text-generation-inference/router/grpc-metadata/src/lib.rs/0
{ "file_path": "text-generation-inference/router/grpc-metadata/src/lib.rs", "repo_id": "text-generation-inference", "token_count": 889 }
411
# Conclusion **Congrats on finishing this unit**! There was a lot of information. And congrats on finishing the tutorial. You've just coded your first Deep Reinforcement Learning agent from scratch using PyTorch and shared it on the Hub 🥳. Don't hesitate to iterate on this unit **by improving the implementation for...
deep-rl-class/units/en/unit4/conclusion.mdx/0
{ "file_path": "deep-rl-class/units/en/unit4/conclusion.mdx", "repo_id": "deep-rl-class", "token_count": 250 }
170
[tool.poetry] name = "plate-chain" version = "0.0.1" description = "Parse data from laboratory plates into standardized formats" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" openai = "<2" langserve = ">=0.0.19" [tool.poetry.group.dev.dependencies] langchain-c...
langchain/templates/plate-chain/pyproject.toml/0
{ "file_path": "langchain/templates/plate-chain/pyproject.toml", "repo_id": "langchain", "token_count": 282 }
670
import { v4 as uuidv4 } from "uuid"; import { type DocumentInterface, Document } from "@langchain/core/documents"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { AsyncCaller, AsyncCallerParams, } from "@langchain/core/utils/async_caller"; import { chunkArray } from "@langchain/core/...
langchainjs/libs/langchain-community/src/vectorstores/turbopuffer.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/turbopuffer.ts", "repo_id": "langchainjs", "token_count": 3332 }
976
20
langchainjs/.nvmrc/0
{ "file_path": "langchainjs/.nvmrc", "repo_id": "langchainjs", "token_count": 2 }
685
package indexparamcheck import ( "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/util/metric" ) const ( MinNBits = 1 MaxNBits = 16 DefaultNBits = 8 // MinNList is the lower limit of nlist that used in Index IVFxxx MinNList = 1 // MaxNList is the upper limit of nlist that use...
milvus/pkg/util/indexparamcheck/constraints.go/0
{ "file_path": "milvus/pkg/util/indexparamcheck/constraints.go", "repo_id": "milvus", "token_count": 928 }
2,055
export * from "@langchain/community/stores/doc/in_memory";
langchainjs/langchain/src/stores/doc/in_memory.ts/0
{ "file_path": "langchainjs/langchain/src/stores/doc/in_memory.ts", "repo_id": "langchainjs", "token_count": 18 }
911
"""Util that calls Google Scholar Search.""" from typing import Any, Dict, Optional, cast from langchain_core.pydantic_v1 import BaseModel, Extra, SecretStr, root_validator from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env class GoogleTrendsAPIWrapper(BaseModel): """Wrapper for SerpApi...
langchain/libs/community/langchain_community/utilities/google_trends.py/0
{ "file_path": "langchain/libs/community/langchain_community/utilities/google_trends.py", "repo_id": "langchain", "token_count": 1911 }
319
"""Init params."""
llama_index/llama-index-core/tests/indices/knowledge_graph/__init__.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/knowledge_graph/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,208
# 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/videomae/convert_videomae_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/videomae/convert_videomae_to_pytorch.py", "repo_id": "transformers", "token_count": 6110 }
758
<!--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...
peft/docs/source/task_guides/lora_based_methods.md/0
{ "file_path": "peft/docs/source/task_guides/lora_based_methods.md", "repo_id": "peft", "token_count": 4847 }
308
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/util/cache/policy.go/0
{ "file_path": "milvus/pkg/util/cache/policy.go", "repo_id": "milvus", "token_count": 2218 }
1,823
from retrieval_agent_fireworks.chain import agent_executor __all__ = ["agent_executor"]
langchain/templates/retrieval-agent-fireworks/retrieval_agent_fireworks/__init__.py/0
{ "file_path": "langchain/templates/retrieval-agent-fireworks/retrieval_agent_fireworks/__init__.py", "repo_id": "langchain", "token_count": 27 }
728
<!--- 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 ...
transformers/docs/source/pt/installation.md/0
{ "file_path": "transformers/docs/source/pt/installation.md", "repo_id": "transformers", "token_count": 3759 }
535
from langchain.agents.output_parsers.self_ask import SelfAskOutputParser # For backwards compatibility __all__ = ["SelfAskOutputParser"]
langchain/libs/langchain/langchain/agents/self_ask_with_search/output_parser.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/self_ask_with_search/output_parser.py", "repo_id": "langchain", "token_count": 38 }
490
# 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/models/test_layers_utils.py/0
{ "file_path": "diffusers/tests/models/test_layers_utils.py", "repo_id": "diffusers", "token_count": 10695 }
270
python_tests( name="tests", )
llama_index/llama-index-core/tests/agent/runner/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/agent/runner/BUILD", "repo_id": "llama_index", "token_count": 15 }
1,205
# coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
transformers/tests/models/camembert/test_modeling_camembert.py/0
{ "file_path": "transformers/tests/models/camembert/test_modeling_camembert.py", "repo_id": "transformers", "token_count": 814 }
705