text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
from langchain_community.document_loaders.reddit import (
RedditPostsLoader,
)
__all__ = ["RedditPostsLoader"]
| langchain/libs/langchain/langchain/document_loaders/reddit.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/reddit.py",
"repo_id": "langchain",
"token_count": 36
} | 492 |
"""Test in memory docstore."""
import pytest
from langchain_core.documents import Document
from langchain_community.docstore.in_memory import InMemoryDocstore
def test_document_found() -> None:
"""Test document found."""
_dict = {"foo": Document(page_content="bar")}
docstore = InMemoryDocstore(_dict)
... | langchain/libs/community/tests/unit_tests/docstore/test_inmemory.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/docstore/test_inmemory.py",
"repo_id": "langchain",
"token_count": 728
} | 386 |
"""Unit tests for beautiful soup document transformer."""
import pytest
from langchain_core.documents import Document
from langchain_community.document_transformers import BeautifulSoupTransformer
@pytest.mark.requires("bs4")
def test_transform_empty_html() -> None:
bs_transformer = BeautifulSoupTransformer()
... | langchain/libs/community/tests/unit_tests/document_transformers/test_beautiful_soup_transformer.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_transformers/test_beautiful_soup_transformer.py",
"repo_id": "langchain",
"token_count": 3227
} | 395 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py",
"repo_id": "diffusers",
"token_count": 18946
} | 243 |
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/model_doc/table-transformer.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/table-transformer.md",
"repo_id": "transformers",
"token_count": 978
} | 519 |
package distance
import (
"math"
"golang.org/x/sys/cpu"
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/util/distance/asm"
)
func init() {
if cpu.X86.HasAVX2 {
log.Info("Hook avx for go simd distance computation")
IPImpl = asm.IP
L2Impl = asm.L2
CosineImpl = func(a []float32, b [... | milvus/pkg/util/distance/calc_distance_amd64.go/0 | {
"file_path": "milvus/pkg/util/distance/calc_distance_amd64.go",
"repo_id": "milvus",
"token_count": 213
} | 1,964 |
"""Unit tests for memory module"""
| langchain/libs/langchain/tests/unit_tests/memory/__init__.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/memory/__init__.py",
"repo_id": "langchain",
"token_count": 8
} | 599 |
# SK-ResNeXt
**SK ResNeXt** is a variant of a [ResNeXt](https://www.paperswithcode.com/method/resnext) that employs a [Selective Kernel](https://paperswithcode.com/method/selective-kernel) unit. In general, all the large kernel convolutions in the original bottleneck blocks in ResNext are replaced by the proposed [SK ... | pytorch-image-models/docs/models/skresnext.md/0 | {
"file_path": "pytorch-image-models/docs/models/skresnext.md",
"repo_id": "pytorch-image-models",
"token_count": 1640
} | 372 |
# Installation
**With Cuda support**:
1. First, make sure that Cuda is correctly installed.
- `nvcc --version` should print information about your Cuda compiler driver.
- `nvidia-smi --query-gpu=compute_cap --format=csv` should print your GPUs compute capability, e.g. something
like:
```bash
compute_cap
8.9
```
You... | candle/candle-book/src/guide/installation.md/0 | {
"file_path": "candle/candle-book/src/guide/installation.md",
"repo_id": "candle",
"token_count": 487
} | 30 |
mod common;
use common::*;
use tokenizers::tokenizer::AddedToken;
#[test]
fn add_tokens() {
let mut tokenizer = get_empty();
assert_eq!(
tokenizer.add_special_tokens(&[
AddedToken::from("<cls>", true),
AddedToken::from("<sep>", true)
]),
2
);
assert_eq!... | tokenizers/tokenizers/tests/added_tokens.rs/0 | {
"file_path": "tokenizers/tokenizers/tests/added_tokens.rs",
"repo_id": "tokenizers",
"token_count": 1770
} | 437 |
---
hide_table_of_contents: true
---
import CodeBlock from "@theme/CodeBlock";
# WolframAlpha Tool
The WolframAlpha tool connects your agents and chains to WolframAlpha's state-of-the-art computational intelligence engine.
## Setup
You'll need to create an app from the [WolframAlpha portal](https://developer.wolfr... | langchainjs/docs/core_docs/docs/integrations/tools/wolframalpha.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/tools/wolframalpha.mdx",
"repo_id": "langchainjs",
"token_count": 142
} | 718 |
import { Table } from "@mantine/core";
const FilesTable = ({ files }: { files: any[] }) => {
return (
<Table>
<thead>
<tr>
<th>File Name</th>
<th>Size (MB)</th>
</tr>
</thead>
<tbody>
{files?.map((file, id) => (
<tr key={id}>
<td... | auto-evaluator/nextjs/components/tables/FilesTable.tsx/0 | {
"file_path": "auto-evaluator/nextjs/components/tables/FilesTable.tsx",
"repo_id": "auto-evaluator",
"token_count": 276
} | 3 |
# Use with JAX
This document is a quick introduction to using `datasets` with JAX, with a particular focus on how to get
`jax.Array` objects out of our datasets, and how to use them to train JAX models.
<Tip>
`jax` and `jaxlib` are required to reproduce to code above, so please make sure you
install them as `pip ins... | datasets/docs/source/use_with_jax.mdx/0 | {
"file_path": "datasets/docs/source/use_with_jax.mdx",
"repo_id": "datasets",
"token_count": 2646
} | 126 |
import operator
from contextlib import asynccontextmanager, contextmanager
from typing import AsyncGenerator, Generator, Sequence, Union
import httpx
import pytest
from pytest_mock import MockerFixture
from langgraph.channels.base import EmptyChannelError, InvalidUpdateError
from langgraph.channels.binop import Binar... | langgraph/tests/test_channels.py/0 | {
"file_path": "langgraph/tests/test_channels.py",
"repo_id": "langgraph",
"token_count": 4425
} | 1,056 |
"""Test GradientAI API wrapper.
In order to run this test, you need to have an GradientAI api key.
You can get it by registering for free at https://gradient.ai/.
You'll then need to set:
- `GRADIENT_ACCESS_TOKEN` environment variable to your api key.
- `GRADIENT_WORKSPACE_ID` environment variable to your workspace i... | langchain/libs/community/tests/integration_tests/llms/test_gradient_ai.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/llms/test_gradient_ai.py",
"repo_id": "langchain",
"token_count": 602
} | 338 |
// Ephemeral, in-memory vector store for demo purposes
import { MemoryVectorStore } from "langchain/vectorstores/memory";
import { OpenAIEmbeddings, ChatOpenAI } from "@langchain/openai";
import { PromptTemplate, FewShotPromptTemplate } from "@langchain/core/prompts";
import { SemanticSimilarityExampleSelector } from "... | langchainjs/examples/src/prompts/semantic_similarity_example_selector_from_existing.ts/0 | {
"file_path": "langchainjs/examples/src/prompts/semantic_similarity_example_selector_from_existing.ts",
"repo_id": "langchainjs",
"token_count": 736
} | 859 |
"""Structured store indices."""
from llama_index.legacy.indices.struct_store.json_query import JSONQueryEngine
from llama_index.legacy.indices.struct_store.pandas import GPTPandasIndex, PandasIndex
from llama_index.legacy.indices.struct_store.sql import (
GPTSQLStructStoreIndex,
SQLContextContainerBuilder,
... | llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/struct_store/__init__.py",
"repo_id": "llama_index",
"token_count": 354
} | 1,521 |
from llama_index.core.node_parser.file.markdown import MarkdownNodeParser
from llama_index.core.schema import Document
def test_header_splits() -> None:
markdown_parser = MarkdownNodeParser()
splits = markdown_parser.get_nodes_from_documents(
[
Document(
text="""# Main Hea... | llama_index/llama-index-core/tests/node_parser/test_markdown.py/0 | {
"file_path": "llama_index/llama-index-core/tests/node_parser/test_markdown.py",
"repo_id": "llama_index",
"token_count": 869
} | 1,238 |
# (Gluon) Xception
**Xception** is a convolutional neural network architecture that relies solely on [depthwise separable convolution](https://paperswithcode.com/method/depthwise-separable-convolution) layers.
The weights from this model were ported from [Gluon](https://cv.gluon.ai/model_zoo/classification.html).
{%... | pytorch-image-models/docs/models/.templates/models/gloun-xception.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/gloun-xception.md",
"repo_id": "pytorch-image-models",
"token_count": 747
} | 347 |
from llama_index.legacy.vector_stores.google.generativeai import set_google_config
from .base import (
GoogleTextSynthesizer,
SynthesizedResponse,
)
__all__ = [
"GoogleTextSynthesizer",
"set_google_config",
"SynthesizedResponse",
]
| llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/google/generativeai/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/google/generativeai/__init__.py",
"repo_id": "llama_index",
"token_count": 97
} | 1,613 |
from typing import Any, Callable, Optional, Sequence
from llama_index.legacy.core.embeddings.base import SimilarityMode, similarity
from llama_index.legacy.evaluation.base import BaseEvaluator, EvaluationResult
from llama_index.legacy.prompts.mixin import PromptDictType
from llama_index.legacy.service_context import S... | llama_index/llama-index-legacy/llama_index/legacy/evaluation/semantic_similarity.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/evaluation/semantic_similarity.py",
"repo_id": "llama_index",
"token_count": 1115
} | 1,705 |
base_job_name: accelerate-sagemaker-1
compute_environment: AMAZON_SAGEMAKER
distributed_type: DATA_PARALLEL
ec2_instance_type: ml.p3.16xlarge
iam_role_name: xxxxx
image_uri: null
mixed_precision: fp16
num_machines: 1
profile: xxxxx
py_version: py38
pytorch_version: 1.10.2
region: us-east-1
transformers_version: 4.17.0
... | notebooks/sagemaker/22_accelerate_sagemaker_examples/src/seq2seq/accelerate_config.yaml/0 | {
"file_path": "notebooks/sagemaker/22_accelerate_sagemaker_examples/src/seq2seq/accelerate_config.yaml",
"repo_id": "notebooks",
"token_count": 138
} | 314 |
// 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/meta/replica_manager_test.go/0 | {
"file_path": "milvus/internal/querycoordv2/meta/replica_manager_test.go",
"repo_id": "milvus",
"token_count": 2913
} | 1,896 |
<jupyter_start><jupyter_text>Multi-Document Agents (V1)In this guide, you learn towards setting up a multi-document agent over the LlamaIndex documentation.This is an extension of V0 multi-document agents with the additional features:- Reranking during document (tool) retrieval- Query planning tool that the agent can u... | llama_index/docs/examples/agent/multi_document_agents-v1.ipynb/0 | {
"file_path": "llama_index/docs/examples/agent/multi_document_agents-v1.ipynb",
"repo_id": "llama_index",
"token_count": 4698
} | 1,102 |
# LLMonitor
>[LLMonitor](https://llmonitor.com?utm_source=langchain&utm_medium=py&utm_campaign=docs) is an open-source observability platform that provides cost and usage analytics, user tracking, tracing and evaluation tools.
<video controls width='100%' >
<source src='https://llmonitor.com/videos/demo-annotated.m... | langchain/docs/docs/integrations/callbacks/llmonitor.md/0 | {
"file_path": "langchain/docs/docs/integrations/callbacks/llmonitor.md",
"repo_id": "langchain",
"token_count": 1086
} | 98 |
- sections:
- local: index
title: 🤗 Transformers
- local: quicktour
title: Visite rapide
- local: installation
title: Installation
title: Démarrer
- sections:
- local: in_translation
title: Pipelines pour l'inférence
- local: autoclass_tutorial
title: Chargement d'in... | transformers/docs/source/fr/_toctree.yml/0 | {
"file_path": "transformers/docs/source/fr/_toctree.yml",
"repo_id": "transformers",
"token_count": 376
} | 536 |
use candle::{DType, IndexOp, Result, Tensor};
use candle_nn::{Module, VarBuilder};
use super::image_encoder::ImageEncoderViT;
use super::mask_decoder::MaskDecoder;
use super::prompt_encoder::PromptEncoder;
use super::tiny_vit::{tiny_vit_5m, TinyViT};
const PROMPT_EMBED_DIM: usize = 256;
pub const IMAGE_SIZE: usize = ... | candle/candle-transformers/src/models/segment_anything/sam.rs/0 | {
"file_path": "candle/candle-transformers/src/models/segment_anything/sam.rs",
"repo_id": "candle",
"token_count": 8444
} | 67 |
<jupyter_start><jupyter_text>pgvecto.rs Firstly, you will probably need to install dependencies :<jupyter_code>%pip install llama-index-vector-stores-pgvecto-rs
%pip install llama-index "pgvecto_rs[sdk]"<jupyter_output><empty_output><jupyter_text>Then start the pgvecto.rs server as the [official document suggests](http... | llama_index/docs/examples/vector_stores/PGVectoRsDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/PGVectoRsDemo.ipynb",
"repo_id": "llama_index",
"token_count": 988
} | 1,133 |
import json
from json import JSONDecodeError
from typing import List, Union
from langchain_core.agents import AgentAction, AgentActionMessageLog, AgentFinish
from langchain_core.exceptions import OutputParserException
from langchain_core.messages import (
AIMessage,
BaseMessage,
)
from langchain_core.outputs i... | langchain/libs/langchain/langchain/agents/output_parsers/openai_functions.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/output_parsers/openai_functions.py",
"repo_id": "langchain",
"token_count": 1406
} | 476 |
# coding=utf-8
# Copyright 2020 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team.
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | transformers/src/transformers/generation_utils.py/0 | {
"file_path": "transformers/src/transformers/generation_utils.py",
"repo_id": "transformers",
"token_count": 315
} | 623 |
"""Init params."""
from llama_index.legacy.program.predefined.evaporate.base import (
DFEvaporateProgram,
MultiValueEvaporateProgram,
)
from llama_index.legacy.program.predefined.evaporate.extractor import EvaporateExtractor
__all__ = [
"EvaporateExtractor",
"DFEvaporateProgram",
"MultiValueEvapor... | llama_index/llama-index-legacy/llama_index/legacy/program/predefined/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/program/predefined/__init__.py",
"repo_id": "llama_index",
"token_count": 123
} | 1,600 |
from langchain_community.document_loaders.obsidian import ObsidianLoader
__all__ = ["ObsidianLoader"]
| langchain/libs/langchain/langchain/document_loaders/obsidian.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/obsidian.py",
"repo_id": "langchain",
"token_count": 29
} | 511 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/api/pipelines/stable_diffusion/overview.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/stable_diffusion/overview.md",
"repo_id": "diffusers",
"token_count": 4281
} | 180 |
"""Experiment with different indices, models, and more."""
from __future__ import annotations
import time
from typing import Any, Dict, List, Type
import pandas as pd
from llama_index.core.callbacks import CallbackManager, TokenCountingHandler
from llama_index.core.indices.base import BaseIndex
from llama_index.core.... | llama_index/llama-index-core/llama_index/core/playground/base.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/playground/base.py",
"repo_id": "llama_index",
"token_count": 3166
} | 1,235 |
from langchain.output_parsers import GuardrailsOutputParser
from langchain_community.llms import OpenAI
from langchain_core.prompts import PromptTemplate
# Define rail string
rail_str = """
<rail version="0.1">
<output>
<string
description="Profanity-free translation"
format="is-profanity-free" ... | langchain/templates/guardrails-output-parser/guardrails_output_parser/chain.py/0 | {
"file_path": "langchain/templates/guardrails-output-parser/guardrails_output_parser/chain.py",
"repo_id": "langchain",
"token_count": 357
} | 637 |
python_sources()
| llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/llama_index/tools/azure_translate/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/llama_index/tools/azure_translate/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,615 |
# Introduction to PPO with Sample-Factory
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit9/thumbnail2.png" alt="thumbnail"/>
In this second part of Unit 8, we'll get deeper into PPO optimization by using [Sample-Factory](https://samplefactory.dev/), an **asynchr... | deep-rl-class/units/en/unit8/introduction-sf.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit8/introduction-sf.mdx",
"repo_id": "deep-rl-class",
"token_count": 328
} | 164 |
<jupyter_start><jupyter_text>Github Repo Reader If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-readers-github
!pip install llama-index
# This is due to the fact that we use asyncio.loop_until_complete in
# the DiscordReader. Since the Jup... | llama_index/docs/examples/data_connectors/GithubRepositoryReaderDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/data_connectors/GithubRepositoryReaderDemo.ipynb",
"repo_id": "llama_index",
"token_count": 493
} | 1,175 |
# coding=utf-8
# Copyright 2024 TikTok 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.0
#... | transformers/src/transformers/models/depth_anything/modeling_depth_anything.py/0 | {
"file_path": "transformers/src/transformers/models/depth_anything/modeling_depth_anything.py",
"repo_id": "transformers",
"token_count": 7171
} | 633 |
<jupyter_start><jupyter_text>Google DriveThis notebook covers how to retrieve documents from `Google Drive`. Prerequisites1. Create a Google Cloud project or use an existing project1. Enable the [Google Drive API](https://console.cloud.google.com/flows/enableapi?apiid=drive.googleapis.com)1. [Authorize credentials for ... | langchain/docs/docs/integrations/retrievers/google_drive.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/retrievers/google_drive.ipynb",
"repo_id": "langchain",
"token_count": 2203
} | 155 |
import { deepCompareStrict } from "./deep-compare-strict.js";
import { dereference } from "./dereference.js";
import { fastFormat } from "./format.js";
import { encodePointer } from "./pointer.js";
import {
InstanceType,
OutputUnit,
Schema,
SchemaDraft,
ValidationResult,
} from "./types.js";
import { ucs2leng... | langchainjs/langchain-core/src/utils/@cfworker/json-schema/src/validate.ts/0 | {
"file_path": "langchainjs/langchain-core/src/utils/@cfworker/json-schema/src/validate.ts",
"repo_id": "langchainjs",
"token_count": 15860
} | 885 |
"""Test token predictor."""
from typing import Any
from unittest.mock import patch
from llama_index.core.indices.keyword_table.base import KeywordTableIndex
from llama_index.core.indices.list.base import SummaryIndex
from llama_index.core.indices.tree.base import TreeIndex
from llama_index.core.llms.mock import MockL... | llama_index/llama-index-core/tests/token_predictor/test_base.py/0 | {
"file_path": "llama_index/llama-index-core/tests/token_predictor/test_base.py",
"repo_id": "llama_index",
"token_count": 626
} | 1,217 |
"""
Upstash vector store index.
An index that is built with Upstash Vector.
https://upstash.com/docs/vector/overall/getstarted
"""
import logging
from typing import Any, List
from llama_index.legacy.schema import BaseNode
from llama_index.legacy.utils import iter_batch
from llama_index.legacy.vector_stores.types im... | llama_index/llama-index-legacy/llama_index/legacy/vector_stores/upstash.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/upstash.py",
"repo_id": "llama_index",
"token_count": 1839
} | 1,613 |
import { ChatOpenAI } from "@langchain/openai";
import type { BasePromptTemplate } from "@langchain/core/prompts";
import { Calculator } from "langchain/tools/calculator";
import { pull } from "langchain/hub";
import { AgentExecutor, createReactAgent } from "langchain/agents";
// Define the tools the agent will have ... | langchainjs/examples/src/agents/max_iterations.ts/0 | {
"file_path": "langchainjs/examples/src/agents/max_iterations.ts",
"repo_id": "langchainjs",
"token_count": 403
} | 783 |
"""Minio file and directory reader.
A loader that fetches a file or iterates through a directory on Minio.
"""
import tempfile
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Union
from llama_index.core.readers import SimpleDirectoryReader
from llama_index.core.readers.base import B... | llama_index/llama-index-integrations/readers/llama-index-readers-minio/llama_index/readers/minio/boto3_client/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-minio/llama_index/readers/minio/boto3_client/base.py",
"repo_id": "llama_index",
"token_count": 2559
} | 1,403 |
""" Attention Factory
Hacked together by / Copyright 2021 Ross Wightman
"""
import torch
from functools import partial
from .bottleneck_attn import BottleneckAttn
from .cbam import CbamModule, LightCbamModule
from .eca import EcaModule, CecaModule
from .gather_excite import GatherExcite
from .global_context import Gl... | pytorch-image-models/timm/layers/create_attn.py/0 | {
"file_path": "pytorch-image-models/timm/layers/create_attn.py",
"repo_id": "pytorch-image-models",
"token_count": 1588
} | 387 |
metrics:
serviceMonitor:
enabled: true
proxy:
resources:
requests:
cpu: "0.3"
memory: "256Mi"
rootCoordinator:
resources:
requests:
cpu: "0.3"
memory: "256Mi"
queryCoordinator:
resources:
requests:
cpu: "0.4"
memory: "100Mi"
queryNode:
resources:
re... | milvus/tests/scripts/values/qa/pr.yaml/0 | {
"file_path": "milvus/tests/scripts/values/qa/pr.yaml",
"repo_id": "milvus",
"token_count": 856
} | 1,981 |
build_performance:
collections:
-
server:
db_config.primary_path: /test/milvus/db_data_011/filter/sift_10m_128_l2_ivf_flat
cache_config.cpu_cache_capacity: 8GB
engine_config.use_blas_threshold: 1100
engine_config.gpu_search_threshold: 100
gpu_resource_config.enable: t... | milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_build_sift10m.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_build_sift10m.yaml",
"repo_id": "milvus",
"token_count": 2511
} | 1,945 |
import random
from locust import HttpUser, task, between
collection_name = "random_1m_2048_512_ip_sq8"
headers = {'Content-Type': "application/json"}
url = '/collections/%s/vectors' % collection_name
top_k = 2
nq = 1
dim = 512
vectors = [[random.random() for _ in range(dim)] for _ in range(nq)]
data = {
"searc... | milvus/tests/benchmark/milvus_benchmark/runners/locust_file.py/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/runners/locust_file.py",
"repo_id": "milvus",
"token_count": 303
} | 1,856 |
"""Test GooseAI"""
import pytest
from langchain_core.pydantic_v1 import SecretStr
from pytest import MonkeyPatch
from langchain_community.llms.gooseai import GooseAI
from langchain_community.utils.openai import is_openai_v1
def _openai_v1_installed() -> bool:
try:
return is_openai_v1()
except Except... | langchain/libs/community/tests/unit_tests/llms/test_gooseai.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/llms/test_gooseai.py",
"repo_id": "langchain",
"token_count": 613
} | 387 |
# Copyright 2023-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | peft/src/peft/tuners/adalora/gptq.py/0 | {
"file_path": "peft/src/peft/tuners/adalora/gptq.py",
"repo_id": "peft",
"token_count": 1173
} | 331 |
import os
from typing import Optional
import requests
from llama_index.core.tools.tool_spec.base import BaseToolSpec
class CogniswitchToolSpec(BaseToolSpec):
"""Cogniswitch Tool Spec.
A toolspec to have store_data and query_knowledge as tools to store the data from a file or a url
and answer questions fr... | llama_index/llama-index-integrations/tools/llama-index-tools-cogniswitch/llama_index/tools/cogniswitch/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-cogniswitch/llama_index/tools/cogniswitch/base.py",
"repo_id": "llama_index",
"token_count": 2652
} | 1,509 |
import { error } from "@sveltejs/kit";
import { collections } from "../database";
import type { Conversation } from "$lib/types/Conversation";
import type { SharedConversation } from "$lib/types/SharedConversation";
export async function downloadFile(
sha256: string,
convId: Conversation["_id"] | SharedConversation[... | chat-ui/src/lib/server/files/downloadFile.ts/0 | {
"file_path": "chat-ui/src/lib/server/files/downloadFile.ts",
"repo_id": "chat-ui",
"token_count": 383
} | 97 |
from langchain_core.pydantic_v1 import SecretStr
from pytest import CaptureFixture
from langchain_community.llms.predibase import Predibase
def test_api_key_is_string() -> None:
llm = Predibase(predibase_api_key="secret-api-key")
assert isinstance(llm.predibase_api_key, SecretStr)
def test_api_key_masked_w... | langchain/libs/community/tests/integration_tests/llms/test_predibase.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/llms/test_predibase.py",
"repo_id": "langchain",
"token_count": 221
} | 366 |
""" Classifier head and layer factory
Hacked together by / Copyright 2020 Ross Wightman
"""
from collections import OrderedDict
from functools import partial
from typing import Optional, Union, Callable
import torch
import torch.nn as nn
from torch.nn import functional as F
from .adaptive_avgmax_pool import SelectAd... | pytorch-image-models/timm/layers/classifier.py/0 | {
"file_path": "pytorch-image-models/timm/layers/classifier.py",
"repo_id": "pytorch-image-models",
"token_count": 3585
} | 362 |
import { Calculator } from "langchain/tools/calculator";
import { ChatOpenAI } from "@langchain/openai";
import { PlanAndExecuteAgentExecutor } from "langchain/experimental/plan_and_execute";
import { SerpAPI } from "@langchain/community/tools/serpapi";
const tools = [new Calculator(), new SerpAPI()];
const model = ne... | langchainjs/examples/src/agents/plan_and_execute.ts/0 | {
"file_path": "langchainjs/examples/src/agents/plan_and_execute.ts",
"repo_id": "langchainjs",
"token_count": 212
} | 812 |
import functools
import logging
import multiprocessing
import sys
from io import StringIO
from typing import Dict, Optional
from langchain_core.pydantic_v1 import BaseModel, Field
logger = logging.getLogger(__name__)
@functools.lru_cache(maxsize=None)
def warn_once() -> None:
"""Warn once about the dangers of P... | langchain/libs/community/langchain_community/utilities/python.py/0 | {
"file_path": "langchain/libs/community/langchain_community/utilities/python.py",
"repo_id": "langchain",
"token_count": 916
} | 303 |
<!--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... | accelerate/docs/source/usage_guides/distributed_inference.md/0 | {
"file_path": "accelerate/docs/source/usage_guides/distributed_inference.md",
"repo_id": "accelerate",
"token_count": 2888
} | 5 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/readers/llama-index-readers-make-com/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-make-com/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,342 |
#!/usr/bin/env python
"""Example LangChain server exposes multiple runnables (LLMs in this case)."""
from fastapi import FastAPI
from langchain.chat_models import ChatAnthropic, ChatOpenAI
from langserve import add_routes
app = FastAPI(
title="LangChain Server",
version="1.0",
description="Spin up a simp... | langserve/examples/llm/server.py/0 | {
"file_path": "langserve/examples/llm/server.py",
"repo_id": "langserve",
"token_count": 223
} | 1,043 |
"""Test vector store indexes."""
from pathlib import Path
from typing import List
import pytest
from llama_index.legacy.indices.vector_store.base import VectorStoreIndex
from llama_index.legacy.schema import Document, TextNode
from llama_index.legacy.service_context import ServiceContext
from llama_index.legacy.stora... | llama_index/llama-index-legacy/tests/indices/vector_store/test_faiss.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/indices/vector_store/test_faiss.py",
"repo_id": "llama_index",
"token_count": 1119
} | 1,637 |
from langchain_community.chat_models import ChatAnthropic, ChatCohere, ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import ConfigurableField
_prompt = ChatPromptTemplate.from_messages(
[
(
"system",
"Translate user input into pirate ... | langchain/templates/pirate-speak-configurable/pirate_speak_configurable/chain.py/0 | {
"file_path": "langchain/templates/pirate-speak-configurable/pirate_speak_configurable/chain.py",
"repo_id": "langchain",
"token_count": 259
} | 684 |
import os
import pickle
import re
import warnings
from abc import ABC, abstractmethod
from typing import Any, Callable, Dict, List, Mapping, Optional
import requests
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models import LLM
from langchain_core.pydantic_v1 import (
... | langchain/libs/community/langchain_community/llms/databricks.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/databricks.py",
"repo_id": "langchain",
"token_count": 7847
} | 266 |
# Best of N sampling: Alternative ways to get better model output without RL based fine-tuning
Within the extras module is the `best-of-n` sampler class that serves as an alternative method of generating better model output.
As to how it fares against the RL based fine-tuning, please look in the `examples` directory ... | trl/docs/source/best_of_n.mdx/0 | {
"file_path": "trl/docs/source/best_of_n.mdx",
"repo_id": "trl",
"token_count": 840
} | 863 |
from langchain_community.vectorstores.pgembedding import (
CollectionStore,
EmbeddingStore,
PGEmbedding,
QueryResult,
)
__all__ = [
"CollectionStore",
"EmbeddingStore",
"QueryResult",
"PGEmbedding",
]
| langchain/libs/langchain/langchain/vectorstores/pgembedding.py/0 | {
"file_path": "langchain/libs/langchain/langchain/vectorstores/pgembedding.py",
"repo_id": "langchain",
"token_count": 95
} | 616 |
import { test } from "@jest/globals";
import { SitemapLoader } from "../web/sitemap.js";
test("SitemapLoader", async () => {
const regexFailIfNotJsLangChain = /^https:\/\/js\.langchain\.com\//;
const regexContainsToolsDynamic = /tools\/dynamic/;
// Filter our 1 bad url (has since been fixed in vercel, but keep ... | langchainjs/langchain/src/document_loaders/tests/sitemap.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/tests/sitemap.int.test.ts",
"repo_id": "langchainjs",
"token_count": 490
} | 909 |
import logging
from typing import List, Optional
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
from langchain_community.document_loaders.helpers import detect_file_encodings
logger = logging.getLogger(__name__)
class TextLoader(BaseLoader):
"""Lo... | langchain/libs/community/langchain_community/document_loaders/text.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/text.py",
"repo_id": "langchain",
"token_count": 905
} | 263 |
<jupyter_start><jupyter_text>Recursively split JSONThis json splitter traverses json data depth first and builds smaller json chunks. It attempts to keep nested json objects whole but will split them if needed to keep chunks between a min_chunk_size and the max_chunk_size. If the value is not a nested json, but rather ... | langchain/docs/docs/modules/data_connection/document_transformers/recursive_json_splitter.ipynb/0 | {
"file_path": "langchain/docs/docs/modules/data_connection/document_transformers/recursive_json_splitter.ipynb",
"repo_id": "langchain",
"token_count": 584
} | 206 |
from llama_index.readers.jaguar.base import JaguarReader
__all__ = ["JaguarReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-jaguar/llama_index/readers/jaguar/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-jaguar/llama_index/readers/jaguar/__init__.py",
"repo_id": "llama_index",
"token_count": 30
} | 1,463 |
from llama_index.readers.bitbucket.base import BitbucketReader
__all__ = ["BitbucketReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-bitbucket/llama_index/readers/bitbucket/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-bitbucket/llama_index/readers/bitbucket/__init__.py",
"repo_id": "llama_index",
"token_count": 32
} | 1,343 |
from typing import Any, Dict, List, Optional
from llama_index.legacy.bridge.pydantic import Field
from llama_index.legacy.callbacks.base import CallbackManager
from llama_index.legacy.constants import DEFAULT_EMBED_BATCH_SIZE
from llama_index.legacy.embeddings.base import BaseEmbedding
class OllamaEmbedding(BaseEmbe... | llama_index/llama-index-legacy/llama_index/legacy/embeddings/ollama_embedding.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/embeddings/ollama_embedding.py",
"repo_id": "llama_index",
"token_count": 1724
} | 1,560 |
from typing import Any, List
from langchain_community.document_loaders.unstructured import (
UnstructuredFileLoader,
validate_unstructured_version,
)
class UnstructuredTSVLoader(UnstructuredFileLoader):
"""Load `TSV` files using `Unstructured`.
Like other
Unstructured loaders, UnstructuredTSVLoa... | langchain/libs/community/langchain_community/document_loaders/tsv.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/tsv.py",
"repo_id": "langchain",
"token_count": 458
} | 250 |
# Training
Training starts with data. We're going to use the huggingface hub and
start with the Hello world dataset of machine learning, MNIST.
Let's start with downloading `MNIST` from [huggingface](https://huggingface.co/datasets/mnist).
This requires [`hf-hub`](https://github.com/huggingface/hf-hub).
```bash
ca... | candle/candle-book/src/training/training.md/0 | {
"file_path": "candle/candle-book/src/training/training.md",
"repo_id": "candle",
"token_count": 361
} | 24 |
//! # Denoising Diffusion Implicit Models
//!
//! The Denoising Diffusion Implicit Models (DDIM) is a simple scheduler
//! similar to Denoising Diffusion Probabilistic Models (DDPM). The DDPM
//! generative process is the reverse of a Markovian process, DDIM generalizes
//! this to non-Markovian guidance.
//!
//! Denoi... | candle/candle-transformers/src/models/stable_diffusion/ddim.rs/0 | {
"file_path": "candle/candle-transformers/src/models/stable_diffusion/ddim.rs",
"repo_id": "candle",
"token_count": 3953
} | 76 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | diffusers/src/diffusers/utils/doc_utils.py/0 | {
"file_path": "diffusers/src/diffusers/utils/doc_utils.py",
"repo_id": "diffusers",
"token_count": 505
} | 265 |
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, cast
import httpx
from openai import AsyncOpenAI
from openai import OpenAI as SyncOpenAI
from openai.types.chat import ChatCompletionMessageParam
from openai.types.chat.chat_completion_chunk import (
ChatCompletionChunk,
ChoiceDelta,
... | llama_index/llama-index-legacy/llama_index/legacy/multi_modal_llms/openai.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/multi_modal_llms/openai.py",
"repo_id": "llama_index",
"token_count": 8475
} | 1,592 |
{%- extends "basic/search.html" %}
{% block extrahead %}
<script type="text/javascript" src="{{ pathto('_static/underscore.js', 1) }}"></script>
<script type="text/javascript" src="{{ pathto('searchindex.js', 1) }}" defer></script>
<script type="text/javascript" src="{{ pathto('_static/doctools.js', 1) }}"></scri... | langchain/docs/api_reference/themes/scikit-learn-modern/search.html/0 | {
"file_path": "langchain/docs/api_reference/themes/scikit-learn-modern/search.html",
"repo_id": "langchain",
"token_count": 279
} | 84 |
from typing import List, cast
from llama_index.core.indices.vector_store.base import VectorStoreIndex
from llama_index.core.schema import (
Document,
NodeRelationship,
QueryBundle,
RelatedNodeInfo,
TextNode,
)
from llama_index.core.service_context import ServiceContext
from llama_index.core.vector_... | llama_index/llama-index-core/tests/indices/vector_store/test_retrievers.py/0 | {
"file_path": "llama_index/llama-index-core/tests/indices/vector_store/test_retrievers.py",
"repo_id": "llama_index",
"token_count": 1222
} | 1,235 |
import { z } from "zod";
import {
embeddingEndpointTei,
embeddingEndpointTeiParametersSchema,
} from "./tei/embeddingEndpoints";
import {
embeddingEndpointTransformersJS,
embeddingEndpointTransformersJSParametersSchema,
} from "./transformersjs/embeddingEndpoints";
// parameters passed when generating text
interfa... | chat-ui/src/lib/server/embeddingEndpoints/embeddingEndpoints.ts/0 | {
"file_path": "chat-ui/src/lib/server/embeddingEndpoints/embeddingEndpoints.ts",
"repo_id": "chat-ui",
"token_count": 413
} | 88 |
from langchain_nomic.embeddings import NomicEmbeddings
__all__ = [
"NomicEmbeddings",
]
| langchain/libs/partners/nomic/langchain_nomic/__init__.py/0 | {
"file_path": "langchain/libs/partners/nomic/langchain_nomic/__init__.py",
"repo_id": "langchain",
"token_count": 37
} | 632 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-txtai/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-txtai/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,572 |
from typing import Any, Callable, Dict, Optional, cast
from overrides import EnforceOverrides, override
from chromadb.config import System
from chromadb.segment.distributed import (
Memberlist,
MemberlistProvider,
SegmentDirectory,
)
from chromadb.types import Segment
from kubernetes import client, config, ... | chroma/chromadb/segment/impl/distributed/segment_directory.py/0 | {
"file_path": "chroma/chromadb/segment/impl/distributed/segment_directory.py",
"repo_id": "chroma",
"token_count": 3730
} | 19 |
# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | accelerate/src/accelerate/state.py/0 | {
"file_path": "accelerate/src/accelerate/state.py",
"repo_id": "accelerate",
"token_count": 21934
} | 14 |
import type { Conversation } from "$lib/types/Conversation";
import { sha256 } from "./sha256";
export async function hashConv(conv: Conversation) {
// messages contains the conversation message but only the immutable part
const messages = conv.messages.map((message) => {
return (({ from, id, content, webSearchId ... | chat-ui/src/lib/utils/hashConv.ts/0 | {
"file_path": "chat-ui/src/lib/utils/hashConv.ts",
"repo_id": "chat-ui",
"token_count": 132
} | 103 |
use crate::models::with_tracing::{linear_no_bias, Embedding, Linear};
/// MPT model used by replit-code-v1_5-3b
/// https://huggingface.co/replit/replit-code-v1_5-3b/blob/main/modeling_mpt.py
use candle::{DType, Device, IndexOp, Module, Result, Tensor, D};
use candle_nn::{layer_norm, LayerNorm, VarBuilder};
// https:/... | candle/candle-transformers/src/models/mpt.rs/0 | {
"file_path": "candle/candle-transformers/src/models/mpt.rs",
"repo_id": "candle",
"token_count": 5485
} | 74 |
poetry_requirements(
name="poetry",
)
python_requirements(
name="reqs",
)
| llama_index/llama-index-integrations/readers/llama-index-readers-zulip/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-zulip/BUILD",
"repo_id": "llama_index",
"token_count": 36
} | 1,405 |
<jupyter_start><jupyter_text>Simple Vector Stores - Maximum Marginal Relevance Retrieval This notebook explores the use of MMR retrieval [1]. By using maximum marginal relevance, one can iteratively find documents that are dissimilar to previous results. It has been shown to improve performance for LLM retrievals [2]. ... | llama_index/docs/examples/vector_stores/SimpleIndexDemoMMR.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/SimpleIndexDemoMMR.ipynb",
"repo_id": "llama_index",
"token_count": 2162
} | 1,218 |
from langchain_community.vectorstores.yellowbrick import Yellowbrick
__all__ = ["Yellowbrick"]
| langchain/libs/langchain/langchain/vectorstores/yellowbrick.py/0 | {
"file_path": "langchain/libs/langchain/langchain/vectorstores/yellowbrick.py",
"repo_id": "langchain",
"token_count": 28
} | 633 |
"""Init params."""
| llama_index/llama-index-legacy/llama_index/legacy/indices/common_tree/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/common_tree/__init__.py",
"repo_id": "llama_index",
"token_count": 6
} | 1,516 |
import {
HandThumbDownIcon,
HandThumbUpIcon,
EllipsisHorizontalIcon,
CheckIcon,
} from "@heroicons/react/24/outline";
import { useState } from "react";
export function LangSmithActions(props: { runId: string }) {
const [state, setState] = useState<{
score: number;
inflight: boolean;
} | null>(null)... | opengpts/frontend/src/components/LangSmithActions.tsx/0 | {
"file_path": "opengpts/frontend/src/components/LangSmithActions.tsx",
"repo_id": "opengpts",
"token_count": 893
} | 1,998 |
import { WikipediaQueryRun } from "@langchain/community/tools/wikipedia_query_run";
const tool = new WikipediaQueryRun({
topKResults: 1,
maxDocContentLength: 100,
});
console.log(tool.name);
console.log(tool.description);
console.log(tool.returnDirect);
const res = await tool.invoke("Langchain");
console.log(... | langchainjs/examples/src/agents/tools.ts/0 | {
"file_path": "langchainjs/examples/src/agents/tools.ts",
"repo_id": "langchainjs",
"token_count": 104
} | 783 |
package funcutil
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/proto/segcorepb"
)
func TestCntOfInternalResult(t *testing.T) {
t.Run("invalid", func(t ... | milvus/internal/util/funcutil/count_util_test.go/0 | {
"file_path": "milvus/internal/util/funcutil/count_util_test.go",
"repo_id": "milvus",
"token_count": 1014
} | 1,794 |
<jupyter_start><jupyter_text>EmotionPrompt in RAGInspired by the "[Large Language Models Understand and Can Be Enhanced byEmotional Stimuli](https://arxiv.org/pdf/2307.11760.pdf)" by Li et al., in this guide we show you how to evaluate the effects of emotional stimuli on your RAG pipeline:1. Setup the RAG pipeline with... | llama_index/docs/examples/prompts/emotion_prompt.ipynb/0 | {
"file_path": "llama_index/docs/examples/prompts/emotion_prompt.ipynb",
"repo_id": "llama_index",
"token_count": 2094
} | 1,156 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/vitdet/test_modeling_vitdet.py/0 | {
"file_path": "transformers/tests/models/vitdet/test_modeling_vitdet.py",
"repo_id": "transformers",
"token_count": 4686
} | 756 |
// 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/pkg/util/indexparamcheck/index_checker_test.go/0 | {
"file_path": "milvus/pkg/util/indexparamcheck/index_checker_test.go",
"repo_id": "milvus",
"token_count": 477
} | 1,938 |
package utils
import (
"github.com/pingcap/log"
"go.uber.org/zap"
"github.com/apache/pulsar-client-go/pulsaradmin"
pulsar_utils "github.com/apache/pulsar-client-go/pulsaradmin/pkg/utils"
)
// This function creates topics in Pulsar. It takes in a list of topics and creates them in pulsar.
// It assumes that the t... | chroma/go/coordinator/internal/utils/pulsar_admin.go/0 | {
"file_path": "chroma/go/coordinator/internal/utils/pulsar_admin.go",
"repo_id": "chroma",
"token_count": 489
} | 54 |
from typing import Any, Dict, Generator, Iterator, List, Mapping, Sequence, Tuple, Union
import pytest
from llama_index.legacy.core.llms.types import (
ChatMessage,
ChatResponse,
CompletionResponse,
MessageRole,
)
from llama_index.legacy.llms.xinference import Xinference
mock_chat_history: List[ChatMe... | llama_index/llama-index-legacy/tests/llms/test_xinference.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/llms/test_xinference.py",
"repo_id": "llama_index",
"token_count": 2727
} | 1,641 |
import { test, describe } from "@jest/globals";
import { NIBittensorLLM } from "../bittensor.js";
describe.skip("NIBittensorLLM", () => {
test("test with no params", async () => {
const niBittensorLLM = new NIBittensorLLM();
const result = await niBittensorLLM.call("What is Bittensor?");
console.log("tes... | langchainjs/langchain/src/experimental/llms/tests/bittensor.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/llms/tests/bittensor.int.test.ts",
"repo_id": "langchainjs",
"token_count": 415
} | 938 |
"""Test tools."""
from typing import Type, cast
import pytest
from llama_index.core.bridge.pydantic import BaseModel
from llama_index.core.query_engine.custom import CustomQueryEngine
from llama_index.core.tools.query_engine import QueryEngineTool
class MockQueryEngine(CustomQueryEngine):
"""Custom query engine.... | llama_index/llama-index-core/tests/tools/test_query_engine_tool.py/0 | {
"file_path": "llama_index/llama-index-core/tests/tools/test_query_engine_tool.py",
"repo_id": "llama_index",
"token_count": 529
} | 1,234 |
import json
from utils.util_log import test_log as log
all_index_types = ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ", "HNSW", "BIN_FLAT", "BIN_IVF_FLAT"]
default_index_params = [{"nlist": 128}, {"nlist": 128}, {"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8},
{"M": 48, "efConstruction": 500}, ... | milvus/tests/python_client/deploy/common.py/0 | {
"file_path": "milvus/tests/python_client/deploy/common.py",
"repo_id": "milvus",
"token_count": 1104
} | 2,121 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.