text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
---
hide_table_of_contents: true
sidebar_class_name: hidden
---
import CodeBlock from "@theme/CodeBlock";
import Tagging from "@examples/chains/openai_functions_tagging.ts";
# `Tagging`
:::tip Compatibility
Must be used with an [OpenAI Functions](https://platform.openai.com/docs/guides/gpt/function-calling) model.
:... | langchainjs/docs/core_docs/docs/modules/chains/additional/openai_functions/tagging.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/chains/additional/openai_functions/tagging.mdx",
"repo_id": "langchainjs",
"token_count": 209
} | 752 |
import asyncio
import multiprocessing
import os
import re
import warnings
from concurrent.futures import ProcessPoolExecutor
from enum import Enum
from functools import partial, reduce
from hashlib import sha256
from itertools import repeat
from pathlib import Path
from typing import Any, Generator, List, Optional, Seq... | llama_index/llama-index-core/llama_index/core/ingestion/pipeline.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/ingestion/pipeline.py",
"repo_id": "llama_index",
"token_count": 15742
} | 1,157 |
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "vectorstores/closevector/node",
});
export * from "@langchain/community/vectorstores/closevector/node";
| langchainjs/langchain/src/vectorstores/closevector/node.ts/0 | {
"file_path": "langchainjs/langchain/src/vectorstores/closevector/node.ts",
"repo_id": "langchainjs",
"token_count": 77
} | 935 |
# Perform Evaluations on LlamaIndex with UpTrain
**Overview**: In this example, we will see how to use UpTrain with LlamaIndex.
**Problem**: There are two main problems:
1. The data that most Large Language Models are trained on is not representative of the data that they are used on. This leads to a mismatch betwee... | llama_index/docs/community/integrations/uptrain.md/0 | {
"file_path": "llama_index/docs/community/integrations/uptrain.md",
"repo_id": "llama_index",
"token_count": 6677
} | 1,066 |
<!--Copyright 2020 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/ja/model_doc/bert.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/bert.md",
"repo_id": "transformers",
"token_count": 6595
} | 490 |
# basic-critique-revise
Iteratively generate schema candidates and revise them based on errors.
## Environment Setup
This template uses OpenAI function calling, so you will need to set the `OPENAI_API_KEY` environment variable in order to use this template.
## Usage
To use this package, you should first have the L... | langchain/templates/basic-critique-revise/README.md/0 | {
"file_path": "langchain/templates/basic-critique-revise/README.md",
"repo_id": "langchain",
"token_count": 616
} | 658 |
<jupyter_start><jupyter_text>LLM Symbolic Math This notebook showcases using LLMs and Python to Solve Algebraic Equations. Under the hood is makes use of [SymPy](https://www.sympy.org/en/index.html).<jupyter_code>from langchain_experimental.llm_symbolic_math.base import LLMSymbolicMathChain
from langchain_openai import... | langchain/cookbook/llm_symbolic_math.ipynb/0 | {
"file_path": "langchain/cookbook/llm_symbolic_math.ipynb",
"repo_id": "langchain",
"token_count": 392
} | 73 |
## ----------------------------------------------------------
# A SDXL pipeline can take unlimited weighted prompt
#
# Author: Andrew Zhu
# Github: https://github.com/xhinker
# Medium: https://medium.com/@xhinker
## -----------------------------------------------------------
import inspect
import os
from typing import... | diffusers/examples/community/lpw_stable_diffusion_xl.py/0 | {
"file_path": "diffusers/examples/community/lpw_stable_diffusion_xl.py",
"repo_id": "diffusers",
"token_count": 49569
} | 203 |
import pickle
from copy import deepcopy
from itertools import chain, islice
import numpy as np
import pandas as pd
import pyarrow as pa
import pyarrow.compute as pc
import pytest
from datasets import Dataset, load_dataset
from datasets.combine import concatenate_datasets, interleave_datasets
from datasets.features im... | datasets/tests/test_iterable_dataset.py/0 | {
"file_path": "datasets/tests/test_iterable_dataset.py",
"repo_id": "datasets",
"token_count": 36328
} | 157 |
import pytest
import unittest
from enum import Enum
import random
import time
import threading
import os
import uuid
import json
import pandas as pd
from datetime import datetime
from prettytable import PrettyTable
import functools
from time import sleep
from base.database_wrapper import ApiDatabaseWrapper
from base.co... | milvus/tests/python_client/chaos/checker.py/0 | {
"file_path": "milvus/tests/python_client/chaos/checker.py",
"repo_id": "milvus",
"token_count": 32082
} | 2,113 |
<!---
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 ... | transformers/docs/source/en/troubleshooting.md/0 | {
"file_path": "transformers/docs/source/en/troubleshooting.md",
"repo_id": "transformers",
"token_count": 2555
} | 501 |
from langchain_community.embeddings.deepinfra import (
DeepInfraEmbeddings,
)
__all__ = ["DeepInfraEmbeddings"]
| langchain/libs/langchain/langchain/embeddings/deepinfra.py/0 | {
"file_path": "langchain/libs/langchain/langchain/embeddings/deepinfra.py",
"repo_id": "langchain",
"token_count": 43
} | 500 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-make-com/llama_index/readers/make_com/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-make-com/llama_index/readers/make_com/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,421 |
import json
from typing import Any, Dict
from langchain_core.load.serializable import Serializable, to_json_not_implemented
def default(obj: Any) -> Any:
"""Return a default value for a Serializable object or
a SerializedNotImplemented object."""
if isinstance(obj, Serializable):
return obj.to_js... | langchain/libs/core/langchain_core/load/dump.py/0 | {
"file_path": "langchain/libs/core/langchain_core/load/dump.py",
"repo_id": "langchain",
"token_count": 470
} | 416 |
# coding=utf-8
# Copyright 2022 Apple 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/LICENSE-2... | transformers/src/transformers/models/mobilevit/modeling_mobilevit.py/0 | {
"file_path": "transformers/src/transformers/models/mobilevit/modeling_mobilevit.py",
"repo_id": "transformers",
"token_count": 17766
} | 659 |
python_tests()
| llama_index/llama-index-packs/llama-index-packs-voyage-query-engine/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-voyage-query-engine/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,828 |
# 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/wavlm/test_modeling_wavlm.py/0 | {
"file_path": "transformers/tests/models/wavlm/test_modeling_wavlm.py",
"repo_id": "transformers",
"token_count": 10880
} | 851 |
[tool.poetry]
name = "pirate-speak-configurable"
version = "0.0.1"
description = "Use Configurable Alternatives to allow clients to choose their Runnables"
authors = []
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
openai = "<2"
anthropic = "^0.6.0"
cohere = "^4.34"
[tool.... | langchain/templates/pirate-speak-configurable/pyproject.toml/0 | {
"file_path": "langchain/templates/pirate-speak-configurable/pyproject.toml",
"repo_id": "langchain",
"token_count": 301
} | 663 |
<!--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/ja/tasks/idefics.md/0 | {
"file_path": "transformers/docs/source/ja/tasks/idefics.md",
"repo_id": "transformers",
"token_count": 9887
} | 522 |
# coding=utf-8
# Copyright 2022 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... | transformers/tests/models/vision_encoder_decoder/test_modeling_tf_vision_encoder_decoder.py/0 | {
"file_path": "transformers/tests/models/vision_encoder_decoder/test_modeling_tf_vision_encoder_decoder.py",
"repo_id": "transformers",
"token_count": 18370
} | 742 |
// 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/segment_manager.go/0 | {
"file_path": "milvus/internal/datacoord/segment_manager.go",
"repo_id": "milvus",
"token_count": 7935
} | 1,769 |
"""Util that calls Jira."""
from typing import Any, Dict, List, Optional
from langchain_core.pydantic_v1 import BaseModel, Extra, root_validator
from langchain_core.utils import get_from_dict_or_env
# TODO: think about error handling, more specific api specs, and jql/project limits
class JiraAPIWrapper(BaseModel):
... | langchain/libs/community/langchain_community/utilities/jira.py/0 | {
"file_path": "langchain/libs/community/langchain_community/utilities/jira.py",
"repo_id": "langchain",
"token_count": 2976
} | 306 |
from __future__ import annotations
import base64
import logging
import uuid
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Tuple,
Type,
)
import numpy as np
from langchain_core.documents import Document
from langchain_core.embeddings import Embed... | langchain/libs/community/langchain_community/vectorstores/chroma.py/0 | {
"file_path": "langchain/libs/community/langchain_community/vectorstores/chroma.py",
"repo_id": "langchain",
"token_count": 14675
} | 313 |
//load the candle yolo wasm module
import init, { Model, ModelPose } from "./build/m.js";
async function fetchArrayBuffer(url) {
const cacheName = "yolo-candle-cache";
const cache = await caches.open(cacheName);
const cachedResponse = await cache.match(url);
if (cachedResponse) {
const data = await cachedR... | candle/candle-wasm-examples/yolo/yoloWorker.js/0 | {
"file_path": "candle/candle-wasm-examples/yolo/yoloWorker.js",
"repo_id": "candle",
"token_count": 756
} | 95 |
python_sources()
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-packs/llama-index-packs-corrective-rag/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-corrective-rag/BUILD",
"repo_id": "llama_index",
"token_count": 25
} | 1,779 |
poetry_requirements(
name="root",
)
| llama_index/BUILD/0 | {
"file_path": "llama_index/BUILD",
"repo_id": "llama_index",
"token_count": 17
} | 1,107 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export4.dtd">
<en-export export-date="20230611T011239Z" application="Evernote" version="10.56.9">
<note>
<title>Summer Training Program</title>
<created>20221227T015948Z</created>
<source>... | langchain/libs/community/tests/unit_tests/document_loaders/sample_documents/sample_notebook_missingcontenttag.enex/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_loaders/sample_documents/sample_notebook_missingcontenttag.enex",
"repo_id": "langchain",
"token_count": 208
} | 391 |
// 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/core/src/common/Json.h/0 | {
"file_path": "milvus/internal/core/src/common/Json.h",
"repo_id": "milvus",
"token_count": 2268
} | 1,654 |
# RWKV-4
This page covers how to use the `RWKV-4` wrapper within LangChain.
It is broken into two parts: installation and setup, and then usage with an example.
## Installation and Setup
- Install the Python package with `pip install rwkv`
- Install the tokenizer Python package with `pip install tokenizer`
- Download... | langchain/docs/docs/integrations/providers/rwkv.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/rwkv.mdx",
"repo_id": "langchain",
"token_count": 678
} | 147 |
// 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/proxy/accesslog/formatter.go/0 | {
"file_path": "milvus/internal/proxy/accesslog/formatter.go",
"repo_id": "milvus",
"token_count": 1497
} | 1,957 |
// Copyright 2019 PingCAP, 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 agreed to i... | milvus/pkg/log/zap_text_encoder.go/0 | {
"file_path": "milvus/pkg/log/zap_text_encoder.go",
"repo_id": "milvus",
"token_count": 6971
} | 1,885 |
from llama_index.readers.wikipedia.base import WikipediaReader
__all__ = ["WikipediaReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-wikipedia/llama_index/readers/wikipedia/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-wikipedia/llama_index/readers/wikipedia/__init__.py",
"repo_id": "llama_index",
"token_count": 26
} | 1,573 |
python_sources()
| llama_index/llama-index-core/llama_index/core/agent/custom/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/agent/custom/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,161 |
"""Test Epsilla functionality."""
from langchain_community.vectorstores import Epsilla
from tests.integration_tests.vectorstores.fake_embeddings import (
FakeEmbeddings,
fake_texts,
)
def _test_from_texts() -> Epsilla:
from pyepsilla import vectordb
embeddings = FakeEmbeddings()
client = vectordb... | langchain/libs/community/tests/integration_tests/vectorstores/test_epsilla.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_epsilla.py",
"repo_id": "langchain",
"token_count": 356
} | 359 |
from langchain_community.tools.file_management.read import ReadFileInput, ReadFileTool
__all__ = ["ReadFileInput", "ReadFileTool"]
| langchain/libs/langchain/langchain/tools/file_management/read.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/file_management/read.py",
"repo_id": "langchain",
"token_count": 38
} | 550 |
# coding=utf-8
# Copyright 2022 The Fairseq Authors and The Google Flax Team 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
#
# ... | transformers/src/transformers/models/opt/modeling_flax_opt.py/0 | {
"file_path": "transformers/src/transformers/models/opt/modeling_flax_opt.py",
"repo_id": "transformers",
"token_count": 13784
} | 665 |
<jupyter_start><jupyter_text>Gradient Embeddings[Gradient](https://gradient.ai) offers embeddings model that can be easily integrated with LlamaIndex. Below is an example of how to use it with LlamaIndex.<jupyter_code>%pip install llama-index-llms-gradient
%pip install llama-index-embeddings-gradient
# Install the requ... | llama_index/docs/examples/embeddings/gradient.ipynb/0 | {
"file_path": "llama_index/docs/examples/embeddings/gradient.ipynb",
"repo_id": "llama_index",
"token_count": 841
} | 1,058 |
python_sources()
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-docarray/llama_index/vector_stores/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-docarray/llama_index/vector_stores/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,479 |
declare module "*.ttf" {
const value: ArrayBuffer;
export default value;
}
| chat-ui/src/ambient.d.ts/0 | {
"file_path": "chat-ui/src/ambient.d.ts",
"repo_id": "chat-ui",
"token_count": 26
} | 91 |
python_sources()
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-text-embeddings-inference/llama_index/embeddings/text_embeddings_inference/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-text-embeddings-inference/llama_index/embeddings/text_embeddings_inference/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,287 |
import time
import copy
import logging
from . import locust_user
from .base import BaseRunner
from milvus_benchmark import parser
from milvus_benchmark import utils
from milvus_benchmark.runners import utils as runner_utils
logger = logging.getLogger("milvus_benchmark.runners.locust")
class LocustRunner(BaseRunner):... | milvus/tests/benchmark/milvus_benchmark/runners/locust.py/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/runners/locust.py",
"repo_id": "milvus",
"token_count": 7815
} | 1,865 |
<jupyter_start><jupyter_text>Run TemplateIn `server.py`, set -```add_routes(app, chain_ext, path="/llama2_functions")```<jupyter_code>from langserve.client import RemoteRunnable
llama2_function = RemoteRunnable("http://0.0.0.0:8001/llama2_functions")
llama2_function.invoke({"question": "How does agent memory work?"})<... | langchain/templates/llama2-functions/llama2-functions.ipynb/0 | {
"file_path": "langchain/templates/llama2-functions/llama2-functions.ipynb",
"repo_id": "langchain",
"token_count": 134
} | 665 |
[isort]
default_section = FIRSTPARTY
ensure_newline_before_comments = True
force_grid_wrap = 0
include_trailing_comma = True
known_first_party = transformers
known_third_party =
absl
conllu
datasets
elasticsearch
fairseq
faiss-cpu
fastprogress
fire
fugashi
git
h5py
matplo... | tokenizers/bindings/python/setup.cfg/0 | {
"file_path": "tokenizers/bindings/python/setup.cfg",
"repo_id": "tokenizers",
"token_count": 386
} | 438 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/llama_index/readers/macrometa_gdn/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-macrometa-gdn/llama_index/readers/macrometa_gdn/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,402 |
## candle-rwkv
The [RWKV model](https://wiki.rwkv.com/) is a recurrent neural network model
with performance on par with transformer architectures. Several variants are
available, candle implements the v5 version and can be used with Eagle 7B([blog
post](https://blog.rwkv.com/p/eagle-7b-soaring-past-transformers)).
`... | candle/candle-examples/examples/rwkv/README.md/0 | {
"file_path": "candle/candle-examples/examples/rwkv/README.md",
"repo_id": "candle",
"token_count": 231
} | 51 |
receivers:
otlp:
protocols:
grpc:
http:
exporters:
logging:
zipkin:
endpoint: "http://zipkin:9411/api/v2/spans"
service:
pipelines:
traces:
receivers: [otlp]
exporters: [zipkin]
| chroma/examples/observability/otel-collector-config.yaml/0 | {
"file_path": "chroma/examples/observability/otel-collector-config.yaml",
"repo_id": "chroma",
"token_count": 111
} | 42 |
"""Tool for the SemanticScholar API."""
from typing import Optional, Type
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_core.tools import BaseTool
from langchain_community.utilities.semanticscholar import SemanticScholarAPIWrappe... | langchain/libs/community/langchain_community/tools/semanticscholar/tool.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/semanticscholar/tool.py",
"repo_id": "langchain",
"token_count": 418
} | 319 |
"""Paged CSV reader.
A parser for tabular data files.
"""
from pathlib import Path
from typing import Any, Dict, List, Optional
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
class PagedCSVReader(BaseReader):
"""Paged CSV parser.
Displayed each row in an... | llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/paged_csv/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/paged_csv/base.py",
"repo_id": "llama_index",
"token_count": 693
} | 1,403 |
"""Hugging Face file reader.
A parser for HF files.
"""
import json
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Dict, List
import pandas as pd
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
class HuggingFaceFSReader(BaseRea... | llama_index/llama-index-integrations/readers/llama-index-readers-huggingface-fs/llama_index/readers/huggingface_fs/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-huggingface-fs/llama_index/readers/huggingface_fs/base.py",
"repo_id": "llama_index",
"token_count": 844
} | 1,380 |
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
import { Callbacks } from "@langchain/core/callbacks/manager";
import { AgentAction, AgentFinish } from "@langchain/core/agents";
import { OutputParserException } from "@langchain/core/output_parsers";
import { renderTemplate } from... | langchainjs/langchain/src/agents/structured_chat/outputParser.ts/0 | {
"file_path": "langchainjs/langchain/src/agents/structured_chat/outputParser.ts",
"repo_id": "langchainjs",
"token_count": 1907
} | 852 |
// 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/mock_data.go/0 | {
"file_path": "milvus/internal/querynodev2/pipeline/mock_data.go",
"repo_id": "milvus",
"token_count": 2010
} | 2,044 |
package httpserver
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
)
type DatabaseReq struct {
DbName string `json:"dbName"`
}
func (req *DatabaseReq) GetDbName() string { return req.DbName }
type CollectionNameReq struct {
DbName string `json:"... | milvus/internal/distributed/proxy/httpserver/request_v2.go/0 | {
"file_path": "milvus/internal/distributed/proxy/httpserver/request_v2.go",
"repo_id": "milvus",
"token_count": 4382
} | 1,986 |
#!/usr/bin/make -f
export HOME = $(CURDIR)
%:
dh $@
override_dh_auto_build:
echo "skip build"
override_dh_auto_install:
mkdir -p $(PWD)/debian/milvus/usr/bin
mkdir -p $(PWD)/debian/milvus/usr/lib/milvus/
mkdir -p $(PWD)/debian/milvus/etc/milvus/configs/advanced
mkdir -p $(PWD)/debian/milvus/var/lib/milvus/mini... | milvus/build/deb/debian/rules/0 | {
"file_path": "milvus/build/deb/debian/rules",
"repo_id": "milvus",
"token_count": 604
} | 1,834 |
#!/usr/bin/env python
"""Example of configurable runnables.
This example shows how to use two options for configuration of runnables:
1) Configurable Fields: Use this to specify values for a given initialization parameter
2) Configurable Alternatives: Use this to specify complete alternative runnables
"""
from typing... | langserve/examples/configurable_chain/server.py/0 | {
"file_path": "langserve/examples/configurable_chain/server.py",
"repo_id": "langserve",
"token_count": 1346
} | 1,024 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/readers/llama-index-readers-steamship/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-steamship/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,556 |
# 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/wuerstchen/test_wuerstchen_combined.py/0 | {
"file_path": "diffusers/tests/pipelines/wuerstchen/test_wuerstchen_combined.py",
"repo_id": "diffusers",
"token_count": 3551
} | 287 |
# coding=utf-8
# 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 requir... | alignment-handbook/src/alignment/configs.py/0 | {
"file_path": "alignment-handbook/src/alignment/configs.py",
"repo_id": "alignment-handbook",
"token_count": 4235
} | 24 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-minio/llama_index/readers/minio/boto3_client/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-minio/llama_index/readers/minio/boto3_client/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,486 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "llms/googlepalm",
});
export * from "@langchain/community/llms/googlepalm";
| langchainjs/langchain/src/llms/googlepalm.ts/0 | {
"file_path": "langchainjs/langchain/src/llms/googlepalm.ts",
"repo_id": "langchainjs",
"token_count": 74
} | 889 |
"""Qdrant reader."""
from typing import Dict, List, Optional, cast
from llama_index.legacy.readers.base import BaseReader
from llama_index.legacy.schema import Document
class QdrantReader(BaseReader):
"""Qdrant reader.
Retrieve documents from existing Qdrant collections.
Args:
location:
... | llama_index/llama-index-legacy/llama_index/legacy/readers/qdrant.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/qdrant.py",
"repo_id": "llama_index",
"token_count": 3402
} | 1,765 |
// 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/storage/event_reader.go/0 | {
"file_path": "milvus/internal/storage/event_reader.go",
"repo_id": "milvus",
"token_count": 990
} | 1,927 |
#!/usr/bin/env python
import torch
from transformers import CamembertForMaskedLM, CamembertTokenizer
def fill_mask(masked_input, model, tokenizer, topk=5):
# Adapted from https://github.com/pytorch/fairseq/blob/master/fairseq/models/roberta/hub_interface.py
assert masked_input.count("<mask>") == 1
input_... | transformers/examples/legacy/run_camembert.py/0 | {
"file_path": "transformers/examples/legacy/run_camembert.py",
"repo_id": "transformers",
"token_count": 880
} | 516 |
from llama_index.core.llms.base import BaseLLM
from llama_index.llms.vertex import Vertex
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in Vertex.__mro__]
assert BaseLLM.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py",
"repo_id": "llama_index",
"token_count": 91
} | 1,242 |
# Visualizer
<tokenizerslangcontent>
<python>
## Annotation
[[autodoc]] tokenizers.tools.Annotation
## EncodingVisualizer
[[autodoc]] tokenizers.tools.EncodingVisualizer
- __call__
</python>
<rust>
The Rust API Reference is available directly on the [Docs.rs](https://docs.rs/tokenizers/latest/tokenizers/) webs... | tokenizers/docs/source-doc-builder/api/visualizer.mdx/0 | {
"file_path": "tokenizers/docs/source-doc-builder/api/visualizer.mdx",
"repo_id": "tokenizers",
"token_count": 134
} | 456 |
"""Exa (formerly Metaphor) tool spec."""
import datetime
from typing import List, Optional
from llama_index.core.schema import Document
from llama_index.core.tools.tool_spec.base import BaseToolSpec
class ExaToolSpec(BaseToolSpec):
"""Exa tool spec."""
spec_functions = [
"search",
"retrieve... | llama_index/llama-index-integrations/tools/llama-index-tools-exa/llama_index/tools/exa/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-exa/llama_index/tools/exa/base.py",
"repo_id": "llama_index",
"token_count": 3033
} | 1,437 |
from llama_index.readers.graphql.base import GraphQLReader
__all__ = ["GraphQLReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-graphql/llama_index/readers/graphql/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-graphql/llama_index/readers/graphql/__init__.py",
"repo_id": "llama_index",
"token_count": 29
} | 1,381 |
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
LABEL maintainer="Hugging Face"
ARG DEBIAN_FRONTEND=noninteractive
# Use login shell to read variables from `~/.profile` (to pass dynamic created variables between RUN commands)
SHELL ["sh", "-lc"]
# The following `ARG` are mainly used to specify the versions explicit... | transformers/docker/transformers-all-latest-gpu/Dockerfile/0 | {
"file_path": "transformers/docker/transformers-all-latest-gpu/Dockerfile",
"repo_id": "transformers",
"token_count": 1305
} | 486 |
"""Integration tests for the langchain tracer module."""
import asyncio
import os
from aiohttp import ClientSession
from langchain_community.callbacks import wandb_tracing_enabled
from langchain_community.llms import OpenAI
questions = [
(
"Who won the US Open men's final in 2019? "
"What is his ... | langchain/libs/community/tests/integration_tests/callbacks/test_wandb_tracer.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/callbacks/test_wandb_tracer.py",
"repo_id": "langchain",
"token_count": 1563
} | 341 |
python_sources()
| llama_index/llama-index-core/llama_index/core/selectors/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/selectors/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,206 |
"""RAdam Optimizer.
Implementation lifted from: https://github.com/LiyuanLucasLiu/RAdam
Paper: `On the Variance of the Adaptive Learning Rate and Beyond` - https://arxiv.org/abs/1908.03265
"""
import math
import torch
from torch.optim.optimizer import Optimizer
class RAdam(Optimizer):
def __init__(self, params, ... | pytorch-image-models/timm/optim/radam.py/0 | {
"file_path": "pytorch-image-models/timm/optim/radam.py",
"repo_id": "pytorch-image-models",
"token_count": 1967
} | 407 |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/bart/convert_bart_original_pytorch_checkpoint_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/bart/convert_bart_original_pytorch_checkpoint_to_pytorch.py",
"repo_id": "transformers",
"token_count": 2355
} | 565 |
from abc import ABC
from typing import Any, Dict, List, Literal, Optional, TypedDict, Union, cast
from langchain_core.pydantic_v1 import BaseModel, PrivateAttr
class BaseSerialized(TypedDict):
"""Base class for serialized objects."""
lc: int
id: List[str]
class SerializedConstructor(BaseSerialized):
... | langchain/libs/core/langchain_core/load/serializable.py/0 | {
"file_path": "langchain/libs/core/langchain_core/load/serializable.py",
"repo_id": "langchain",
"token_count": 3049
} | 401 |
import pytest
from langchain_community.agent_toolkits import PowerBIToolkit, create_pbi_agent
from langchain_community.chat_models import ChatOpenAI
from langchain_community.utilities.powerbi import PowerBIDataset
from langchain.utils import get_from_env
def azure_installed() -> bool:
try:
from azure.cor... | langchain/libs/langchain/tests/integration_tests/agent/test_powerbi_agent.py/0 | {
"file_path": "langchain/libs/langchain/tests/integration_tests/agent/test_powerbi_agent.py",
"repo_id": "langchain",
"token_count": 646
} | 582 |
# coding=utf-8
# Copyright 2022 Google LLC., 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
#
# U... | transformers/src/transformers/models/longt5/modeling_longt5.py/0 | {
"file_path": "transformers/src/transformers/models/longt5/modeling_longt5.py",
"repo_id": "transformers",
"token_count": 45685
} | 638 |
<jupyter_start><jupyter_text>Patch Time Series Transformer in HuggingFace - Getting StartedIn this blog, we provide examples of how to get started with PatchTST. We first demonstrate the forecasting capability of `PatchTST` on the Electricity data. We will then demonstrate the transfer learning capability of `PatchTST`... | notebooks/examples/patch_tst.ipynb/0 | {
"file_path": "notebooks/examples/patch_tst.ipynb",
"repo_id": "notebooks",
"token_count": 7448
} | 302 |
from typing import Dict, List, Optional, cast
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
class DuckDBLoader(BaseLoader):
"""Load from `DuckDB`.
Each document represents one row of the result. The `page_content_columns`
are written into... | langchain/libs/community/langchain_community/document_loaders/duckdb_loader.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/duckdb_loader.py",
"repo_id": "langchain",
"token_count": 1415
} | 246 |
pub mod tinystories;
| candle/candle-datasets/src/nlp/mod.rs/0 | {
"file_path": "candle/candle-datasets/src/nlp/mod.rs",
"repo_id": "candle",
"token_count": 6
} | 41 |
import os
from argparse import ArgumentParser
from pathlib import Path
from shutil import copyfile
from typing import List
from datasets import config
from datasets.builder import DatasetBuilder
from datasets.commands import BaseDatasetsCLICommand
from datasets.download.download_config import DownloadConfig
from datas... | datasets/src/datasets/commands/run_beam.py/0 | {
"file_path": "datasets/src/datasets/commands/run_beam.py",
"repo_id": "datasets",
"token_count": 3193
} | 127 |
import { MemoryVectorStore } from "langchain/vectorstores/memory";
import { CohereEmbeddings } from "@langchain/cohere";
import { MultiQueryRetriever } from "langchain/retrievers/multi_query";
import { ChatAnthropic } from "@langchain/anthropic";
const vectorstore = await MemoryVectorStore.fromTexts(
[
"Building... | langchainjs/examples/src/retrievers/multi_query.ts/0 | {
"file_path": "langchainjs/examples/src/retrievers/multi_query.ts",
"repo_id": "langchainjs",
"token_count": 537
} | 840 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/git/convert_git_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/git/convert_git_to_pytorch.py",
"repo_id": "transformers",
"token_count": 9474
} | 621 |
"""Test suite for the tools module."""
| langchain/libs/community/tests/unit_tests/tools/__init__.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/tools/__init__.py",
"repo_id": "langchain",
"token_count": 10
} | 423 |
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/src/transformers/models/electra/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/electra/__init__.py",
"repo_id": "transformers",
"token_count": 2221
} | 597 |
[tool.poetry]
name = "rag_conversation_zep"
version = "0.0.1"
description = "A RAG application built with Zep. Zep provides a VectorStore implementation to the chain."
authors = ["Daniel Chalef <daniel@getzep.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
openai = "<2... | langchain/templates/rag-conversation-zep/pyproject.toml/0 | {
"file_path": "langchain/templates/rag-conversation-zep/pyproject.toml",
"repo_id": "langchain",
"token_count": 349
} | 686 |
# (Gluon) SE-ResNeXt
**SE ResNeXt** is a variant of a [ResNext](https://www.paperswithcode.com/method/resnext) that employs [squeeze-and-excitation blocks](https://paperswithcode.com/method/squeeze-and-excitation-block) to enable the network to perform dynamic channel-wise feature recalibration.
The weights from this... | pytorch-image-models/docs/models/gloun-seresnext.md/0 | {
"file_path": "pytorch-image-models/docs/models/gloun-seresnext.md",
"repo_id": "pytorch-image-models",
"token_count": 2535
} | 355 |
from langchain_community.document_loaders.news import NewsURLLoader
__all__ = ["NewsURLLoader"]
| langchain/libs/langchain/langchain/document_loaders/news.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/news.py",
"repo_id": "langchain",
"token_count": 32
} | 509 |
"""txtai reader."""
from typing import Any, Dict, List
import numpy as np
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
class TxtaiReader(BaseReader):
"""txtai reader.
Retrieves documents through an existing in-memory txtai index.
These documents can ... | llama_index/llama-index-integrations/readers/llama-index-readers-txtai/llama_index/readers/txtai/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-txtai/llama_index/readers/txtai/base.py",
"repo_id": "llama_index",
"token_count": 1103
} | 1,462 |
import { ChatOllama } from "@langchain/community/chat_models/ollama";
import { ChatPromptTemplate } from "@langchain/core/prompts";
const prompt = ChatPromptTemplate.fromMessages([
[
"system",
`You are an expert translator. Format all responses as JSON objects with two keys: "original" and "translated".`,
... | langchainjs/examples/src/models/chat/integration_ollama_json_mode.ts/0 | {
"file_path": "langchainjs/examples/src/models/chat/integration_ollama_json_mode.ts",
"repo_id": "langchainjs",
"token_count": 267
} | 836 |
from langchain_core.messages import __all__
EXPECTED_ALL = [
"AIMessage",
"AIMessageChunk",
"AnyMessage",
"BaseMessage",
"BaseMessageChunk",
"ChatMessage",
"ChatMessageChunk",
"FunctionMessage",
"FunctionMessageChunk",
"HumanMessage",
"HumanMessageChunk",
"SystemMessage"... | langchain/libs/core/tests/unit_tests/messages/test_imports.py/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/messages/test_imports.py",
"repo_id": "langchain",
"token_count": 276
} | 437 |
from langchain_community.tools.searchapi.tool import SearchAPIResults, SearchAPIRun
"""SearchApi.io API Toolkit."""
"""Tool for the SearchApi.io Google SERP API."""
__all__ = ["SearchAPIResults", "SearchAPIRun"]
| langchain/libs/community/langchain_community/tools/searchapi/__init__.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/searchapi/__init__.py",
"repo_id": "langchain",
"token_count": 72
} | 310 |
import { base } from "$app/paths";
import { collections } from "$lib/server/database.js";
import { redirect } from "@sveltejs/kit";
import { ObjectId } from "mongodb";
export const load = async ({ params }) => {
try {
const assistant = await collections.assistants.findOne({
_id: new ObjectId(params.assistantId),... | chat-ui/src/routes/assistant/[assistantId]/+page.server.ts/0 | {
"file_path": "chat-ui/src/routes/assistant/[assistantId]/+page.server.ts",
"repo_id": "chat-ui",
"token_count": 178
} | 109 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "vectorstores/rockset",
});
export * from "@langchain/community/vectorstores/rockset";
| langchainjs/langchain/src/vectorstores/rockset.ts/0 | {
"file_path": "langchainjs/langchain/src/vectorstores/rockset.ts",
"repo_id": "langchainjs",
"token_count": 74
} | 952 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/nystromformer/convert_nystromformer_original_pytorch_checkpoint_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/nystromformer/convert_nystromformer_original_pytorch_checkpoint_to_pytorch.py",
"repo_id": "transformers",
"token_count": 1668
} | 701 |
<jupyter_start><jupyter_text>OpenAI Adapter(Old)**Please ensure OpenAI library is less than 1.0.0; otherwise, refer to the newer doc [OpenAI Adapter](./openai).**A lot of people get started with OpenAI but want to explore other models. LangChain's integrations with many model providers make this easy to do so. While La... | langchain/docs/docs/integrations/adapters/openai-old.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/adapters/openai-old.ipynb",
"repo_id": "langchain",
"token_count": 1030
} | 97 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "embeddings/gradient_ai",
});
export * from "@langchain/community/embeddings/gradient_ai";
| langchainjs/langchain/src/embeddings/gradient_ai.ts/0 | {
"file_path": "langchainjs/langchain/src/embeddings/gradient_ai.ts",
"repo_id": "langchainjs",
"token_count": 76
} | 902 |
<jupyter_start><jupyter_text>Google Speech-to-Text Audio TranscriptsThe `GoogleSpeechToTextLoader` allows to transcribe audio files with the [Google Cloud Speech-to-Text API](https://cloud.google.com/speech-to-text) and loads the transcribed text into documents.To use it, you should have the `google-cloud-speech` pytho... | langchain/docs/docs/integrations/document_loaders/google_speech_to_text.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/google_speech_to_text.ipynb",
"repo_id": "langchain",
"token_count": 1264
} | 115 |
<jupyter_start><jupyter_text>CoNLL-U>[CoNLL-U](https://universaldependencies.org/format.html) is revised version of the CoNLL-X format. Annotations are encoded in plain text files (UTF-8, normalized to NFC, using only the LF character as line break, including an LF character at the end of file) with three types of line... | langchain/docs/docs/integrations/document_loaders/conll-u.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/conll-u.ipynb",
"repo_id": "langchain",
"token_count": 274
} | 96 |
from langchain_community.tools.wikipedia.tool import WikipediaQueryRun
__all__ = ["WikipediaQueryRun"]
| langchain/libs/langchain/langchain/tools/wikipedia/tool.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/wikipedia/tool.py",
"repo_id": "langchain",
"token_count": 27
} | 589 |
import pytest
def pytest_addoption(parser):
parser.addoption("--runslow", action="store_true", default=False, help="run slow tests")
def pytest_configure(config):
config.addinivalue_line("markers", "slow: mark test as slow to run")
def pytest_collection_modifyitems(config, items):
if config.getoption(... | tokenizers/bindings/python/conftest.py/0 | {
"file_path": "tokenizers/bindings/python/conftest.py",
"repo_id": "tokenizers",
"token_count": 217
} | 412 |
python_sources()
| llama_index/llama-index-integrations/extractors/llama-index-extractors-marvin/llama_index/extractors/marvin/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/extractors/llama-index-extractors-marvin/llama_index/extractors/marvin/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,240 |
import json
import logging
import re
from typing import (
Any,
List,
)
from langchain_core.chat_history import BaseChatMessageHistory
from langchain_core.messages import (
BaseMessage,
message_to_dict,
messages_from_dict,
)
logger = logging.getLogger(__name__)
class SingleStoreDBChatMessageHisto... | langchain/libs/community/langchain_community/chat_message_histories/singlestoredb.py/0 | {
"file_path": "langchain/libs/community/langchain_community/chat_message_histories/singlestoredb.py",
"repo_id": "langchain",
"token_count": 5028
} | 241 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.