text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
"""Document store."""
from typing import Dict, List, Optional, Sequence, Tuple
from llama_index.legacy.schema import BaseNode, TextNode
from llama_index.legacy.storage.docstore.types import (
BaseDocumentStore,
RefDocInfo,
)
from llama_index.legacy.storage.docstore.utils import doc_to_json, json_to_doc
from l... | llama_index/llama-index-legacy/llama_index/legacy/storage/docstore/keyval_docstore.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/docstore/keyval_docstore.py",
"repo_id": "llama_index",
"token_count": 9755
} | 1,715 |
// 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/repack_func_test.go/0 | {
"file_path": "milvus/internal/proxy/repack_func_test.go",
"repo_id": "milvus",
"token_count": 2186
} | 1,748 |
<jupyter_start><jupyter_text>Logging to fileThis example shows how to print logs to file. It shows how to use the `FileCallbackHandler`, which does the same thing as [`StdOutCallbackHandler`](https://python.langchain.com/docs/modules/callbacks/get-started), but instead writes the output to file. It also uses the `logur... | langchain/docs/docs/modules/callbacks/filecallbackhandler.ipynb/0 | {
"file_path": "langchain/docs/docs/modules/callbacks/filecallbackhandler.ipynb",
"repo_id": "langchain",
"token_count": 521
} | 189 |
# coding=utf-8
# Copyright 2023 Authors: Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan,
# Kaitao Song, Ding Liang, Tong Lu, Ping Luo, Ling Shao 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... | transformers/src/transformers/models/pvt/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/pvt/__init__.py",
"repo_id": "transformers",
"token_count": 907
} | 683 |
import { Document } from "@langchain/core/documents";
import { BasePromptTemplate } from "@langchain/core/prompts";
/**
* Formats a document using a given prompt template.
*
* @async
* @param {Document} document - The document to format.
* @param {BasePromptTemplate} prompt - The prompt template to use for format... | langchainjs/langchain/src/schema/prompt_template.ts/0 | {
"file_path": "langchainjs/langchain/src/schema/prompt_template.ts",
"repo_id": "langchainjs",
"token_count": 451
} | 948 |
import { test } from "@jest/globals";
import { OpenAI, ChatOpenAI } from "@langchain/openai";
import { PromptTemplate } from "@langchain/core/prompts";
import { LLMChain } from "../llm_chain.js";
import { SequentialChain } from "../sequential_chain.js";
test("Test SequentialChain example usage", async () => {
// Thi... | langchainjs/langchain/src/chains/tests/sequential_chain.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/chains/tests/sequential_chain.int.test.ts",
"repo_id": "langchainjs",
"token_count": 1091
} | 897 |
from typing import TYPE_CHECKING, Optional, Type
from langchain_core.callbacks import (
CallbackManagerForToolRun,
)
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_core.tools import BaseTool
if TYPE_CHECKING:
# This is for linting and IDE typehints
import multion
else:
try:
... | langchain/libs/community/langchain_community/tools/multion/update_session.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/multion/update_session.py",
"repo_id": "langchain",
"token_count": 953
} | 289 |
"""Provides the PanelChatPack."""
import os
from typing import Any, Dict
from llama_index.core.llama_pack.base import BaseLlamaPack
ENVIRONMENT_VARIABLES = [
"GITHUB_TOKEN",
"OPENAI_API_KEY",
]
class PanelChatPack(BaseLlamaPack):
"""Panel chatbot pack."""
def get_modules(self) -> Dict[str, Any]:
... | llama_index/llama-index-packs/llama-index-packs-panel-chatbot/llama_index/packs/panel_chatbot/base.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-panel-chatbot/llama_index/packs/panel_chatbot/base.py",
"repo_id": "llama_index",
"token_count": 534
} | 1,671 |
from __future__ import print_function
from utils import *
import logging
from pprint import pprint
from kubernetes import client, config
from kubernetes.client.rest import ApiException
from milvus_benchmark import config as cf
logger = logging.getLogger("milvus_benchmark.chaos.chaosOpt")
class ChaosOpt(object):
d... | milvus/tests/benchmark/milvus_benchmark/chaos/chaos_opt.py/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/chaos/chaos_opt.py",
"repo_id": "milvus",
"token_count": 1308
} | 1,956 |
poetry_requirements(
name="poetry",
)
python_requirements(
name="reqs",
)
| llama_index/llama-index-integrations/readers/llama-index-readers-weather/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-weather/BUILD",
"repo_id": "llama_index",
"token_count": 36
} | 1,564 |
# flake8: noqa
OPEN_METEO_DOCS = """BASE URL: https://api.open-meteo.com/
API Documentation
The API endpoint /v1/forecast accepts a geographical coordinate, a list of weather variables and responds with a JSON hourly weather forecast for 7 days. Time always starts at 0:00 today and contains 168 hours. All URL paramete... | langchain/libs/langchain/langchain/chains/api/open_meteo_docs.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/api/open_meteo_docs.py",
"repo_id": "langchain",
"token_count": 863
} | 498 |
# Opentracing User Guide
This guide mainly describes the use of jaeger, and the commonly used display meanings.
Jaeger, inspired by [Dapper](https://research.google.com/pubs/pub36356.html) and [OpenZipkin](https://zipkin.io/), is a distributed tracing platform created by [Uber Technologies](https://uber.github.io/) a... | milvus/docs/jaeger_guides/opentracing_user_guide.md/0 | {
"file_path": "milvus/docs/jaeger_guides/opentracing_user_guide.md",
"repo_id": "milvus",
"token_count": 1011
} | 1,772 |
"""Chain that runs an arbitrary python function."""
import functools
import logging
from typing import Any, Awaitable, Callable, Dict, List, Optional
from langchain_core.callbacks import (
AsyncCallbackManagerForChainRun,
CallbackManagerForChainRun,
)
from langchain_core.pydantic_v1 import Field
from langchai... | langchain/libs/langchain/langchain/chains/transform.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/transform.py",
"repo_id": "langchain",
"token_count": 958
} | 514 |
from typing import Generator
import pytest
from langchain_core.documents import Document
from langchain_community.storage.mongodb import MongoDBStore
pytest.importorskip("pymongo")
@pytest.fixture
def mongo_store() -> Generator:
import mongomock
# mongomock creates a mock MongoDB instance for testing purp... | langchain/libs/community/tests/integration_tests/storage/test_mongodb.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/storage/test_mongodb.py",
"repo_id": "langchain",
"token_count": 855
} | 371 |
//! Encoding Utilities. (e.g., one-hot/cold encoding)
use candle::{bail, DType, Result, Tensor, WithDType};
/// One-hot/cold encoding.
///
/// Given an input tensor of indices, this function returns a tensor of the same shape as the input
/// tensor with an additional dimension of the given depth size. The values in ... | candle/candle-nn/src/encoding.rs/0 | {
"file_path": "candle/candle-nn/src/encoding.rs",
"repo_id": "candle",
"token_count": 2025
} | 63 |
import { ChatOpenAI } from "@langchain/openai";
import { Run } from "@langchain/core/tracers/base";
import { ChatPromptTemplate } from "@langchain/core/prompts";
const prompt = ChatPromptTemplate.fromMessages([
["ai", "You are a nice assistant."],
["human", "{question}"],
]);
const model = new ChatOpenAI({});
cons... | langchainjs/examples/src/guides/expression_language/with_listeners.ts/0 | {
"file_path": "langchainjs/examples/src/guides/expression_language/with_listeners.ts",
"repo_id": "langchainjs",
"token_count": 625
} | 822 |
# https://github.com/fpgaminer/GPTQ-triton
"""
Mostly the same as the autotuner in Triton, but with a few changes like using 40 runs instead of 100.
"""
import builtins
import math
import time
from typing import Dict
import triton
class Autotuner(triton.KernelInterface):
def __init__(
self,
fn,
... | text-generation-inference/server/text_generation_server/utils/gptq/custom_autotune.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/utils/gptq/custom_autotune.py",
"repo_id": "text-generation-inference",
"token_count": 5116
} | 433 |
"""Zapier Tool."""
from langchain_community.tools.zapier.tool import (
ZapierNLAListActions,
ZapierNLARunAction,
)
__all__ = [
"ZapierNLARunAction",
"ZapierNLAListActions",
]
| langchain/libs/langchain/langchain/tools/zapier/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/zapier/__init__.py",
"repo_id": "langchain",
"token_count": 86
} | 601 |
from rag_weaviate.chain import chain
__all__ = ["chain"]
| langchain/templates/rag-weaviate/rag_weaviate/__init__.py/0 | {
"file_path": "langchain/templates/rag-weaviate/rag_weaviate/__init__.py",
"repo_id": "langchain",
"token_count": 20
} | 677 |
// 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/querycoordv2/observers/resource_observer.go/0 | {
"file_path": "milvus/internal/querycoordv2/observers/resource_observer.go",
"repo_id": "milvus",
"token_count": 1058
} | 1,980 |
/* eslint-disable no-process-env */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { test } from "@jest/globals";
import { BaseMessageChunk, HumanMessage } from "@langchain/core/messages";
import { BedrockChat } from "@langchain/community/chat_models/bedrock/web";
import { AnthropicFunctions } fro... | langchainjs/langchain/src/experimental/chat_models/tests/anthropic_functions.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/chat_models/tests/anthropic_functions.int.test.ts",
"repo_id": "langchainjs",
"token_count": 1813
} | 909 |
# Installation
## Official release
To install LangChain run:
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from "@theme/CodeBlock";
<Tabs>
<TabItem value="pip" label="Pip" default>
<CodeBlock language="bash">pip install langchain</CodeBlock>
</TabItem>
<TabItem val... | langchain/docs/docs/get_started/installation.mdx/0 | {
"file_path": "langchain/docs/docs/get_started/installation.mdx",
"repo_id": "langchain",
"token_count": 659
} | 89 |
import torch
import torch.nn as nn
class SpaceToDepth(nn.Module):
bs: torch.jit.Final[int]
def __init__(self, block_size=4):
super().__init__()
assert block_size == 4
self.bs = block_size
def forward(self, x):
N, C, H, W = x.size()
x = x.view(N, C, H // self.bs, s... | pytorch-image-models/timm/layers/space_to_depth.py/0 | {
"file_path": "pytorch-image-models/timm/layers/space_to_depth.py",
"repo_id": "pytorch-image-models",
"token_count": 938
} | 357 |
# Prediction Guard
This page covers how to use the Prediction Guard ecosystem within LangChain.
It is broken into two parts: installation and setup, and then references to specific Prediction Guard wrappers.
## Installation and Setup
- Install the Python SDK with `pip install predictionguard`
- Get a Prediction Guard... | langchain/docs/docs/integrations/providers/predictionguard.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/predictionguard.mdx",
"repo_id": "langchain",
"token_count": 1252
} | 145 |
# Tables Packs
## Chain-of-table Pack
This LlamaPack implements the [Chain-of-Table paper by Wang et al.](https://arxiv.org/pdf/2401.04398v1.pdf).
Chain-of-Table proposes the following: given a user query over tabular data, plan out a sequence of tabular operations over the table to retrieve the right information in... | llama_index/llama-index-packs/llama-index-packs-tables/README.md/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-tables/README.md",
"repo_id": "llama_index",
"token_count": 1482
} | 1,680 |
# 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/vit_msn/convert_msn_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/vit_msn/convert_msn_to_pytorch.py",
"repo_id": "transformers",
"token_count": 4263
} | 711 |
"""Spark SQL agent."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from langchain_core.callbacks import BaseCallbackManager, Callbacks
from langchain_core.language_models import BaseLanguageModel
from langchain_community.agent_toolkits.spark_sql.prompt import SQL_PR... | langchain/libs/community/langchain_community/agent_toolkits/spark_sql/base.py/0 | {
"file_path": "langchain/libs/community/langchain_community/agent_toolkits/spark_sql/base.py",
"repo_id": "langchain",
"token_count": 929
} | 216 |
---
{{ card_data }}
---
<!-- This model card has been generated automatically according to the information the training script had access to. You
should probably proofread and complete it, then remove this comment. -->
{{ model_description }}
## Intended uses & limitations
#### How to use
```python
# TODO: add an ... | diffusers/src/diffusers/utils/model_card_template.md/0 | {
"file_path": "diffusers/src/diffusers/utils/model_card_template.md",
"repo_id": "diffusers",
"token_count": 138
} | 256 |
<jupyter_start><jupyter_text>TSV>A [tab-separated values (TSV)](https://en.wikipedia.org/wiki/Tab-separated_values) file is a simple, text-based file format for storing tabular data.[3] Records are separated by newlines, and values within a record are separated by tab characters. `UnstructuredTSVLoader`You can also lo... | langchain/docs/docs/integrations/document_loaders/tsv.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/tsv.ipynb",
"repo_id": "langchain",
"token_count": 909
} | 120 |
import logging
from typing import Callable, Literal, Optional, Union
from datasets import Dataset, Value
from transformers import AutoTokenizer
from ..trainer.utils import ConstantLengthDataset
FORMAT_MAPPING = {
"chatml": [{"content": Value(dtype="string", id=None), "role": Value(dtype="string", id=None)}],
... | trl/trl/extras/dataset_formatting.py/0 | {
"file_path": "trl/trl/extras/dataset_formatting.py",
"repo_id": "trl",
"token_count": 1400
} | 786 |
<jupyter_start><jupyter_text>Query Pipeline over Pandas DataFramesThis is a simple example that builds a query pipeline that can perform structured operations over a Pandas DataFrame to satisfy a user query, using LLMs to infer the set of operations.This can be treated as the "from-scratch" version of our `PandasQueryE... | llama_index/docs/examples/pipeline/query_pipeline_pandas.ipynb/0 | {
"file_path": "llama_index/docs/examples/pipeline/query_pipeline_pandas.ipynb",
"repo_id": "llama_index",
"token_count": 1553
} | 1,121 |
// eslint-disable-next-line import/no-extraneous-dependencies
import { AxiosRequestConfig, AxiosPromise } from "axios";
export default function fetchAdapter(config: AxiosRequestConfig): AxiosPromise;
| langchainjs/langchain/src/util/axios-fetch-adapter.d.ts/0 | {
"file_path": "langchainjs/langchain/src/util/axios-fetch-adapter.d.ts",
"repo_id": "langchainjs",
"token_count": 59
} | 960 |
import { BaseLanguageModel } from "@langchain/core/language_models/base";
import { Serialized } from "@langchain/core/load/serializable";
import { mapStoredMessagesToChatMessages } from "@langchain/core/messages";
import {
Runnable,
RunnableConfig,
RunnableLambda,
getCallbackManagerForConfig,
} from "@langchain... | langchainjs/langchain/src/smith/runner_utils.ts/0 | {
"file_path": "langchainjs/langchain/src/smith/runner_utils.ts",
"repo_id": "langchainjs",
"token_count": 7112
} | 966 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/tools/llama-index-tools-code-interpreter/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-code-interpreter/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,478 |
import { test, expect } from "@jest/globals";
import { ChatOpenAI } from "@langchain/openai";
import { createTaggingChain } from "../tagging.js";
test("tagging chain", async () => {
const chain = createTaggingChain(
{
type: "object",
properties: {
sentiment: { type: "string" },
tone:... | langchainjs/langchain/src/chains/openai_functions/tests/tagging.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/chains/openai_functions/tests/tagging.int.test.ts",
"repo_id": "langchainjs",
"token_count": 300
} | 906 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/swin/test_modeling_swin.py/0 | {
"file_path": "transformers/tests/models/swin/test_modeling_swin.py",
"repo_id": "transformers",
"token_count": 8752
} | 752 |
import { test } from "@jest/globals";
import { HumanMessage } from "@langchain/core/messages";
import * as fs from "node:fs/promises";
import { fileURLToPath } from "node:url";
import * as path from "node:path";
import { ChatOpenAI } from "../chat_models.js";
test("Test ChatOpenAI with a file", async () => {
const _... | langchainjs/libs/langchain-openai/src/tests/chat_models-vision.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-openai/src/tests/chat_models-vision.int.test.ts",
"repo_id": "langchainjs",
"token_count": 619
} | 1,064 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/src/transformers/models/mobilevit/configuration_mobilevit.py/0 | {
"file_path": "transformers/src/transformers/models/mobilevit/configuration_mobilevit.py",
"repo_id": "transformers",
"token_count": 3268
} | 716 |
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
)
// ITransaction is an autogenerated mock type for the ITransaction type
type ITransaction struct {
mock.Mock
}
// Transaction provides a mock function with given fields: ctx, fn
... | chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ITransaction.go/0 | {
"file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ITransaction.go",
"repo_id": "chroma",
"token_count": 352
} | 48 |
# coding=utf-8
# Copyright 2023 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 requi... | transformers/src/transformers/models/gptsan_japanese/tokenization_gptsan_japanese.py/0 | {
"file_path": "transformers/src/transformers/models/gptsan_japanese/tokenization_gptsan_japanese.py",
"repo_id": "transformers",
"token_count": 11883
} | 643 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/datanode/io/binlog_io.go/0 | {
"file_path": "milvus/internal/datanode/io/binlog_io.go",
"repo_id": "milvus",
"token_count": 1096
} | 1,803 |
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
module.exports = withBundleAnalyzer({}) | langchain-nextjs-template/next.config.js/0 | {
"file_path": "langchain-nextjs-template/next.config.js",
"repo_id": "langchain-nextjs-template",
"token_count": 51
} | 68 |
// 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_test.go/0 | {
"file_path": "milvus/internal/storage/event_test.go",
"repo_id": "milvus",
"token_count": 14785
} | 1,888 |
from functools import partial
import torch.nn as nn
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from ._builder import build_model_with_cfg
from ._builder import pretrained_cfg_for_features
from ._efficientnet_blocks import SqueezeExcite
from ._efficientnet_builder import decode_arch_def, resolve... | pytorch-image-models/timm/models/hardcorenas.py/0 | {
"file_path": "pytorch-image-models/timm/models/hardcorenas.py",
"repo_id": "pytorch-image-models",
"token_count": 4629
} | 385 |
#!/usr/bin/env groovy
pipeline {
agent {
kubernetes {
defaultContainer 'main'
yamlFile "ci/jenkins/pod/rte.yaml"
customWorkspace '/home/jenkins/agent/workspace'
// We allow this pod to remain active for a while, later jobs can
// reuse cache in pr... | milvus/ci/jenkins/PublishImages.groovy/0 | {
"file_path": "milvus/ci/jenkins/PublishImages.groovy",
"repo_id": "milvus",
"token_count": 8388
} | 1,717 |
<jupyter_start><jupyter_text>Structured Hierarchical RetrievalDoing RAG well over multiple documents is hard. A general framework is given a user query, first select the relevant documents before selecting the content inside.But selecting the documents can be tough - how can we dynamically select documents based on dif... | llama_index/docs/examples/query_engine/multi_doc_auto_retrieval/multi_doc_auto_retrieval.ipynb/0 | {
"file_path": "llama_index/docs/examples/query_engine/multi_doc_auto_retrieval/multi_doc_auto_retrieval.ipynb",
"repo_id": "llama_index",
"token_count": 3866
} | 1,082 |
"""Test OctoAI API wrapper."""
from pathlib import Path
import pytest
from langchain_community.llms.loading import load_llm
from langchain_community.llms.octoai_endpoint import OctoAIEndpoint
from tests.integration_tests.llms.utils import assert_llm_equality
def test_octoai_endpoint_text_generation() -> None:
... | langchain/libs/community/tests/integration_tests/llms/test_octoai_endpoint.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/llms/test_octoai_endpoint.py",
"repo_id": "langchain",
"token_count": 886
} | 365 |
# coding=utf-8
# Copyright 2021 The OpenAI Team Authors 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/L... | text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_vision.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_vision.py",
"repo_id": "text-generation-inference",
"token_count": 9661
} | 415 |
import logging
from typing import Any, List, Mapping, Optional
import requests
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_community.llms.utils import enforce_stop_tokens
logger = logging.getLogger(__name__)
class ChatGLM(LLM):
... | langchain/libs/community/langchain_community/llms/chatglm.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/chatglm.py",
"repo_id": "langchain",
"token_count": 1764
} | 261 |
"""
This module contains the ConneryToolkit.
"""
from .toolkit import ConneryToolkit
__all__ = ["ConneryToolkit"]
| langchain/libs/community/langchain_community/agent_toolkits/connery/__init__.py/0 | {
"file_path": "langchain/libs/community/langchain_community/agent_toolkits/connery/__init__.py",
"repo_id": "langchain",
"token_count": 37
} | 227 |
// 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/data_codec_test.go/0 | {
"file_path": "milvus/internal/storage/data_codec_test.go",
"repo_id": "milvus",
"token_count": 12272
} | 1,860 |
package kafka
import (
"testing"
"github.com/confluentinc/confluent-kafka-go/kafka"
"github.com/stretchr/testify/assert"
)
func TestKafkaMessage_All(t *testing.T) {
topic := "t"
msg := &kafka.Message{TopicPartition: kafka.TopicPartition{Topic: &topic, Partition: 0, Offset: 0}, Value: nil, Headers: nil}
km := &... | milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_message_test.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_message_test.go",
"repo_id": "milvus",
"token_count": 228
} | 1,956 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-dynamodb/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-dynamodb/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,589 |
# coding=utf-8
# Copyright 2023 Mistral AI and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | transformers/tests/models/mistral/test_modeling_mistral.py/0 | {
"file_path": "transformers/tests/models/mistral/test_modeling_mistral.py",
"repo_id": "transformers",
"token_count": 11190
} | 757 |
## MM-IMDb
Based on the script [`run_mmimdb.py`](https://github.com/huggingface/transformers/blob/main/examples/research_projects/mm-imdb/run_mmimdb.py).
[MM-IMDb](http://lisi1.unal.edu.co/mmimdb/) is a Multimodal dataset with around 26,000 movies including images, plots and other metadata.
### Training on MM-IMDb
... | transformers/examples/research_projects/mm-imdb/README.md/0 | {
"file_path": "transformers/examples/research_projects/mm-imdb/README.md",
"repo_id": "transformers",
"token_count": 284
} | 565 |
package msgstream
type WastedMockMsgStream struct {
MsgStream
AsProducerFunc func(channels []string)
BroadcastMarkFunc func(*MsgPack) (map[string][]MessageID, error)
BroadcastFunc func(*MsgPack) error
ChanFunc func() <-chan *MsgPack
}
func NewWastedMockMsgStream() *WastedMockMsgStream {
return &... | milvus/pkg/mq/msgstream/wasted_mock_msgstream.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/wasted_mock_msgstream.go",
"repo_id": "milvus",
"token_count": 245
} | 2,100 |
#!/usr/bin/env python
# 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... | transformers/scripts/pegasus/build_test_sample_spm_no_bos.py/0 | {
"file_path": "transformers/scripts/pegasus/build_test_sample_spm_no_bos.py",
"repo_id": "transformers",
"token_count": 391
} | 614 |
package dbmodel
import (
"time"
"github.com/chroma/chroma-coordinator/internal/types"
)
type SegmentMetadata struct {
SegmentID string `gorm:"segment_id;primaryKey"`
Key *string `gorm:"key;primaryKey"`
StrValue *string `gorm:"str_value"`
IntValue *int64 `gorm:"int_... | chroma/go/coordinator/internal/metastore/db/dbmodel/segment_metadata.go/0 | {
"file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/segment_metadata.go",
"repo_id": "chroma",
"token_count": 394
} | 52 |
"""Test Awa Embedding"""
from langchain_community.embeddings.awa import AwaEmbeddings
def test_awa_embedding_documents() -> None:
"""Test Awa embeddings for documents."""
documents = ["foo bar", "test document"]
embedding = AwaEmbeddings()
output = embedding.embed_documents(documents)
assert len(o... | langchain/libs/community/tests/integration_tests/embeddings/test_awa.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_awa.py",
"repo_id": "langchain",
"token_count": 205
} | 333 |
chaos:
kind: PodChaos
spec:
action: pod-kill
selector:
namespaces:
- milvus
labelSelectors:
"app.kubernetes.io/name": etcd
scheduler:
cron: "@every 20s" | milvus/tests/benchmark/milvus_benchmark/chaos/pod.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/chaos/pod.yaml",
"repo_id": "milvus",
"token_count": 103
} | 1,923 |
# These are canonical sets of parameters for different types of pipelines.
# They are set on subclasses of `PipelineTesterMixin` as `params` and
# `batch_params`.
#
# If a pipeline's set of arguments has minor changes from one of the common sets
# of arguments, do not make modifications to the existing common sets of a... | diffusers/tests/pipelines/pipeline_params.py/0 | {
"file_path": "diffusers/tests/pipelines/pipeline_params.py",
"repo_id": "diffusers",
"token_count": 1584
} | 254 |
# Copyright 2024 Kakao Brain 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 requi... | diffusers/src/diffusers/schedulers/scheduling_unclip.py/0 | {
"file_path": "diffusers/src/diffusers/schedulers/scheduling_unclip.py",
"repo_id": "diffusers",
"token_count": 6254
} | 259 |
import { describe, test } from "@jest/globals";
import { ChatMessage, HumanMessage } from "@langchain/core/messages";
import {
PromptTemplate,
ChatPromptTemplate,
AIMessagePromptTemplate,
HumanMessagePromptTemplate,
SystemMessagePromptTemplate,
} from "@langchain/core/prompts";
import { ChatFireworks } from "... | langchainjs/libs/langchain-community/src/chat_models/tests/chatfireworks.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/chat_models/tests/chatfireworks.int.test.ts",
"repo_id": "langchainjs",
"token_count": 768
} | 950 |
"""Response parser."""
import json
import re
from typing import Any
from langchain_core.language_models import BaseLanguageModel
from langchain_core.output_parsers import BaseOutputParser
from langchain_core.prompts.prompt import PromptTemplate
from langchain.chains.api.openapi.prompts import RESPONSE_TEMPLATE
from ... | langchain/libs/langchain/langchain/chains/api/openapi/response_chain.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/api/openapi/response_chain.py",
"repo_id": "langchain",
"token_count": 746
} | 462 |
from llama_index.llms.vllm.base import Vllm, VllmServer
__all__ = ["Vllm", "VllmServer"]
| llama_index/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/__init__.py",
"repo_id": "llama_index",
"token_count": 41
} | 1,306 |
cd /d %~dp0
rmdir /s /q default.etcd s3data var
del /q *.log | milvus/deployments/windows/cleanup_data.bat/0 | {
"file_path": "milvus/deployments/windows/cleanup_data.bat",
"repo_id": "milvus",
"token_count": 30
} | 1,904 |
# coding=utf-8
# Copyright 2021 Google Research and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | transformers/src/transformers/models/tapas/modeling_tf_tapas.py/0 | {
"file_path": "transformers/src/transformers/models/tapas/modeling_tf_tapas.py",
"repo_id": "transformers",
"token_count": 47664
} | 700 |
import { test, expect } from "@jest/globals";
import { BaseLLM } from "@langchain/core/language_models/llms";
import { PromptTemplate } from "@langchain/core/prompts";
import { AIMessage, HumanMessage } from "@langchain/core/messages";
import { LLMResult } from "@langchain/core/outputs";
import { ChatMessageHistory } f... | langchainjs/langchain/src/chains/tests/sequential_chain.test.ts/0 | {
"file_path": "langchainjs/langchain/src/chains/tests/sequential_chain.test.ts",
"repo_id": "langchainjs",
"token_count": 2881
} | 886 |
from langchain_community.tools.ddg_search.tool import (
DDGInput,
DuckDuckGoSearchResults,
DuckDuckGoSearchRun,
DuckDuckGoSearchTool,
)
__all__ = [
"DDGInput",
"DuckDuckGoSearchRun",
"DuckDuckGoSearchResults",
"DuckDuckGoSearchTool",
]
| langchain/libs/langchain/langchain/tools/ddg_search/tool.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/ddg_search/tool.py",
"repo_id": "langchain",
"token_count": 117
} | 574 |
// 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/Span.h/0 | {
"file_path": "milvus/internal/core/src/common/Span.h",
"repo_id": "milvus",
"token_count": 1440
} | 1,746 |
# coding=utf-8
# Copyright 2024 The Qwen team, Alibaba Group 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/... | transformers/src/transformers/models/qwen2/tokenization_qwen2.py/0 | {
"file_path": "transformers/src/transformers/models/qwen2/tokenization_qwen2.py",
"repo_id": "transformers",
"token_count": 6208
} | 648 |
import glob
import importlib
from pathlib import Path
def test_importable_all() -> None:
for path in glob.glob("../langchain/langchain/*"):
relative_path = Path(path).parts[-1]
if relative_path.endswith(".typed"):
continue
module_name = relative_path.split(".")[0]
modul... | langchain/libs/langchain/tests/unit_tests/test_imports.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/test_imports.py",
"repo_id": "langchain",
"token_count": 210
} | 655 |
# Copyright 2022 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | datasets/metrics/mse/mse.py/0 | {
"file_path": "datasets/metrics/mse/mse.py",
"repo_id": "datasets",
"token_count": 1715
} | 122 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.openalex import OpenAlexReader
def test_class():
names_of_base_classes = [b.__name__ for b in OpenAlexReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-openalex/tests/test_readers_openalex.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-openalex/tests/test_readers_openalex.py",
"repo_id": "llama_index",
"token_count": 89
} | 1,438 |
# Structured output parser
import CodeBlock from "@theme/CodeBlock";
This output parser can be used when you want to return multiple fields. If you want complex schema returned (i.e. a JSON object with arrays of strings), use the Zod Schema detailed below.
import Structured from "@examples/prompts/structured_parser_... | langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/structured.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/structured.mdx",
"repo_id": "langchainjs",
"token_count": 285
} | 739 |
# Create a dataset for training
There are many datasets on the [Hub](https://huggingface.co/datasets?task_categories=task_categories:text-to-image&sort=downloads) to train a model on, but if you can't find one you're interested in or want to use your own, you can create a dataset with the 🤗 [Datasets](hf.co/docs/data... | diffusers/docs/source/en/training/create_dataset.md/0 | {
"file_path": "diffusers/docs/source/en/training/create_dataset.md",
"repo_id": "diffusers",
"token_count": 1301
} | 186 |
from langchain_community.document_loaders.browserless import BrowserlessLoader
__all__ = ["BrowserlessLoader"]
| langchain/libs/langchain/langchain/document_loaders/browserless.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/browserless.py",
"repo_id": "langchain",
"token_count": 29
} | 524 |
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu20.04
LABEL maintainer="Hugging Face"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg
RUN python3 -m pip install --no-cache-dir --upgrade pip
ARG REF=main
RUN git clone https://githu... | transformers/docker/transformers-pytorch-gpu/Dockerfile/0 | {
"file_path": "transformers/docker/transformers-pytorch-gpu/Dockerfile",
"repo_id": "transformers",
"token_count": 611
} | 487 |
from typing import TYPE_CHECKING, Callable, List, Optional
from llama_index.legacy.bridge.pydantic import PrivateAttr
from llama_index.legacy.callbacks import CallbackManager
from llama_index.legacy.node_parser.interface import TextSplitter
from llama_index.legacy.node_parser.node_utils import default_id_func
from lla... | llama_index/llama-index-legacy/llama_index/legacy/node_parser/text/langchain.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/node_parser/text/langchain.py",
"repo_id": "llama_index",
"token_count": 713
} | 1,622 |
<jupyter_start><jupyter_text>Prompt Engineering for RAGIn this notebook we show various prompt techniques you can try to customize your LlamaIndex RAG pipeline.- Getting and setting prompts for query engines, etc.- Defining template variable mappings (e.g. you have an existing QA prompt)- Adding few-shot examples + per... | llama_index/docs/examples/prompts/prompts_rag.ipynb/0 | {
"file_path": "llama_index/docs/examples/prompts/prompts_rag.ipynb",
"repo_id": "llama_index",
"token_count": 3240
} | 1,122 |
<jupyter_start><jupyter_text>Agent SupervisorThe [previous example](multi-agent-collaboration.ipynb) routed messages automatically based on the output of the initial researcher agent.We can also choose to use an LLM to orchestrate the different agents.Below, we will create an agent group, with an agent supervisor to he... | langgraph/examples/multi_agent/agent_supervisor.ipynb/0 | {
"file_path": "langgraph/examples/multi_agent/agent_supervisor.ipynb",
"repo_id": "langgraph",
"token_count": 2777
} | 1,015 |
/* eslint-disable no-process-env */
import { describe, expect, test } from "@jest/globals";
import { AstraDB } from "@datastax/astra-db-ts";
import { faker } from "@faker-js/faker";
import { Document } from "@langchain/core/documents";
import { OpenAIEmbeddings } from "@langchain/openai";
import { AstraDBVectorStore, A... | langchainjs/libs/langchain-community/src/vectorstores/tests/astradb.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/astradb.int.test.ts",
"repo_id": "langchainjs",
"token_count": 1547
} | 1,050 |
#[cfg(feature = "mkl")]
extern crate intel_mkl_src;
#[cfg(feature = "accelerate")]
extern crate accelerate_src;
use anyhow::{Error as E, Result};
use clap::Parser;
use candle_transformers::models::qwen2::{Config, Model};
use candle::{DType, Device, Tensor};
use candle_examples::token_output_stream::TokenOutputStrea... | candle/candle-examples/examples/qwen/main.rs/0 | {
"file_path": "candle/candle-examples/examples/qwen/main.rs",
"repo_id": "candle",
"token_count": 4059
} | 48 |
#!/bin/bash
set -e
# set -x
func() {
echo "Usage:"
echo "test.sh [-t Task] [-m Mode] [-r Release] [-p Password]"
echo "Description"
echo "Task, the task type of test. reinstall or upgrade"
echo "Mode, the mode of milvus deploy. standalone or cluster"
echo "Release, the release of milvus. e.g. 2... | milvus/tests/python_client/deploy/test.sh/0 | {
"file_path": "milvus/tests/python_client/deploy/test.sh",
"repo_id": "milvus",
"token_count": 2394
} | 2,039 |
python_sources()
| llama_index/llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_connector/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-playgrounds/llama_index/tools/playgrounds/subgraph_connector/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,492 |
import {
PaperAirplaneIcon,
ChatBubbleLeftIcon,
XCircleIcon,
} from "@heroicons/react/20/solid";
import { cn } from "../utils/cn";
import { useState } from "react";
export default function TypingBox(props: {
onSubmit: (message: string) => Promise<void>;
onInterrupt?: () => void;
inflight?: boolean;
}) {
... | opengpts/frontend/src/components/TypingBox.tsx/0 | {
"file_path": "opengpts/frontend/src/components/TypingBox.tsx",
"repo_id": "opengpts",
"token_count": 1336
} | 2,204 |
# coding=utf-8
# Copyright 2020 The HuggingFace Team 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 clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/tests/generation/test_beam_search.py/0 | {
"file_path": "transformers/tests/generation/test_beam_search.py",
"repo_id": "transformers",
"token_count": 11152
} | 764 |
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | milvus/internal/core/src/query/SubSearchResult.h/0 | {
"file_path": "milvus/internal/core/src/query/SubSearchResult.h",
"repo_id": "milvus",
"token_count": 1196
} | 1,663 |
from typing import Iterator, List, Optional
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
from langchain_community.document_loaders.blob_loaders import Blob
from langchain_community.document_loaders.parsers import (
AzureAIDocumentIntelligenceParser... | langchain/libs/community/langchain_community/document_loaders/doc_intelligence.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/doc_intelligence.py",
"repo_id": "langchain",
"token_count": 1359
} | 230 |
"""Document summary index.
A data structure where LlamaIndex stores the summary per document, and maps
the summary to the underlying Nodes.
This summary can be used for retrieval.
"""
import logging
from collections import defaultdict
from enum import Enum
from typing import Any, Dict, List, Optional, Sequence, Unio... | llama_index/llama-index-legacy/llama_index/legacy/indices/document_summary/base.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/document_summary/base.py",
"repo_id": "llama_index",
"token_count": 4698
} | 1,563 |
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base";
import type { ToolInterface } from "@langchain/core/tools";
import { Agent } from "./agent.js";
import { loadFromHub } from "../util/hub.js";
import { FileLoader, loadFromFile } from "../util/load.js";
import { parseFileConfig } fro... | langchainjs/langchain/src/agents/load.ts/0 | {
"file_path": "langchainjs/langchain/src/agents/load.ts",
"repo_id": "langchainjs",
"token_count": 348
} | 942 |
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import Metal from "@getmetal/metal-sdk";
import { MetalRetriever } from "@langchain/community/retrievers/metal";
export const run = async () => {
const MetalSDK = Metal;
const client = new MetalSDK(
process.env.METAL_API_KEY!,
process.env.METAL... | langchainjs/examples/src/retrievers/metal.ts/0 | {
"file_path": "langchainjs/examples/src/retrievers/metal.ts",
"repo_id": "langchainjs",
"token_count": 177
} | 851 |
# Streaming
LlamaIndex supports streaming the response as it's being generated.
This allows you to start printing or processing the beginning of the response before the full response is finished.
This can drastically reduce the perceived latency of queries.
### Setup
To enable streaming, you need to use an LLM that ... | llama_index/docs/module_guides/deploying/query_engine/streaming.md/0 | {
"file_path": "llama_index/docs/module_guides/deploying/query_engine/streaming.md",
"repo_id": "llama_index",
"token_count": 569
} | 1,175 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.qdrant import QdrantReader
def test_class():
names_of_base_classes = [b.__name__ for b in QdrantReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-qdrant/tests/test_readers_qdrant.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-qdrant/tests/test_readers_qdrant.py",
"repo_id": "llama_index",
"token_count": 91
} | 1,420 |
ANTHROPIC_API_KEY=ADD_YOURS_HERE # https://www.anthropic.com/
COHERE_API_KEY=ADD_YOURS_HERE # https://dashboard.cohere.ai/api-keys
GOOGLE_PALM_API_KEY=ADD_YOURS_HERE # https://makersuite.google.com/app/apikey
GOOGLE_CALENDAR_PRIVATE_KEY=ADD_YOURS_HERE
GOOGLE_CALENDAR_CLIENT_EMAIL=ADD_YOURS_HERE
GOOGLE_CALENDAR_CALENDAR... | langchainjs/examples/.env.example/0 | {
"file_path": "langchainjs/examples/.env.example",
"repo_id": "langchainjs",
"token_count": 1722
} | 764 |
"""Gemini embeddings file."""
from typing import Any, List, Optional
import google.generativeai as gemini
from llama_index.core.base.embeddings.base import (
DEFAULT_EMBED_BATCH_SIZE,
BaseEmbedding,
)
from llama_index.core.bridge.pydantic import Field, PrivateAttr
from llama_index.core.callbacks.base import C... | llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/llama_index/embeddings/gemini/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/llama_index/embeddings/gemini/base.py",
"repo_id": "llama_index",
"token_count": 1485
} | 1,273 |
python_sources()
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-adapter/llama_index/embeddings/adapter/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-adapter/llama_index/embeddings/adapter/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,299 |
// 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/util/ratelimitutil/rate_collector.go/0 | {
"file_path": "milvus/pkg/util/ratelimitutil/rate_collector.go",
"repo_id": "milvus",
"token_count": 2053
} | 1,850 |
import { PostgresRecordManager } from "@langchain/community/indexes/postgres";
import { index } from "langchain/indexes";
import { PGVectorStore } from "@langchain/community/vectorstores/pgvector";
import { PoolConfig } from "pg";
import { OpenAIEmbeddings } from "@langchain/openai";
import { CharacterTextSplitter } fr... | langchainjs/examples/src/indexes/indexing_api/indexing.ts/0 | {
"file_path": "langchainjs/examples/src/indexes/indexing_api/indexing.ts",
"repo_id": "langchainjs",
"token_count": 3709
} | 811 |
"""An example that shows how to use the API handler directly.
For this to work with RemoteClient, the routes must match those expected
by the client; i.e., /invoke, /batch, /stream, etc. No trailing slashes should be used.
"""
from importlib import metadata
from typing import Annotated
from fastapi import Depends, Fa... | langserve/examples/api_handler_examples/server.py/0 | {
"file_path": "langserve/examples/api_handler_examples/server.py",
"repo_id": "langserve",
"token_count": 1449
} | 1,008 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.