text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
target
.yarn | tokenizers/bindings/node/.prettierignore/0 | {
"file_path": "tokenizers/bindings/node/.prettierignore",
"repo_id": "tokenizers",
"token_count": 5
} | 436 |
pub mod coco_classes;
pub mod imagenet;
pub mod token_output_stream;
use candle::utils::{cuda_is_available, metal_is_available};
use candle::{Device, Result, Tensor};
pub fn device(cpu: bool) -> Result<Device> {
if cpu {
Ok(Device::Cpu)
} else if cuda_is_available() {
Ok(Device::new_cuda(0)?)
... | candle/candle-examples/src/lib.rs/0 | {
"file_path": "candle/candle-examples/src/lib.rs",
"repo_id": "candle",
"token_count": 2436
} | 53 |
python_sources()
| llama_index/llama-index-core/llama_index/core/multi_modal_llms/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/multi_modal_llms/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,161 |
<!--Copyright 2020 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/fast_tokenizers.md/0 | {
"file_path": "transformers/docs/source/en/fast_tokenizers.md",
"repo_id": "transformers",
"token_count": 792
} | 467 |
import {
ChatPromptTemplate,
HumanMessagePromptTemplate,
SystemMessagePromptTemplate,
} from "@langchain/core/prompts";
import { Tool, DynamicStructuredTool } from "@langchain/core/tools";
export const PLANNER_SYSTEM_PROMPT_MESSAGE_TEMPLATE = [
`Let's first understand the problem and devise a plan to solve th... | langchainjs/langchain/src/experimental/plan_and_execute/prompt.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/plan_and_execute/prompt.ts",
"repo_id": "langchainjs",
"token_count": 574
} | 963 |
#!/usr/bin/env bash
export PYTHONPATH="../":"${PYTHONPATH}"
# From appendix C of paper https://arxiv.org/abs/1912.08777
# Set --gradient_accumulation_steps so that effective batch size is 256 (2*128, 4*64, 8*32, 16*16)
python finetune.py \
--learning_rate=1e-4 \
--do_train \
--do_predict \
--n_val 100... | transformers/examples/research_projects/seq2seq-distillation/finetune_pegasus_xsum.sh/0 | {
"file_path": "transformers/examples/research_projects/seq2seq-distillation/finetune_pegasus_xsum.sh",
"repo_id": "transformers",
"token_count": 208
} | 575 |
from gevent import monkey
monkey.patch_all()
from yaml import full_load, dump
from chaos.chaos_opt import ChaosOpt
from milvus_benchmark.chaos.chaos_mesh import PodChaos, NetworkChaos
from milvus_benchmark import config
kind_chaos_mapping = {
"PodChaos": PodChaos,
"NetworkChaos": NetworkChaos
}
if __name__ =... | milvus/tests/benchmark/milvus_benchmark/chaos/test.py/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/chaos/test.py",
"repo_id": "milvus",
"token_count": 511
} | 1,852 |
"""Test Vertex AI API wrapper.
In order to run this test, you need to install VertexAI SDK:
pip install google-cloud-aiplatform>=1.36.0
Your end-user credentials would be used to make the calls (make sure you've run
`gcloud auth login` first).
"""
import os
from typing import Optional
import pytest
from langchain_co... | langchain/libs/community/tests/integration_tests/llms/test_vertexai.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/llms/test_vertexai.py",
"repo_id": "langchain",
"token_count": 2283
} | 342 |
"""
Development Scripts for template packages
"""
from typing import Sequence
from fastapi import FastAPI
from langserve import add_routes
from langchain_cli.utils.packages import get_langserve_export, get_package_root
def create_demo_server(
*,
config_keys: Sequence[str] = (),
):
"""
Creates a dem... | langchain/libs/cli/langchain_cli/dev_scripts.py/0 | {
"file_path": "langchain/libs/cli/langchain_cli/dev_scripts.py",
"repo_id": "langchain",
"token_count": 411
} | 212 |
# coding=utf-8
# Copyright 2020 Google 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 required by... | transformers/src/transformers/models/pegasus/convert_pegasus_tf_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/pegasus/convert_pegasus_tf_to_pytorch.py",
"repo_id": "transformers",
"token_count": 2026
} | 666 |
<jupyter_start><jupyter_text>TensorFlow Datasets>[TensorFlow Datasets](https://www.tensorflow.org/datasets) is a collection of datasets ready to use, with TensorFlow or other Python ML frameworks, such as Jax. All datasets are exposed as [tf.data.Datasets](https://www.tensorflow.org/api_docs/python/tf/data/Dataset), en... | langchain/docs/docs/integrations/document_loaders/tensorflow_datasets.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/tensorflow_datasets.ipynb",
"repo_id": "langchain",
"token_count": 1319
} | 112 |
import { test, expect } from "@jest/globals";
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
import { AIMessage } from "@langchain/core/messages";
import { FunctionCallStructuredOutputParser } from "../structured_output.js";
test("structured output parser", async () => {
const parser... | langchainjs/langchain/src/chains/openai_functions/tests/structured_output.test.ts/0 | {
"file_path": "langchainjs/langchain/src/chains/openai_functions/tests/structured_output.test.ts",
"repo_id": "langchainjs",
"token_count": 1750
} | 928 |
"""Tree-structured Index Data Structures."""
# indices
from llama_index.legacy.indices.tree.all_leaf_retriever import TreeAllLeafRetriever
from llama_index.legacy.indices.tree.base import GPTTreeIndex, TreeIndex
from llama_index.legacy.indices.tree.select_leaf_embedding_retriever import (
TreeSelectLeafEmbeddingRe... | llama_index/llama-index-legacy/llama_index/legacy/indices/tree/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/tree/__init__.py",
"repo_id": "llama_index",
"token_count": 266
} | 1,723 |
import pytest
from langchain.evaluation.parsing.json_schema import JsonSchemaEvaluator
@pytest.fixture
def json_schema_evaluator() -> JsonSchemaEvaluator:
return JsonSchemaEvaluator()
@pytest.mark.requires("jsonschema")
def test_json_schema_evaluator_requires_input(
json_schema_evaluator: JsonSchemaEvaluat... | langchain/libs/langchain/tests/unit_tests/evaluation/parsing/test_json_schema.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/evaluation/parsing/test_json_schema.py",
"repo_id": "langchain",
"token_count": 925
} | 656 |
import * as fs from "fs";
import * as yaml from "js-yaml";
import { OpenAI } from "@langchain/openai";
import { JsonSpec, JsonObject } from "langchain/tools";
import { JsonToolkit, createJsonAgent } from "langchain/agents";
export const run = async () => {
let data: JsonObject;
try {
const yamlFile = fs.readFi... | langchainjs/examples/src/agents/json.ts/0 | {
"file_path": "langchainjs/examples/src/agents/json.ts",
"repo_id": "langchainjs",
"token_count": 384
} | 810 |
from langchain_community.utilities.alpha_vantage import AlphaVantageAPIWrapper
__all__ = ["AlphaVantageAPIWrapper"]
| langchain/libs/langchain/langchain/utilities/alpha_vantage.py/0 | {
"file_path": "langchain/libs/langchain/langchain/utilities/alpha_vantage.py",
"repo_id": "langchain",
"token_count": 34
} | 569 |
# Batch mapping
Combining the utility of [`Dataset.map`] with batch mode is very powerful. It allows you to speed up processing, and freely control the size of the generated dataset.
## Need for speed
The primary objective of batch mapping is to speed up processing. Often times, it is faster to work with batches of... | datasets/docs/source/about_map_batch.mdx/0 | {
"file_path": "datasets/docs/source/about_map_batch.mdx",
"repo_id": "datasets",
"token_count": 722
} | 120 |
# 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/upernet/modeling_upernet.py/0 | {
"file_path": "transformers/src/transformers/models/upernet/modeling_upernet.py",
"repo_id": "transformers",
"token_count": 7505
} | 680 |
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
dbmodel "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel"
mock "github.com/stretchr/testify/mock"
)
// ICollectionDb is an autogenerated mock type for the ICollectionDb type
type ICollectionDb struct {
mock.Mock
}
// Del... | chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ICollectionDb.go/0 | {
"file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/mocks/ICollectionDb.go",
"repo_id": "chroma",
"token_count": 1093
} | 47 |
"""Embeddings."""
from llama_index.core.callbacks.base import CallbackManager
from llama_index.core.callbacks.llama_debug import LlamaDebugHandler
from llama_index.core.callbacks.schema import CBEventType
TEST_PAYLOAD = {"one": 1, "two": 2}
TEST_ID = "my id"
def test_on_event_start() -> None:
"""Test event star... | llama_index/llama-index-core/tests/callbacks/test_llama_debug.py/0 | {
"file_path": "llama_index/llama-index-core/tests/callbacks/test_llama_debug.py",
"repo_id": "llama_index",
"token_count": 1199
} | 1,225 |
from typing import Any, List
from langchain_core.callbacks import CallbackManagerForRetrieverRun
from langchain_core.documents import Document
from langchain_core.retrievers import BaseRetriever
from langchain_community.utilities import YouSearchAPIWrapper
class YouRetriever(BaseRetriever, YouSearchAPIWrapper):
... | langchain/libs/community/langchain_community/retrievers/you.py/0 | {
"file_path": "langchain/libs/community/langchain_community/retrievers/you.py",
"repo_id": "langchain",
"token_count": 264
} | 275 |
---
sidebar_class_name: hidden
hide_table_of_contents: true
---
# LangChain Expression Language (LCEL)
LangChain Expression Language or LCEL is a declarative way to easily compose chains together.
Any chain constructed this way will automatically have full sync, async, and streaming support.
If you're looking for a ... | langchainjs/docs/core_docs/docs/expression_language/index.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/expression_language/index.mdx",
"repo_id": "langchainjs",
"token_count": 206
} | 748 |
import type { Collection, Document as MongoDBDocument } from "mongodb";
import {
MaxMarginalRelevanceSearchOptions,
VectorStore,
} from "@langchain/core/vectorstores";
import type { EmbeddingsInterface } from "@langchain/core/embeddings";
import { Document } from "@langchain/core/documents";
import { maximalMargina... | langchainjs/libs/langchain-community/src/vectorstores/mongodb_atlas.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/vectorstores/mongodb_atlas.ts",
"repo_id": "langchainjs",
"token_count": 3833
} | 993 |
"""General utils functions."""
import asyncio
import os
import random
import sys
import time
import traceback
import uuid
from contextlib import contextmanager
from dataclasses import dataclass
from functools import partial, wraps
from itertools import islice
from pathlib import Path
from typing import (
Any,
... | llama_index/llama-index-core/llama_index/core/utils.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/utils.py",
"repo_id": "llama_index",
"token_count": 6071
} | 1,152 |
"""
Ported to pytorch thanks to [tstandley](https://github.com/tstandley/Xception-PyTorch)
@author: tstandley
Adapted by cadene
Creates an Xception Model as defined in:
Francois Chollet
Xception: Deep Learning with Depthwise Separable Convolutions
https://arxiv.org/pdf/1610.02357.pdf
This weights ported from the Ke... | pytorch-image-models/timm/models/xception.py/0 | {
"file_path": "pytorch-image-models/timm/models/xception.py",
"repo_id": "pytorch-image-models",
"token_count": 3973
} | 349 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.mangadex import MangaDexReader
def test_class():
names_of_base_classes = [b.__name__ for b in MangaDexReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-mangadex/tests/test_readers_mangadex.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mangadex/tests/test_readers_mangadex.py",
"repo_id": "llama_index",
"token_count": 90
} | 1,344 |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/rembert/test_modeling_rembert.py/0 | {
"file_path": "transformers/tests/models/rembert/test_modeling_rembert.py",
"repo_id": "transformers",
"token_count": 9297
} | 809 |
kind: Schedule
apiVersion: chaos-mesh.org/v1alpha1
metadata:
name: test-indexnode-pod-kill
namespace: chaos-testing
spec:
schedule: '*/5 * * * * *'
startingDeadlineSeconds: 60
concurrencyPolicy: Forbid
historyLimit: 1
type: PodChaos
podChaos:
selector:
namespaces:
- chaos-testing
... | milvus/tests/python_client/chaos/chaos_objects/pod_kill/chaos_indexnode_pod_kill.yaml/0 | {
"file_path": "milvus/tests/python_client/chaos/chaos_objects/pod_kill/chaos_indexnode_pod_kill.yaml",
"repo_id": "milvus",
"token_count": 222
} | 1,992 |
Installation with npm
----------------------------------------------------------------------------------------------------
You can simply install 🤗 Tokenizers with npm using::
npm install tokenizers
| tokenizers/docs/source/installation/node.inc/0 | {
"file_path": "tokenizers/docs/source/installation/node.inc",
"repo_id": "tokenizers",
"token_count": 31
} | 452 |
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/src/transformers/models/marian/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/marian/__init__.py",
"repo_id": "transformers",
"token_count": 1314
} | 626 |
---
sidebar_position: 0
---
# Toolkits
Toolkits are collections of tools that are designed to be used together for specific tasks and have convenient loading methods.
For a complete list of these, visit the section in [Integrations](/docs/integrations/toolkits).
All Toolkits expose a `getTools()` method which return... | langchainjs/docs/core_docs/docs/modules/agents/tools/toolkits.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/agents/tools/toolkits.mdx",
"repo_id": "langchainjs",
"token_count": 161
} | 735 |
from langchain.schema.embeddings import __all__
EXPECTED_ALL = ["Embeddings"]
def test_all_imports() -> None:
assert set(__all__) == set(EXPECTED_ALL)
| langchain/libs/langchain/tests/unit_tests/schema/test_embeddings.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/schema/test_embeddings.py",
"repo_id": "langchain",
"token_count": 61
} | 616 |
import { zodToJsonSchema } from "zod-to-json-schema";
import { z } from "zod";
import {
type BaseMessage,
type AgentFinish,
type AgentStep,
} from "langchain/schema";
import { ChatOpenAI } from "@langchain/openai";
import { convertToOpenAIFunction } from "@langchain/core/utils/function_calling";
import { AgentExe... | langchainjs/examples/src/agents/agent_structured.ts/0 | {
"file_path": "langchainjs/examples/src/agents/agent_structured.ts",
"repo_id": "langchainjs",
"token_count": 1550
} | 751 |
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain.utils.openai_functions import convert_pydantic_to_openai_function
def test_convert_pydantic_to_openai_function() -> None:
class Data(BaseModel):
"""The data to return."""
key: str = Field(..., description="API key")
d... | langchain/libs/langchain/tests/unit_tests/utils/test_openai_functions.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/utils/test_openai_functions.py",
"repo_id": "langchain",
"token_count": 1182
} | 615 |
package iterator
import (
"testing"
"github.com/stretchr/testify/suite"
"github.com/milvus-io/milvus/internal/storage"
)
func TestDeltalogIteratorSuite(t *testing.T) {
suite.Run(t, new(DeltalogIteratorSuite))
}
type DeltalogIteratorSuite struct {
suite.Suite
}
func (s *DeltalogIteratorSuite) TestDeltalogIter... | milvus/internal/datanode/iterators/deltalog_iterator_test.go/0 | {
"file_path": "milvus/internal/datanode/iterators/deltalog_iterator_test.go",
"repo_id": "milvus",
"token_count": 613
} | 1,804 |
import { test, expect } from "@jest/globals";
import type { PromptTemplate } from "@langchain/core/prompts";
import { TavilySearchResults } from "@langchain/community/tools/tavily_search";
import { pull } from "../../hub.js";
import { AgentExecutor, createXmlAgent } from "../index.js";
import { ChatAnthropic } from "..... | langchainjs/langchain/src/agents/tests/create_xml_agent.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/agents/tests/create_xml_agent.int.test.ts",
"repo_id": "langchainjs",
"token_count": 384
} | 882 |
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
// https://vitejs.dev/config/
export default defineConfig({
base: "/____LANGSERVE_BASE_URL/",
plugins: [svgr(), react()],
server: {
proxy: {
"^/____LANGSERVE_BASE_URL.*/(config_schema|inp... | langserve/langserve/playground/vite.config.ts/0 | {
"file_path": "langserve/langserve/playground/vite.config.ts",
"repo_id": "langserve",
"token_count": 238
} | 1,005 |
[DEFAULT]
nbs_path = .
recursive = True
tst_flags = notest
user = hwchase17
doc_host = https://python.langchain.com
doc_baseurl = /docs
module_baseurls = metaflow=https://github.com/Netflix/metaflow/tree/master/
fastcore=https://github.com/fastcore/tree/master
host = github
| langchain/docs/settings.ini/0 | {
"file_path": "langchain/docs/settings.ini",
"repo_id": "langchain",
"token_count": 102
} | 219 |
<jupyter_start><jupyter_text>URLThis covers how to load HTML documents from a list of URLs into a document format that we can use downstream.<jupyter_code>from langchain_community.document_loaders import UnstructuredURLLoader
urls = [
"https://www.understandingwar.org/backgrounder/russian-offensive-campaign-assessm... | langchain/docs/docs/integrations/document_loaders/url.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/url.ipynb",
"repo_id": "langchain",
"token_count": 695
} | 112 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | transformers/src/transformers/tools/image_segmentation.py/0 | {
"file_path": "transformers/src/transformers/tools/image_segmentation.py",
"repo_id": "transformers",
"token_count": 696
} | 753 |
<jupyter_start><jupyter_text>Streamlit>[Streamlit](https://docs.streamlit.io/) is an open-source Python library that makes it easy to create and share beautiful, custom web apps for machine learning and data science.This notebook goes over how to store and use chat message history in a `Streamlit` app. `StreamlitChatMe... | langchain/docs/docs/integrations/memory/streamlit_chat_message_history.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/memory/streamlit_chat_message_history.ipynb",
"repo_id": "langchain",
"token_count": 1018
} | 134 |
from langchain_community.graphs.kuzu_graph import KuzuGraph
__all__ = ["KuzuGraph"]
| langchain/libs/langchain/langchain/graphs/kuzu_graph.py/0 | {
"file_path": "langchain/libs/langchain/langchain/graphs/kuzu_graph.py",
"repo_id": "langchain",
"token_count": 32
} | 531 |
"""Wolfram Alpha API toolkit."""
from langchain_community.tools.wolfram_alpha.tool import WolframAlphaQueryRun
__all__ = [
"WolframAlphaQueryRun",
]
| langchain/libs/community/langchain_community/tools/wolfram_alpha/__init__.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/wolfram_alpha/__init__.py",
"repo_id": "langchain",
"token_count": 52
} | 312 |
from typing import (
TYPE_CHECKING,
Any,
Dict,
List,
Optional,
Tuple,
Type,
TypeVar,
Union,
cast,
)
from tenacity import (
AsyncRetrying,
RetryCallState,
RetryError,
Retrying,
retry_if_exception_type,
stop_after_attempt,
wait_exponential_jitter,
)
fr... | langchain/libs/core/langchain_core/runnables/retry.py/0 | {
"file_path": "langchain/libs/core/langchain_core/runnables/retry.py",
"repo_id": "langchain",
"token_count": 5702
} | 398 |
import { beforeEach, describe, expect, test } from "@jest/globals";
import * as fs from "node:fs/promises";
import * as path from "node:path";
import * as os from "node:os";
import { connect, Table } from "vectordb";
import { OpenAIEmbeddings } from "@langchain/openai";
import { Document } from "@langchain/core/docume... | langchainjs/libs/langchain-community/src/vectorstores/tests/lancedb.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/lancedb.int.test.ts",
"repo_id": "langchainjs",
"token_count": 525
} | 1,052 |
<jupyter_start><jupyter_text>Protein Folding with ESMFold and 🤗`transformers` ESMFold ([paper link](https://www.biorxiv.org/content/10.1101/2022.07.20.500902v2)) is a recently released protein folding model from FAIR. Unlike other protein folding models, it does not require external databases or search tools to predic... | notebooks/examples/protein_folding.ipynb/0 | {
"file_path": "notebooks/examples/protein_folding.ipynb",
"repo_id": "notebooks",
"token_count": 6321
} | 282 |
syntax = "proto3";
package milvus.proto.query;
option go_package = "github.com/milvus-io/milvus/internal/proto/querypb";
import "common.proto";
import "milvus.proto";
import "internal.proto";
import "schema.proto";
import "msg.proto";
import "data_coord.proto";
import "index_coord.proto";
service QueryCoord {
rpc... | milvus/internal/proto/query_coord.proto/0 | {
"file_path": "milvus/internal/proto/query_coord.proto",
"repo_id": "milvus",
"token_count": 6126
} | 1,874 |
from langchain_community.document_loaders.azure_ai_data import AzureAIDataLoader
__all__ = ["AzureAIDataLoader"]
| langchain/libs/langchain/langchain/document_loaders/azure_ai_data.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/azure_ai_data.py",
"repo_id": "langchain",
"token_count": 38
} | 475 |
import json
from abc import abstractmethod
from typing import Any, Dict, List, Optional
from llama_index.legacy.callbacks.base import BaseCallbackHandler
from llama_index.legacy.callbacks.schema import CBEventType, EventPayload
class BaseFinetuningHandler(BaseCallbackHandler):
"""
Callback handler for finetu... | llama_index/llama-index-legacy/llama_index/legacy/callbacks/finetuning_handler.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/callbacks/finetuning_handler.py",
"repo_id": "llama_index",
"token_count": 3352
} | 1,641 |
// 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/checkers/channel_checker.go/0 | {
"file_path": "milvus/internal/querycoordv2/checkers/channel_checker.go",
"repo_id": "milvus",
"token_count": 3104
} | 1,756 |
import json
import pytest
from base.client_base import TestcaseBase
from deploy.common import get_deploy_test_collections
from common.common_type import CaseLabel
from utils.util_log import test_log as log
class TestGetCollections(TestcaseBase):
""" Test case of getting all collections """
@pytest.mark.tags... | milvus/tests/python_client/deploy/testcases/test_get_all_collections.py/0 | {
"file_path": "milvus/tests/python_client/deploy/testcases/test_get_all_collections.py",
"repo_id": "milvus",
"token_count": 435
} | 1,899 |
"""Azure Translate tool spec."""
import requests
from llama_index.core.tools.tool_spec.base import BaseToolSpec
ENDPOINT_BASE_URL = "https://api.cognitive.microsofttranslator.com/translate"
class AzureTranslateToolSpec(BaseToolSpec):
"""Azure Translate tool spec."""
spec_functions = ["translate"]
def ... | llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/llama_index/tools/azure_translate/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-azure-translate/llama_index/tools/azure_translate/base.py",
"repo_id": "llama_index",
"token_count": 693
} | 1,506 |
from langchain_community.embeddings.ollama import OllamaEmbeddings
__all__ = ["OllamaEmbeddings"]
| langchain/libs/langchain/langchain/embeddings/ollama.py/0 | {
"file_path": "langchain/libs/langchain/langchain/embeddings/ollama.py",
"repo_id": "langchain",
"token_count": 34
} | 500 |
from typing import Dict, Generator, Union
import pytest
from docker.models.containers import Container
from llama_index.storage.kvstore.postgres import PostgresKVStore
try:
import asyncpg # noqa
import psycopg2 # noqa
import sqlalchemy # noqa
no_packages = False
except ImportError:
no_packages... | llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-postgres/tests/test_postgres.py/0 | {
"file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-postgres/tests/test_postgres.py",
"repo_id": "llama_index",
"token_count": 2443
} | 1,470 |
# address of mongoDB
MONGO_SERVER = 'mongodb://192.168.1.234:27017/'
SCHEDULER_DB = "scheduler"
JOB_COLLECTION = "jobs"
REGISTRY_URL = "registry.milvus.io/milvus/milvus"
IDC_NAS_URL = "//172.16.70.249/test"
DEFAULT_IMAGE = "milvusdb/milvus:latest"
SERVER_HOST_DEFAULT = "127.0.0.1"
SERVER_PORT_DEFAULT = 19530
# milv... | milvus/tests/benchmark/milvus_benchmark/config.py/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/config.py",
"repo_id": "milvus",
"token_count": 597
} | 1,989 |
from langchain_community.tools.nasa.tool import NasaAction
__all__ = ["NasaAction"]
| langchain/libs/langchain/langchain/tools/nasa/tool.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/nasa/tool.py",
"repo_id": "langchain",
"token_count": 27
} | 552 |
import { toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import { emojisplosion } from "emojisplosion";
import { useState, useRef } from "react";
import * as DOMPurify from "dompurify";
import { SourceBubble, Source } from "./SourceBubble";
import {
VStack,
Flex,
Heading,
HStack,
... | weblangchain/nextjs/app/components/ChatMessageBubble.tsx/0 | {
"file_path": "weblangchain/nextjs/app/components/ChatMessageBubble.tsx",
"repo_id": "weblangchain",
"token_count": 5981
} | 2,028 |
package proxy
import (
"context"
"time"
"go.uber.org/zap"
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/mq/msgstream"
"github.com/milvus-io/milvus/pkg/util/merr"
"github.com/milvus-io/milvus/pkg/util/resource"
)
const (
ReplicateMsgStreamTyp = "replicate_msg_stream"
Replicat... | milvus/internal/proxy/replicate_stream_manager.go/0 | {
"file_path": "milvus/internal/proxy/replicate_stream_manager.go",
"repo_id": "milvus",
"token_count": 841
} | 1,743 |
kind: Schedule
apiVersion: chaos-mesh.org/v1alpha1
metadata:
name: test-etcd-pod-kill
namespace: chaos-testing
spec:
schedule: '*/5 * * * * *'
startingDeadlineSeconds: 60
concurrencyPolicy: Forbid
historyLimit: 1
type: PodChaos
podChaos:
selector:
namespaces:
- chaos-testing
labe... | milvus/tests/python_client/chaos/chaos_objects/pod_kill/chaos_etcd_pod_kill.yaml/0 | {
"file_path": "milvus/tests/python_client/chaos/chaos_objects/pod_kill/chaos_etcd_pod_kill.yaml",
"repo_id": "milvus",
"token_count": 209
} | 2,111 |
# flake8: noqa
from langchain.prompts.prompt import PromptTemplate
_PROMPT_TEMPLATE = """Translate a math problem into a expression that can be executed using Python's SymPy library. Use the output of running this code to answer the question.
Question: ${{Question with math problem.}}
```text
${{single line sympy exp... | langchain/libs/experimental/langchain_experimental/llm_symbolic_math/prompt.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/llm_symbolic_math/prompt.py",
"repo_id": "langchain",
"token_count": 415
} | 443 |
<jupyter_start><jupyter_text>🦙 x 🦙 Rap Battle What happens when 2 🦙 (13B vs. 70B) have a rap battle? If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-replicate
!pip install llama-index<jupyter_output><empty_output><jupyter_text>Setu... | llama_index/docs/examples/llm/llama_2_rap_battle.ipynb/0 | {
"file_path": "llama_index/docs/examples/llm/llama_2_rap_battle.ipynb",
"repo_id": "llama_index",
"token_count": 1095
} | 1,062 |
[book]
authors = ["Nicolas Patry"]
language = "en"
multilingual = false
src = "src"
title = "Candle Documentation"
| candle/candle-book/book.toml/0 | {
"file_path": "candle/candle-book/book.toml",
"repo_id": "candle",
"token_count": 38
} | 27 |
use crate::backend::{BackendDevice, BackendStorage};
use crate::op::{BinaryOpT, CmpOp, ReduceOp, UnaryOpT};
use crate::{DType, Error, IntDType, Layout, Result, Shape, WithDType};
use half::{bf16, f16};
use rayon::prelude::*;
const USE_IM2COL_CONV1D: bool = true;
const USE_IM2COL_CONV2D: bool = true;
// TODO: Maybe we... | candle/candle-core/src/cpu_backend.rs/0 | {
"file_path": "candle/candle-core/src/cpu_backend.rs",
"repo_id": "candle",
"token_count": 68866
} | 30 |
# Load image data
Image datasets have [`Image`] type columns, which contain PIL objects.
<Tip>
To work with image datasets, you need to have the `vision` dependency installed. Check out the [installation](./installation#vision) guide to learn how to install it.
</Tip>
When you load an image dataset and call the i... | datasets/docs/source/image_load.mdx/0 | {
"file_path": "datasets/docs/source/image_load.mdx",
"repo_id": "datasets",
"token_count": 1389
} | 121 |
"""Keyword Table Index Data Structures."""
# indices
from llama_index.legacy.indices.keyword_table.base import (
GPTKeywordTableIndex,
KeywordTableIndex,
)
from llama_index.legacy.indices.keyword_table.rake_base import (
GPTRAKEKeywordTableIndex,
RAKEKeywordTableIndex,
)
from llama_index.legacy.indices... | llama_index/llama-index-legacy/llama_index/legacy/indices/keyword_table/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/keyword_table/__init__.py",
"repo_id": "llama_index",
"token_count": 347
} | 1,564 |
# 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... | transformers/tests/pipelines/test_pipelines_image_classification.py/0 | {
"file_path": "transformers/tests/pipelines/test_pipelines_image_classification.py",
"repo_id": "transformers",
"token_count": 4939
} | 761 |
<!--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/it/perf_infer_gpu_one.md/0 | {
"file_path": "transformers/docs/source/it/perf_infer_gpu_one.md",
"repo_id": "transformers",
"token_count": 2306
} | 510 |
import { expect, test } from "@jest/globals";
import { OpenAIEmbeddings } from "@langchain/openai";
import { InMemoryDocstore } from "@langchain/community/stores/doc/in_memory";
import { TextLoader } from "../../document_loaders/fs/text.js";
import { InMemoryStore } from "../../storage/in_memory.js";
import { MemoryVec... | langchainjs/langchain/src/retrievers/tests/parent_document.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/retrievers/tests/parent_document.int.test.ts",
"repo_id": "langchainjs",
"token_count": 1778
} | 932 |
search_performance:
collections:
-
server:
db_config.primary_path: /test/milvus/db_data_011/sift_1b_128_l2_sq8
cache_config.cpu_cache_capacity: 150GB
engine_config.use_blas_threshold: 0
engine_config.gpu_search_threshold: 100
gpu_resource_config.enable: false
... | milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search_sift1b.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_cpu_search_sift1b.yaml",
"repo_id": "milvus",
"token_count": 400
} | 1,968 |
python_sources()
| llama_index/llama-index-packs/llama-index-packs-nebulagraph-query-engine/llama_index/packs/nebulagraph_query_engine/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-nebulagraph-query-engine/llama_index/packs/nebulagraph_query_engine/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,578 |
<!--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/roberta-prelayernorm.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/roberta-prelayernorm.md",
"repo_id": "transformers",
"token_count": 1519
} | 453 |
// Code generated by mockery v2.32.4. DO NOT EDIT.
package balance
import (
meta "github.com/milvus-io/milvus/internal/querycoordv2/meta"
mock "github.com/stretchr/testify/mock"
)
// MockBalancer is an autogenerated mock type for the Balance type
type MockBalancer struct {
mock.Mock
}
type MockBalancer_Expecter ... | milvus/internal/querycoordv2/balance/mock_balancer.go/0 | {
"file_path": "milvus/internal/querycoordv2/balance/mock_balancer.go",
"repo_id": "milvus",
"token_count": 2250
} | 1,971 |
# SWSL ResNet
**Residual Networks**, or **ResNets**, learn residual functions with reference to the layer inputs, instead of learning unreferenced functions. Instead of hoping each few stacked layers directly fit a desired underlying mapping, residual nets let these layers fit a residual mapping. They stack [residual ... | pytorch-image-models/docs/models/swsl-resnet.md/0 | {
"file_path": "pytorch-image-models/docs/models/swsl-resnet.md",
"repo_id": "pytorch-image-models",
"token_count": 2439
} | 355 |
# Discord Loader
This loader loads conversations from Discord. The user specifies `channel_ids` and we fetch conversations from
those `channel_ids`.
## Usage
Here's an example usage of the DiscordReader.
```python
from llama_index import download_loader
import os
DiscordReader = download_loader("DiscordReader")
d... | llama_index/llama-index-integrations/readers/llama-index-readers-discord/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-discord/README.md",
"repo_id": "llama_index",
"token_count": 266
} | 1,392 |
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/ja/model_doc/clvp.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/clvp.md",
"repo_id": "transformers",
"token_count": 2038
} | 520 |
import json
from dataclasses import dataclass
from typing import Any, List
from dataclasses_json import DataClassJsonMixin
from llama_index.legacy.output_parsers.base import (
OutputParserException,
StructuredOutput,
)
from llama_index.legacy.output_parsers.utils import _marshal_llm_to_json
from llama_index.l... | llama_index/llama-index-legacy/llama_index/legacy/output_parsers/selection.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/output_parsers/selection.py",
"repo_id": "llama_index",
"token_count": 1532
} | 1,583 |
import { PPTXLoader } from "langchain/document_loaders/fs/pptx";
export const run = async () => {
const loader = new PPTXLoader(
"src/document_loaders/example_data/theikuntest.pptx"
);
const docs = await loader.load();
console.log({ docs });
};
| langchainjs/examples/src/document_loaders/ppt.ts/0 | {
"file_path": "langchainjs/examples/src/document_loaders/ppt.ts",
"repo_id": "langchainjs",
"token_count": 91
} | 830 |
from dataclasses import dataclass
from typing import Callable, Optional
import datasets
@dataclass
class GeneratorConfig(datasets.BuilderConfig):
generator: Optional[Callable] = None
gen_kwargs: Optional[dict] = None
features: Optional[datasets.Features] = None
def __post_init__(self):
asser... | datasets/src/datasets/packaged_modules/generator/generator.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/generator/generator.py",
"repo_id": "datasets",
"token_count": 351
} | 136 |
from __future__ import annotations
from typing import TYPE_CHECKING, List
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
if TYPE_CHECKING:
import pandas as pd
class DiscordChatLoader(BaseLoader):
"""Load `Discord` chat logs."""
def __ini... | langchain/libs/community/langchain_community/document_loaders/discord.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/discord.py",
"repo_id": "langchain",
"token_count": 523
} | 234 |
import { z } from "zod";
import { GmailBaseToolParams, GmailBaseTool } from "./base.js";
import { GET_MESSAGE_DESCRIPTION } from "./descriptions.js";
export class GmailGetMessage extends GmailBaseTool {
name = "gmail_get_message";
schema = z.object({
messageId: z.string(),
});
description = GET_MESSAGE_D... | langchainjs/libs/langchain-community/src/tools/gmail/get_message.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/tools/gmail/get_message.ts",
"repo_id": "langchainjs",
"token_count": 792
} | 996 |
fn main() {
wasm_logger::init(wasm_logger::Config::new(log::Level::Trace));
console_error_panic_hook::set_once();
yew::Renderer::<candle_wasm_example_yolo::App>::new().render();
}
| candle/candle-wasm-examples/yolo/src/bin/app.rs/0 | {
"file_path": "candle/candle-wasm-examples/yolo/src/bin/app.rs",
"repo_id": "candle",
"token_count": 82
} | 88 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/others/test_config.py/0 | {
"file_path": "diffusers/tests/others/test_config.py",
"repo_id": "diffusers",
"token_count": 3986
} | 267 |
<jupyter_start><jupyter_text>Entraîner un modèle de langage causal de zéro (PyTorch)Ici nous entraînons un modèle à générer du code Python. Le Python utilisant des fonctions basées sur des mots anglais, nous gardons un gpt-2 anglais dans l'optique d'obtenir de meilleures performances que ce que l'on pourrait s'attendre... | notebooks/course/fr/chapter7/section6_pt.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter7/section6_pt.ipynb",
"repo_id": "notebooks",
"token_count": 4772
} | 288 |
// 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/metricsinfo/metric_type.go/0 | {
"file_path": "milvus/pkg/util/metricsinfo/metric_type.go",
"repo_id": "milvus",
"token_count": 718
} | 1,846 |
// 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/storage/azure-blob-storage/AzureBlobChunkManager.cpp/0 | {
"file_path": "milvus/internal/core/src/storage/azure-blob-storage/AzureBlobChunkManager.cpp",
"repo_id": "milvus",
"token_count": 5120
} | 1,809 |
from langchain_community.document_loaders.gcs_file import GCSFileLoader
__all__ = ["GCSFileLoader"]
| langchain/libs/langchain/langchain/document_loaders/gcs_file.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/gcs_file.py",
"repo_id": "langchain",
"token_count": 33
} | 484 |
<script lang="ts">
export let checked: boolean;
export let name: string;
</script>
<input bind:checked type="checkbox" {name} class="peer pointer-events-none absolute opacity-0" />
<div
aria-checked={checked}
aria-roledescription="switch"
aria-label="switch"
role="switch"
tabindex="0"
class="relative inline-fl... | chat-ui/src/lib/components/Switch.svelte/0 | {
"file_path": "chat-ui/src/lib/components/Switch.svelte",
"repo_id": "chat-ui",
"token_count": 239
} | 85 |
<!--Copyright 2021 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/model_doc/bartpho.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/bartpho.md",
"repo_id": "transformers",
"token_count": 1166
} | 469 |
# 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/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_flax_{{cookiecutter.lowercase_modelname}}.py/0 | {
"file_path": "transformers/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_flax_{{cookiecutter.lowercase_modelname}}.py",
"repo_id": "transformers",
"token_count": 12273
} | 790 |
Copyright (c) [year] [name]
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicens... | tokenizers/tokenizers/examples/unstable_wasm/www/LICENSE-MIT/0 | {
"file_path": "tokenizers/tokenizers/examples/unstable_wasm/www/LICENSE-MIT",
"repo_id": "tokenizers",
"token_count": 275
} | 477 |
import {
ChatGoogleBase,
ChatGoogleBaseInput,
GoogleAbstractedClient,
GoogleBaseLLMInput,
} from "@langchain/google-common";
import { GoogleAuthOptions } from "google-auth-library";
import { GAuthClient } from "./auth.js";
/**
* Input to chat model class.
*/
export interface ChatGoogleInput
extends ChatGoo... | langchainjs/libs/langchain-google-gauth/src/chat_models.ts/0 | {
"file_path": "langchainjs/libs/langchain-google-gauth/src/chat_models.ts",
"repo_id": "langchainjs",
"token_count": 248
} | 991 |
use candle::{DType, Device, Tensor};
use candle_nn::VarBuilder;
use candle_transformers::models::bert::{BertModel, Config};
use candle_wasm_example_bert::console_log;
use tokenizers::{PaddingParams, Tokenizer};
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub struct Model {
bert: BertModel,
tokenizer: Tokeniz... | candle/candle-wasm-examples/bert/src/bin/m.rs/0 | {
"file_path": "candle/candle-wasm-examples/bert/src/bin/m.rs",
"repo_id": "candle",
"token_count": 1534
} | 80 |
poetry_requirements(
name="poetry",
)
python_requirements(
name="reqs",
)
| llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-gong/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-gong/BUILD",
"repo_id": "llama_index",
"token_count": 36
} | 1,449 |
# API Getting Started
This documentation covers how to get started with the API that backs OpenGPTs.
This allows you to easily integrate it with a different frontend of your choice.
For full API documentation, see [localhost:8100/docs](localhost:8100/docs) after deployment.
If you want to see the API docs before dep... | opengpts/API.md/0 | {
"file_path": "opengpts/API.md",
"repo_id": "opengpts",
"token_count": 3159
} | 2,197 |
// 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/rate_collector.go/0 | {
"file_path": "milvus/internal/datanode/rate_collector.go",
"repo_id": "milvus",
"token_count": 825
} | 1,977 |
import { FaissStore } from "@langchain/community/vectorstores/faiss";
import { OpenAIEmbeddings } from "@langchain/openai";
export const run = async () => {
// Create an initial vector store
const vectorStore = await FaissStore.fromTexts(
["Hello world", "Bye bye", "hello nice world"],
[{ id: 2 }, { id: 1 ... | langchainjs/examples/src/indexes/vector_stores/faiss_mergefrom.ts/0 | {
"file_path": "langchainjs/examples/src/indexes/vector_stores/faiss_mergefrom.ts",
"repo_id": "langchainjs",
"token_count": 326
} | 827 |
// 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/rootcoord/redo_test.go/0 | {
"file_path": "milvus/internal/rootcoord/redo_test.go",
"repo_id": "milvus",
"token_count": 1537
} | 1,780 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/vivit/convert_vivit_flax_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/vivit/convert_vivit_flax_to_pytorch.py",
"repo_id": "transformers",
"token_count": 3449
} | 696 |
# Quantization
TGI offers GPTQ and bits-and-bytes quantization to quantize large language models.
## Quantization with GPTQ
GPTQ is a post-training quantization method to make the model smaller. It quantizes the layers by finding a compressed version of that weight, that will yield a minimum mean squared error like ... | text-generation-inference/docs/source/conceptual/quantization.md/0 | {
"file_path": "text-generation-inference/docs/source/conceptual/quantization.md",
"repo_id": "text-generation-inference",
"token_count": 1114
} | 371 |
[pytest]
addopts = --snapshot-warn-unused
asyncio_mode = auto
markers =
private: marks tests as requiring an admin hf token (deselect with '-m "not private"') | text-generation-inference/integration-tests/pytest.ini/0 | {
"file_path": "text-generation-inference/integration-tests/pytest.ini",
"repo_id": "text-generation-inference",
"token_count": 57
} | 383 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.