text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { VectorStore } from "@langchain/core/vectorstores"; import { Document } from "@langchain/core/documents"; /** * Database config for your vectorstore. */ export interface VectorstoreIntegrationParams {} /** * Class for managing and opera...
langchainjs/libs/create-langchain-integration/template/src/vectorstores.ts/0
{ "file_path": "langchainjs/libs/create-langchain-integration/template/src/vectorstores.ts", "repo_id": "langchainjs", "token_count": 869 }
955
import asyncio from typing import Any, Dict, Optional from langchain_experimental.comprehend_moderation.base_moderation_exceptions import ( ModerationPiiError, ) class ComprehendPII: def __init__( self, client: Any, callback: Optional[Any] = None, unique_id: Optional[str] = No...
langchain/libs/experimental/langchain_experimental/comprehend_moderation/pii.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/comprehend_moderation/pii.py", "repo_id": "langchain", "token_count": 3089 }
416
from langchain_community.document_loaders.rss import RSSFeedLoader __all__ = ["RSSFeedLoader"]
langchain/libs/langchain/langchain/document_loaders/rss.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/rss.py", "repo_id": "langchain", "token_count": 29 }
537
#!/bin/bash set -eu # Initialize a variable to keep track of errors errors=0 # Check the conditions git grep '^from langchain import' langchain | grep -vE 'from langchain import (__version__|hub)' && errors=$((errors+1)) git grep '^from langchain\.' langchain/pydantic_v1 | grep -vE 'from langchain.(pydantic_v1)' && ...
langchain/libs/langchain/scripts/lint_imports.sh/0
{ "file_path": "langchain/libs/langchain/scripts/lint_imports.sh", "repo_id": "langchain", "token_count": 1021 }
634
"""Slack toolkit."""
langchain/libs/community/langchain_community/agent_toolkits/slack/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/slack/__init__.py", "repo_id": "langchain", "token_count": 8 }
228
<jupyter_start><jupyter_text>Comet In this guide we will demonstrate how to track your Langchain Experiments, Evaluation Metrics, and LLM Sessions with [Comet](https://www.comet.com/site/?utm_source=langchain&utm_medium=referral&utm_campaign=comet_notebook). **Example Project:** [Comet with LangChain](https://www.c...
langchain/docs/docs/integrations/providers/comet_tracking.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/providers/comet_tracking.ipynb", "repo_id": "langchain", "token_count": 2552 }
144
--- sidebar_class_name: node-only --- import CodeBlock from "@theme/CodeBlock"; # Vectara Vectara is a platform for building GenAI applications. It provides an easy-to-use API for document indexing and querying that is managed by Vectara and is optimized for performance and accuracy. You can use Vectara as a vector...
langchainjs/docs/core_docs/docs/integrations/vectorstores/vectara.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/vectara.mdx", "repo_id": "langchainjs", "token_count": 766 }
745
# 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 applicabl...
transformers/src/transformers/modeling_flax_outputs.py/0
{ "file_path": "transformers/src/transformers/modeling_flax_outputs.py", "repo_id": "transformers", "token_count": 15429 }
614
import { LunaryHandler } from "@langchain/community/callbacks/handlers/lunary"; import { ChatOpenAI } from "@langchain/openai"; const chat = new ChatOpenAI({ modelName: "gpt-3.5-turbo", temperature: 0, callbacks: [new LunaryHandler()], }); await chat.invoke("Hello", { tags: ["greeting"], });
langchainjs/examples/src/callbacks/lunary_tags.ts/0
{ "file_path": "langchainjs/examples/src/callbacks/lunary_tags.ts", "repo_id": "langchainjs", "token_count": 107 }
786
#!/usr/bin/env python """Example that shows how to use the underlying APIHandler class directly with Auth. This example shows how to apply logic based on the user's identity. You can build on these concepts to implement a more complex app: * Add endpoints that allow users to manage their documents. * Make a more comp...
langserve/examples/auth/api_handler/server.py/0
{ "file_path": "langserve/examples/auth/api_handler/server.py", "repo_id": "langserve", "token_count": 3424 }
1,123
<jupyter_start><jupyter_text>Evaporate DemoThis demo shows how you can extract DataFrame from raw text using the Evaporate paper (Arora et al.): https://arxiv.org/abs/2304.09433.The inspiration is to first "fit" on a set of training text. The fitting process uses the LLM to generate a set of parsing functions from the ...
llama_index/docs/examples/output_parsing/evaporate_program.ipynb/0
{ "file_path": "llama_index/docs/examples/output_parsing/evaporate_program.ipynb", "repo_id": "llama_index", "token_count": 9619 }
1,136
pub use crate::models::with_tracing::Linear; use candle::{Result, Tensor}; use candle_nn::{Module, VarBuilder}; pub mod image_encoder; pub mod mask_decoder; pub mod prompt_encoder; pub mod sam; pub mod tiny_vit; pub mod transformer; pub fn linear(vb: VarBuilder, in_dim: usize, out_dim: usize, bias: bool) -> Result<Li...
candle/candle-transformers/src/models/segment_anything/mod.rs/0
{ "file_path": "candle/candle-transformers/src/models/segment_anything/mod.rs", "repo_id": "candle", "token_count": 1119 }
74
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/models/megatron_gpt2/checkpoint_reshaping_and_interoperability.py/0
{ "file_path": "transformers/src/transformers/models/megatron_gpt2/checkpoint_reshaping_and_interoperability.py", "repo_id": "transformers", "token_count": 16485 }
699
# Metric Card for WER ## Metric description Word error rate (WER) is a common metric of the performance of an automatic speech recognition (ASR) system. The general difficulty of measuring the performance of ASR systems lies in the fact that the recognized word sequence can have a different length from the reference...
datasets/metrics/wer/README.md/0
{ "file_path": "datasets/metrics/wer/README.md", "repo_id": "datasets", "token_count": 1325 }
126
# DreamBooth training example for Stable Diffusion XL (SDXL) [DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few (3~5) images of a subject. The `train_dreambooth_lora_sdxl.py` script shows how to implement the training procedure and adapt ...
diffusers/examples/dreambooth/README_sdxl.md/0
{ "file_path": "diffusers/examples/dreambooth/README_sdxl.md", "repo_id": "diffusers", "token_count": 2789 }
212
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/main_classes/onnx.md/0
{ "file_path": "transformers/docs/source/en/main_classes/onnx.md", "repo_id": "transformers", "token_count": 523 }
495
# Load a dataset from the Hub Finding high-quality datasets that are reproducible and accessible can be difficult. One of 🤗 Datasets main goals is to provide a simple way to load a dataset of any format or type. The easiest way to get started is to discover an existing dataset on the [Hugging Face Hub](https://huggin...
datasets/docs/source/load_hub.mdx/0
{ "file_path": "datasets/docs/source/load_hub.mdx", "repo_id": "datasets", "token_count": 1685 }
118
/** * Represents a string value with autocompleted, but not required, suggestions. */ export type StringWithAutocomplete<T> = T | (string & Record<never, never>); // eslint-disable-next-line @typescript-eslint/no-explicit-any export type InputValues<K extends string = string> = Record<K, any>; export type PartialV...
langchainjs/langchain-core/src/utils/types.ts/0
{ "file_path": "langchainjs/langchain-core/src/utils/types.ts", "repo_id": "langchainjs", "token_count": 174 }
847
<jupyter_start><jupyter_code># Setup OpenAI Agent import openai openai.api_key = "sk-your-key" from llama_index.agent import OpenAIAgent # Import and initialize our tool spec from llama_index.tools.tool_spec.load_and_search.base import LoadAndSearchToolSpec from llama_index.tools.google_search.base import GoogleSearch...
llama_index/llama-index-integrations/tools/llama-index-tools-google/examples/google_search.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-google/examples/google_search.ipynb", "repo_id": "llama_index", "token_count": 376 }
1,485
import os from abc import ABC, abstractmethod from dataclasses import dataclass, field from typing import Any, Dict, List, Optional, Sequence import fsspec from dataclasses_json import DataClassJsonMixin from llama_index.core.schema import BaseNode from llama_index.core.storage.kvstore.types import DEFAULT_BATCH_SIZE ...
llama_index/llama-index-core/llama_index/core/storage/docstore/types.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/storage/docstore/types.py", "repo_id": "llama_index", "token_count": 2835 }
1,149
#!/bin/bash # var readonly STRATEGY='RollingUpdate' # default option NAMESPACE="default" IMAGE_TAG="milvusdb/milvus:v2.2.3" OPERATION="update" function env_check() { # check kubectl whether exist which kubectl &>/dev/null if [[ $? != 0 ]]; then echo "Require kubectl" exit 1 fi } func...
milvus/deployments/upgrade/rollingUpdate.sh/0
{ "file_path": "milvus/deployments/upgrade/rollingUpdate.sh", "repo_id": "milvus", "token_count": 2859 }
1,627
# coding=utf-8 # Copyright 2021 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/test_feature_extraction_common.py/0
{ "file_path": "transformers/tests/test_feature_extraction_common.py", "repo_id": "transformers", "token_count": 828 }
836
# coding=utf-8 # Copyright 2020, The RAG 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 r...
transformers/tests/models/rag/test_modeling_rag.py/0
{ "file_path": "transformers/tests/models/rag/test_modeling_rag.py", "repo_id": "transformers", "token_count": 21728 }
808
<jupyter_start><jupyter_text>---sidebar_position: 0title: Get startedkeywords: [chain.invoke]---<jupyter_code>LCEL makes it easy to build complex chains from basic components, and supports out of the box functionality such as streaming, parallelism, and logging. ## Basic example: prompt + model + output parser The mos...
langchain/docs/docs/expression_language/get_started.ipynb/0
{ "file_path": "langchain/docs/docs/expression_language/get_started.ipynb", "repo_id": "langchain", "token_count": 2047 }
84
version: '3.9' networks: net: driver: bridge services: server: image: ghcr.io/chroma-core/chroma:${ChromaVersion} volumes: - index_data:/index_data ports: - 8000:8000 networks: - net volumes: index_data: driver: local backups: driver: local
chroma/bin/templates/docker-compose.yml/0
{ "file_path": "chroma/bin/templates/docker-compose.yml", "repo_id": "chroma", "token_count": 135 }
12
import os from typing import List, Tuple from langchain.agents import AgentExecutor from langchain.agents.format_scratchpad import format_log_to_messages from langchain.agents.output_parsers import ( ReActJsonSingleInputOutputParser, ) from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder from lang...
langchain/templates/neo4j-semantic-ollama/neo4j_semantic_ollama/agent.py/0
{ "file_path": "langchain/templates/neo4j-semantic-ollama/neo4j_semantic_ollama/agent.py", "repo_id": "langchain", "token_count": 1211 }
715
import argparse import json import os from datetime import date from pathlib import Path from tabulate import tabulate MAX_LEN_MESSAGE = 2900 # slack endpoint has a limit of 3001 characters parser = argparse.ArgumentParser() parser.add_argument( "--slack_channel_name", default="peft-ci-daily", ) def main...
peft/scripts/log_reports.py/0
{ "file_path": "peft/scripts/log_reports.py", "repo_id": "peft", "token_count": 2521 }
329
#!/usr/bin/env groovy int total_timeout_minutes = 60 * 5 int e2e_timeout_seconds = 70 * 60 def imageTag='' int case_timeout_seconds = 10 * 60 def chart_version='4.1.8' pipeline { options { timestamps() timeout(time: total_timeout_minutes, unit: 'MINUTES') // buildDiscarder logRotator(artifa...
milvus/ci/jenkins/PRGPU.groovy/0
{ "file_path": "milvus/ci/jenkins/PRGPU.groovy", "repo_id": "milvus", "token_count": 8577 }
1,837
<jupyter_start><jupyter_text>How to fine-tune a T5 model with ONNX RuntimeThis notebook is largely inspired by the summarization [notebook of Transformers](https://github.com/huggingface/notebooks/blob/main/examples/summarization.ipynb) which takes PyTorch as backend for fine tuning.Here you will use the `ORTSeq2SeqTra...
notebooks/examples/summarization_ort.ipynb/0
{ "file_path": "notebooks/examples/summarization_ort.ipynb", "repo_id": "notebooks", "token_count": 6048 }
308
import { ChaindeskRetriever } from "@langchain/community/retrievers/chaindesk"; const retriever = new ChaindeskRetriever({ datastoreId: "DATASTORE_ID", apiKey: "CHAINDESK_API_KEY", // optional: needed for private datastores topK: 8, // optional: default value is 3 }); const docs = await retriever.getRelevantDoc...
langchainjs/examples/src/retrievers/chaindesk.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/chaindesk.ts", "repo_id": "langchainjs", "token_count": 118 }
819
from llama_index.core.vector_stores.types import BasePydanticVectorStore from llama_index.vector_stores.google import GoogleVectorStore def test_class(): names_of_base_classes = [b.__name__ for b in GoogleVectorStore.__mro__] assert BasePydanticVectorStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-google/tests/test_vector_stores_google.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-google/tests/test_vector_stores_google.py", "repo_id": "llama_index", "token_count": 97 }
1,484
python_tests()
llama_index/llama-index-packs/llama-index-packs-fusion-retriever/tests/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-fusion-retriever/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,844
""" ConViT Model @article{d2021convit, title={ConViT: Improving Vision Transformers with Soft Convolutional Inductive Biases}, author={d'Ascoli, St{\'e}phane and Touvron, Hugo and Leavitt, Matthew and Morcos, Ari and Biroli, Giulio and Sagun, Levent}, journal={arXiv preprint arXiv:2103.10697}, year={2021} } P...
pytorch-image-models/timm/models/convit.py/0
{ "file_path": "pytorch-image-models/timm/models/convit.py", "repo_id": "pytorch-image-models", "token_count": 7716 }
382
python_tests()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-zep/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-zep/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,545
# coding=utf-8 # Copyright 2020 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/prophetnet/convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/prophetnet/convert_prophetnet_original_pytorch_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 3107 }
730
// Code generated by mockery v2.32.4. DO NOT EDIT. package segments import ( schemapb "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" querypb "github.com/milvus-io/milvus/internal/proto/querypb" mock "github.com/stretchr/testify/mock" segcorepb "github.com/milvus-io/milvus/internal/proto/segcorepb" ) // ...
milvus/internal/querynodev2/segments/mock_collection_manager.go/0
{ "file_path": "milvus/internal/querynodev2/segments/mock_collection_manager.go", "repo_id": "milvus", "token_count": 2406 }
1,842
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/ko/api/pipelines/stable_diffusion/stable_diffusion_xl.md/0
{ "file_path": "diffusers/docs/source/ko/api/pipelines/stable_diffusion/stable_diffusion_xl.md", "repo_id": "diffusers", "token_count": 10987 }
187
<!--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/loading.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/loading.md", "repo_id": "diffusers", "token_count": 7191 }
191
"""Finetuning Engine.""" from abc import ABC, abstractmethod from typing import Any from llama_index.legacy.embeddings.base import BaseEmbedding from llama_index.legacy.llms.llm import LLM from llama_index.legacy.postprocessor import CohereRerank, SentenceTransformerRerank class BaseLLMFinetuneEngine(ABC): """B...
llama_index/llama-index-legacy/llama_index/legacy/finetuning/types.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/finetuning/types.py", "repo_id": "llama_index", "token_count": 610 }
1,493
from typing import Any, Dict, Generator, List from unittest.mock import MagicMock, patch import pytest from llama_index.legacy.core.llms.types import ( ChatMessage, MessageRole, ) from llama_index.legacy.llms.rungpt import RunGptLLM try: import sseclient except ImportError: sseclient = None def mock...
llama_index/llama-index-legacy/tests/llms/test_rungpt.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/llms/test_rungpt.py", "repo_id": "llama_index", "token_count": 4325 }
1,538
apiVersion: apps/v1 kind: Deployment metadata: name: minio-deployment namespace: chroma spec: selector: matchLabels: app: minio strategy: type: Recreate template: metadata: labels: app: minio spec: volumes: - name: minio emptyDir: {} containers...
chroma/k8s/test/minio.yaml/0
{ "file_path": "chroma/k8s/test/minio.yaml", "repo_id": "chroma", "token_count": 447 }
58
Condense Question Chat Engine ======================= .. automodule:: llama_index.core.chat_engine.condense_question :members: :inherited-members: .. :exclude-members: index_struct, query, set_llm_predictor, set_prompt_helper
llama_index/docs/api_reference/query/chat_engines/condense_question_chat_engine.rst/0
{ "file_path": "llama_index/docs/api_reference/query/chat_engines/condense_question_chat_engine.rst", "repo_id": "llama_index", "token_count": 81 }
1,032
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/quicktour.md/0
{ "file_path": "transformers/docs/source/en/quicktour.md", "repo_id": "transformers", "token_count": 8276 }
496
"""Logic for selecting examples to include in prompts.""" from langchain_core.example_selectors.base import BaseExampleSelector from langchain_core.example_selectors.length_based import ( LengthBasedExampleSelector, ) from langchain_core.example_selectors.semantic_similarity import ( MaxMarginalRelevanceExample...
langchain/libs/core/langchain_core/example_selectors/__init__.py/0
{ "file_path": "langchain/libs/core/langchain_core/example_selectors/__init__.py", "repo_id": "langchain", "token_count": 181 }
390
from llama_index.embeddings.langchain.base import LangchainEmbedding __all__ = ["LangchainEmbedding"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-langchain/llama_index/embeddings/langchain/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-langchain/llama_index/embeddings/langchain/__init__.py", "repo_id": "llama_index", "token_count": 35 }
1,249
python_sources() python_tests( name="tests", )
llama_index/llama-index-core/tests/storage/kvstore/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/storage/kvstore/BUILD", "repo_id": "llama_index", "token_count": 22 }
1,158
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "chat_models/fireworks", }); export * from "@langchain/community/chat_models/fireworks";
langchainjs/langchain/src/chat_models/fireworks.ts/0
{ "file_path": "langchainjs/langchain/src/chat_models/fireworks.ts", "repo_id": "langchainjs", "token_count": 74 }
899
# 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...
diffusers/src/diffusers/loaders/single_file_utils.py/0
{ "file_path": "diffusers/src/diffusers/loaders/single_file_utils.py", "repo_id": "diffusers", "token_count": 26629 }
233
import { FewShotPromptTemplate, PromptTemplate } from "@langchain/core/prompts"; import { examples } from "./examples.js"; const examplePrompt = PromptTemplate.fromTemplate( `User input: {input}\nSQL Query: {query}` ); const prompt = new FewShotPromptTemplate({ examples: examples.slice(0, 5), examplePrompt, p...
langchainjs/examples/src/use_cases/sql/prompting/few_shot.ts/0
{ "file_path": "langchainjs/examples/src/use_cases/sql/prompting/few_shot.ts", "repo_id": "langchainjs", "token_count": 503 }
854
interactions: - request: body: '{"input": [[8134], [2308], [43673]], "encoding_format": "base64"}' headers: Accept: - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive Content-Length: - '65' Content-Type: - application/json User-Age...
langchain/libs/community/tests/integration_tests/vectorstores/cassettes/test_weaviate/TestWeaviate.test_similarity_search_without_metadata.yaml/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/cassettes/test_weaviate/TestWeaviate.test_similarity_search_without_metadata.yaml", "repo_id": "langchain", "token_count": 22065 }
373
from typing import Any, List, Optional from urllib.parse import urljoin, urlparse from langchain_core.documents import Document from langchain_community.document_loaders.web_base import WebBaseLoader class GitbookLoader(WebBaseLoader): """Load `GitBook` data. 1. load from either a single page, or 2. lo...
langchain/libs/community/langchain_community/document_loaders/gitbook.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/gitbook.py", "repo_id": "langchain", "token_count": 1496 }
250
from langchain_community.document_loaders.trello import TrelloLoader __all__ = ["TrelloLoader"]
langchain/libs/langchain/langchain/document_loaders/trello.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/trello.py", "repo_id": "langchain", "token_count": 31 }
517
# 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/unets/test_models_unet_1d.py/0
{ "file_path": "diffusers/tests/models/unets/test_models_unet_1d.py", "repo_id": "diffusers", "token_count": 3985 }
265
from langchain_community.llms.llamacpp import LlamaCpp __all__ = ["LlamaCpp"]
langchain/libs/langchain/langchain/llms/llamacpp.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/llamacpp.py", "repo_id": "langchain", "token_count": 31 }
540
from llama_index.llms.portkey.base import Portkey __all__ = ["Portkey"]
llama_index/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/__init__.py", "repo_id": "llama_index", "token_count": 27 }
1,300
"""Multi-Modal Evaluation Modules.""" from llama_index.legacy.evaluation.multi_modal.faithfulness import ( MultiModalFaithfulnessEvaluator, ) from llama_index.legacy.evaluation.multi_modal.relevancy import ( MultiModalRelevancyEvaluator, ) __all__ = ["MultiModalRelevancyEvaluator", "MultiModalFaithfulnessEval...
llama_index/llama-index-legacy/llama_index/legacy/evaluation/multi_modal/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/evaluation/multi_modal/__init__.py", "repo_id": "llama_index", "token_count": 119 }
1,555
import { ChatMinimax } from "@langchain/community/chat_models/minimax"; import { HumanMessage } from "@langchain/core/messages"; const model = new ChatMinimax({ modelName: "abab5.5-chat", botSetting: [ { bot_name: "MM Assistant", content: "MM Assistant is an AI Assistant developed by minimax.", ...
langchainjs/examples/src/models/chat/minimax_plugins.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/minimax_plugins.ts", "repo_id": "langchainjs", "token_count": 338 }
834
from llama_index.embeddings.huggingface.base import ( HuggingFaceEmbedding, HuggingFaceInferenceAPIEmbedding, HuggingFaceInferenceAPIEmbeddings, ) __all__ = [ "HuggingFaceEmbedding", "HuggingFaceInferenceAPIEmbedding", "HuggingFaceInferenceAPIEmbeddings", ]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface/llama_index/embeddings/huggingface/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface/llama_index/embeddings/huggingface/__init__.py", "repo_id": "llama_index", "token_count": 115 }
1,187
// 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/mock/grpc_querynode_client.go/0
{ "file_path": "milvus/internal/util/mock/grpc_querynode_client.go", "repo_id": "milvus", "token_count": 2127 }
2,079
from enum import Enum class ResponseMode(str, Enum): """Response modes of the response builder (and synthesizer).""" REFINE = "refine" """ Refine is an iterative way of generating a response. We first use the context in the first node, along with the query, to generate an \ initial answer. ...
llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/type.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/type.py", "repo_id": "llama_index", "token_count": 604 }
1,711
from .reader_factory import create_reader from .img_extensions import *
pytorch-image-models/timm/data/readers/__init__.py/0
{ "file_path": "pytorch-image-models/timm/data/readers/__init__.py", "repo_id": "pytorch-image-models", "token_count": 20 }
387
# 이미지 밝기 조절하기 Stable Diffusion 파이프라인은 [일반적인 디퓨전 노이즈 스케줄과 샘플 단계에 결함이 있음](https://huggingface.co/papers/2305.08891) 논문에서 설명한 것처럼 매우 밝거나 어두운 이미지를 생성하는 데는 성능이 평범합니다. 이 논문에서 제안한 솔루션은 현재 [`DDIMScheduler`]에 구현되어 있으며 이미지의 밝기를 개선하는 데 사용할 수 있습니다. <Tip> 💡 제안된 솔루션에 대한 자세한 내용은 위에 링크된 논문을 참고하세요! </Tip> 해결책 중 하나는 *v 예측값*과 *v 로스...
diffusers/docs/source/ko/using-diffusers/control_brightness.md/0
{ "file_path": "diffusers/docs/source/ko/using-diffusers/control_brightness.md", "repo_id": "diffusers", "token_count": 1435 }
191
# 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 ...
transformers/tests/models/marian/test_modeling_marian.py/0
{ "file_path": "transformers/tests/models/marian/test_modeling_marian.py", "repo_id": "transformers", "token_count": 15311 }
795
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/src/query/PlanImpl.h/0
{ "file_path": "milvus/internal/core/src/query/PlanImpl.h", "repo_id": "milvus", "token_count": 893 }
1,651
# Slack >[Slack](https://slack.com/) is an instant messaging program. ## Installation and Setup There isn't any special setup for it. ## Document Loader See a [usage example](/docs/integrations/document_loaders/slack). ```python from langchain_community.document_loaders import SlackDirectoryLoader ```
langchain/docs/docs/integrations/providers/slack.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/slack.mdx", "repo_id": "langchain", "token_count": 92 }
148
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/unittest/test_index_wrapper.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_index_wrapper.cpp", "repo_id": "milvus", "token_count": 3176 }
1,767
{ "activation": "gelu", "attention_dropout": 0.1, "dim": 768, "dropout": 0.1, "hidden_dim": 3072, "initializer_range": 0.02, "max_position_embeddings": 512, "n_heads": 12, "n_layers": 6, "sinusoidal_pos_embds": true, "tie_weights_": true, "vocab_size": 30522 }
transformers/examples/research_projects/distillation/training_configs/distilbert-base-uncased.json/0
{ "file_path": "transformers/examples/research_projects/distillation/training_configs/distilbert-base-uncased.json", "repo_id": "transformers", "token_count": 134 }
599
import { ChatOpenAI } from "@langchain/openai"; // Use a model with a shorter context window const shorterLlm = new ChatOpenAI({ modelName: "gpt-3.5-turbo", maxRetries: 0, }); const longerLlm = new ChatOpenAI({ modelName: "gpt-3.5-turbo-16k", }); const modelWithFallback = shorterLlm.withFallbacks({ fallbacks...
langchainjs/examples/src/guides/fallbacks/long_inputs.ts/0
{ "file_path": "langchainjs/examples/src/guides/fallbacks/long_inputs.ts", "repo_id": "langchainjs", "token_count": 267 }
808
<!--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/pt/multilingual.md/0
{ "file_path": "transformers/docs/source/pt/multilingual.md", "repo_id": "transformers", "token_count": 3154 }
511
<jupyter_start><jupyter_text>Select by similarityThis object selects examples based on similarity to the inputs. It does this by finding the examples with the embeddings that have the greatest cosine similarity with the inputs.<jupyter_code>from langchain.prompts import FewShotPromptTemplate, PromptTemplate from langch...
langchain/docs/docs/modules/model_io/prompts/example_selector_types/similarity.ipynb/0
{ "file_path": "langchain/docs/docs/modules/model_io/prompts/example_selector_types/similarity.ipynb", "repo_id": "langchain", "token_count": 681 }
195
import importlib.util import logging import pickle from typing import Any, Callable, List, Mapping, Optional from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.pydantic_v1 import Extra from langchain_community.llms.utils import enforce...
langchain/libs/community/langchain_community/llms/self_hosted.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/self_hosted.py", "repo_id": "langchain", "token_count": 3408 }
268
from pathlib import Path from langchain_core._api import path HERE = Path(__file__).parent ROOT = HERE.parent.parent.parent def test_as_import_path() -> None: """Test that the path is converted to a LangChain import path.""" # Verify that default paths are correct assert path.PACKAGE_DIR == ROOT / "lan...
langchain/libs/core/tests/unit_tests/_api/test_path.py/0
{ "file_path": "langchain/libs/core/tests/unit_tests/_api/test_path.py", "repo_id": "langchain", "token_count": 282 }
442
--- sidebar_class_name: node-only --- import CodeBlock from "@theme/CodeBlock"; # USearch :::tip Compatibility Only available on Node.js. ::: [USearch](https://github.com/unum-cloud/usearch) is a library for efficient similarity search and clustering of dense vectors. ## Setup Install the [usearch](https://github...
langchainjs/docs/core_docs/docs/integrations/vectorstores/usearch.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/usearch.mdx", "repo_id": "langchainjs", "token_count": 341 }
731
""" CPAL Chain and its subchains """ from __future__ import annotations import json from typing import Any, ClassVar, Dict, List, Optional, Type from langchain.base_language import BaseLanguageModel from langchain.callbacks.manager import CallbackManagerForChainRun from langchain.chains.base import Chain from langcha...
langchain/libs/experimental/langchain_experimental/cpal/base.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/cpal/base.py", "repo_id": "langchain", "token_count": 4690 }
440
# LlamaIndex Evaluation Integration: Tonic Validate
llama_index/llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/README.md/0
{ "file_path": "llama_index/llama-index-integrations/evaluation/llama-index-evaluation-tonic-validate/README.md", "repo_id": "llama_index", "token_count": 12 }
1,259
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/indices/keyword_table/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/keyword_table/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,571
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-sbert-rerank/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-sbert-rerank/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,356
# 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/pipelines/dance_diffusion/pipeline_dance_diffusion.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/dance_diffusion/pipeline_dance_diffusion.py", "repo_id": "diffusers", "token_count": 2622 }
253
export const VECTOR_PREFIX = `You are an agent designed to answer questions about sets of documents. You have access to tools for interacting with the documents, and the inputs to the tools are questions. Sometimes, you will be asked to provide sources for your questions, in which case you should use the appropriate to...
langchainjs/langchain/src/agents/toolkits/vectorstore/prompt.ts/0
{ "file_path": "langchainjs/langchain/src/agents/toolkits/vectorstore/prompt.ts", "repo_id": "langchainjs", "token_count": 193 }
885
<jupyter_start><jupyter_text>Building Response Synthesis from ScratchIn this tutorial, we show you how to build the "LLM synthesis" component of a RAG pipeline from scratch. Given a set of retrieved Nodes, we'll show you how to synthesize a response even if the retrieved context overflows the context window.We'll walk ...
llama_index/docs/examples/low_level/response_synthesis.ipynb/0
{ "file_path": "llama_index/docs/examples/low_level/response_synthesis.ipynb", "repo_id": "llama_index", "token_count": 6074 }
1,113
syntax = "proto3"; package generate.v2; service TextGenerationService { /// Model Info rpc Info (InfoRequest) returns (InfoResponse) {} /// Service discovery rpc ServiceDiscovery (ServiceDiscoveryRequest) returns (ServiceDiscoveryResponse) {} /// Empties batch cache rpc ClearCache (ClearCacheR...
text-generation-inference/proto/generate.proto/0
{ "file_path": "text-generation-inference/proto/generate.proto", "repo_id": "text-generation-inference", "token_count": 2078 }
430
# InstructPix2Pix training example [InstructPix2Pix](https://arxiv.org/abs/2211.09800) is a method to fine-tune text-conditioned diffusion models such that they can follow an edit instruction for an input image. Models fine-tuned using this method take the following as inputs: <p align="center"> <img src="https:/...
diffusers/examples/instruct_pix2pix/README.md/0
{ "file_path": "diffusers/examples/instruct_pix2pix/README.md", "repo_id": "diffusers", "token_count": 2738 }
221
import { z } from "zod"; import { zodToJsonSchema } from "zod-to-json-schema"; import { ChatOpenAI } from "@langchain/openai"; import { JsonOutputFunctionsParser } from "langchain/output_parsers"; import { ChatPromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate, } from "@langchain/core/prompt...
langchainjs/examples/src/chains/openai_functions_structured_format.ts/0
{ "file_path": "langchainjs/examples/src/chains/openai_functions_structured_format.ts", "repo_id": "langchainjs", "token_count": 825 }
848
# serializer version: 1 # name: test_fallbacks[chain] ''' { "lc": 1, "type": "constructor", "id": [ "langchain", "schema", "runnable", "RunnableSequence" ], "kwargs": { "first": { "lc": 1, "type": "constructor", "id": [ "langchain",...
langchain/libs/core/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr/0
{ "file_path": "langchain/libs/core/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr", "repo_id": "langchain", "token_count": 5734 }
448
# 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/generation/tf_logits_process.py/0
{ "file_path": "transformers/src/transformers/generation/tf_logits_process.py", "repo_id": "transformers", "token_count": 12055 }
595
# Data Connectors (LlamaHub) ## Concept A data connector (aka `Reader`) ingest data from different data sources and data formats into a simple `Document` representation (text and simple metadata). ```{tip} Once you've ingested your data, you can build an [Index](/modules/indexing/indexing.md) on top, ask questions u...
llama_index/docs/module_guides/loading/connector/root.md/0
{ "file_path": "llama_index/docs/module_guides/loading/connector/root.md", "repo_id": "llama_index", "token_count": 580 }
1,144
#!/usr/bin/env bash # 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 r...
transformers/scripts/fsmt/convert-allenai-wmt19.sh/0
{ "file_path": "transformers/scripts/fsmt/convert-allenai-wmt19.sh", "repo_id": "transformers", "token_count": 950 }
565
[build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] [tool.codespell] check-filenames = true check-hidden = true skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb" [tool.llamahub] classes = ["Clarifai"] contains_example = false import_path = "llama_index.llms.clarifai" [tool.mypy...
llama_index/llama-index-integrations/llms/llama-index-llms-clarifai/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-clarifai/pyproject.toml", "repo_id": "llama_index", "token_count": 652 }
1,305
# LlamaIndex Llms Integration: Nvidia Tensorrt
llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/README.md", "repo_id": "llama_index", "token_count": 13 }
1,269
# SPDX-License-Identifier: Apache-2.0 # Copyright 2023 The HuggingFace Authors. from typing import Any, Dict, List, Optional, Union from huggingface_hub import HfFileSystem from . import config from .table import CastError from .utils.track import TrackedIterable, tracked_list, tracked_str class DatasetsError(Excep...
datasets/src/datasets/exceptions.py/0
{ "file_path": "datasets/src/datasets/exceptions.py", "repo_id": "datasets", "token_count": 1260 }
141
"""Test object index.""" from llama_index.core.indices.list.base import SummaryIndex from llama_index.core.objects.base import ObjectIndex from llama_index.core.objects.base_node_mapping import SimpleObjectNodeMapping from llama_index.core.objects.tool_node_mapping import SimpleToolNodeMapping from llama_index.core.se...
llama_index/llama-index-core/tests/objects/test_base.py/0
{ "file_path": "llama_index/llama-index-core/tests/objects/test_base.py", "repo_id": "llama_index", "token_count": 975 }
1,321
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use clap::{Parser, ValueEnum}; use candle::{DType, IndexOp, D}; use candle_nn::{Module, VarBuilder}; use candle_transformers::models::mobileone; #[derive(Clone, Copy, Debug, ValueEnum)] enum Which { S...
candle/candle-examples/examples/mobileone/main.rs/0
{ "file_path": "candle/candle-examples/examples/mobileone/main.rs", "repo_id": "candle", "token_count": 1206 }
43
# LlamaIndex Llms Integration: Together
llama_index/llama-index-integrations/llms/llama-index-llms-together/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-together/README.md", "repo_id": "llama_index", "token_count": 10 }
1,373
<jupyter_start><jupyter_text>Llama Pack - Resume Screener 📄This example shows you how to use the Resume Screener Llama Pack.You can find all packs on https://llamahub.aiThe resume screener is designed to analyze a candidate's resume according to a set of criteria, and decide whether the candidate is a fit for the job....
llama_index/docs/examples/llama_hub/llama_pack_resume.ipynb/0
{ "file_path": "llama_index/docs/examples/llama_hub/llama_pack_resume.ipynb", "repo_id": "llama_index", "token_count": 2066 }
1,124
"""Test azure openai embeddings.""" import os from typing import Any import numpy as np import openai import pytest from langchain_openai import AzureOpenAIEmbeddings OPENAI_API_VERSION = os.environ.get("AZURE_OPENAI_API_VERSION", "") OPENAI_API_BASE = os.environ.get("AZURE_OPENAI_API_BASE", "") OPENAI_API_KEY = os....
langchain/libs/partners/openai/tests/integration_tests/embeddings/test_azure.py/0
{ "file_path": "langchain/libs/partners/openai/tests/integration_tests/embeddings/test_azure.py", "repo_id": "langchain", "token_count": 1679 }
694
# MEP: Add collection level auto compaction config Current state: In Progress ISSUE: [[Enhancement]: Support collection level config to disable auto-compaction #23993](https://github.com/milvus-io/milvus/issues/23993) Keywords: Collection, Compaction, Config Released: N/A ## Summary Compaction has a config item ...
milvus/docs/design_docs/20230511-collection_level_autocompaction_switch.md/0
{ "file_path": "milvus/docs/design_docs/20230511-collection_level_autocompaction_switch.md", "repo_id": "milvus", "token_count": 360 }
1,768
# coding=utf-8 # Copyright 2022 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/deprecated/van/configuration_van.py/0
{ "file_path": "transformers/src/transformers/models/deprecated/van/configuration_van.py", "repo_id": "transformers", "token_count": 1853 }
603
from .base import Redis, RedisVectorStoreRetriever from .filters import ( RedisFilter, RedisNum, RedisTag, RedisText, ) __all__ = [ "Redis", "RedisFilter", "RedisTag", "RedisText", "RedisNum", "RedisVectorStoreRetriever", ]
langchain/libs/community/langchain_community/vectorstores/redis/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/redis/__init__.py", "repo_id": "langchain", "token_count": 122 }
331
<!--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/overview.md/0
{ "file_path": "diffusers/docs/source/en/training/overview.md", "repo_id": "diffusers", "token_count": 1545 }
182
from typing import TYPE_CHECKING from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_torch_available, is_transformers_available, ) _dummy_objects = {} _import_structure = {"pipeline_output": ["AnimateDiffPipelineOutput"]} try...
diffusers/src/diffusers/pipelines/animatediff/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/animatediff/__init__.py", "repo_id": "diffusers", "token_count": 612 }
241