text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
# coding=utf-8 # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
diffusers/examples/text_to_image/train_text_to_image_lora.py/0
{ "file_path": "diffusers/examples/text_to_image/train_text_to_image_lora.py", "repo_id": "diffusers", "token_count": 18135 }
222
from typing import Any, List, Literal from langchain_core.messages.base import ( BaseMessage, BaseMessageChunk, merge_content, ) class AIMessage(BaseMessage): """Message from an AI.""" example: bool = False """Whether this Message is being passed in to the model as part of an example ...
langchain/libs/core/langchain_core/messages/ai.py/0
{ "file_path": "langchain/libs/core/langchain_core/messages/ai.py", "repo_id": "langchain", "token_count": 719 }
432
# LlamaIndex Readers Integration: Arango Db This loader loads documents from ArangoDB. The user specifies a ArangoDB instance to initialize the reader. They then specify the collection name and query params to fetch the relevant docs. ## Usage Here's an example usage of the SimpleArangoDBReader. ```python from llam...
llama_index/llama-index-integrations/readers/llama-index-readers-arango-db/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-arango-db/README.md", "repo_id": "llama_index", "token_count": 382 }
1,337
# VectorDB Tool This tool wraps a VectorStoreIndex and enables a agent to call it with queries and filters to retrieve data. ## Usage ```python from llama_index.tools.vector_db import VectorDB from llama_index.agent import OpenAIAgent from llama_index.vector_stores.types import VectorStoreInfo from llama_index impor...
llama_index/llama-index-integrations/tools/llama-index-tools-vector-db/README.md/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-vector-db/README.md", "repo_id": "llama_index", "token_count": 754 }
1,504
ARG INCLUDE_DB=false FROM mongo:latest as mongo FROM node:20-slim as local_db_false FROM node:20-slim as local_db_true RUN apt-get update RUN apt-get install gnupg curl -y COPY --from=mongo /usr/bin/mongo* /usr/bin/ FROM local_db_${INCLUDE_DB} as final ARG INCLUDE_DB=false ENV INCLUDE_DB=${INCLUDE_DB} WORKDIR /ap...
chat-ui/Dockerfile.local/0
{ "file_path": "chat-ui/Dockerfile.local", "repo_id": "chat-ui", "token_count": 278 }
91
# KDB.AI >[KDB.AI](https://kdb.ai) is a powerful knowledge-based vector database and search engine that allows you to build scalable, reliable AI applications, using real-time data, by providing advanced search, recommendation and personalization. ## Installation and Setup Install the Python SDK: ```bash pip insta...
langchain/docs/docs/integrations/providers/kdbai.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/kdbai.mdx", "repo_id": "langchain", "token_count": 182 }
140
from llama_index.core.readers.base import BaseReader from llama_index.readers.graphql import GraphQLReader def test_class(): names_of_base_classes = [b.__name__ for b in GraphQLReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-graphql/tests/test_readers_graphql.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-graphql/tests/test_readers_graphql.py", "repo_id": "llama_index", "token_count": 88 }
1,362
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-mbox/llama_index/readers/mbox/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mbox/llama_index/readers/mbox/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,520
<jupyter_start><jupyter_text>If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets. We will also use the `seqeval` library to compute some evaluation metrics. Uncomment the following cell and run it.<jupyter_code>#! pip install transformers #! pip install datasets #...
notebooks/examples/token_classification-tf.ipynb/0
{ "file_path": "notebooks/examples/token_classification-tf.ipynb", "repo_id": "notebooks", "token_count": 9592 }
314
from langchain_community.agent_toolkits.office365.toolkit import O365Toolkit __all__ = ["O365Toolkit"]
langchain/libs/langchain/langchain/agents/agent_toolkits/office365/toolkit.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/office365/toolkit.py", "repo_id": "langchain", "token_count": 35 }
440
python_sources()
llama_index/llama-index-integrations/tools/llama-index-tools-vector-db/llama_index/tools/vector_db/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-vector-db/llama_index/tools/vector_db/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,460
"""Init file.""" from llama_index.core.query_pipeline.components.agent import ( AgentFnComponent, AgentInputComponent, CustomAgentComponent, QueryComponent, ) from llama_index.core.query_pipeline.components.argpacks import ArgPackComponent from llama_index.core.query_pipeline.components.function import...
llama_index/llama-index-core/llama_index/core/query_pipeline/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/query_pipeline/__init__.py", "repo_id": "llama_index", "token_count": 415 }
1,137
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/models/upsampling.py/0
{ "file_path": "diffusers/src/diffusers/models/upsampling.py", "repo_id": "diffusers", "token_count": 7818 }
235
"""Chain that does self-ask with search.""" from typing import Any, Sequence, Union from langchain_community.utilities.google_serper import GoogleSerperAPIWrapper from langchain_community.utilities.searchapi import SearchApiAPIWrapper from langchain_community.utilities.serpapi import SerpAPIWrapper from langchain_core...
langchain/libs/langchain/langchain/agents/self_ask_with_search/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/self_ask_with_search/base.py", "repo_id": "langchain", "token_count": 3096 }
446
FROM python:3.9 # Set the working directory to /app WORKDIR /app # Copy the current directory contents into the container at /app COPY . . # Install any needed packages specified in requirements.txt RUN pip install poetry && poetry config virtualenvs.create false && poetry install --with test,lint,typing,dev RUN po...
langgraph/Dockerfile/0
{ "file_path": "langgraph/Dockerfile", "repo_id": "langgraph", "token_count": 92 }
1,072
{ "openapi": "3.0.0", "x-optic-url": "https://app.useoptic.com/organizations/febf8ac6-ee67-4565-b45a-5c85a469dca7/apis/_0fKWqUvhs9ssYNkq1k-c", "x-optic-standard": "@febf8ac6-ee67-4565-b45a-5c85a469dca7/Fz6KU3_wMIO5iJ6_VUZ30", "info": { "version": "2.2.0", "title": "APIs.guru", "description...
langchain/libs/community/tests/unit_tests/examples/test_specs/apis-guru/apispec.json/0
{ "file_path": "langchain/libs/community/tests/unit_tests/examples/test_specs/apis-guru/apispec.json", "repo_id": "langchain", "token_count": 9471 }
382
// Code generated by mockery v2.32.4. DO NOT EDIT. package dist import ( context "context" mock "github.com/stretchr/testify/mock" ) // MockController is an autogenerated mock type for the Controller type type MockController struct { mock.Mock } type MockController_Expecter struct { mock *mock.Mock } func (_m...
milvus/internal/querycoordv2/dist/mock_controller.go/0
{ "file_path": "milvus/internal/querycoordv2/dist/mock_controller.go", "repo_id": "milvus", "token_count": 1699 }
2,029
// 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/delegator/distribution_test.go/0
{ "file_path": "milvus/internal/querynodev2/delegator/distribution_test.go", "repo_id": "milvus", "token_count": 7252 }
1,764
import pytest @pytest.mark.compile def test_placeholder() -> None: """Used for compiling integration tests without running any real tests.""" pass
langchain/libs/partners/google-genai/tests/integration_tests/test_compile.py/0
{ "file_path": "langchain/libs/partners/google-genai/tests/integration_tests/test_compile.py", "repo_id": "langchain", "token_count": 46 }
684
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional from langchain_core.documents import Document from langchain_core.pydantic_v1 import BaseModel, root_validator from langchain_core.utils import get_from_dict_or_env if TYPE_CHECKING: from langchain_community.document_loaders import ApifyDatasetLoader...
langchain/libs/community/langchain_community/utilities/apify.py/0
{ "file_path": "langchain/libs/community/langchain_community/utilities/apify.py", "repo_id": "langchain", "token_count": 3656 }
303
# coding=utf-8 # Copyright 2022 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/models/audio_spectrogram_transformer/test_feature_extraction_audio_spectrogram_transformer.py/0
{ "file_path": "transformers/tests/models/audio_spectrogram_transformer/test_feature_extraction_audio_spectrogram_transformer.py", "repo_id": "transformers", "token_count": 3869 }
782
from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorstores import Pinecone all_documents = { "doc1": "Climate change and economic impact.", "doc2": "Public health concerns due to climate change.", "doc3": "Climate change: A social perspective.", "doc4": "Technolog...
langchain/templates/rag-fusion/ingest.py/0
{ "file_path": "langchain/templates/rag-fusion/ingest.py", "repo_id": "langchain", "token_count": 247 }
689
<!-- 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 agree...
transformers/docs/source/ja/add_new_model.md/0
{ "file_path": "transformers/docs/source/ja/add_new_model.md", "repo_id": "transformers", "token_count": 28026 }
510
python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/query_pipeline/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/query_pipeline/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,677
# Quickstart This quickstart is intended for developers who are ready to dive into the code and see an example of how to integrate `timm` into their model training workflow. First, you'll need to install `timm`. For more information on installation, see [Installation](installation). ```bash pip install timm ``` ## ...
pytorch-image-models/hfdocs/source/quickstart.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/quickstart.mdx", "repo_id": "pytorch-image-models", "token_count": 2583 }
378
"""Test MyScale functionality.""" from langchain_core.documents import Document from langchain_community.vectorstores import MyScale, MyScaleSettings from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings def test_myscale() -> None: """Test end to end construction and search.""" text...
langchain/libs/community/tests/integration_tests/vectorstores/test_myscale.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_myscale.py", "repo_id": "langchain", "token_count": 1498 }
377
# Activeloop Deep Lake This page covers how to use the Deep Lake ecosystem within LangChain. ## Why Deep Lake? - More than just a (multi-modal) vector store. You can later use the dataset to fine-tune your own LLM models. - Not only stores embeddings, but also the original data with automatic version control. - Truly ...
langchain/docs/docs/integrations/providers/activeloop_deeplake.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/activeloop_deeplake.mdx", "repo_id": "langchain", "token_count": 553 }
127
package conc import "golang.org/x/sync/singleflight" // Singleflight wraps golang.org/x/sync/singleflight.Group into generic one. type Singleflight[T any] struct { internal singleflight.Group } // SingleflightResult is a generic Result wrapper for DoChan. type SingleflightResult[T any] struct { Val T Err er...
milvus/pkg/util/conc/singleflight.go/0
{ "file_path": "milvus/pkg/util/conc/singleflight.go", "repo_id": "milvus", "token_count": 371 }
1,906
import sys from pathlib import Path from typing import Optional from langchain_core.pydantic_v1 import BaseModel def is_relative_to(path: Path, root: Path) -> bool: """Check if path is relative to root.""" if sys.version_info >= (3, 9): # No need for a try/except block in Python 3.8+. return ...
langchain/libs/community/langchain_community/tools/file_management/utils.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/file_management/utils.py", "repo_id": "langchain", "token_count": 608 }
286
<!--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/zh/model_sharing.md/0
{ "file_path": "transformers/docs/source/zh/model_sharing.md", "repo_id": "transformers", "token_count": 5352 }
534
<!--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/zh/llm_tutorial.md/0
{ "file_path": "transformers/docs/source/zh/llm_tutorial.md", "repo_id": "transformers", "token_count": 7107 }
511
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-feedly-rss/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-feedly-rss/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,363
"""Multion tool spec.""" import base64 from io import BytesIO from typing import Optional from llama_index.core.tools.tool_spec.base import BaseToolSpec class MultionToolSpec(BaseToolSpec): """Multion tool spec.""" spec_functions = ["browse"] def __init__(self, token_file: Optional[str] = "multion_tok...
llama_index/llama-index-integrations/tools/llama-index-tools-multion/llama_index/tools/multion/base.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-multion/llama_index/tools/multion/base.py", "repo_id": "llama_index", "token_count": 759 }
1,573
# Use with Spark This document is a quick introduction to using 🤗 Datasets with Spark, with a particular focus on how to load a Spark DataFrame into a [`Dataset`] object. From there, you have fast access to any element and you can use it as a data loader to train models. ## Load from Spark A [`Dataset`] object is ...
datasets/docs/source/use_with_spark.mdx/0
{ "file_path": "datasets/docs/source/use_with_spark.mdx", "repo_id": "datasets", "token_count": 962 }
125
use crate::model::{report_detect, report_pose, Bbox, Multiples, YoloV8, YoloV8Pose}; use candle::{DType, Device, Result, Tensor}; use candle_nn::{Module, VarBuilder}; use serde::{Deserialize, Serialize}; use wasm_bindgen::prelude::*; use yew_agent::{HandlerId, Public, WorkerLink}; #[wasm_bindgen] extern "C" { // U...
candle/candle-wasm-examples/yolo/src/worker.rs/0
{ "file_path": "candle/candle-wasm-examples/yolo/src/worker.rs", "repo_id": "candle", "token_count": 4077 }
81
import hashlib import re import shutil from pathlib import Path from typing import Dict, List, Optional, Sequence, TypedDict from git import Repo from langchain_cli.constants import ( DEFAULT_GIT_REF, DEFAULT_GIT_REPO, DEFAULT_GIT_SUBDIRECTORY, ) class DependencySource(TypedDict): git: str ref: ...
langchain/libs/cli/langchain_cli/utils/git.py/0
{ "file_path": "langchain/libs/cli/langchain_cli/utils/git.py", "repo_id": "langchain", "token_count": 2839 }
224
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/typeorm", }); export * from "@langchain/community/vectorstores/typeorm";
langchainjs/langchain/src/vectorstores/typeorm.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/typeorm.ts", "repo_id": "langchainjs", "token_count": 72 }
1,006
from llama_index.readers.milvus.base import MilvusReader __all__ = ["MilvusReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-milvus/llama_index/readers/milvus/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-milvus/llama_index/readers/milvus/__init__.py", "repo_id": "llama_index", "token_count": 32 }
1,401
"""Test conversation chain and memory.""" from langchain_community.llms.fake import FakeListLLM from langchain_core.documents import Document from langchain.chains.conversational_retrieval.base import ( ConversationalRetrievalChain, ) from langchain.memory.buffer import ConversationBufferMemory from tests.unit_tes...
langchain/libs/langchain/tests/unit_tests/chains/test_conversation_retrieval.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/chains/test_conversation_retrieval.py", "repo_id": "langchain", "token_count": 1400 }
599
""" GitHub repository issues reader. Retrieves the list of issues of a GitHub repository and converts them to documents. Each issue is converted to a document by doing the following: - The text of the document is the concatenation of the title and the body of the issue. - The title of the document is the tit...
llama_index/llama-index-integrations/readers/llama-index-readers-github/llama_index/readers/github/issues/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-github/llama_index/readers/github/issues/base.py", "repo_id": "llama_index", "token_count": 3393 }
1,304
# coding=utf-8 # Copyright 2018 Microsoft 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 # # Unless ...
transformers/tests/models/deberta_v2/test_modeling_deberta_v2.py/0
{ "file_path": "transformers/tests/models/deberta_v2/test_modeling_deberta_v2.py", "repo_id": "transformers", "token_count": 5861 }
741
import unittest from diffusers import FlaxAutoencoderKL from diffusers.utils import is_flax_available from diffusers.utils.testing_utils import require_flax from ..test_modeling_common_flax import FlaxModelTesterMixin if is_flax_available(): import jax @require_flax class FlaxAutoencoderKLTests(FlaxModelTeste...
diffusers/tests/models/autoencoders/test_models_vae_flax.py/0
{ "file_path": "diffusers/tests/models/autoencoders/test_models_vae_flax.py", "repo_id": "diffusers", "token_count": 513 }
283
python_sources()
llama_index/llama-index-packs/llama-index-packs-voyage-query-engine/llama_index/packs/voyage_query_engine/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-voyage-query-engine/llama_index/packs/voyage_query_engine/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,707
import { getEnvironmentVariable } from "@langchain/core/utils/env"; import { Embeddings, type EmbeddingsParams } from "@langchain/core/embeddings"; import { chunkArray } from "@langchain/core/utils/chunk_array"; /** * Interface for TogetherAIEmbeddingsParams parameters. Extends EmbeddingsParams and * defines additio...
langchainjs/libs/langchain-community/src/embeddings/togetherai.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/embeddings/togetherai.ts", "repo_id": "langchainjs", "token_count": 1901 }
1,023
"""Test ChatAnthropicMessages chat model.""" from langchain_core.prompts import ChatPromptTemplate from langchain_anthropic.chat_models import ChatAnthropicMessages def test_stream() -> None: """Test streaming tokens from Anthropic.""" llm = ChatAnthropicMessages(model_name="claude-instant-1.2") for tok...
langchain/libs/partners/anthropic/tests/integration_tests/test_chat_models.py/0
{ "file_path": "langchain/libs/partners/anthropic/tests/integration_tests/test_chat_models.py", "repo_id": "langchain", "token_count": 1046 }
623
import React, { useEffect, useState } from "react"; const PREFIX = "langgizmo-"; export function useStatePersist<T>( defaultValue: T, key: string ): [T, React.Dispatch<React.SetStateAction<T>>] { const [state, setState] = useState<T>(() => { const storageValue = localStorage.getItem(PREFIX + key); if (...
opengpts/frontend/src/hooks/useStatePersist.tsx/0
{ "file_path": "opengpts/frontend/src/hooks/useStatePersist.tsx", "repo_id": "opengpts", "token_count": 208 }
1,924
<!--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/training/dreambooth.md/0
{ "file_path": "diffusers/docs/source/en/training/dreambooth.md", "repo_id": "diffusers", "token_count": 6164 }
195
<!--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/quicktour.md/0
{ "file_path": "diffusers/docs/source/en/quicktour.md", "repo_id": "diffusers", "token_count": 4836 }
194
package httpserver import ( "io" "net/http" "github.com/cockroachdb/errors" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" ) var errBadRequest = errors.New("bad request") // handlerFunc handles http request with gin context type handlerFun...
milvus/internal/distributed/proxy/httpserver/wrapper.go/0
{ "file_path": "milvus/internal/distributed/proxy/httpserver/wrapper.go", "repo_id": "milvus", "token_count": 712 }
1,716
[tool.poetry] name = "langgraph" version = "0.0.24" description = "langgraph" authors = [] license = "LangGraph License" readme = "README.md" repository = "https://www.github.com/langchain-ai/langgraph" [tool.poetry.dependencies] python = ">=3.9.0,<4.0" langchain-core = "^0.1.16" [tool.poetry.group.test.dependencies...
langgraph/pyproject.toml/0
{ "file_path": "langgraph/pyproject.toml", "repo_id": "langgraph", "token_count": 868 }
1,078
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/model_doc/big_bird.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/big_bird.md", "repo_id": "transformers", "token_count": 2762 }
540
filters: ".*": reviewers: - fishpenguin - godchen0212 - xige-16 - FluorineDog - XuanYang-cn - czs007 - bigsheeper - sunby approvers: - maintainers "{common|milvus|schema}\\.proto": labels: - area/api approvers: - maintainers "{dat...
milvus/internal/proto/OWNERS/0
{ "file_path": "milvus/internal/proto/OWNERS", "repo_id": "milvus", "token_count": 226 }
1,955
# coding=utf-8 # Copyright 2024 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/depth_anything/convert_depth_anything_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/depth_anything/convert_depth_anything_to_hf.py", "repo_id": "transformers", "token_count": 5755 }
649
<jupyter_start><jupyter_text>Xorbits Pandas DataFrameThis notebook goes over how to load data from a [xorbits.pandas](https://doc.xorbits.io/en/latest/reference/pandas/frame.html) DataFrame.<jupyter_code>%pip install --upgrade --quiet xorbits import xorbits.pandas as pd df = pd.read_csv("example_data/mlb_teams_2012.cs...
langchain/docs/docs/integrations/document_loaders/xorbits.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/xorbits.ipynb", "repo_id": "langchain", "token_count": 217 }
109
from typing import Any, Iterator, List from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.document_loaders.tencent_cos_file import TencentCOSFileLoader class TencentCOSDirectoryLoader(BaseLoader): """Load from `Tencent Cloud CO...
langchain/libs/community/langchain_community/document_loaders/tencent_cos_directory.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/tencent_cos_directory.py", "repo_id": "langchain", "token_count": 785 }
245
SERVER_HOST_DEFAULT = "127.0.0.1" SERVER_PORT_DEFAULT = 19530 SERVER_VERSION = "2.0" RAW_DATA_DIR = "/test/milvus/raw_data/" DEFAULT_DEPLOY_MODE = "single" CHAOS_NAMESPACE = "chaos-testing" # namespace of chaos CHAOS_API_VERSION = 'chaos-mesh.org/v1alpha1' # chaos mesh api version CHAOS_GROUP = 'chaos-mesh.org' #...
milvus/tests/python_client/chaos/constants.py/0
{ "file_path": "milvus/tests/python_client/chaos/constants.py", "repo_id": "milvus", "token_count": 455 }
1,961
from llama_index.packs.ollama_query_engine.base import OllamaQueryEnginePack __all__ = ["OllamaQueryEnginePack"]
llama_index/llama-index-packs/llama-index-packs-ollama-query-engine/llama_index/packs/ollama_query_engine/__init__.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-ollama-query-engine/llama_index/packs/ollama_query_engine/__init__.py", "repo_id": "llama_index", "token_count": 38 }
1,670
from langchain_community.llms.octoai_endpoint import OctoAIEndpoint __all__ = ["OctoAIEndpoint"]
langchain/libs/langchain/langchain/llms/octoai_endpoint.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/octoai_endpoint.py", "repo_id": "langchain", "token_count": 37 }
540
from llama_index.core.tools.tool_spec.base import BaseToolSpec from llama_index.tools.yelp import YelpToolSpec def test_class(): names_of_base_classes = [b.__name__ for b in YelpToolSpec.__mro__] assert BaseToolSpec.__name__ in names_of_base_classes
llama_index/llama-index-integrations/tools/llama-index-tools-yelp/tests/test_tools_yelp.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-yelp/tests/test_tools_yelp.py", "repo_id": "llama_index", "token_count": 93 }
1,540
# 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/vivit/configuration_vivit.py/0
{ "file_path": "transformers/src/transformers/models/vivit/configuration_vivit.py", "repo_id": "transformers", "token_count": 2040 }
713
import { z } from "zod"; import { ChatOpenAI } from "@langchain/openai"; import { StructuredOutputParser, OutputFixingParser, } from "langchain/output_parsers"; export const run = async () => { const parser = StructuredOutputParser.fromZodSchema( z.object({ answer: z.string().describe("answer to the us...
langchainjs/examples/src/prompts/fix_parser.ts/0
{ "file_path": "langchainjs/examples/src/prompts/fix_parser.ts", "repo_id": "langchainjs", "token_count": 700 }
878
""" PyTorch Mixed Convolution Paper: MixConv: Mixed Depthwise Convolutional Kernels (https://arxiv.org/abs/1907.09595) Hacked together by / Copyright 2020 Ross Wightman """ import torch from torch import nn as nn from .conv2d_same import create_conv2d_pad def _split_channels(num_chan, num_groups): split = [nu...
pytorch-image-models/timm/layers/mixed_conv2d.py/0
{ "file_path": "pytorch-image-models/timm/layers/mixed_conv2d.py", "repo_id": "pytorch-image-models", "token_count": 834 }
334
"""Init params.""" from llama_index.finetuning.openai.base import OpenAIFinetuneEngine __all__ = ["OpenAIFinetuneEngine"]
llama_index/llama-index-finetuning/llama_index/finetuning/openai/__init__.py/0
{ "file_path": "llama_index/llama-index-finetuning/llama_index/finetuning/openai/__init__.py", "repo_id": "llama_index", "token_count": 42 }
1,238
""" Model / state_dict utils Hacked together by / Copyright 2020 Ross Wightman """ import fnmatch from copy import deepcopy import torch from torchvision.ops.misc import FrozenBatchNorm2d from timm.layers import BatchNormAct2d, SyncBatchNormAct, FrozenBatchNormAct2d,\ freeze_batch_norm_2d, unfreeze_batch_norm_2d...
pytorch-image-models/timm/utils/model.py/0
{ "file_path": "pytorch-image-models/timm/utils/model.py", "repo_id": "pytorch-image-models", "token_count": 4233 }
410
# Know your dataset There are two types of dataset objects, a regular [`Dataset`] and then an ✨ [`IterableDataset`] ✨. A [`Dataset`] provides fast random access to the rows, and memory-mapping so that loading even large datasets only uses a relatively small amount of device memory. But for really, really big datasets ...
datasets/docs/source/access.mdx/0
{ "file_path": "datasets/docs/source/access.mdx", "repo_id": "datasets", "token_count": 2274 }
119
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/api/pipelines/deepfloyd_if.md/0
{ "file_path": "diffusers/docs/source/en/api/pipelines/deepfloyd_if.md", "repo_id": "diffusers", "token_count": 6743 }
174
// 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/balance_checker_test.go/0
{ "file_path": "milvus/internal/querycoordv2/checkers/balance_checker_test.go", "repo_id": "milvus", "token_count": 3214 }
1,826
# Instructions to Replicate Zephyr-7b-β As described in the Zephyr [technical report](https://huggingface.co/papers/2310.16944), training this model proceeds in two steps: 1. Apply SFT to fine-tune Mistral 7B on a filtered version of the UltraChat dataset ([link](https://huggingface.co/datasets/HuggingFaceH4/ultrach...
alignment-handbook/recipes/zephyr-7b-beta/README.md/0
{ "file_path": "alignment-handbook/recipes/zephyr-7b-beta/README.md", "repo_id": "alignment-handbook", "token_count": 888 }
28
from langchain_community.document_loaders.dropbox import DropboxLoader __all__ = ["DropboxLoader"]
langchain/libs/langchain/langchain/document_loaders/dropbox.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/dropbox.py", "repo_id": "langchain", "token_count": 28 }
513
pub trait VecOps: num_traits::NumAssign + Copy { fn min(self, rhs: Self) -> Self; fn max(self, rhs: Self) -> Self; /// Dot-product of two vectors. /// /// # Safety /// /// The length of `lhs` and `rhs` have to be at least `len`. `res` has to point to a valid /// element. #[inline(al...
candle/candle-core/src/cpu/kernels.rs/0
{ "file_path": "candle/candle-core/src/cpu/kernels.rs", "repo_id": "candle", "token_count": 2328 }
33
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
langchain-nextjs-template/postcss.config.js/0
{ "file_path": "langchain-nextjs-template/postcss.config.js", "repo_id": "langchain-nextjs-template", "token_count": 38 }
68
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/univnet/test_feature_extraction_univnet.py/0
{ "file_path": "transformers/tests/models/univnet/test_feature_extraction_univnet.py", "repo_id": "transformers", "token_count": 7246 }
830
# coding=utf-8 # Copyright 2023 Google AI and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
transformers/src/transformers/models/owlv2/modeling_owlv2.py/0
{ "file_path": "transformers/src/transformers/models/owlv2/modeling_owlv2.py", "repo_id": "transformers", "token_count": 35173 }
674
python_sources()
llama_index/llama-index-packs/llama-index-packs-tables/llama_index/packs/tables/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-tables/llama_index/packs/tables/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,876
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/output_parsers/llama-index-output-parsers-langchain/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/output_parsers/llama-index-output-parsers-langchain/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,347
from llama_index.packs.vectara_rag.base import VectaraRagPack __all__ = ["VectaraRagPack"]
llama_index/llama-index-packs/llama-index-packs-vectara-rag/llama_index/packs/vectara_rag/__init__.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-vectara-rag/llama_index/packs/vectara_rag/__init__.py", "repo_id": "llama_index", "token_count": 37 }
1,695
"""JSON node parser.""" import json from typing import Any, Dict, Generator, List, Optional, Sequence from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.node_parser.interface import NodeParser from llama_index.legacy.node_parser.node_utils import build_nodes_from_splits from llama_i...
llama_index/llama-index-legacy/llama_index/legacy/node_parser/file/json.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/node_parser/file/json.py", "repo_id": "llama_index", "token_count": 1617 }
1,593
from llama_index.vector_stores.chatgpt_plugin.base import ChatGPTRetrievalPluginClient __all__ = ["ChatGPTRetrievalPluginClient"]
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-chatgpt-plugin/llama_index/vector_stores/chatgpt_plugin/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-chatgpt-plugin/llama_index/vector_stores/chatgpt_plugin/__init__.py", "repo_id": "llama_index", "token_count": 43 }
1,549
import contextlib import gc import inspect import io import json import os import re import tempfile import unittest import uuid from typing import Callable, Union import numpy as np import PIL.Image import torch from huggingface_hub import ModelCard, delete_repo from huggingface_hub.utils import is_jinja_available fr...
diffusers/tests/pipelines/test_pipelines_common.py/0
{ "file_path": "diffusers/tests/pipelines/test_pipelines_common.py", "repo_id": "diffusers", "token_count": 24360 }
259
import type { BaseLanguageModel, BaseLanguageModelInterface, } from "@langchain/core/language_models/base"; import type { TiktokenModel } from "js-tiktoken/lite"; import type { OpenAI } from "@langchain/openai"; import { ChainValues } from "@langchain/core/utils/types"; import { BasePromptTemplate, PromptTemplate }...
langchainjs/langchain/src/chains/sql_db/sql_db_chain.ts/0
{ "file_path": "langchainjs/langchain/src/chains/sql_db/sql_db_chain.ts", "repo_id": "langchainjs", "token_count": 3532 }
856
import pytest import threading from time import sleep from pymilvus import connections from chaos.checker import (CollectionCreateChecker, InsertChecker, FlushChecker, SearchChecker, QueryChecker, ...
milvus/tests/python_client/chaos/testcases/test_single_request_operation_for_standby.py/0
{ "file_path": "milvus/tests/python_client/chaos/testcases/test_single_request_operation_for_standby.py", "repo_id": "milvus", "token_count": 2080 }
1,895
from typing import Any, Mapping, Optional from llama_index.readers.airbyte_cdk.base import AirbyteCDKReader, RecordHandler class AirbyteStripeReader(AirbyteCDKReader): """AirbyteStripeReader reader. Retrieve documents from Stripe Args: config: The config object for the stripe source. """ ...
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-stripe/llama_index/readers/airbyte_stripe/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-stripe/llama_index/readers/airbyte_stripe/base.py", "repo_id": "llama_index", "token_count": 283 }
1,284
package distance import ( "math" "strings" "sync" "github.com/cockroachdb/errors" ) /** * Delete in #25663 Remove calc_distance * Add back partially as clustering feature needs to calculate distance between search vector and clustering center */ const ( // L2 represents the Euclidean distance L2 = "L2" // ...
milvus/pkg/util/distance/calc_distance.go/0
{ "file_path": "milvus/pkg/util/distance/calc_distance.go", "repo_id": "milvus", "token_count": 1334 }
2,049
"""Test query transform.""" from llama_index.core.indices.query.query_transform.base import ( DecomposeQueryTransform, ) from llama_index.core.service_context import ServiceContext from tests.indices.query.query_transform.mock_utils import MOCK_DECOMPOSE_PROMPT def test_decompose_query_transform(mock_service_co...
llama_index/llama-index-core/tests/indices/query/query_transform/test_base.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/query/query_transform/test_base.py", "repo_id": "llama_index", "token_count": 283 }
1,221
# Airtable >[Airtable](https://en.wikipedia.org/wiki/Airtable) is a cloud collaboration service. `Airtable` is a spreadsheet-database hybrid, with the features of a database but applied to a spreadsheet. > The fields in an Airtable table are similar to cells in a spreadsheet, but have types such as 'checkbox', > 'ph...
langchain/docs/docs/integrations/providers/airtable.md/0
{ "file_path": "langchain/docs/docs/integrations/providers/airtable.md", "repo_id": "langchain", "token_count": 365 }
132
from typing import List, cast import pytest from llama_index.legacy.indices.vector_store.base import VectorStoreIndex from llama_index.legacy.schema import ( Document, NodeRelationship, QueryBundle, RelatedNodeInfo, TextNode, ) from llama_index.legacy.service_context import ServiceContext from llam...
llama_index/llama-index-legacy/tests/indices/vector_store/test_retrievers.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/vector_store/test_retrievers.py", "repo_id": "llama_index", "token_count": 1979 }
1,555
# candle-yolo-v8: Object Detection and Pose Estimation This is a port of [Ultralytics YOLOv8](https://github.com/ultralytics/ultralytics). The implementation is based on the [tinygrad version](https://github.com/tinygrad/tinygrad/blob/master/examples/yolov8.py) and on the model architecture described in this [issue](h...
candle/candle-examples/examples/yolo-v8/README.md/0
{ "file_path": "candle/candle-examples/examples/yolo-v8/README.md", "repo_id": "candle", "token_count": 562 }
54
# 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/gpt_neo/test_modeling_gpt_neo.py/0
{ "file_path": "transformers/tests/models/gpt_neo/test_modeling_gpt_neo.py", "repo_id": "transformers", "token_count": 11505 }
802
import abc import json from typing import TYPE_CHECKING, List if TYPE_CHECKING: from botocore.response import StreamingBody from llama_index.core.bridge.pydantic import Field class BaseIOHandler(metaclass=abc.ABCMeta): content_type: str = Field( description="The MIME type of the input data in the re...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-sagemaker-endpoint/llama_index/embeddings/sagemaker_endpoint/utils.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-sagemaker-endpoint/llama_index/embeddings/sagemaker_endpoint/utils.py", "repo_id": "llama_index", "token_count": 651 }
1,374
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/graph_stores/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/graph_stores/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,710
<script lang="ts"> import { base } from "$app/paths"; import { page } from "$app/stores"; import { PUBLIC_APP_DESCRIPTION, PUBLIC_APP_NAME } from "$env/static/public"; import LogoHuggingFaceBorderless from "$lib/components/icons/LogoHuggingFaceBorderless.svelte"; import Modal from "$lib/components/Modal.svelte"; ...
chat-ui/src/lib/components/LoginModal.svelte/0
{ "file_path": "chat-ui/src/lib/components/LoginModal.svelte", "repo_id": "chat-ui", "token_count": 917 }
94
from llama_index.core.llms.base import BaseLLM from llama_index.llms.llama_cpp import LlamaCPP def test_embedding_class(): names_of_base_classes = [b.__name__ for b in LlamaCPP.__mro__] assert BaseLLM.__name__ in names_of_base_classes
llama_index/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py", "repo_id": "llama_index", "token_count": 97 }
1,228
.. _Ref-LLMs: LLMs ==== A large language model (LLM) is a reasoning engine that can complete text, chat with users, and follow instructions. LLM Interface ^^^^^^^^^^^^^^^^^^^^^^^ .. autoclass:: llama_index.core.llms.base.LLM :members: :inherited-members: Schemas ^^^^^^^ .. autoclass:: llama_index.core.llms...
llama_index/docs/api_reference/llms.rst/0
{ "file_path": "llama_index/docs/api_reference/llms.rst", "repo_id": "llama_index", "token_count": 232 }
1,077
# LangChain google-webauth This package contains resources to access Google AI/ML models and other Google services. Authorization to these services use either an API Key or service account credentials that are included in an environment variable. If you are running this on the Google Cloud Platform, or in a way where...
langchainjs/libs/langchain-google-webauth/README.md/0
{ "file_path": "langchainjs/libs/langchain-google-webauth/README.md", "repo_id": "langchainjs", "token_count": 372 }
993
"""Llama integration with Langchain agents.""" from llama_index.core.langchain_helpers.agents.agents import ( create_llama_agent, create_llama_chat_agent, ) from llama_index.core.langchain_helpers.agents.toolkits import LlamaToolkit from llama_index.core.langchain_helpers.agents.tools import ( IndexToolCon...
llama_index/llama-index-core/llama_index/core/langchain_helpers/agents/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/langchain_helpers/agents/__init__.py", "repo_id": "llama_index", "token_count": 209 }
1,226
# 🦜️🔗 LangChain ⚡ Building applications with LLMs through composability ⚡ [![Release Notes](https://img.shields.io/github/release/langchain-ai/langchain)](https://github.com/langchain-ai/langchain/releases) [![lint](https://github.com/langchain-ai/langchain/actions/workflows/lint.yml/badge.svg)](https://github.com/...
langchain/libs/langchain/README.md/0
{ "file_path": "langchain/libs/langchain/README.md", "repo_id": "langchain", "token_count": 1708 }
430
from langchain_robocorp.toolkits import ActionServerToolkit __all__ = [ "ActionServerToolkit", ]
langchain/libs/partners/robocorp/langchain_robocorp/__init__.py/0
{ "file_path": "langchain/libs/partners/robocorp/langchain_robocorp/__init__.py", "repo_id": "langchain", "token_count": 36 }
624
// Assumes that chroma-hnswlib is checked out at the same level as chroma #include "../../../hnswlib/hnswlib/hnswlib.h" template <typename dist_t, typename data_t = float> class Index { public: std::string space_name; int dim; size_t seed; bool normalize; bool index_inited; hnswlib::Hierarchi...
chroma/rust/worker/bindings.cpp/0
{ "file_path": "chroma/rust/worker/bindings.cpp", "repo_id": "chroma", "token_count": 2831 }
58
[tool.poetry] name = "rag-google-cloud-sensitive-data-protection" version = "0.0.1" description = "RAG using sensitive data protection" authors = ["Juan Calvo <juan.calvo@datatonic.com>"] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" google-cloud-aiplatform = ">=1.35.0" goo...
langchain/templates/rag-google-cloud-sensitive-data-protection/pyproject.toml/0
{ "file_path": "langchain/templates/rag-google-cloud-sensitive-data-protection/pyproject.toml", "repo_id": "langchain", "token_count": 322 }
716
import { FigmaFileLoader } from "langchain/document_loaders/web/figma"; const loader = new FigmaFileLoader({ accessToken: "FIGMA_ACCESS_TOKEN", // or load it from process.env.FIGMA_ACCESS_TOKEN nodeIds: ["id1", "id2", "id3"], fileKey: "key", }); const docs = await loader.load(); console.log({ docs });
langchainjs/examples/src/document_loaders/figma.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/figma.ts", "repo_id": "langchainjs", "token_count": 111 }
853