text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
# 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/kandinsky2_2/test_kandinsky_prior.py/0 | {
"file_path": "diffusers/tests/pipelines/kandinsky2_2/test_kandinsky_prior.py",
"repo_id": "diffusers",
"token_count": 4049
} | 271 |
import logging
import sys
import uuid
from typing import Any, Generator, List
import clickhouse_connect
import pytest
from llama_index.core.schema import (
NodeRelationship,
RelatedNodeInfo,
TextNode,
)
from llama_index.core.vector_stores.types import (
ExactMatchFilter,
MetadataFilters,
VectorS... | llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-clickhouse/tests/test_clickhouse.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-clickhouse/tests/test_clickhouse.py",
"repo_id": "llama_index",
"token_count": 5840
} | 1,599 |
"""Simple Reader that reads transcript of youtube video."""
import re
from typing import Any, List, Optional
from youtube_transcript_api import YouTubeTranscriptApi
from llama_index.core.readers.base import BasePydanticReader
from llama_index.core.schema import Document
from llama_index.readers.youtube_transcript.uti... | llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/llama_index/readers/youtube_transcript/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-youtube-transcript/llama_index/readers/youtube_transcript/base.py",
"repo_id": "llama_index",
"token_count": 1024
} | 1,477 |
# Share a dataset using the CLI
At Hugging Face, we are on a mission to democratize good Machine Learning and we believe in the value of open source. That's why we designed 🤗 Datasets so that anyone can share a dataset with the greater ML community. There are currently thousands of datasets in over 100 languages in t... | datasets/docs/source/share.mdx/0 | {
"file_path": "datasets/docs/source/share.mdx",
"repo_id": "datasets",
"token_count": 2930
} | 120 |
import pytest
def pytest_addoption(parser):
parser.addoption("--file_type", action="store", default="json", help="filetype")
parser.addoption("--create_index", action="store", default="create_index", help="whether creating index")
parser.addoption("--nb", action="store", default=50000, help="nb")
par... | milvus/tests/python_client/bulk_insert/conftest.py/0 | {
"file_path": "milvus/tests/python_client/bulk_insert/conftest.py",
"repo_id": "milvus",
"token_count": 394
} | 1,951 |
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};
module.exports = nextConfig;
| langchain-template-supabase/next.config.js/0 | {
"file_path": "langchain-template-supabase/next.config.js",
"repo_id": "langchain-template-supabase",
"token_count": 40
} | 69 |
// 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_array_expr.cpp/0 | {
"file_path": "milvus/internal/core/unittest/test_array_expr.cpp",
"repo_id": "milvus",
"token_count": 45616
} | 1,950 |
# Copyright 2024 UC Berkeley Team and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | diffusers/src/diffusers/schedulers/scheduling_ddpm_flax.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_ddpm_flax.py",
"repo_id": "diffusers",
"token_count": 5236
} | 275 |
<!--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... | accelerate/docs/source/usage_guides/checkpoint.md/0 | {
"file_path": "accelerate/docs/source/usage_guides/checkpoint.md",
"repo_id": "accelerate",
"token_count": 1156
} | 5 |
python_tests(
name="tests",
skip_tests=True,
)
| llama_index/llama-index-legacy/tests/ingestion/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/tests/ingestion/BUILD",
"repo_id": "llama_index",
"token_count": 25
} | 1,667 |
// Code generated by mockery v2.16.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// Credential is an autogenerated mock type for the Credential type
type Credential struct {
mock.Mock
}
type Credential_Expecter struct {
mock *mock.Mock
}
func (_m *Credential) EXPECT() *Credential_E... | milvus/internal/storage/aliyun/mocks/Credential.go/0 | {
"file_path": "milvus/internal/storage/aliyun/mocks/Credential.go",
"repo_id": "milvus",
"token_count": 2412
} | 2,007 |
from llama_index.core.indices.managed.base import BaseManagedIndex
__all__ = [
"BaseManagedIndex",
]
| llama_index/llama-index-core/llama_index/core/indices/managed/__init__.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/indices/managed/__init__.py",
"repo_id": "llama_index",
"token_count": 39
} | 1,194 |
import inspect
import warnings
from typing import Callable, List, Optional, Union
import numpy as np
import torch
from packaging import version
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, CLIPVisionModelWithProjection
from ...configuration_utils import FrozenDict
from ...image_processor... | diffusers/src/diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py",
"repo_id": "diffusers",
"token_count": 17304
} | 259 |
use tokenizers::models::wordpiece::WordPiece;
use tokenizers::{AddedToken, Tokenizer};
fn main() {
let start = std::time::Instant::now();
let mut tokenizer = Tokenizer::new(WordPiece::default());
// Mix special and not special
// You can make sure ids are in order, and special status is correct.
l... | tokenizers/tokenizers/examples/serialization.rs/0 | {
"file_path": "tokenizers/tokenizers/examples/serialization.rs",
"repo_id": "tokenizers",
"token_count": 300
} | 433 |
.. _Ref-Agents:
Agents
=================
This doc shows our agent classes - both the high-level and lower-level components.
There are also legacy classes (e.g. `OldOpenAIAgent`, and `OldReActAgent`) that still work but are deprecated.
.. automodule:: llama_index.core.agent
:members:
:inherited-members:
| llama_index/docs/api_reference/agents.rst/0 | {
"file_path": "llama_index/docs/api_reference/agents.rst",
"repo_id": "llama_index",
"token_count": 100
} | 1,034 |
<jupyter_start><jupyter_text>Streaming If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>!pip install llama-index
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.st... | llama_index/docs/examples/customization/streaming/SimpleIndexDemo-streaming.ipynb/0 | {
"file_path": "llama_index/docs/examples/customization/streaming/SimpleIndexDemo-streaming.ipynb",
"repo_id": "llama_index",
"token_count": 591
} | 1,127 |
[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 = ["RayyanReader"]
contains_example = false
import_path = "llama_index.readers.rayyan"
[tool... | llama_index/llama-index-integrations/readers/llama-index-readers-rayyan/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-rayyan/pyproject.toml",
"repo_id": "llama_index",
"token_count": 695
} | 1,544 |
[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 = ["DadJokesReader"]
contains_example = false
import_path = "llama_index.readers.dad_jokes"
... | llama_index/llama-index-integrations/readers/llama-index-readers-dad-jokes/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-dad-jokes/pyproject.toml",
"repo_id": "llama_index",
"token_count": 660
} | 1,337 |
# 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/autoencoders/test_models_vae.py/0 | {
"file_path": "diffusers/tests/models/autoencoders/test_models_vae.py",
"repo_id": "diffusers",
"token_count": 18282
} | 257 |
""" Activations
A collection of activations fn and modules with a common interface so that they can
easily be swapped. All have an `inplace` arg even if not used.
Hacked together by / Copyright 2020 Ross Wightman
"""
import torch
from torch import nn as nn
from torch.nn import functional as F
def swish(x, inplace:... | pytorch-image-models/timm/layers/activations.py/0 | {
"file_path": "pytorch-image-models/timm/layers/activations.py",
"repo_id": "pytorch-image-models",
"token_count": 2012
} | 372 |
"""Test Tongyi API wrapper."""
from langchain_core.outputs import LLMResult
from langchain_community.llms.tongyi import Tongyi
def test_tongyi_call() -> None:
"""Test valid call to tongyi."""
llm = Tongyi()
output = llm("who are you")
assert isinstance(output, str)
def test_tongyi_generate() -> No... | langchain/libs/community/tests/integration_tests/llms/test_tongyi.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/llms/test_tongyi.py",
"repo_id": "langchain",
"token_count": 294
} | 340 |
---
hide_table_of_contents: true
---
# Text files
This example goes over how to load data from text files.
```typescript
import { TextLoader } from "langchain/document_loaders/fs/text";
const loader = new TextLoader("src/document_loaders/example_data/example.txt");
const docs = await loader.load();
```
| langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/text.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/text.mdx",
"repo_id": "langchainjs",
"token_count": 98
} | 779 |
#!/usr/bin/env python
# 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
#
# Unles... | accelerate/src/accelerate/test_utils/scripts/test_distributed_data_loop.py/0 | {
"file_path": "accelerate/src/accelerate/test_utils/scripts/test_distributed_data_loop.py",
"repo_id": "accelerate",
"token_count": 3115
} | 11 |
# coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team and Facebook, 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
#
# Un... | transformers/examples/research_projects/distillation/utils.py/0 | {
"file_path": "transformers/examples/research_projects/distillation/utils.py",
"repo_id": "transformers",
"token_count": 1772
} | 561 |
"use client";
import React, { useEffect, useRef, useState } from "react";
import { useSearchParams } from "next/navigation";
import { RemoteRunnable } from "@langchain/core/runnables/remote";
import { applyPatch } from "@langchain/core/utils/json_patch";
import { EmptyState } from "../components/EmptyState";
import {... | chat-langchain/chat-langchain/app/components/ChatWindow.tsx/0 | {
"file_path": "chat-langchain/chat-langchain/app/components/ChatWindow.tsx",
"repo_id": "chat-langchain",
"token_count": 5118
} | 6 |
# LlamaIndex Kvstore Integration: Dynamodb Kvstore
| llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-dynamodb/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-dynamodb/README.md",
"repo_id": "llama_index",
"token_count": 16
} | 1,497 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/querynodev2/pipeline/insert_node_test.go/0 | {
"file_path": "milvus/internal/querynodev2/pipeline/insert_node_test.go",
"repo_id": "milvus",
"token_count": 1745
} | 1,851 |
<jupyter_start><jupyter_text>Bedrock Basic Usage Call `complete` with a prompt If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-bedrock
!pip install llama-index
from llama_index.llms.bedrock import Bedrock
profile_name = "Your aws p... | llama_index/docs/examples/llm/bedrock.ipynb/0 | {
"file_path": "llama_index/docs/examples/llm/bedrock.ipynb",
"repo_id": "llama_index",
"token_count": 1742
} | 1,125 |
/*
* 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... | milvus/pkg/mq/msgstream/msg_for_partition_test.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/msg_for_partition_test.go",
"repo_id": "milvus",
"token_count": 1398
} | 1,893 |
# Generated content DO NOT EDIT
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence
from os import PathLike
from candle.typing import _ArrayLike, Device, Scalar, Index, Shape
from candle import Tensor, DType, QTensor
@staticmethod
def avg_pool2d(tensor: Tensor, ksize: int, stride: int = 1) -... | candle/candle-pyo3/py_src/candle/functional/__init__.pyi/0 | {
"file_path": "candle/candle-pyo3/py_src/candle/functional/__init__.pyi",
"repo_id": "candle",
"token_count": 484
} | 67 |
import type { GoogleAIModelParams, GoogleLLMModelFamily } from "../types.js";
import { isModelGemini, validateGeminiParams } from "./gemini.js";
export function copyAIModelParams(
params: GoogleAIModelParams | undefined
): GoogleAIModelParams {
return copyAIModelParamsInto(params, {});
}
export function copyAIMod... | langchainjs/libs/langchain-google-common/src/utils/common.ts/0 | {
"file_path": "langchainjs/libs/langchain-google-common/src/utils/common.ts",
"repo_id": "langchainjs",
"token_count": 607
} | 990 |
#![allow(clippy::redundant_closure_call)]
use crate::{CpuStorage, CudaStorage, Layout, MetalStorage, Result, Shape, Tensor};
use half::{bf16, f16};
use num_traits::float::Float;
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum CmpOp {
Eq,
Ne,
Le,
Ge,
Lt,
Gt,
}
#[derive(Debug, Clone, Copy, Partia... | candle/candle-core/src/op.rs/0 | {
"file_path": "candle/candle-core/src/op.rs",
"repo_id": "candle",
"token_count": 14983
} | 29 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | transformers/examples/legacy/multiple_choice/run_multiple_choice.py/0 | {
"file_path": "transformers/examples/legacy/multiple_choice/run_multiple_choice.py",
"repo_id": "transformers",
"token_count": 3303
} | 540 |
// 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/SegmentInterface.cpp/0 | {
"file_path": "milvus/internal/core/src/segcore/SegmentInterface.cpp",
"repo_id": "milvus",
"token_count": 5664
} | 1,657 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/pipelines/zero_shot_audio_classification.py/0 | {
"file_path": "transformers/src/transformers/pipelines/zero_shot_audio_classification.py",
"repo_id": "transformers",
"token_count": 2571
} | 764 |
[
{
"server": "poseidon",
"suite_params": [
{
"suite": "011_search_dsl.yaml",
"image_type": "gpu"
}
]
}
]
| milvus/tests/benchmark/milvus_benchmark/scheduler/filter.json/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/filter.json",
"repo_id": "milvus",
"token_count": 134
} | 1,868 |
#!/usr/bin/env python
# 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/L... | transformers/src/transformers/tools/__init__.py/0 | {
"file_path": "transformers/src/transformers/tools/__init__.py",
"repo_id": "transformers",
"token_count": 984
} | 752 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/querynodev2/segments/cgo_util.go/0 | {
"file_path": "milvus/internal/querynodev2/segments/cgo_util.go",
"repo_id": "milvus",
"token_count": 1060
} | 1,852 |
from enum import Enum
from typing import Any, Dict, List, Mapping, Optional
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import BaseModel, Extra, root_validator
CUSTOM_ENDPOINT_PREFIX = "ocid1.generativeaiendpoint"
class OCIAuthType(Enum):
"""OCI authentication types as enume... | langchain/libs/community/langchain_community/embeddings/oci_generative_ai.py/0 | {
"file_path": "langchain/libs/community/langchain_community/embeddings/oci_generative_ai.py",
"repo_id": "langchain",
"token_count": 3214
} | 278 |
import * as url from "node:url";
import * as path from "node:path";
import * as fs from "node:fs/promises";
import { test, expect } from "@jest/globals";
import { SRTLoader } from "../fs/srt.js";
test("Test SRT loader from blob", async () => {
const filePath = path.resolve(
path.dirname(url.fileURLToPath(import.... | langchainjs/langchain/src/document_loaders/tests/srt-blob.test.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/tests/srt-blob.test.ts",
"repo_id": "langchainjs",
"token_count": 310
} | 974 |
# @langchain/cloudflare
This package contains the LangChain.js integrations for Cloudflare through their SDK.
## Installation
```bash npm2yarn
npm install @langchain/cloudflare
```
## Development
To develop the Cloudflare package, you'll need to follow these instructions:
### Install dependencies
```bash
yarn in... | langchainjs/libs/langchain-cloudflare/README.md/0 | {
"file_path": "langchainjs/libs/langchain-cloudflare/README.md",
"repo_id": "langchainjs",
"token_count": 328
} | 1,044 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "chat_models/minimax",
});
export * from "@langchain/community/chat_models/minimax";
| langchainjs/langchain/src/chat_models/minimax.ts/0 | {
"file_path": "langchainjs/langchain/src/chat_models/minimax.ts",
"repo_id": "langchainjs",
"token_count": 76
} | 915 |
<jupyter_start><jupyter_text>Connect to templateIn `server.py`, set -```add_routes(app, chain_ext, path="/rag_aws_bedrock")```<jupyter_code>from langserve.client import RemoteRunnable
rag_app_pinecone = RemoteRunnable("http://0.0.0.0:8001/rag_aws_bedrock")
rag_app_pinecone.invoke("What are the different types of agent... | langchain/templates/rag-aws-bedrock/rag_aws_bedrock.ipynb/0 | {
"file_path": "langchain/templates/rag-aws-bedrock/rag_aws_bedrock.ipynb",
"repo_id": "langchain",
"token_count": 135
} | 666 |
import { AnalyticDBVectorStore } from "@langchain/community/vectorstores/analyticdb";
import { OpenAIEmbeddings } from "@langchain/openai";
const connectionOptions = {
host: process.env.ANALYTICDB_HOST || "localhost",
port: Number(process.env.ANALYTICDB_PORT) || 5432,
database: process.env.ANALYTICDB_DATABASE ||... | langchainjs/examples/src/indexes/vector_stores/analyticdb.ts/0 | {
"file_path": "langchainjs/examples/src/indexes/vector_stores/analyticdb.ts",
"repo_id": "langchainjs",
"token_count": 504
} | 810 |
<jupyter_start><jupyter_text>Alibaba Cloud MaxCompute>[Alibaba Cloud MaxCompute](https://www.alibabacloud.com/product/maxcompute) (previously known as ODPS) is a general purpose, fully managed, multi-tenancy data processing platform for large-scale data warehousing. MaxCompute supports various data importing solutions ... | langchain/docs/docs/integrations/document_loaders/alibaba_cloud_maxcompute.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/alibaba_cloud_maxcompute.ipynb",
"repo_id": "langchain",
"token_count": 1207
} | 106 |
""" Cross Entropy w/ smoothing or soft targets
Hacked together by / Copyright 2021 Ross Wightman
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
class LabelSmoothingCrossEntropy(nn.Module):
""" NLL loss with label smoothing.
"""
def __init__(self, smoothing=0.1):
super(Lab... | pytorch-image-models/timm/loss/cross_entropy.py/0 | {
"file_path": "pytorch-image-models/timm/loss/cross_entropy.py",
"repo_id": "pytorch-image-models",
"token_count": 470
} | 393 |
"""Test SKLearnVectorStore functionality."""
from pathlib import Path
import pytest
from langchain_community.vectorstores import SKLearnVectorStore
from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings
@pytest.mark.requires("numpy", "sklearn")
def test_sklearn() -> None:
"""Test end to... | langchain/libs/community/tests/unit_tests/vectorstores/test_sklearn.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/vectorstores/test_sklearn.py",
"repo_id": "langchain",
"token_count": 1297
} | 385 |
import { test } from "@jest/globals";
import { GitbookLoader } from "../web/gitbook.js";
test("Test GitbookLoader", async () => {
const loader = new GitbookLoader(
"https://docs.gitbook.com/product-tour/navigation"
);
const docs = await loader.load();
console.log("Loaded", docs.length, "Gitbook documents"... | langchainjs/langchain/src/document_loaders/tests/gitbook.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/tests/gitbook.int.test.ts",
"repo_id": "langchainjs",
"token_count": 196
} | 879 |
"""Utilities for chat loaders."""
from copy import deepcopy
from typing import Iterable, Iterator, List
from langchain_core.chat_sessions import ChatSession
from langchain_core.messages import AIMessage, BaseMessage
def merge_chat_runs_in_session(
chat_session: ChatSession, delimiter: str = "\n\n"
) -> ChatSessi... | langchain/libs/community/langchain_community/chat_loaders/utils.py/0 | {
"file_path": "langchain/libs/community/langchain_community/chat_loaders/utils.py",
"repo_id": "langchain",
"token_count": 1344
} | 215 |
# 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/loaders/lora_conversion_utils.py/0 | {
"file_path": "diffusers/src/diffusers/loaders/lora_conversion_utils.py",
"repo_id": "diffusers",
"token_count": 6712
} | 240 |
python_sources()
| llama_index/llama-index-core/llama_index/core/composability/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/composability/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,181 |
// Code generated by mockery v2.32.4. DO NOT EDIT.
package predicates
import mock "github.com/stretchr/testify/mock"
// MockPredicate is an autogenerated mock type for the Predicate type
type MockPredicate struct {
mock.Mock
}
type MockPredicate_Expecter struct {
mock *mock.Mock
}
func (_m *MockPredicate) EXPECT... | milvus/internal/kv/predicates/mock_predicate.go/0 | {
"file_path": "milvus/internal/kv/predicates/mock_predicate.go",
"repo_id": "milvus",
"token_count": 2355
} | 1,723 |
from langchain_community.chat_models.konko import (
ChatKonko,
)
__all__ = ["ChatKonko"]
| langchain/libs/langchain/langchain/chat_models/konko.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chat_models/konko.py",
"repo_id": "langchain",
"token_count": 39
} | 518 |
[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 = ["DocxReader", "EpubReader", "FlatReader", "HTMLTagReader", "HWPReader", "IPYNBReader", "Im... | llama_index/llama-index-integrations/readers/llama-index-readers-file/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/pyproject.toml",
"repo_id": "llama_index",
"token_count": 955
} | 1,366 |
<jupyter_start><jupyter_text>Managing prompt sizeAgents dynamically call tools. The results of those tool calls are added back to the prompt, so that the agent can plan the next action. Depending on what tools are being used and how they're being called, the agent prompt can easily grow larger than the model context wi... | langchain/docs/docs/expression_language/cookbook/prompt_size.ipynb/0 | {
"file_path": "langchain/docs/docs/expression_language/cookbook/prompt_size.ipynb",
"repo_id": "langchain",
"token_count": 1742
} | 90 |
search_performance:
collections:
# -
# milvus:
# db_config.primary_path: /test/milvus/db_data_011/sift_10m_128_l2
# cache_config.cpu_cache_capacity: 32GB
# engine_config.use_blas_threshold: 0
# engine_config.gpu_search_threshold: 100
# gpu_resource_config.enable: true
# ... | milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search_sift10m.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search_sift10m.yaml",
"repo_id": "milvus",
"token_count": 2049
} | 1,863 |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | transformers/tests/models/glpn/test_image_processing_glpn.py/0 | {
"file_path": "transformers/tests/models/glpn/test_image_processing_glpn.py",
"repo_id": "transformers",
"token_count": 2610
} | 734 |
import argparse
import logging
import sys
import time
import tensorflow as tf
from datasets import load_dataset
from packaging.version import parse
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
try:
import tf_keras as keras
except (ModuleNotFoundError, ImportError):
import ker... | transformers/tests/sagemaker/scripts/tensorflow/run_tf.py/0 | {
"file_path": "transformers/tests/sagemaker/scripts/tensorflow/run_tf.py",
"repo_id": "transformers",
"token_count": 1577
} | 844 |
python_tests()
| llama_index/llama-index-integrations/readers/llama-index-readers-faiss/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-faiss/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,288 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/dinov2/configuration_dinov2.py/0 | {
"file_path": "transformers/src/transformers/models/dinov2/configuration_dinov2.py",
"repo_id": "transformers",
"token_count": 3160
} | 596 |
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
dbmodel "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel"
mock "github.com/stretchr/testify/mock"
)
// ISegmentMetadataDb is an autogenerated mock type for the ISegmentMetadataDb type
type ISegmentMetadataDb struct {
mock... | chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ISegmentMetadataDb.go/0 | {
"file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ISegmentMetadataDb.go",
"repo_id": "chroma",
"token_count": 766
} | 47 |
_type: few_shot
input_variables:
["adjective"]
prefix:
Write antonyms for the following words.
example_prompt:
_type: prompt
input_variables:
["input", "output"]
template:
"Input: {input}\nOutput: {output}"
examples:
examples.yaml
suffix:
"Input: {adjective}\nOutput:"
| langchain/libs/core/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml",
"repo_id": "langchain",
"token_count": 134
} | 429 |
# coding=utf-8
# Copyright 2023 Meta Platforms, Inc. 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... | transformers/src/transformers/models/convnextv2/modeling_convnextv2.py/0 | {
"file_path": "transformers/src/transformers/models/convnextv2/modeling_convnextv2.py",
"repo_id": "transformers",
"token_count": 9839
} | 664 |
// 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/distributed/datanode/service.go/0 | {
"file_path": "milvus/internal/distributed/datanode/service.go",
"repo_id": "milvus",
"token_count": 5185
} | 1,984 |
# 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/p_tuning/config.py/0 | {
"file_path": "peft/src/peft/tuners/p_tuning/config.py",
"repo_id": "peft",
"token_count": 732
} | 336 |
# Model arguments
model_name_or_path: alignment-handbook/zephyr-7b-sft-full
torch_dtype: null
# Data training arguments
# For definitions, see: src/h4/training/config.py
dataset_mixer:
HuggingFaceH4/ultrafeedback_binarized: 1.0
dataset_splits:
- train_prefs
- test_prefs
preprocessing_num_workers: 12
# DPOTrainer ar... | alignment-handbook/recipes/zephyr-7b-beta/dpo/config_full.yaml/0 | {
"file_path": "alignment-handbook/recipes/zephyr-7b-beta/dpo/config_full.yaml",
"repo_id": "alignment-handbook",
"token_count": 365
} | 25 |
# 🦙 Panel ChatBot Pack
Build a chatbot to talk to your Github repository.
Powered by LlamaIndex, OpenAI ChatGPT and [HoloViz Panel](https://panel.holoviz.org/reference/chat/ChatInterface.html).

__all__ = [
"ChatHunyuan",
]
| langchain/libs/langchain/langchain/chat_models/hunyuan.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chat_models/hunyuan.py",
"repo_id": "langchain",
"token_count": 46
} | 480 |
<!--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/conceptual/ethical_guidelines.md/0 | {
"file_path": "diffusers/docs/source/en/conceptual/ethical_guidelines.md",
"repo_id": "diffusers",
"token_count": 1155
} | 178 |
<jupyter_start><jupyter_text>Alpha Vantage>[Alpha Vantage](https://www.alphavantage.co) Alpha Vantage provides realtime and historical financial market data through a set of powerful and developer-friendly data APIs and spreadsheets. Use the ``AlphaVantageAPIWrapper`` to get currency exchange rates.<jupyter_code>import... | langchain/docs/docs/integrations/tools/alpha_vantage.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/tools/alpha_vantage.ipynb",
"repo_id": "langchain",
"token_count": 170
} | 172 |
import torch
import os
MEM_POOL = torch.cuda.graph_pool_handle()
# This is overridden by the cli
ENABLE_CUDA_GRAPHS = os.getenv("ENABLE_CUDA_GRAPHS", "false").lower() in {"1", "true"}
| text-generation-inference/server/text_generation_server/models/globals.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/globals.py",
"repo_id": "text-generation-inference",
"token_count": 73
} | 417 |
"""Memory used to save agent output AND intermediate steps."""
from typing import Any, Dict, List
from langchain_core.language_models import BaseLanguageModel
from langchain_core.messages import BaseMessage, get_buffer_string
from langchain.agents.format_scratchpad.openai_functions import (
format_to_openai_funct... | langchain/libs/langchain/langchain/agents/openai_functions_agent/agent_token_buffer_memory.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/openai_functions_agent/agent_token_buffer_memory.py",
"repo_id": "langchain",
"token_count": 1021
} | 475 |
<!--Copyright 2021 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/debugging.md/0 | {
"file_path": "transformers/docs/source/en/debugging.md",
"repo_id": "transformers",
"token_count": 6482
} | 493 |
# Zep
import CodeBlock from "@theme/CodeBlock";
Zep is an open source long-term memory store for LLM applications. Zep makes it easy to add relevant documents,
chat history memory & rich user data to your LLM app's prompts.
**Note:** The `ZepVectorStore` works with `Documents` and is intended to be used as a `Retrie... | langchainjs/docs/core_docs/docs/integrations/vectorstores/zep.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/zep.mdx",
"repo_id": "langchainjs",
"token_count": 766
} | 752 |
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, includi... | langserve/langserve/playground/src/components/CustomArrayControlRenderer/MaterialTableControl.tsx/0 | {
"file_path": "langserve/langserve/playground/src/components/CustomArrayControlRenderer/MaterialTableControl.tsx",
"repo_id": "langserve",
"token_count": 5768
} | 1,049 |
from langchain_community.vectorstores.epsilla import Epsilla
__all__ = ["Epsilla"]
| langchain/libs/langchain/langchain/vectorstores/epsilla.py/0 | {
"file_path": "langchain/libs/langchain/langchain/vectorstores/epsilla.py",
"repo_id": "langchain",
"token_count": 26
} | 614 |
# 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/trocr/test_modeling_trocr.py/0 | {
"file_path": "transformers/tests/models/trocr/test_modeling_trocr.py",
"repo_id": "transformers",
"token_count": 3144
} | 828 |
import type { EPub } from "epub2";
import { Document } from "@langchain/core/documents";
import { BaseDocumentLoader } from "../base.js";
/**
* A class that extends the `BaseDocumentLoader` class. It represents a
* document loader that loads documents from EPUB files.
*/
export class EPubLoader extends BaseDocument... | langchainjs/langchain/src/document_loaders/fs/epub.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/fs/epub.ts",
"repo_id": "langchainjs",
"token_count": 1142
} | 967 |
# 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/roberta/test_modeling_roberta.py/0 | {
"file_path": "transformers/tests/models/roberta/test_modeling_roberta.py",
"repo_id": "transformers",
"token_count": 10516
} | 785 |
import logging
from typing import Dict, Optional
from llama_index.legacy.evaluation.base import Evaluation
from llama_index.legacy.indices.query.query_transform.base import BaseQueryTransform
from llama_index.legacy.llm_predictor.base import LLMPredictorType
from llama_index.legacy.llms.utils import resolve_llm
from l... | llama_index/llama-index-legacy/llama_index/legacy/indices/query/query_transform/feedback_transform.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/query/query_transform/feedback_transform.py",
"repo_id": "llama_index",
"token_count": 1964
} | 1,721 |
Graph Query Engine
=======================
.. automodule:: llama_index.core.query_engine.graph_query_engine
:members:
:inherited-members:
.. :exclude-members: index_struct, query, set_llm_predictor, set_prompt_helper
| llama_index/docs/api_reference/query/query_engines/graph_query_engine.rst/0 | {
"file_path": "llama_index/docs/api_reference/query/query_engines/graph_query_engine.rst",
"repo_id": "llama_index",
"token_count": 80
} | 1,079 |
from langchain_core.vectorstores import VectorStore
import langchain_community.vectorstores
def test_compatible_vectorstore_documentation() -> None:
"""Test which vectorstores are compatible with the indexing API.
This serves as a reminder to update the documentation in [1]
that specifies which vectorst... | langchain/libs/community/tests/unit_tests/vectorstores/test_indexing_docs.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/vectorstores/test_indexing_docs.py",
"repo_id": "langchain",
"token_count": 1125
} | 427 |
<jupyter_start><jupyter_text>Step-wise, Controllable AgentsThis notebook shows you how to use our brand-new lower-level agent API, which supports a host of functionalities beyond simply executing a user query to help you create tasks, iterate through steps, and control the inputs for each step. High-Level Agent Archite... | llama_index/docs/examples/agent/agent_runner/agent_runner.ipynb/0 | {
"file_path": "llama_index/docs/examples/agent/agent_runner/agent_runner.ipynb",
"repo_id": "llama_index",
"token_count": 1970
} | 1,087 |
import torch
import math
import warnings
from torch.nn.init import _calculate_fan_in_and_fan_out
def _trunc_normal_(tensor, mean, std, a, b):
# Cut & paste from PyTorch official master until it's in a few official releases - RW
# Method based on https://people.sc.fsu.edu/~jburkardt/presentations/truncated_no... | pytorch-image-models/timm/layers/weight_init.py/0 | {
"file_path": "pytorch-image-models/timm/layers/weight_init.py",
"repo_id": "pytorch-image-models",
"token_count": 1838
} | 358 |
<jupyter_start><jupyter_code>import os
current_dir = os.getcwd()
os.chdir("../../")
import chromadb
client = chromadb.PersistentClient()
col = client.get_or_create_collection('test_collection')
print(col)
col1=client.get_collection(id=col.id)
print(col1.tenant)
assert col1.id == col.id
assert col1.tenant == col... | chroma/examples/basic_functionality/test_get_collection_by_id.ipynb/0 | {
"file_path": "chroma/examples/basic_functionality/test_get_collection_by_id.ipynb",
"repo_id": "chroma",
"token_count": 226
} | 39 |
from llama_index.legacy.program.guidance_program import GuidancePydanticProgram
from llama_index.legacy.program.llm_program import LLMTextCompletionProgram
from llama_index.legacy.program.lmformatenforcer_program import (
LMFormatEnforcerPydanticProgram,
)
from llama_index.legacy.program.multi_modal_llm_program imp... | llama_index/llama-index-legacy/llama_index/legacy/program/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/program/__init__.py",
"repo_id": "llama_index",
"token_count": 340
} | 1,599 |
"""Vector SQL Database Chain Retriever"""
from __future__ import annotations
from typing import Any, Dict, List, Optional, Sequence, Union
from langchain.callbacks.manager import CallbackManagerForChainRun
from langchain.chains.llm import LLMChain
from langchain.chains.sql_database.prompt import PROMPT, SQL_PROMPTS
f... | langchain/libs/experimental/langchain_experimental/sql/vector_sql.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/sql/vector_sql.py",
"repo_id": "langchain",
"token_count": 4317
} | 468 |
package tasks
import (
"fmt"
"time"
"github.com/milvus-io/milvus/pkg/util/merr"
"github.com/milvus-io/milvus/pkg/util/paramtable"
)
var _ schedulePolicy = &userTaskPollingPolicy{}
// newUserTaskPollingPolicy create a new user task polling schedule policy.
func newUserTaskPollingPolicy() *userTaskPollingPolicy {... | milvus/internal/querynodev2/tasks/user_task_polling_policy.go/0 | {
"file_path": "milvus/internal/querynodev2/tasks/user_task_polling_policy.go",
"repo_id": "milvus",
"token_count": 730
} | 1,916 |
import torch
from collections import OrderedDict
# Write a trivial tensor to a pt file
a= torch.tensor([[1,2,3,4], [5,6,7,8]])
o = OrderedDict()
o["test"] = a
# Write a trivial tensor to a pt file
torch.save(o, "test.pt")
###############################################################################################... | candle/candle-core/tests/pth.py/0 | {
"file_path": "candle/candle-core/tests/pth.py",
"repo_id": "candle",
"token_count": 441
} | 38 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "tools/google_places",
});
export * from "@langchain/community/tools/google_places";
| langchainjs/langchain/src/tools/google_places.ts/0 | {
"file_path": "langchainjs/langchain/src/tools/google_places.ts",
"repo_id": "langchainjs",
"token_count": 72
} | 973 |
<!--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/phi.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/phi.md",
"repo_id": "transformers",
"token_count": 2611
} | 468 |
# Pydantic Program
A pydantic program is a generic abstraction that takes in an input string and converts it to a structured Pydantic object type.
Because this abstraction is so generic, it encompasses a broad range of LLM workflows. The programs are composable and be for more generic or specific use cases.
There's ... | llama_index/docs/module_guides/querying/structured_outputs/pydantic_program.md/0 | {
"file_path": "llama_index/docs/module_guides/querying/structured_outputs/pydantic_program.md",
"repo_id": "llama_index",
"token_count": 396
} | 1,161 |
# Modified from:
# https://github.com/nyno-ai/openai-token-counter
from typing import Any, Callable, Dict, List, Optional
from llama_index.core.llms import ChatMessage, MessageRole
from llama_index.core.utils import get_tokenizer
class TokenCounter:
"""Token counter class.
Attributes:
model (Option... | llama_index/llama-index-core/llama_index/core/utilities/token_counting.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/utilities/token_counting.py",
"repo_id": "llama_index",
"token_count": 1113
} | 1,204 |
import os
from typing import Any, List
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
from langchain_community.document_loaders.unstructured import (
UnstructuredFileLoader,
satisfies_min_unstructured_version,
)
class UnstructuredEmailLoader(Un... | langchain/libs/community/langchain_community/document_loaders/email.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/email.py",
"repo_id": "langchain",
"token_count": 1533
} | 236 |
# Process text data
This guide shows specific methods for processing text datasets. Learn how to:
- Tokenize a dataset with [`~Dataset.map`].
- Align dataset labels with label ids for NLI datasets.
For a guide on how to process any type of dataset, take a look at the <a class="underline decoration-sky-400 decoration... | datasets/docs/source/nlp_process.mdx/0 | {
"file_path": "datasets/docs/source/nlp_process.mdx",
"repo_id": "datasets",
"token_count": 1109
} | 111 |
import type { Message } from "$lib/types/Message";
import type { LegacyParamatersTemplateInput } from "$lib/types/Template";
import Handlebars from "handlebars";
Handlebars.registerHelper("ifUser", function (this: Pick<Message, "from" | "content">, options) {
if (this.from == "user") return options.fn(this);
});
Han... | chat-ui/src/lib/utils/template.ts/0 | {
"file_path": "chat-ui/src/lib/utils/template.ts",
"repo_id": "chat-ui",
"token_count": 290
} | 109 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/pkg/metrics/proxy_metrics.go/0 | {
"file_path": "milvus/pkg/metrics/proxy_metrics.go",
"repo_id": "milvus",
"token_count": 5362
} | 1,811 |
"""Chain that does self ask with search.
Heavily borrowed from https://github.com/ofirpress/self-ask
"""
| langchain/libs/langchain/langchain/agents/self_ask_with_search/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/self_ask_with_search/__init__.py",
"repo_id": "langchain",
"token_count": 32
} | 445 |
from langchain_community.tools.jira.tool import JiraAction
__all__ = ["JiraAction"]
| langchain/libs/langchain/langchain/tools/jira/tool.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/jira/tool.py",
"repo_id": "langchain",
"token_count": 28
} | 605 |
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Wellknown",
"description": "A registry of AI Plugins.",
"contact": {
"name": "Wellknown",
"url": "https://wellknown.ai",
"email": "cfortuner@gmail.com"
},
"x-logo": {
"url": "http:... | langchain/libs/community/tests/unit_tests/examples/test_specs/wellknown/apispec.json/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/examples/test_specs/wellknown/apispec.json",
"repo_id": "langchain",
"token_count": 725
} | 384 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.