text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from langchain_community.document_loaders.sharepoint import SharePointLoader __all__ = ["SharePointLoader"]
langchain/libs/langchain/langchain/document_loaders/sharepoint.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/sharepoint.py", "repo_id": "langchain", "token_count": 29 }
500
import argparse import json import os from typing import Optional import weaviate from langchain import load as langchain_load from langchain.agents import AgentExecutor, Tool from langchain.agents.openai_functions_agent.agent_token_buffer_memory import ( AgentTokenBufferMemory, ) from langchain.agents.openai_func...
chat-langchain/_scripts/evaluate_chains_agent.py/0
{ "file_path": "chat-langchain/_scripts/evaluate_chains_agent.py", "repo_id": "chat-langchain", "token_count": 3090 }
4
from langchain_core._api.path import as_import_path, get_relative_path __all__ = ["get_relative_path", "as_import_path"]
langchain/libs/langchain/langchain/_api/path.py/0
{ "file_path": "langchain/libs/langchain/langchain/_api/path.py", "repo_id": "langchain", "token_count": 42 }
435
use candle::{DType, IndexOp, Result, Tensor}; use candle_nn::{layer_norm, LayerNorm, Module, VarBuilder}; #[derive(Debug)] struct PatchEmbed { proj: candle_nn::Conv2d, span: tracing::Span, } impl PatchEmbed { fn new( in_chans: usize, embed_dim: usize, k_size: usize, stride:...
candle/candle-transformers/src/models/segment_anything/image_encoder.rs/0
{ "file_path": "candle/candle-transformers/src/models/segment_anything/image_encoder.rs", "repo_id": "candle", "token_count": 8848 }
76
<jupyter_start><jupyter_text>Dynamo DB Docstore DemoThis guide shows you how to directly use our `DocumentStore` abstraction backed by DynamoDB. By putting nodes in the docstore, this allows you to define multiple indices over the same underlying docstore, instead of duplicating data across indices. If you're opening t...
llama_index/docs/examples/docstore/DynamoDBDocstoreDemo.ipynb/0
{ "file_path": "llama_index/docs/examples/docstore/DynamoDBDocstoreDemo.ipynb", "repo_id": "llama_index", "token_count": 1685 }
1,056
import { test, expect } from "@jest/globals"; import { Document } from "@langchain/core/documents"; import { FakeEmbeddings } from "@langchain/core/utils/testing"; import { HNSWLib } from "../hnswlib.js"; test("Test HNSWLib.fromTexts + addVectors", async () => { const vectorStore = await HNSWLib.fromTexts( ["He...
langchainjs/libs/langchain-community/src/vectorstores/tests/hnswlib.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/hnswlib.test.ts", "repo_id": "langchainjs", "token_count": 706 }
1,087
from langchain_community.vectorstores.marqo import Marqo __all__ = ["Marqo"]
langchain/libs/langchain/langchain/vectorstores/marqo.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/marqo.py", "repo_id": "langchain", "token_count": 28 }
576
// 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/datanode/metrics_info.go/0
{ "file_path": "milvus/internal/datanode/metrics_info.go", "repo_id": "milvus", "token_count": 1576 }
1,789
"""Init params."""
llama_index/llama-index-legacy/tests/tools/tool_spec/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/tools/tool_spec/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,652
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/readers/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,516
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/llms/llama-index-llms-gradient/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-gradient/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,396
# A thin wrapper around the pulsar admin api import requests from chromadb.config import System from chromadb.ingest.impl.utils import parse_topic_name class PulsarAdmin: """A thin wrapper around the pulsar admin api, only used for interim development towards distributed chroma. This functionality will be mov...
chroma/chromadb/ingest/impl/pulsar_admin.py/0
{ "file_path": "chroma/chromadb/ingest/impl/pulsar_admin.py", "repo_id": "chroma", "token_count": 1301 }
16
<jupyter_start><jupyter_text>Unigram tokenizationNous gardons un modèle en anglais ici car il n'existe pas de modèle en français utilisant la tokenisation Unigram. Installez les bibliothèques 🤗 *Transformers* et 🤗 *Datasets* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece] c...
notebooks/course/fr/chapter6/section7.ipynb/0
{ "file_path": "notebooks/course/fr/chapter6/section7.ipynb", "repo_id": "notebooks", "token_count": 1959 }
291
python_sources()
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-langchain/llama_index/embeddings/langchain/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-langchain/llama_index/embeddings/langchain/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,233
<jupyter_start><jupyter_text>Pairwise EvaluatorThis notebook uses the `PairwiseEvaluator` module to see if an evaluation LLM would prefer one query engine over another.<jupyter_code>%pip install llama-index-llms-openai # attach to the same event-loop import nest_asyncio nest_asyncio.apply() # configuring logger to INF...
llama_index/docs/examples/evaluation/pairwise_eval.ipynb/0
{ "file_path": "llama_index/docs/examples/evaluation/pairwise_eval.ipynb", "repo_id": "llama_index", "token_count": 1480 }
1,118
<jupyter_start><jupyter_text>Finetuner un modèle avec l'API Trainer Installez les bibliothèques 🤗 Transformers et 🤗 Datasets pour exécuter ce notebook.<jupyter_code>!pip install datasets transformers[sentencepiece] from datasets import load_dataset from transformers import AutoTokenizer, DataCollatorWithPadding raw_...
notebooks/course/fr/chapter3/section3.ipynb/0
{ "file_path": "notebooks/course/fr/chapter3/section3.ipynb", "repo_id": "notebooks", "token_count": 754 }
285
/* eslint-disable @typescript-eslint/no-explicit-any */ import weaviate, { ApiKey } from "weaviate-ts-client"; import { WeaviateStore } from "@langchain/weaviate"; import { OpenAIEmbeddings } from "@langchain/openai"; export async function run() { // Something wrong with the weaviate-ts-client types, so we need to d...
langchainjs/examples/src/indexes/vector_stores/weaviate_mmr.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/weaviate_mmr.ts", "repo_id": "langchainjs", "token_count": 303 }
835
import urllib.request import xml.etree.ElementTree as ET from typing import List from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document from llama_index.readers.web.async_web.base import AsyncWebPageReader class SitemapReader(BaseReader): """Asynchronous sitemap reader ...
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/sitemap/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/sitemap/base.py", "repo_id": "llama_index", "token_count": 805 }
1,570
# flake8: noqa """Tools for interacting with a SQL database.""" from typing import Any, Dict, Optional, Sequence, Type, Union from sqlalchemy.engine import Result from langchain_core.pydantic_v1 import BaseModel, Field, root_validator from langchain_core.language_models import BaseLanguageModel from langchain_core.c...
langchain/libs/community/langchain_community/tools/sql_database/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/sql_database/tool.py", "repo_id": "langchain", "token_count": 1910 }
316
# Metric Card for seqeval ## Metric description seqeval is a Python framework for sequence labeling evaluation. seqeval can evaluate the performance of chunking tasks such as named-entity recognition, part-of-speech tagging, semantic role labeling and so on. ## How to use Seqeval produces labelling scores along ...
datasets/metrics/seqeval/README.md/0
{ "file_path": "datasets/metrics/seqeval/README.md", "repo_id": "datasets", "token_count": 2355 }
144
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/tuners/poly/config.py/0
{ "file_path": "peft/src/peft/tuners/poly/config.py", "repo_id": "peft", "token_count": 1408 }
326
poetry_requirements( name="poetry", module_mapping={"argilla": ["argilla_llama_index"]} )
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-argilla/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-argilla/BUILD", "repo_id": "llama_index", "token_count": 41 }
1,343
from langchain_community.agent_toolkits.openapi.toolkit import ( OpenAPIToolkit, RequestsToolkit, ) __all__ = ["RequestsToolkit", "OpenAPIToolkit"]
langchain/libs/langchain/langchain/agents/agent_toolkits/openapi/toolkit.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/openapi/toolkit.py", "repo_id": "langchain", "token_count": 60 }
461
from llama_index.core.readers.base import BaseReader from llama_index.readers.youtube_transcript import YoutubeTranscriptReader def test_class(): names_of_base_classes = [b.__name__ for b in YoutubeTranscriptReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/tests/test_readers_youtube_transcript.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/tests/test_readers_youtube_transcript.py", "repo_id": "llama_index", "token_count": 92 }
1,578
from pathlib import Path import pytest from langchain_community.document_loaders.mediawikidump import MWDumpLoader PARENT_DIR = Path(__file__).parent / "sample_documents" @pytest.mark.requires("mwparserfromhell", "mwxml") def test_loading_flawed_xml() -> None: loader = MWDumpLoader((PARENT_DIR / "mwtest_curren...
langchain/libs/community/tests/unit_tests/document_loaders/test_mediawikidump.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_mediawikidump.py", "repo_id": "langchain", "token_count": 565 }
370
from llama_index.program.openai.base import OpenAIPydanticProgram __all__ = ["OpenAIPydanticProgram"]
llama_index/llama-index-integrations/program/llama-index-program-openai/llama_index/program/openai/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/program/llama-index-program-openai/llama_index/program/openai/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,360
from typing import Dict, Tuple import pytest as pytest from langchain.chains.query_constructor.ir import ( Comparator, Comparison, Operation, Operator, StructuredQuery, ) from langchain.retrievers.self_query.timescalevector import TimescaleVectorTranslator DEFAULT_TRANSLATOR = TimescaleVectorTran...
langchain/libs/langchain/tests/unit_tests/retrievers/self_query/test_timescalevector.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/retrievers/self_query/test_timescalevector.py", "repo_id": "langchain", "token_count": 1198 }
613
import { OpenAI } from "@langchain/openai"; import { BufferMemory } from "langchain/memory"; import { LLMChain } from "langchain/chains"; import { PromptTemplate } from "@langchain/core/prompts"; const memory = new BufferMemory({ memoryKey: "chat_history" }); const model = new OpenAI({ temperature: 0.9 }); const promp...
langchainjs/examples/src/memory/buffer.ts/0
{ "file_path": "langchainjs/examples/src/memory/buffer.ts", "repo_id": "langchainjs", "token_count": 249 }
858
from llama_index.embeddings.clip.base import ClipEmbedding __all__ = ["ClipEmbedding"]
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-clip/llama_index/embeddings/clip/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-clip/llama_index/embeddings/clip/__init__.py", "repo_id": "llama_index", "token_count": 32 }
1,356
from rag_singlestoredb.chain import chain __all__ = ["chain"]
langchain/templates/rag-singlestoredb/rag_singlestoredb/__init__.py/0
{ "file_path": "langchain/templates/rag-singlestoredb/rag_singlestoredb/__init__.py", "repo_id": "langchain", "token_count": 21 }
672
import { loadPyodide, type PyodideInterface } from "pyodide"; import { Tool, ToolParams } from "@langchain/core/tools"; export type PythonInterpreterToolParams = Parameters<typeof loadPyodide>[0] & ToolParams & { instance: PyodideInterface; }; export class PythonInterpreterTool extends Tool { static lc_name...
langchainjs/langchain/src/experimental/tools/pyinterpreter.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/tools/pyinterpreter.ts", "repo_id": "langchainjs", "token_count": 2501 }
900
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { BaseChatMemory, BaseChatMemoryInput, } from "@langchain/community/memory/chat_memory"; import { InputValues, MemoryVariables, OutputValues, } from "@langchain/core/memory"; import { getBufferString } from "@langch...
langchainjs/langchain/src/memory/buffer_token_memory.ts/0
{ "file_path": "langchainjs/langchain/src/memory/buffer_token_memory.ts", "repo_id": "langchainjs", "token_count": 1247 }
892
<jupyter_start><jupyter_text>Réponses aux questions (PyTorch) Installez les bibliothèques 🤗 *Datasets* et 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece] !pip install accelerate # Pour exécuter l'entraînement sur TPU, vous devez décommenter la ligne suivant...
notebooks/course/fr/chapter7/section7_pt.ipynb/0
{ "file_path": "notebooks/course/fr/chapter7/section7_pt.ipynb", "repo_id": "notebooks", "token_count": 7562 }
311
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/pipelines/deepfloyd_if/test_if_img2img_superresolution.py/0
{ "file_path": "diffusers/tests/pipelines/deepfloyd_if/test_if_img2img_superresolution.py", "repo_id": "diffusers", "token_count": 2052 }
262
from __future__ import annotations import logging from contextlib import contextmanager from contextvars import ContextVar from typing import ( Generator, Optional, ) from langchain_core.tracers.context import register_configure_hook from langchain_community.callbacks.openai_info import OpenAICallbackHandler...
langchain/libs/community/langchain_community/callbacks/manager.py/0
{ "file_path": "langchain/libs/community/langchain_community/callbacks/manager.py", "repo_id": "langchain", "token_count": 799 }
236
# nvidia-rag-canonical This template performs RAG using Milvus Vector Store and NVIDIA Models (Embedding and Chat). ## Environment Setup You should export your NVIDIA API Key as an environment variable. If you do not have an NVIDIA API Key, you can create one by following these steps: 1. Create a free account with ...
langchain/templates/nvidia-rag-canonical/README.md/0
{ "file_path": "langchain/templates/nvidia-rag-canonical/README.md", "repo_id": "langchain", "token_count": 1274 }
667
# Weather >[OpenWeatherMap](https://openweathermap.org/) is an open-source weather service provider. ## Installation and Setup ```bash pip install pyowm ``` We must set up the `OpenWeatherMap API token`. ## Document Loader See a [usage example](/docs/integrations/document_loaders/weather). ```python from langc...
langchain/docs/docs/integrations/providers/weather.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/weather.mdx", "repo_id": "langchain", "token_count": 113 }
164
# Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor. # # 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....
datasets/metrics/mahalanobis/mahalanobis.py/0
{ "file_path": "datasets/metrics/mahalanobis/mahalanobis.py", "repo_id": "datasets", "token_count": 1363 }
121
from langchain_community.llms.gigachat import GigaChat __all__ = ["GigaChat"]
langchain/libs/langchain/langchain/llms/gigachat.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/gigachat.py", "repo_id": "langchain", "token_count": 29 }
515
import type { Config } from 'tailwindcss' const config: Config = { content: [ './pages/**/*.{js,ts,jsx,tsx,mdx}', './components/**/*.{js,ts,jsx,tsx,mdx}', './app/**/*.{js,ts,jsx,tsx,mdx}', ], theme: { extend: { backgroundImage: { 'gradient-radial': 'radial-gradient(var(--tw-gradient...
weblangchain/nextjs/tailwind.config.ts/0
{ "file_path": "weblangchain/nextjs/tailwind.config.ts", "repo_id": "weblangchain", "token_count": 233 }
2,213
import { PuppeteerWebBaseLoader } from "langchain/document_loaders/web/puppeteer"; const loaderWithOptions = new PuppeteerWebBaseLoader("https://langchain.com", { launchOptions: { headless: true, }, gotoOptions: { waitUntil: "domcontentloaded", }, }); const screenshot = await loaderWithOptions.screensh...
langchainjs/examples/src/document_loaders/puppeteer_screenshot_web.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/puppeteer_screenshot_web.ts", "repo_id": "langchainjs", "token_count": 110 }
810
import * as fs from "fs"; import * as path from "path"; import { fileURLToPath } from "url"; import { dirname } from "path"; import { OpenAIFiles } from "../index.js"; /** * Otherwise we got the error __dirname doesn't exist */ const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename);...
langchainjs/langchain/src/experimental/openai_files/tests/openai_file.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/openai_files/tests/openai_file.int.test.ts", "repo_id": "langchainjs", "token_count": 997 }
926
package grpccoordinator import ( "testing" "github.com/chroma/chroma-coordinator/internal/model" "github.com/chroma/chroma-coordinator/internal/proto/coordinatorpb" "github.com/chroma/chroma-coordinator/internal/types" "github.com/stretchr/testify/assert" ) func TestConvertCollectionMetadataToModel(t *testing.T...
chroma/go/coordinator/internal/grpccoordinator/proto_model_convert_test.go/0
{ "file_path": "chroma/go/coordinator/internal/grpccoordinator/proto_model_convert_test.go", "repo_id": "chroma", "token_count": 2743 }
48
services: db: image: ankane/pgvector ports: - 5432:5432 volumes: - ./data:/var/lib/postgresql/data environment: - POSTGRES_PASSWORD= - POSTGRES_USER= - POSTGRES_DB=
langchainjs/examples/src/indexes/vector_stores/prisma_vectorstore/docker-compose.example.yml/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/prisma_vectorstore/docker-compose.example.yml", "repo_id": "langchainjs", "token_count": 108 }
788
# coding=utf-8 # Copyright 2024 Stability AI and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE...
transformers/src/transformers/models/stablelm/configuration_stablelm.py/0
{ "file_path": "transformers/src/transformers/models/stablelm/configuration_stablelm.py", "repo_id": "transformers", "token_count": 3547 }
671
import { z } from "zod"; import { GmailBaseTool, GmailBaseToolParams } from "./base.js"; import { GET_MESSAGE_DESCRIPTION } from "./descriptions.js"; export class GmailSendMessage extends GmailBaseTool { name = "gmail_send_message"; schema = z.object({ message: z.string(), to: z.array(z.string()), sub...
langchainjs/libs/langchain-community/src/tools/gmail/send_message.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/tools/gmail/send_message.ts", "repo_id": "langchainjs", "token_count": 820 }
958
"""KonkoAI chat wrapper.""" from __future__ import annotations import logging import os import warnings from typing import ( Any, Dict, Iterator, List, Optional, Set, Tuple, Union, cast, ) import requests from langchain_core.callbacks import ( CallbackManagerForLLMRun, ) from l...
langchain/libs/community/langchain_community/chat_models/konko.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_models/konko.py", "repo_id": "langchain", "token_count": 4448 }
221
from __future__ import annotations import functools import uuid import warnings from itertools import islice from operator import itemgetter from typing import ( TYPE_CHECKING, Any, AsyncGenerator, Callable, Dict, Generator, Iterable, List, Optional, Sequence, Tuple, Typ...
langchain/libs/community/langchain_community/vectorstores/qdrant.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/qdrant.py", "repo_id": "langchain", "token_count": 42944 }
328
from llama_index.core.vector_stores.types import VectorStore from llama_index.vector_stores.myscale import MyScaleVectorStore def test_class(): names_of_base_classes = [b.__name__ for b in MyScaleVectorStore.__mro__] assert VectorStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-myscale/tests/test_vector_stores_myscale.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-myscale/tests/test_vector_stores_myscale.py", "repo_id": "llama_index", "token_count": 93 }
1,565
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/es/tasks/question_answering.md/0
{ "file_path": "transformers/docs/source/es/tasks/question_answering.md", "repo_id": "transformers", "token_count": 3895 }
507
from langchain_community.chat_models.bedrock import BedrockChat, ChatPromptAdapter __all__ = ["ChatPromptAdapter", "BedrockChat"]
langchain/libs/langchain/langchain/chat_models/bedrock.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/bedrock.py", "repo_id": "langchain", "token_count": 39 }
494
from llama_index.readers.spotify.base import SpotifyReader __all__ = ["SpotifyReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-spotify/llama_index/readers/spotify/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-spotify/llama_index/readers/spotify/__init__.py", "repo_id": "llama_index", "token_count": 28 }
1,459
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/src/segcore/Record.h/0
{ "file_path": "milvus/internal/core/src/segcore/Record.h", "repo_id": "milvus", "token_count": 371 }
1,764
python_tests()
llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-dynamodb/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/storage/index_store/llama-index-storage-index-store-dynamodb/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,459
<jupyter_start><jupyter_text>GPT Builder DemoInspired by GPTs interface, presented at OpenAI Dev Day 2023. Construct an agent with natural language.Here you can build your own agent...with another agent!<jupyter_code>%pip install llama-index-agent-openai %pip install llama-index-embeddings-openai %pip install llama-ind...
llama_index/docs/examples/agent/agent_builder.ipynb/0
{ "file_path": "llama_index/docs/examples/agent/agent_builder.ipynb", "repo_id": "llama_index", "token_count": 2385 }
1,067
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/src/peft/peft_model.py/0
{ "file_path": "peft/src/peft/peft_model.py", "repo_id": "peft", "token_count": 40340 }
322
import inspect import os import random import re from dataclasses import dataclass from typing import Callable, Dict, List, Optional, Union import torch from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer from diffusers import DiffusionPipeline from diffusers.configuration_utils import FrozenDic...
diffusers/examples/community/wildcard_stable_diffusion.py/0
{ "file_path": "diffusers/examples/community/wildcard_stable_diffusion.py", "repo_id": "diffusers", "token_count": 8987 }
212
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/util/importutil/import_options_test.go/0
{ "file_path": "milvus/internal/util/importutil/import_options_test.go", "repo_id": "milvus", "token_count": 1399 }
1,796
export { mapStoredMessagesToChatMessages, mapChatMessagesToStoredMessages, } from "@langchain/core/messages";
langchainjs/langchain/src/stores/message/utils.ts/0
{ "file_path": "langchainjs/langchain/src/stores/message/utils.ts", "repo_id": "langchainjs", "token_count": 39 }
1,020
from __future__ import annotations import pickle from pathlib import Path from typing import Any, Dict, Iterable, List, Optional from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever class TFIDFRetriever(...
langchain/libs/community/langchain_community/retrievers/tfidf.py/0
{ "file_path": "langchain/libs/community/langchain_community/retrievers/tfidf.py", "repo_id": "langchain", "token_count": 1866 }
288
# [The Hugging Face Deep Reinforcement Learning Course 🤗 (v2.0)](https://huggingface.co/deep-rl-course/unit0/introduction) <img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit0/thumbnail.jpg" alt="Thumbnail"/> If you like the course, don't hesitate to **⭐ star this ...
deep-rl-class/README.md/0
{ "file_path": "deep-rl-class/README.md", "repo_id": "deep-rl-class", "token_count": 388 }
158
import { Document } from "@langchain/core/documents"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; import { BaseDocumentLoader } from "../base.js"; /** * Interface representing a Figma file. It includes properties for the * file name, role, last modified date, editor type, thumbnail URL, * ve...
langchainjs/langchain/src/document_loaders/web/figma.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/web/figma.ts", "repo_id": "langchainjs", "token_count": 1169 }
884
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/sam.md/0
{ "file_path": "transformers/docs/source/en/model_doc/sam.md", "repo_id": "transformers", "token_count": 1871 }
486
<jupyter_start><jupyter_text>Twitter (via Apify)This notebook shows how to load chat messages from Twitter to fine-tune on. We do this by utilizing Apify. First, use Apify to export tweets. An example<jupyter_code>import json from langchain.adapters.openai import convert_message_to_dict from langchain.schema import AI...
langchain/docs/docs/integrations/chat_loaders/twitter.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/chat_loaders/twitter.ipynb", "repo_id": "langchain", "token_count": 306 }
100
package tasks const ( schedulePolicyNameFIFO = "fifo" schedulePolicyNameUserTaskPolling = "user-task-polling" ) // NewScheduler create a scheduler by policyName. func NewScheduler(policyName string) Scheduler { switch policyName { case "": fallthrough case schedulePolicyNameFIFO: return newSchedul...
milvus/internal/querynodev2/tasks/tasks.go/0
{ "file_path": "milvus/internal/querynodev2/tasks/tasks.go", "repo_id": "milvus", "token_count": 773 }
1,998
# LlamaIndex Vector_Stores Integration: Dashvector
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dashvector/README.md/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dashvector/README.md", "repo_id": "llama_index", "token_count": 13 }
1,521
# these stubs are just for backwards compatibility from langchain_core.utils.function_calling import ( FunctionDescription, ToolDescription, convert_pydantic_to_openai_function, convert_pydantic_to_openai_tool, ) __all__ = [ "FunctionDescription", "ToolDescription", "convert_pydantic_to_op...
langchain/libs/community/langchain_community/utils/openai_functions.py/0
{ "file_path": "langchain/libs/community/langchain_community/utils/openai_functions.py", "repo_id": "langchain", "token_count": 138 }
305
import { DataSource } from "typeorm"; import { SqlDatabase } from "langchain/sql_db"; import { ChatOpenAI } from "@langchain/openai"; import { RunnablePassthrough, RunnableSequence, } from "@langchain/core/runnables"; import { PromptTemplate } from "@langchain/core/prompts"; import { StringOutputParser } from "@lan...
langchainjs/examples/src/guides/expression_language/cookbook_sql_db.ts/0
{ "file_path": "langchainjs/examples/src/guides/expression_language/cookbook_sql_db.ts", "repo_id": "langchainjs", "token_count": 721 }
794
.PHONY: deps_table_update modified_only_fixup extra_style_checks quality style fixup fix-copies test test-examples # make sure to test the local checkout in scripts and not the pre-installed one (don't use quotes!) export PYTHONPATH = src check_dirs := examples scripts src tests utils benchmarks modified_only_fixup:...
diffusers/Makefile/0
{ "file_path": "diffusers/Makefile", "repo_id": "diffusers", "token_count": 889 }
170
--- sidebar_class_name: hidden --- import CodeBlock from "@theme/CodeBlock"; import TimeoutExample from "@examples/agents/agent_timeout.ts"; # Timeouts for agents By default, LangChain will wait indefinitely for a response from the model provider. If you want to add a timeout to an agent, you can pass a `timeout` op...
langchainjs/docs/core_docs/docs/modules/agents/how_to/timeouts.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/agents/how_to/timeouts.mdx", "repo_id": "langchainjs", "token_count": 179 }
749
version: "3" services: redis: container_name: opengpts-redis image: redis/redis-stack-server:latest ports: - "6379:6379" volumes: - ./redis-volume:/data backend: container_name: opengpts-backend image: docker.io/langchain/open-gpts:latest ports: - "8100:8000" # Backend...
opengpts/docker-compose-prod.yml/0
{ "file_path": "opengpts/docker-compose-prod.yml", "repo_id": "opengpts", "token_count": 227 }
1,996
// 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/importutilv2/binlog/util.go/0
{ "file_path": "milvus/internal/util/importutilv2/binlog/util.go", "repo_id": "milvus", "token_count": 1444 }
1,901
"""Util that Searches calendar events in Office 365. Free, but setup is required. See link below. https://learn.microsoft.com/en-us/graph/auth/ """ from datetime import datetime as dt from typing import Any, Dict, List, Optional, Type from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core...
langchain/libs/community/langchain_community/tools/office365/events_search.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/office365/events_search.py", "repo_id": "langchain", "token_count": 1964 }
314
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/tools/llama-index-tools-neo4j/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-neo4j/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,574
import os from pathlib import Path from langchain.chains.openai_functions.openapi import get_openapi_chain def test_openai_opeanapi() -> None: chain = get_openapi_chain( "https://www.klarna.com/us/shopping/public/openai/v0/api-docs/" ) output = chain.run("What are some options for a men's large b...
langchain/libs/langchain/tests/integration_tests/chains/openai_functions/test_openapi.py/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/chains/openai_functions/test_openapi.py", "repo_id": "langchain", "token_count": 321 }
637
[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 = ["SlackToolSpec"] contains_example = false import_path = "llama_index.tools.slack" [tool.m...
llama_index/llama-index-integrations/tools/llama-index-tools-slack/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-slack/pyproject.toml", "repo_id": "llama_index", "token_count": 662 }
1,455
export { type DocumentInput, Document } from "@langchain/core/documents";
langchainjs/langchain/src/document.ts/0
{ "file_path": "langchainjs/langchain/src/document.ts", "repo_id": "langchainjs", "token_count": 19 }
937
# How Huggy works [[how-huggy-works]] Huggy is a Deep Reinforcement Learning environment made by Hugging Face and based on [Puppo the Corgi, a project by the Unity MLAgents team](https://blog.unity.com/technology/puppo-the-corgi-cuteness-overload-with-the-unity-ml-agents-toolkit). This environment was created using th...
deep-rl-class/units/en/unitbonus1/how-huggy-works.mdx/0
{ "file_path": "deep-rl-class/units/en/unitbonus1/how-huggy-works.mdx", "repo_id": "deep-rl-class", "token_count": 1245 }
170
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/tasks/asr.md/0
{ "file_path": "transformers/docs/source/en/tasks/asr.md", "repo_id": "transformers", "token_count": 5105 }
528
import '@/styles/globals.css' import type { AppProps } from 'next/app' export default function App({ Component, pageProps }: AppProps) { return <Component {...pageProps} /> }
langchainjs/environment_tests/test-exports-vercel/src/pages/_app.tsx/0
{ "file_path": "langchainjs/environment_tests/test-exports-vercel/src/pages/_app.tsx", "repo_id": "langchainjs", "token_count": 60 }
806
[build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] [tool.codespell] check-filenames = true check-hidden = true # Feel free to un-skip examples, and experimental, you will just need to # work through many typos (--write-changes and --interactive will help) skip = "*.csv,*.html,*.json,*....
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-presidio/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-presidio/pyproject.toml", "repo_id": "llama_index", "token_count": 714 }
1,388
#!/usr/bin/env python # 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/LI...
diffusers/examples/research_projects/consistency_training/train_cm_ct_unconditional.py/0
{ "file_path": "diffusers/examples/research_projects/consistency_training/train_cm_ct_unconditional.py", "repo_id": "diffusers", "token_count": 26288 }
210
package coordinator import ( "context" "github.com/chroma/chroma-coordinator/internal/common" "github.com/chroma/chroma-coordinator/internal/metastore" "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel" "github.com/chroma/chroma-coordinator/internal/model" "github.com/chroma/chroma-coordinator...
chroma/go/coordinator/internal/metastore/coordinator/table_catalog.go/0
{ "file_path": "chroma/go/coordinator/internal/metastore/coordinator/table_catalog.go", "repo_id": "chroma", "token_count": 6871 }
47
# 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/tests/models/vits/test_modeling_vits.py/0
{ "file_path": "transformers/tests/models/vits/test_modeling_vits.py", "repo_id": "transformers", "token_count": 8429 }
822
# The Deep Q-Learning Algorithm [[deep-q-algorithm]] We learned that Deep Q-Learning **uses a deep neural network to approximate the different Q-values for each possible action at a state** (value-function estimation). The difference is that, during the training phase, instead of updating the Q-value of a state-actio...
deep-rl-class/units/en/unit3/deep-q-algorithm.mdx/0
{ "file_path": "deep-rl-class/units/en/unit3/deep-q-algorithm.mdx", "repo_id": "deep-rl-class", "token_count": 2281 }
178
import argparse import torch import yaml from diffusers import DDIMScheduler, LDMPipeline, UNetLDMModel, VQModel def convert_ldm_original(checkpoint_path, config_path, output_path): config = yaml.safe_load(config_path) state_dict = torch.load(checkpoint_path, map_location="cpu")["model"] keys = list(sta...
diffusers/scripts/conversion_ldm_uncond.py/0
{ "file_path": "diffusers/scripts/conversion_ldm_uncond.py", "repo_id": "diffusers", "token_count": 793 }
224
import { ChatOpenAI } from "@langchain/openai"; import { initializeAgentExecutorWithOptions } from "langchain/agents"; import { DiscordSendMessagesTool } from "@langchain/community/tools/discord"; import { DadJokeAPI } from "@langchain/community/tools/dadjokeapi"; const model = new ChatOpenAI({ temperature: 0, }); ...
langchainjs/examples/src/agents/discord.ts/0
{ "file_path": "langchainjs/examples/src/agents/discord.ts", "repo_id": "langchainjs", "token_count": 210 }
753
from concurrent.futures import ThreadPoolExecutor from unittest.mock import MagicMock from langsmith import run_trees from langsmith.client import Client def test_run_tree_accepts_tpe() -> None: mock_client = MagicMock(spec=Client) run_trees.RunTree( name="My Chat Bot", inputs={"text": "Summa...
langsmith-sdk/python/tests/unit_tests/test_run_trees.py/0
{ "file_path": "langsmith-sdk/python/tests/unit_tests/test_run_trees.py", "repo_id": "langsmith-sdk", "token_count": 161 }
1,028
"""Map-reduce chain. Splits up a document, sends the smaller parts to the LLM with one prompt, then combines the results with another one. """ from __future__ import annotations from typing import Any, Dict, List, Mapping, Optional from langchain_core.callbacks import CallbackManagerForChainRun, Callbacks from langc...
langchain/libs/langchain/langchain/chains/mapreduce.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/mapreduce.py", "repo_id": "langchain", "token_count": 1511 }
484
<!--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/ja/model_doc/deta.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/deta.md", "repo_id": "transformers", "token_count": 1894 }
484
import { OpenAI } from "@langchain/openai"; import { loadSummarizationChain, AnalyzeDocumentChain } from "langchain/chains"; import * as fs from "fs"; // In this example, we use the `AnalyzeDocumentChain` to summarize a large text document. const text = fs.readFileSync("state_of_the_union.txt", "utf8"); const model = ...
langchainjs/examples/src/chains/analyze_document_chain_summarize.ts/0
{ "file_path": "langchainjs/examples/src/chains/analyze_document_chain_summarize.ts", "repo_id": "langchainjs", "token_count": 314 }
798
import unittest from typing import Any from unittest.mock import patch import pytest import requests_mock from requests_mock.mocker import Mocker from langchain_community.document_loaders.lakefs import LakeFSLoader @pytest.fixture def mock_lakefs_client() -> Any: with patch( "langchain_community.documen...
langchain/libs/community/tests/integration_tests/document_loaders/test_lakefs.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_lakefs.py", "repo_id": "langchain", "token_count": 1089 }
342
<!--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/ko/autoclass_tutorial.md/0
{ "file_path": "transformers/docs/source/ko/autoclass_tutorial.md", "repo_id": "transformers", "token_count": 5222 }
551
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 60, "prefill": [ { "id": 589, "logprob": null, "text": "def" }, { "id": 1459, "logprob": -5.6328125, "text": " print" }, { "id"...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_starcoder/test_flash_starcoder_default_params.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_starcoder/test_flash_starcoder_default_params.json", "repo_id": "text-generation-inference", "token_count": 4734 }
402
from langchain_community.chat_models.minimax import ( MiniMaxChat, ) __all__ = ["MiniMaxChat"]
langchain/libs/langchain/langchain/chat_models/minimax.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/minimax.py", "repo_id": "langchain", "token_count": 37 }
496
# coding=utf-8 # Copyright 2023 The BigCode team and 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 requi...
transformers/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py/0
{ "file_path": "transformers/src/transformers/models/gpt_bigcode/configuration_gpt_bigcode.py", "repo_id": "transformers", "token_count": 2533 }
678
<jupyter_start><jupyter_text>Derrière le pipeline (TensorFlow) Installez la bibliothèque 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install transformers[sentencepiece] from transformers import pipeline classifier = pipeline("sentiment-analysis", model="tblard/tf-allocine") classifier( ["J'ai ...
notebooks/course/fr/chapter2/section2_tf.ipynb/0
{ "file_path": "notebooks/course/fr/chapter2/section2_tf.ipynb", "repo_id": "notebooks", "token_count": 473 }
292
import { TextServiceClient } from "@google-ai/generativelanguage"; import { GoogleAuth } from "google-auth-library"; import { Embeddings, EmbeddingsParams } from "@langchain/core/embeddings"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; /** * Interface that extends EmbeddingsParams and defines ...
langchainjs/libs/langchain-community/src/embeddings/googlepalm.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/embeddings/googlepalm.ts", "repo_id": "langchainjs", "token_count": 1084 }
966
"""PubMed API toolkit."""
langchain/libs/langchain/langchain/tools/pubmed/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/pubmed/__init__.py", "repo_id": "langchain", "token_count": 9 }
587
from __future__ import annotations import json from typing import Any, Dict, List, Optional from langchain_core.callbacks import CallbackManagerForChainRun from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts import BasePromptTemplate from langchain_core.pydantic_v1 import Field f...
langchain/libs/langchain/langchain/chains/qa_generation/base.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/qa_generation/base.py", "repo_id": "langchain", "token_count": 968 }
472