text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
"""All unit tests for LLM objects."""
| langchain/libs/community/tests/unit_tests/llms/__init__.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/llms/__init__.py",
"repo_id": "langchain",
"token_count": 11
} | 417 |
# flake8: noqa
from langchain_core.prompts.prompt import PromptTemplate
_DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE = """You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update the summary of the provided entity in the "Entity" section based on the last ... | langchain/libs/langchain/langchain/indexes/prompts/entity_summarization.py/0 | {
"file_path": "langchain/libs/langchain/langchain/indexes/prompts/entity_summarization.py",
"repo_id": "langchain",
"token_count": 298
} | 534 |
//! Recurrent Neural Networks
use candle::{DType, Device, IndexOp, Result, Tensor};
/// Trait for Recurrent Neural Networks.
#[allow(clippy::upper_case_acronyms)]
pub trait RNN {
type State: Clone;
/// A zero state from which the recurrent network is usually initialized.
fn zero_state(&self, batch_dim: us... | candle/candle-nn/src/rnn.rs/0 | {
"file_path": "candle/candle-nn/src/rnn.rs",
"repo_id": "candle",
"token_count": 4874
} | 61 |
import { DataSource } from "typeorm";
import { OpenAI } from "@langchain/openai";
import { SqlDatabase } from "langchain/sql_db";
import { SqlDatabaseChain } from "langchain/chains/sql_db";
import { PromptTemplate } from "@langchain/core/prompts";
const template = `Given an input question, first create a syntactically... | langchainjs/examples/src/chains/sql_db_custom_prompt.ts/0 | {
"file_path": "langchainjs/examples/src/chains/sql_db_custom_prompt.ts",
"repo_id": "langchainjs",
"token_count": 467
} | 780 |
from langchain_community.tools.merriam_webster.tool import MerriamWebsterQueryRun
__all__ = ["MerriamWebsterQueryRun"]
| langchain/libs/langchain/langchain/tools/merriam_webster/tool.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/merriam_webster/tool.py",
"repo_id": "langchain",
"token_count": 40
} | 551 |
import { ChatOpenAI } from "@langchain/openai";
import { BytesOutputParser } from "@langchain/core/output_parsers";
const handler = async () => {
const parser = new BytesOutputParser();
const model = new ChatOpenAI({ temperature: 0 });
const stream = await model.pipe(parser).stream("Hello there!");
const ht... | langchainjs/examples/src/prompts/bytes_output_parser.ts/0 | {
"file_path": "langchainjs/examples/src/prompts/bytes_output_parser.ts",
"repo_id": "langchainjs",
"token_count": 152
} | 811 |
{
"name": "chromadb",
"version": "1.8.1",
"description": "A JavaScript interface for chroma",
"keywords": [],
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"@openapi-generator-plus/typescript-fetch-client-generator": "^1.5.0",
"@types/jest": "^29.5.0",
"@types/node": "^20.8.10",
... | chroma/clients/js/package.json/0 | {
"file_path": "chroma/clients/js/package.json",
"repo_id": "chroma",
"token_count": 2147
} | 30 |
from langchain_community.callbacks.promptlayer_callback import (
PromptLayerCallbackHandler,
)
__all__ = ["PromptLayerCallbackHandler"]
| langchain/libs/langchain/langchain/callbacks/promptlayer_callback.py/0 | {
"file_path": "langchain/libs/langchain/langchain/callbacks/promptlayer_callback.py",
"repo_id": "langchain",
"token_count": 41
} | 481 |
from unittest.mock import patch
import pyspark
from datasets.packaged_modules.spark.spark import (
Spark,
SparkExamplesIterable,
_generate_iterable_examples,
)
from ..utils import (
require_dill_gt_0_3_2,
require_not_windows,
)
def _get_expected_row_ids_and_row_dicts_for_partition_order(df, par... | datasets/tests/packaged_modules/test_spark.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_spark.py",
"repo_id": "datasets",
"token_count": 2054
} | 149 |
# coding=utf-8
# Copyright 2022 The Trajectory Transformers paper authors 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://ww... | transformers/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py/0 | {
"file_path": "transformers/src/transformers/models/deprecated/trajectory_transformer/modeling_trajectory_transformer.py",
"repo_id": "transformers",
"token_count": 11094
} | 631 |
// 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/datacoord/broker/coordinator_broker.go/0 | {
"file_path": "milvus/internal/datacoord/broker/coordinator_broker.go",
"repo_id": "milvus",
"token_count": 1974
} | 1,761 |
"""Test Xata chat memory store functionality.
Before running this test, please create a Xata database.
"""
import json
import os
from langchain_community.chat_message_histories import XataChatMessageHistory
from langchain_core.messages import message_to_dict
from langchain.memory import ConversationBufferMemory
c... | langchain/libs/langchain/tests/integration_tests/memory/test_xata.py/0 | {
"file_path": "langchain/libs/langchain/tests/integration_tests/memory/test_xata.py",
"repo_id": "langchain",
"token_count": 582
} | 641 |
import nbformat
import os
import re
import shutil
# Paths are set to work by invoking this scrip from the notebooks repo, presuming the transformers repo is in the
# same parent folder as the notebooks repo.
PATH_TO_DOCS = '../transformers/docs/source'
PATH_TO_DEST = 'transformers_doc'
DOC_BASE_URL = "https://huggingf... | notebooks/utils/convert_doc_to_notebooks.py/0 | {
"file_path": "notebooks/utils/convert_doc_to_notebooks.py",
"repo_id": "notebooks",
"token_count": 7880
} | 304 |
# Troubleshooting
This is a document explaining how to deal with various issues on Circle-CI. The entries may include actual solutions or pointers to Issues that cover those.
## Circle CI
* pytest worker runs out of resident RAM and gets killed by `cgroups`: https://github.com/huggingface/transformers/issues/11408
| transformers/.circleci/TROUBLESHOOT.md/0 | {
"file_path": "transformers/.circleci/TROUBLESHOOT.md",
"repo_id": "transformers",
"token_count": 80
} | 438 |
from langchain_community.llms.gpt4all import GPT4All
__all__ = ["GPT4All"]
| langchain/libs/langchain/langchain/llms/gpt4all.py/0 | {
"file_path": "langchain/libs/langchain/langchain/llms/gpt4all.py",
"repo_id": "langchain",
"token_count": 31
} | 513 |
<jupyter_start><jupyter_text>Zapier Natural Language Actions**Deprecated** This API will be sunset on 2023-11-17: https://nla.zapier.com/start/ >[Zapier Natural Language Actions](https://nla.zapier.com/start/) gives you access to the 5k+ apps, 20k+ actions on Zapier's platform through a natural language API interface.>... | langchain/docs/docs/integrations/tools/zapier.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/tools/zapier.ipynb",
"repo_id": "langchain",
"token_count": 2904
} | 191 |
<jupyter_start><jupyter_text>Sentence Window Retrieval PackThis LlamaPack provides an example of our sentence window retriever.<jupyter_code>import nest_asyncio
nest_asyncio.apply()<jupyter_output><empty_output><jupyter_text>Setup Data<jupyter_code>!wget "https://www.dropbox.com/s/f6bmb19xdg0xedm/paul_graham_essay.txt... | llama_index/llama-index-packs/llama-index-packs-sentence-window-retriever/examples/sentence_window.ipynb/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-sentence-window-retriever/examples/sentence_window.ipynb",
"repo_id": "llama_index",
"token_count": 869
} | 1,605 |
# JSON
>[JSON (JavaScript Object Notation)](https://en.wikipedia.org/wiki/JSON) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other serializable values).
>[JSON Lines](https://jsonlines.or... | langchain/docs/docs/modules/data_connection/document_loaders/json.mdx/0 | {
"file_path": "langchain/docs/docs/modules/data_connection/document_loaders/json.mdx",
"repo_id": "langchain",
"token_count": 6533
} | 205 |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/hubert/test_modeling_tf_hubert.py/0 | {
"file_path": "transformers/tests/models/hubert/test_modeling_tf_hubert.py",
"repo_id": "transformers",
"token_count": 12352
} | 804 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-falkordb/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-falkordb/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,263 |
<!--Copyright 2021 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | accelerate/docs/source/package_reference/torch_wrappers.md/0 | {
"file_path": "accelerate/docs/source/package_reference/torch_wrappers.md",
"repo_id": "accelerate",
"token_count": 381
} | 4 |
insert_flush_performance:
collections:
-
server:
db_config.primary_path: /test/milvus/db_data_011/sift_2m_128_128_l2_flush
cache_config.cpu_cache_capacity: 8
cache_config.insert_buffer_size: 2
engine_config.use_blas_threshold: 1100
engine_config.gpu_search_threshold:... | milvus/tests/benchmark/milvus_benchmark/suites/011_add_flush_performance.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_add_flush_performance.yaml",
"repo_id": "milvus",
"token_count": 334
} | 1,998 |
"""Init file of LlamaIndex."""
import logging
from logging import NullHandler
from typing import Callable, Optional
# response
from llama_index.core.base.response.schema import Response
# import global eval handler
from llama_index.core.callbacks.global_handlers import set_global_handler
from llama_index.core.data_s... | llama_index/llama-index-core/llama_index/core/__init__.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/__init__.py",
"repo_id": "llama_index",
"token_count": 1421
} | 1,159 |
# Supported Models and Hardware
Text Generation Inference enables serving optimized models on specific hardware for the highest performance. The following sections list which models are hardware are supported.
## Supported Models
The following models are optimized and can be served with TGI, which uses custom CUDA k... | text-generation-inference/docs/source/supported_models.md/0 | {
"file_path": "text-generation-inference/docs/source/supported_models.md",
"repo_id": "text-generation-inference",
"token_count": 1170
} | 372 |
import { AgentAction, AgentFinish } from "@langchain/core/agents";
import { renderTemplate } from "@langchain/core/prompts";
import { AgentActionOutputParser } from "../types.js";
import { FORMAT_INSTRUCTIONS } from "./prompt.js";
const FINAL_ANSWER_ACTION = "Final Answer:";
const FINAL_ANSWER_AND_PARSABLE_ACTION_ERRO... | langchainjs/langchain/src/agents/react/output_parser.ts/0 | {
"file_path": "langchainjs/langchain/src/agents/react/output_parser.ts",
"repo_id": "langchainjs",
"token_count": 1179
} | 880 |
import { expect, test } from "@jest/globals";
import { GoogleBaseLLM, GoogleBaseLLMInput } from "../llms.js";
import {
authOptions,
MockClient,
MockClientAuthInfo,
mockFile,
mockId,
} from "./mock.js";
class GoogleLLM extends GoogleBaseLLM<MockClientAuthInfo> {
constructor(fields?: GoogleBaseLLMInput<MockC... | langchainjs/libs/langchain-google-common/src/tests/llms.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-google-common/src/tests/llms.test.ts",
"repo_id": "langchainjs",
"token_count": 2918
} | 1,016 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/tools/tool_spec/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/tools/tool_spec/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,606 |
import { HumanMessage } from "@langchain/core/messages";
import { ChatPromptTemplate } from "@langchain/core/prompts";
import fs from "node:fs/promises";
const hotdogImage = await fs.readFile("hotdog.jpg");
const base64Image = hotdogImage.toString("base64");
const imageURL = "https://avatars.githubusercontent.com/u/1... | langchainjs/examples/src/prompts/multi_modal.ts/0 | {
"file_path": "langchainjs/examples/src/prompts/multi_modal.ts",
"repo_id": "langchainjs",
"token_count": 850
} | 879 |
python_sources()
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-redis/llama_index/vector_stores/redis/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,534 |
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.embeddings.voyageai import VoyageEmbedding
def test_embedding_class():
emb = VoyageEmbedding(model_name="")
assert isinstance(emb, BaseEmbedding)
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/tests/test_embeddings_voyageai.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/tests/test_embeddings_voyageai.py",
"repo_id": "llama_index",
"token_count": 83
} | 1,326 |
<jupyter_start><jupyter_text>Flashrank RerankerThis notebook shows how to use [flashrank](https://github.com/PrithivirajDamodaran/FlashRank) for document compression and retrieval.<jupyter_code>% pip install --upgrade --quiet flashrank
% pip install --upgrade --quiet faiss
# OR (depending on Python version)
% pip ... | langchain/docs/docs/integrations/retrievers/flashrank-reranker.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/retrievers/flashrank-reranker.ipynb",
"repo_id": "langchain",
"token_count": 1331
} | 157 |
""" Normalization + Activation Layers
Provides Norm+Act fns for standard PyTorch norm layers such as
* BatchNorm
* GroupNorm
* LayerNorm
This allows swapping with alternative layers that are natively both norm + act such as
* EvoNorm (evo_norm.py)
* FilterResponseNorm (filter_response_norm.py)
* InplaceABN (inplace_a... | pytorch-image-models/timm/layers/norm_act.py/0 | {
"file_path": "pytorch-image-models/timm/layers/norm_act.py",
"repo_id": "pytorch-image-models",
"token_count": 8051
} | 366 |
import { z } from "zod";
import { OpenAI } from "@langchain/openai";
import { StructuredOutputParser } from "langchain/output_parsers";
import { PromptTemplate } from "@langchain/core/prompts";
// We can use zod to define a schema for the output using the `fromZodSchema` method of `StructuredOutputParser`.
const parse... | langchainjs/examples/src/prompts/structured_parser_zod.ts/0 | {
"file_path": "langchainjs/examples/src/prompts/structured_parser_zod.ts",
"repo_id": "langchainjs",
"token_count": 656
} | 910 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/stable_diffusion/test_stable_diffusion.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion/test_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 25619
} | 272 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.macrometa_gdn import MacrometaGDNReader
def test_class():
names_of_base_classes = [b.__name__ for b in MacrometaGDNReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/tests/test_readers_macrometa_gdn.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/tests/test_readers_macrometa_gdn.py",
"repo_id": "llama_index",
"token_count": 98
} | 1,375 |
# Awesome projects built with Transformers
This page lists awesome projects built on top of Transformers. Transformers is more than a toolkit to use pretrained
models: it's a community of projects built around it and the Hugging Face Hub. We want Transformers to enable
developers, researchers, students, professors, en... | transformers/awesome-transformers.md/0 | {
"file_path": "transformers/awesome-transformers.md",
"repo_id": "transformers",
"token_count": 10233
} | 440 |
module github.com/chroma/chroma-coordinator
go 1.20
require (
ariga.io/atlas-provider-gorm v0.1.1
github.com/apache/pulsar-client-go v0.9.1-0.20231030094548-620ecf4addfb
github.com/google/uuid v1.3.1
github.com/pingcap/log v1.1.0
github.com/rs/zerolog v1.31.0
github.com/spf13/cobra v1.7.0
github.com/stretchr/t... | chroma/go/coordinator/go.mod/0 | {
"file_path": "chroma/go/coordinator/go.mod",
"repo_id": "chroma",
"token_count": 2280
} | 41 |
[
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [
{
"id": 14402,
"logprob": null,
"text": "Test"
},
{
"id": 2581,
"logprob": -11.6171875,
"text": " ... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_phi/test_flash_phi_load.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_phi/test_flash_phi_load.json",
"repo_id": "text-generation-inference",
"token_count": 4672
} | 425 |
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import React from "react";
import { Redirect } from "@docusaurus/router";
export default function Home() {
retu... | langchainjs/docs/core_docs/src/pages/index.js/0 | {
"file_path": "langchainjs/docs/core_docs/src/pages/index.js",
"repo_id": "langchainjs",
"token_count": 107
} | 779 |
package planparserv2
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/internal/proto/planpb"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)
func TestCheckIdentical(t *testing.T) {
schema := newTestSchema()
helper, err := typeutil.CreateSchemaHelper(schema)
assert.NoErro... | milvus/internal/parser/planparserv2/check_identical_test.go/0 | {
"file_path": "milvus/internal/parser/planparserv2/check_identical_test.go",
"repo_id": "milvus",
"token_count": 4789
} | 1,734 |
/* eslint-disable @typescript-eslint/no-explicit-any */
// eslint-disable-next-line import/no-extraneous-dependencies
import {
DocumentByInfo,
DocumentByName,
FieldPaths,
FunctionReference,
GenericActionCtx,
GenericDataModel,
NamedTableInfo,
TableNamesInDataModel,
IndexNames,
makeFunctionReference,... | langchainjs/libs/langchain-community/src/stores/message/convex.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/stores/message/convex.ts",
"repo_id": "langchainjs",
"token_count": 2116
} | 993 |
# LlamaIndex Readers Integration: Pathway
| llama_index/llama-index-integrations/readers/llama-index-readers-pathway/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-pathway/README.md",
"repo_id": "llama_index",
"token_count": 10
} | 1,443 |
"""Prompt class."""
from llama_index.legacy.core.llms.types import ChatMessage, MessageRole
from llama_index.legacy.prompts.base import (
BasePromptTemplate,
ChatPromptTemplate,
LangchainPromptTemplate,
Prompt,
PromptTemplate,
PromptType,
SelectorPromptTemplate,
)
from llama_index.legacy.pr... | llama_index/llama-index-legacy/llama_index/legacy/prompts/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/prompts/__init__.py",
"repo_id": "llama_index",
"token_count": 237
} | 1,587 |
# Latent Consistency Distillation Example:
[Latent Consistency Models (LCMs)](https://arxiv.org/abs/2310.04378) is a method to distill a latent diffusion model to enable swift inference with minimal steps. This example demonstrates how to use latent consistency distillation to distill stable-diffusion-v1.5 for inferen... | diffusers/examples/consistency_distillation/README.md/0 | {
"file_path": "diffusers/examples/consistency_distillation/README.md",
"repo_id": "diffusers",
"token_count": 1511
} | 210 |
---
hide_table_of_contents: true
---
# Dria Retriever
The [Dria](https://dria.co/profile) retriever allows an agent to perform a text-based search across a comprehensive knowledge hub.
## Setup
To use Dria retriever, first install Dria JS client:
```bash npm2yarn
npm install dria
```
You need to provide two thing... | langchainjs/docs/core_docs/docs/integrations/retrievers/dria.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/retrievers/dria.mdx",
"repo_id": "langchainjs",
"token_count": 477
} | 786 |
from __future__ import annotations
import json
import logging
import os
from dataclasses import dataclass, field
from hashlib import md5
from typing import Any, Iterable, List, Optional, Tuple, Type
import requests
from langchain_core.documents import Document
from langchain_core.embeddings import Embeddings
from lan... | langchain/libs/community/langchain_community/vectorstores/vectara.py/0 | {
"file_path": "langchain/libs/community/langchain_community/vectorstores/vectara.py",
"repo_id": "langchain",
"token_count": 10340
} | 314 |
import { MaskingTransformer } from "./transformer.js";
import type { HashFunction, MaskingPattern } from "./types.js";
/**
* RegexMaskingTransformer class for masking and rehydrating messages with Regex.
*/
export class RegexMaskingTransformer extends MaskingTransformer {
private patterns: { [key: string]: MaskingP... | langchainjs/langchain/src/experimental/masking/regex_masking_transformer.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/masking/regex_masking_transformer.ts",
"repo_id": "langchainjs",
"token_count": 2205
} | 923 |
---
hide_table_of_contents: true
---
# Zep Retriever
This example shows how to use the Zep Retriever in a retrieval chain to retrieve documents from Zep memory store.
## Setup
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallToo... | langchainjs/docs/core_docs/docs/integrations/retrievers/zep-retriever.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/retrievers/zep-retriever.mdx",
"repo_id": "langchainjs",
"token_count": 176
} | 741 |
# Dense-X-Retrieval Pack
This LlamaPack creates a query engine that uses a `RecursiveRetriever` in llama-index to fetch nodes based on propoistions extracted from each node.
This follows the idea from the paper [Dense X Retrieval: What Retreival Granularity Should We Use?](https://arxiv.org/abs/2312.06648).
From the... | llama_index/llama-index-packs/llama-index-packs-dense-x-retrieval/README.md/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-dense-x-retrieval/README.md",
"repo_id": "llama_index",
"token_count": 612
} | 1,563 |
<jupyter_start><jupyter_text>NASAThis notebook shows how to use agents to interact with the NASA toolkit. The toolkit provides access to the NASA Image and Video Library API, with potential to expand and include other accessible NASA APIs in future iterations.**Note: NASA Image and Video Library search queries can resu... | langchain/docs/docs/integrations/toolkits/nasa.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/toolkits/nasa.ipynb",
"repo_id": "langchain",
"token_count": 433
} | 166 |
# 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/tests/others/test_check_dummies.py/0 | {
"file_path": "diffusers/tests/others/test_check_dummies.py",
"repo_id": "diffusers",
"token_count": 1872
} | 272 |
flash_att_v2_commit_cuda := 02ac572f3ffc4f402e4183aaa6824b45859d3ed3
flash_att_v2_commit_rocm := 8736558c287ff2ef28b24878e42828c595ac3e69
flash-attention-v2-cuda:
# Clone flash attention
pip install -U packaging ninja --no-cache-dir
git clone https://github.com/HazyResearch/flash-attention.git flash-attention-v2... | text-generation-inference/server/Makefile-flash-att-v2/0 | {
"file_path": "text-generation-inference/server/Makefile-flash-att-v2",
"repo_id": "text-generation-inference",
"token_count": 496
} | 406 |
"""Loads Microsoft Excel files."""
from typing import Any, List
from langchain_community.document_loaders.unstructured import (
UnstructuredFileLoader,
validate_unstructured_version,
)
class UnstructuredXMLLoader(UnstructuredFileLoader):
"""Load `XML` file using `Unstructured`.
You can run the loade... | langchain/libs/community/langchain_community/document_loaders/xml.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/xml.py",
"repo_id": "langchain",
"token_count": 511
} | 265 |
from langchain_community.vectorstores.tigris import Tigris
__all__ = ["Tigris"]
| langchain/libs/langchain/langchain/vectorstores/tigris.py/0 | {
"file_path": "langchain/libs/langchain/langchain/vectorstores/tigris.py",
"repo_id": "langchain",
"token_count": 27
} | 586 |
"""deepinfra.com chat models wrapper"""
from __future__ import annotations
import json
import logging
from typing import (
Any,
AsyncIterator,
Callable,
Dict,
Iterator,
List,
Mapping,
Optional,
Tuple,
Type,
Union,
)
import aiohttp
import requests
from langchain_core.callba... | langchain/libs/community/langchain_community/chat_models/deepinfra.py/0 | {
"file_path": "langchain/libs/community/langchain_community/chat_models/deepinfra.py",
"repo_id": "langchain",
"token_count": 7099
} | 237 |
#!/bin/bash
NUM_PROC=$1
shift
torchrun --nproc_per_node=$NUM_PROC train.py "$@"
| pytorch-image-models/distributed_train.sh/0 | {
"file_path": "pytorch-image-models/distributed_train.sh",
"repo_id": "pytorch-image-models",
"token_count": 37
} | 343 |
python_tests()
| llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-nebula/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-nebula/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,267 |
export {
type LengthBasedExampleSelectorInput,
LengthBasedExampleSelector,
} from "@langchain/core/example_selectors";
| langchainjs/langchain/src/prompts/selectors/LengthBasedExampleSelector.ts/0 | {
"file_path": "langchainjs/langchain/src/prompts/selectors/LengthBasedExampleSelector.ts",
"repo_id": "langchainjs",
"token_count": 35
} | 940 |
from contextlib import contextmanager
from typing import Generator, Generic, Optional, Sequence, Type
from typing_extensions import Self
from langgraph.channels.base import (
BaseChannel,
EmptyChannelError,
InvalidUpdateError,
Value,
)
class LastValue(Generic[Value], BaseChannel[Value, Value, Value]... | langgraph/langgraph/channels/last_value.py/0 | {
"file_path": "langgraph/langgraph/channels/last_value.py",
"repo_id": "langgraph",
"token_count": 683
} | 1,003 |
import chromadb.utils.messageid as mid
import pulsar
import hypothesis.strategies as st
from hypothesis import given, settings, note
from typing import Any, Tuple
@st.composite
def message_id(draw: st.DrawFn) -> pulsar.MessageId:
ledger_id = draw(st.integers(min_value=0, max_value=2**63 - 1))
entry_id = draw(... | chroma/chromadb/test/utils/test_messagid.py/0 | {
"file_path": "chroma/chromadb/test/utils/test_messagid.py",
"repo_id": "chroma",
"token_count": 1424
} | 27 |
# Copyright 2020 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/roc_auc/roc_auc.py/0 | {
"file_path": "datasets/metrics/roc_auc/roc_auc.py",
"repo_id": "datasets",
"token_count": 3792
} | 134 |
# Redis
>[Redis (Remote Dictionary Server)](https://en.wikipedia.org/wiki/Redis) is an open-source in-memory storage,
> used as a distributed, in-memory key–value database, cache and message broker, with optional durability.
> Because it holds all data in memory and because of its design, `Redis` offers low-latency ... | langchain/docs/docs/integrations/providers/redis.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/redis.mdx",
"repo_id": "langchain",
"token_count": 1437
} | 158 |
# coding=utf-8
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | transformers/tests/models/xlm/test_modeling_xlm.py/0 | {
"file_path": "transformers/tests/models/xlm/test_modeling_xlm.py",
"repo_id": "transformers",
"token_count": 9334
} | 835 |
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "stores/message/convex",
});
export * from "@langchain/community/stores/message/convex";
| langchainjs/langchain/src/stores/message/convex.ts/0 | {
"file_path": "langchainjs/langchain/src/stores/message/convex.ts",
"repo_id": "langchainjs",
"token_count": 77
} | 926 |
from llama_index.core.question_gen.llm_generators import LLMQuestionGenerator
from llama_index.core.question_gen.output_parser import SubQuestionOutputParser
__all__ = [
"LLMQuestionGenerator",
"SubQuestionOutputParser",
]
| llama_index/llama-index-core/llama_index/core/question_gen/__init__.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/question_gen/__init__.py",
"repo_id": "llama_index",
"token_count": 75
} | 1,213 |
# The cache
The cache is one of the reasons why 🤗 Datasets is so efficient. It stores previously downloaded and processed datasets so when you need to use them again, they are reloaded directly from the cache. This avoids having to download a dataset all over again, or reapplying processing functions. Even after you ... | datasets/docs/source/about_cache.mdx/0 | {
"file_path": "datasets/docs/source/about_cache.mdx",
"repo_id": "datasets",
"token_count": 909
} | 108 |
python_tests(
name="tests",
skip_tests=True,
)
| llama_index/llama-index-legacy/tests/program/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/tests/program/BUILD",
"repo_id": "llama_index",
"token_count": 25
} | 1,675 |
# coding=utf-8
# Copyright 2022 Google LongT5 Authors 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 ... | transformers/tests/models/longt5/test_modeling_flax_longt5.py/0 | {
"file_path": "transformers/tests/models/longt5/test_modeling_flax_longt5.py",
"repo_id": "transformers",
"token_count": 17644
} | 753 |
import assert from "assert";
import { OpenAI } from "langchain/llms/openai";
import { LLMChain } from "langchain/chains";
import { ChatPromptTemplate } from "langchain/prompts";
import { loadPrompt } from "langchain/prompts/load";
import { HNSWLib } from "langchain/vectorstores/hnswlib";
import { OpenAIEmbeddings } fro... | langchainjs/environment_tests/test-exports-cjs/src/index.mjs/0 | {
"file_path": "langchainjs/environment_tests/test-exports-cjs/src/index.mjs",
"repo_id": "langchainjs",
"token_count": 490
} | 783 |
# 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/mixed/model.py/0 | {
"file_path": "peft/src/peft/tuners/mixed/model.py",
"repo_id": "peft",
"token_count": 6427
} | 348 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello wasm-pack!</title>
</head>
<body>
<noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript>
<script src="./bootstrap.js"></script>
</body>
</html>
| tokenizers/tokenizers/examples/unstable_wasm/www/index.html/0 | {
"file_path": "tokenizers/tokenizers/examples/unstable_wasm/www/index.html",
"repo_id": "tokenizers",
"token_count": 110
} | 451 |
from langchain_community.retrievers.weaviate_hybrid_search import (
WeaviateHybridSearchRetriever,
)
__all__ = ["WeaviateHybridSearchRetriever"]
| langchain/libs/langchain/langchain/retrievers/weaviate_hybrid_search.py/0 | {
"file_path": "langchain/libs/langchain/langchain/retrievers/weaviate_hybrid_search.py",
"repo_id": "langchain",
"token_count": 54
} | 562 |
python_tests()
| llama_index/llama-index-integrations/readers/llama-index-readers-trello/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-trello/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,427 |
<!--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/optimization/onnx.md/0 | {
"file_path": "diffusers/docs/source/ko/optimization/onnx.md",
"repo_id": "diffusers",
"token_count": 1437
} | 188 |
"""Tests for correct functioning of chains."""
| langchain/libs/langchain/tests/unit_tests/chains/__init__.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/chains/__init__.py",
"repo_id": "langchain",
"token_count": 11
} | 623 |
# NASNet
**NASNet** is a type of convolutional neural network discovered through neural architecture search. The building blocks consist of normal and reduction cells.
## How do I use this model on an image?
To load a pretrained model:
```python
import timm
model = timm.create_model('nasnetalarge', pretrained=True)
... | pytorch-image-models/docs/models/nasnet.md/0 | {
"file_path": "pytorch-image-models/docs/models/nasnet.md",
"repo_id": "pytorch-image-models",
"token_count": 1533
} | 370 |
from langchain_community.vectorstores.timescalevector import (
TimescaleVector,
)
__all__ = [
"TimescaleVector",
]
| langchain/libs/langchain/langchain/vectorstores/timescalevector.py/0 | {
"file_path": "langchain/libs/langchain/langchain/vectorstores/timescalevector.py",
"repo_id": "langchain",
"token_count": 43
} | 576 |
// Code generated by mockery v2.32.4. DO NOT EDIT.
package mocks
import (
context "context"
commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
grpc "google.golang.org/grpc"
indexpb "github.com/milvus-io/milvus/internal/proto/indexpb"
internalpb "github.com/milvus-io/milvus/internal/proto/interna... | milvus/internal/mocks/mock_indexnode_client.go/0 | {
"file_path": "milvus/internal/mocks/mock_indexnode_client.go",
"repo_id": "milvus",
"token_count": 8878
} | 1,813 |
syntax = "proto3";
package milvus.proto.proxy;
option go_package = "github.com/milvus-io/milvus/internal/proto/proxypb";
import "common.proto";
import "internal.proto";
import "milvus.proto";
service Proxy {
rpc GetComponentStates(milvus.GetComponentStatesRequest) returns (milvus.ComponentStates) {}
rpc GetStati... | milvus/internal/proto/proxy.proto/0 | {
"file_path": "milvus/internal/proto/proxy.proto",
"repo_id": "milvus",
"token_count": 685
} | 1,956 |
<jupyter_start><jupyter_text>RAG FusionYou can also run this notebook online [at Noteable.io](https://app.noteable.io/published/d9902d51-c5e9-4d89-bcb1-f82521ab4497/rag_fusion).This notebook shows off a LangChain JS port of [this Github repo](https://github.com/Raudaschl/rag-fusion) - all credit to the original author!... | langchainjs/cookbook/rag_fusion.ipynb/0 | {
"file_path": "langchainjs/cookbook/rag_fusion.ipynb",
"repo_id": "langchainjs",
"token_count": 1915
} | 763 |
<jupyter_start><jupyter_text>Stable Diffusion : plongée en profondeurStable Diffusion est un puissant modèle de texte à image. Il existe plusieurs sites web et outils pour rendre son utilisation aussi simple que possible. Il est également intégré à la bibliothèque de Diffusers d'Huggingface, ce qui permet de générer de... | diffusion-models-class/units/fr/unit3/stable_diffusion_deep_dive.ipynb/0 | {
"file_path": "diffusion-models-class/units/fr/unit3/stable_diffusion_deep_dive.ipynb",
"repo_id": "diffusion-models-class",
"token_count": 19297
} | 305 |
#include <ATen/Dispatch.h>
#include <THC/THCAtomics.cuh>
#include <ATen/ATen.h>
#include <torch/torch.h>
#include <vector>
#include <optional>
/**
* Friendly reminder of how multithreading works in CUDA: https://developer.nvidia.com/blog/even-easier-introduction-cuda
* Check example at https://github.com/thomasw21/Li... | text-generation-inference/server/custom_kernels/custom_kernels/fused_bloom_attention_cuda.cu/0 | {
"file_path": "text-generation-inference/server/custom_kernels/custom_kernels/fused_bloom_attention_cuda.cu",
"repo_id": "text-generation-inference",
"token_count": 5344
} | 436 |
<!--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/accelerate.md/0 | {
"file_path": "transformers/docs/source/es/accelerate.md",
"repo_id": "transformers",
"token_count": 1889
} | 468 |
poetry_requirements(
name="poetry",
)
python_requirements(
name="reqs",
)
| llama_index/llama-index-integrations/readers/llama-index-readers-wordlift/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-wordlift/BUILD",
"repo_id": "llama_index",
"token_count": 36
} | 1,574 |
import { collections } from "$lib/server/database";
import { authCondition } from "$lib/server/auth";
import type { Conversation } from "$lib/types/Conversation";
export async function GET({ locals }) {
if (locals.user?._id || locals.sessionId) {
const convs = await collections.conversations
.find({
...authC... | chat-ui/src/routes/api/conversations/+server.ts/0 | {
"file_path": "chat-ui/src/routes/api/conversations/+server.ts",
"repo_id": "chat-ui",
"token_count": 298
} | 99 |
{
"name": "langchain-convex-tests",
"version": "0.0.1",
"type": "module",
"dependencies": {
"convex": "1.4.1",
"@langchain/core": "~0.1"
}
}
| langchainjs/libs/langchain-community/src/vectorstores/tests/convex/package.json/0 | {
"file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/convex/package.json",
"repo_id": "langchainjs",
"token_count": 81
} | 1,018 |
from __future__ import annotations
import uuid
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Type
from langchain_core.documents import Document
from langchain_core.embeddings import Embeddings
from langchain_core.utils import get_from_env
from langchain_core.vectorstores import VectorS... | langchain/libs/community/langchain_community/vectorstores/meilisearch.py/0 | {
"file_path": "langchain/libs/community/langchain_community/vectorstores/meilisearch.py",
"repo_id": "langchain",
"token_count": 4842
} | 311 |
<jupyter_start><jupyter_text>Running Agent as an IteratorIt can be useful to run the agent as an interator, to add human-in-the-loop checks as needed.To demonstrate the `AgentExecutorIterator` functionality, we will set up a problem where an Agent must:- Retrieve three prime numbers from a Tool- Multiply these together... | langchain/docs/docs/modules/agents/how_to/agent_iter.ipynb/0 | {
"file_path": "langchain/docs/docs/modules/agents/how_to/agent_iter.ipynb",
"repo_id": "langchain",
"token_count": 1725
} | 189 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "retrievers/zep",
});
export * from "@langchain/community/retrievers/zep";
| langchainjs/langchain/src/retrievers/zep.ts/0 | {
"file_path": "langchainjs/langchain/src/retrievers/zep.ts",
"repo_id": "langchainjs",
"token_count": 74
} | 947 |
package planparserv2
import (
"fmt"
"strconv"
"strings"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/proto/planpb"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)
func IsBool(n *planpb.GenericValue) bool {
switch n.GetVal().(type) {
case *planpb.GenericValue_... | milvus/internal/parser/planparserv2/utils.go/0 | {
"file_path": "milvus/internal/parser/planparserv2/utils.go",
"repo_id": "milvus",
"token_count": 6038
} | 1,731 |
python_tests()
| llama_index/llama-index-integrations/readers/llama-index-readers-openalex/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-openalex/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,529 |
from langchain_google_genai.llms import GoogleModelFamily
def test_model_family() -> None:
model = GoogleModelFamily("gemini-pro")
assert model == GoogleModelFamily.GEMINI
model = GoogleModelFamily("gemini-ultra")
assert model == GoogleModelFamily.GEMINI
| langchain/libs/partners/google-genai/tests/unit_tests/test_llms.py/0 | {
"file_path": "langchain/libs/partners/google-genai/tests/unit_tests/test_llms.py",
"repo_id": "langchain",
"token_count": 89
} | 685 |
from langchain_community.document_loaders.larksuite import LarkSuiteDocLoader
__all__ = ["LarkSuiteDocLoader"]
| langchain/libs/langchain/langchain/document_loaders/larksuite.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/larksuite.py",
"repo_id": "langchain",
"token_count": 37
} | 509 |
# Generated content DO NOT EDIT
from .. import trainers
Trainer = trainers.Trainer
BpeTrainer = trainers.BpeTrainer
UnigramTrainer = trainers.UnigramTrainer
WordLevelTrainer = trainers.WordLevelTrainer
WordPieceTrainer = trainers.WordPieceTrainer
| tokenizers/bindings/python/py_src/tokenizers/trainers/__init__.py/0 | {
"file_path": "tokenizers/bindings/python/py_src/tokenizers/trainers/__init__.py",
"repo_id": "tokenizers",
"token_count": 74
} | 443 |
search_performance:
collections:
-
server:
db_config.primary_path: /test/milvus/db_data_011/sift_10m_128_l2_ivf_flat_16384
cache_config.cpu_cache_capacity: 32GB
engine_config.use_blas_threshold: 0
wal_enable: true
collection_name: sift_10m_128_l2
run_count: 2
... | milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search_sift10m_ivf.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search_sift10m_ivf.yaml",
"repo_id": "milvus",
"token_count": 491
} | 2,000 |
import itertools
import random
import uuid
from typing import Dict, List, Optional, Set
from unittest.mock import MagicMock, patch
import pytest
from langchain_community.vectorstores import DatabricksVectorSearch
from tests.integration_tests.vectorstores.fake_embeddings import (
FakeEmbeddings,
fake_texts,
)
... | langchain/libs/community/tests/unit_tests/vectorstores/test_databricks_vector_search.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/vectorstores/test_databricks_vector_search.py",
"repo_id": "langchain",
"token_count": 10300
} | 407 |
python_sources()
| llama_index/llama-index-core/llama_index/core/evaluation/multi_modal/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/evaluation/multi_modal/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,173 |
# for backwards compatibility
from llama_index.core.schema import QueryBundle, QueryType
__all__ = ["QueryBundle", "QueryType"]
| llama_index/llama-index-core/llama_index/core/indices/query/schema.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/indices/query/schema.py",
"repo_id": "llama_index",
"token_count": 38
} | 1,154 |
"""Implement integration tests for Redis storage."""
import os
import typing
import uuid
import pytest
from langchain_community.storage.redis import RedisStore
if typing.TYPE_CHECKING:
from redis import Redis
pytest.importorskip("redis")
@pytest.fixture
def redis_client() -> Redis:
"""Yield redis client."... | langchain/libs/community/tests/integration_tests/storage/test_redis.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/storage/test_redis.py",
"repo_id": "langchain",
"token_count": 1233
} | 364 |
# OpenGPTs
This is an open source effort to create a similar experience to OpenAI's GPTs and Assistants API.
It is powered by [LangGraph](https://github.com/langchain-ai/langgraph) - a framework for creating agent runtimes.
It also builds upon [LangChain](https://github.com/langchain-ai/langchain), [LangServe](https:/... | opengpts/README.md/0 | {
"file_path": "opengpts/README.md",
"repo_id": "opengpts",
"token_count": 4084
} | 1,991 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.