text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
# Modal
This page covers how to use the Modal ecosystem to run LangChain custom LLMs.
It is broken into two parts:
1. Modal installation and web endpoint deployment
2. Using deployed web endpoint with `LLM` wrapper class.
## Installation and Setup
- Install with `pip install modal`
- Run `modal token new`
## Defi... | langchain/docs/docs/integrations/providers/modal.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/modal.mdx",
"repo_id": "langchain",
"token_count": 938
} | 153 |
<!--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/zh/quicktour.md/0 | {
"file_path": "transformers/docs/source/zh/quicktour.md",
"repo_id": "transformers",
"token_count": 12880
} | 535 |
// @ts-nocheck
// Inlined to deal with portability issues
// Originally from: https://github.com/isaacs/sax-js
const initializeSax = function () {
const sax: any = {};
sax.parser = function (strict, opt) {
return new SAXParser(strict, opt);
};
sax.SAXParser = SAXParser;
sax.SAXStream = SAXStream;
sax.... | langchainjs/langchain-core/src/utils/sax-js/sax.ts/0 | {
"file_path": "langchainjs/langchain-core/src/utils/sax-js/sax.ts",
"repo_id": "langchainjs",
"token_count": 22435
} | 872 |
from langchain_community.callbacks.arthur_callback import (
ArthurCallbackHandler,
)
__all__ = [
"ArthurCallbackHandler",
]
| langchain/libs/langchain/langchain/callbacks/arthur_callback.py/0 | {
"file_path": "langchain/libs/langchain/langchain/callbacks/arthur_callback.py",
"repo_id": "langchain",
"token_count": 44
} | 473 |
# 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 applicabl... | transformers/tests/models/owlvit/test_processor_owlvit.py/0 | {
"file_path": "transformers/tests/models/owlvit/test_processor_owlvit.py",
"repo_id": "transformers",
"token_count": 4354
} | 804 |
import { NextRequest, NextResponse } from "next/server";
import { ChatWindowMessage } from "@/schema/ChatWindowMessage";
import { ChatOpenAI } from "langchain/chat_models/openai";
import { BytesOutputParser } from "langchain/schema/output_parser";
import { PromptTemplate } from "langchain/prompts";
export const runti... | langsmith-cookbook/feedback-examples/nextjs/app/api/chat/route.ts/0 | {
"file_path": "langsmith-cookbook/feedback-examples/nextjs/app/api/chat/route.ts",
"repo_id": "langsmith-cookbook",
"token_count": 1105
} | 1,094 |
from typing import Any
from unittest.mock import patch
import pytest
from llama_index.core.base.response.schema import Response
from llama_index.core.query_engine.cogniswitch_query_engine import (
CogniswitchQueryEngine,
)
@pytest.fixture()
def query_engine() -> CogniswitchQueryEngine:
return CogniswitchQuer... | llama_index/llama-index-core/tests/query_engine/test_cogniswitch_query_engine.py/0 | {
"file_path": "llama_index/llama-index-core/tests/query_engine/test_cogniswitch_query_engine.py",
"repo_id": "llama_index",
"token_count": 409
} | 1,198 |
"""Module for fetching data from the SEC EDGAR Archives."""
import json
import os
import re
import sys
from typing import List, Optional, Tuple, Union
import requests
if sys.version_info < (3, 8): # noqa: UP036
from typing import Final
else:
from typing import Final
import webbrowser
try:
from ratelim... | llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/fetch.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/fetch.py",
"repo_id": "llama_index",
"token_count": 3355
} | 1,371 |
"""Load agent."""
from typing import Any, Optional, Sequence
from langchain_core._api import deprecated
from langchain_core.callbacks import BaseCallbackManager
from langchain_core.language_models import BaseLanguageModel
from langchain_core.tools import BaseTool
from langchain.agents.agent import AgentExecutor
from ... | langchain/libs/langchain/langchain/agents/initialize.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/initialize.py",
"repo_id": "langchain",
"token_count": 1305
} | 444 |
""" CUDA / AMP utils
Hacked together by / Copyright 2020 Ross Wightman
"""
import torch
try:
from apex import amp
has_apex = True
except ImportError:
amp = None
has_apex = False
from .clip_grad import dispatch_clip_grad
class ApexScaler:
state_dict_key = "amp"
def __call__(
sel... | pytorch-image-models/timm/utils/cuda.py/0 | {
"file_path": "pytorch-image-models/timm/utils/cuda.py",
"repo_id": "pytorch-image-models",
"token_count": 980
} | 396 |
<!--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/pt/custom_models.md/0 | {
"file_path": "transformers/docs/source/pt/custom_models.md",
"repo_id": "transformers",
"token_count": 5915
} | 559 |
# coding=utf-8
# Copyright 2022 The Salesforce authors, The Open AI Team Authors 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/l... | transformers/src/transformers/models/codegen/tokenization_codegen.py/0 | {
"file_path": "transformers/src/transformers/models/codegen/tokenization_codegen.py",
"repo_id": "transformers",
"token_count": 6731
} | 582 |
# 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 applicabl... | accelerate/tests/test_examples.py/0 | {
"file_path": "accelerate/tests/test_examples.py",
"repo_id": "accelerate",
"token_count": 4376
} | 23 |
// 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/unittest/test_chunk_cache.cpp/0 | {
"file_path": "milvus/internal/core/unittest/test_chunk_cache.cpp",
"repo_id": "milvus",
"token_count": 2722
} | 1,951 |
python_tests()
| llama_index/llama-index-packs/llama-index-packs-streamlit-chatbot/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-streamlit-chatbot/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,873 |
# coding=utf-8
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | transformers/src/transformers/utils/model_parallel_utils.py/0 | {
"file_path": "transformers/src/transformers/utils/model_parallel_utils.py",
"repo_id": "transformers",
"token_count": 778
} | 737 |
from llama_index.packs.arize_phoenix_query_engine.base import (
ArizePhoenixQueryEnginePack,
)
__all__ = ["ArizePhoenixQueryEnginePack"]
| llama_index/llama-index-packs/llama-index-packs-arize-phoenix-query-engine/llama_index/packs/arize_phoenix_query_engine/__init__.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-arize-phoenix-query-engine/llama_index/packs/arize_phoenix_query_engine/__init__.py",
"repo_id": "llama_index",
"token_count": 49
} | 1,773 |
python_sources()
| llama_index/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,416 |
from typing import Any, List, Optional
from langchain_core.language_models import BaseLanguageModel
from langchain_core.prompts import BasePromptTemplate, ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain.chains.base import Chain
from langchain.chains.llm import LLMChain
from langchai... | langchain/libs/langchain/langchain/chains/openai_functions/extraction.py/0 | {
"file_path": "langchain/libs/langchain/langchain/chains/openai_functions/extraction.py",
"repo_id": "langchain",
"token_count": 1548
} | 465 |
import CodeBlock from "@theme/CodeBlock";
import TimeoutExample from "@examples/models/chat/chat_timeout.ts";
# Adding a timeout
By default, LangChain will wait indefinitely for a response from the model provider. If you want to add a timeout, you can pass a `timeout` option, in milliseconds, when you call the model.... | langchainjs/docs/core_docs/docs/modules/model_io/chat/timeouts.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/model_io/chat/timeouts.mdx",
"repo_id": "langchainjs",
"token_count": 170
} | 793 |
import os
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_community.chat_models import ChatOpenAI
from langchain_community.document_loaders import PyPDFLoader
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import MongoDBAtlasVectorSea... | langchain/templates/rag-mongo/rag_mongo/chain.py/0 | {
"file_path": "langchain/templates/rag-mongo/rag_mongo/chain.py",
"repo_id": "langchain",
"token_count": 825
} | 676 |
import { Document } from "@langchain/core/documents";
import { SearchApiLoader } from "../web/searchapi.js";
test("Test buildUrl method without engine", () => {
const loader = new SearchApiLoader({ apiKey: "ApiKey", q: "Query" });
expect(loader.buildUrl()).toBe(
"https://www.searchapi.io/api/v1/search?engine=... | langchainjs/langchain/src/document_loaders/tests/searchapi.test.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/tests/searchapi.test.ts",
"repo_id": "langchainjs",
"token_count": 426
} | 910 |
[package]
name = "candle-examples"
version.workspace = true
edition.workspace = true
description.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
license.workspace = true
readme = "README.md"
[dependencies]
accelerate-src = { workspace = true, optional = true }
candle ... | candle/candle-examples/Cargo.toml/0 | {
"file_path": "candle/candle-examples/Cargo.toml",
"repo_id": "candle",
"token_count": 946
} | 38 |
import { test, expect } from "@jest/globals";
import Exa from "exa-js";
import { ExaFindSimilarResults, ExaSearchResults } from "../tools.js";
test("ExaSearchResults can perform a search given a string query", async () => {
const exaTool = new ExaSearchResults<{ text: true }>({
// @ts-expect-error type errors
... | langchainjs/libs/langchain-exa/src/tests/tools.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-exa/src/tests/tools.int.test.ts",
"repo_id": "langchainjs",
"token_count": 373
} | 1,013 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.pinecone import PineconeReader
def test_class():
names_of_base_classes = [b.__name__ for b in PineconeReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-pinecone/tests/test_readers_pinecone.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-pinecone/tests/test_readers_pinecone.py",
"repo_id": "llama_index",
"token_count": 88
} | 1,404 |
from langchain_astradb import __all__
EXPECTED_ALL = [
"AstraDBVectorStore",
]
def test_all_imports() -> None:
assert sorted(EXPECTED_ALL) == sorted(__all__)
| langchain/libs/partners/astradb/tests/unit_tests/test_imports.py/0 | {
"file_path": "langchain/libs/partners/astradb/tests/unit_tests/test_imports.py",
"repo_id": "langchain",
"token_count": 67
} | 626 |
import { expect, test } from "@jest/globals";
import { z } from "zod";
import { OpenAI, ChatOpenAI } from "@langchain/openai";
import {
ChatPromptTemplate,
PromptTemplate,
SystemMessagePromptTemplate,
} from "@langchain/core/prompts";
import { LLMChain } from "../../chains/index.js";
import { StructuredOutputPar... | langchainjs/langchain/src/output_parsers/tests/structured.int.test.ts/0 | {
"file_path": "langchainjs/langchain/src/output_parsers/tests/structured.int.test.ts",
"repo_id": "langchainjs",
"token_count": 2115
} | 955 |
from typing import Generator
import pytest
from llama_index.legacy.storage.kvstore.s3_kvstore import S3DBKVStore
try:
import boto3
from moto import mock_s3
has_boto_libs = True
except ImportError:
has_boto_libs = False
@pytest.fixture()
def kvstore_from_mocked_bucket() -> Generator[S3DBKVStore, Non... | llama_index/llama-index-legacy/tests/storage/kvstore/test_s3_kvstore.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/storage/kvstore/test_s3_kvstore.py",
"repo_id": "llama_index",
"token_count": 1476
} | 1,637 |
<jupyter_start><jupyter_text>Apache CassandraThis page provides a quickstart for using [Apache Cassandra®](https://cassandra.apache.org/) as a Vector Store. > [Cassandra](https://cassandra.apache.org/) is a NoSQL, row-oriented, highly scalable and highly available database.Starting with version 5.0, the database ships ... | langchain/docs/docs/integrations/vectorstores/cassandra.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/cassandra.ipynb",
"repo_id": "langchain",
"token_count": 3091
} | 181 |
from operator import itemgetter
from typing import Literal
from langchain.output_parsers.openai_functions import PydanticAttrOutputFunctionsParser
from langchain.retrievers import (
ArxivRetriever,
KayAiRetriever,
PubMedRetriever,
WikipediaRetriever,
)
from langchain.schema import StrOutputParser
from ... | langchain/templates/rag-multi-index-router/rag_multi_index_router/chain.py/0 | {
"file_path": "langchain/templates/rag-multi-index-router/rag_multi_index_router/chain.py",
"repo_id": "langchain",
"token_count": 1234
} | 678 |
from typing import TYPE_CHECKING
from ...utils import DIFFUSERS_SLOW_IMPORT, _LazyModule
_import_structure = {"pipeline_dit": ["DiTPipeline"]}
if TYPE_CHECKING or DIFFUSERS_SLOW_IMPORT:
from .pipeline_dit import DiTPipeline
else:
import sys
sys.modules[__name__] = _LazyModule(
__name__,
... | diffusers/src/diffusers/pipelines/dit/__init__.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/dit/__init__.py",
"repo_id": "diffusers",
"token_count": 177
} | 259 |
import io
import itertools
import json
from dataclasses import dataclass
from typing import Optional
import pyarrow as pa
import pyarrow.json as paj
import datasets
from datasets.table import table_cast
from datasets.utils.file_utils import readline
logger = datasets.utils.logging.get_logger(__name__)
@dataclass
... | datasets/src/datasets/packaged_modules/json/json.py/0 | {
"file_path": "datasets/src/datasets/packaged_modules/json/json.py",
"repo_id": "datasets",
"token_count": 4907
} | 147 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/paged_csv/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/paged_csv/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,295 |
import random
from typing import (
Any,
Dict,
Optional,
Sequence,
)
from llama_index.core.bridge.pydantic import Field, PrivateAttr
from llama_index.core.callbacks import CallbackManager
from llama_index.core.llms.base import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatRespon... | llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py",
"repo_id": "llama_index",
"token_count": 3580
} | 1,270 |
//! The shape of a tensor is a tuple with the size of each of its dimensions.
#![allow(clippy::redundant_closure_call)]
use crate::{Error, Result};
#[derive(Clone, PartialEq, Eq)]
pub struct Shape(Vec<usize>);
pub const SCALAR: Shape = Shape(vec![]);
impl std::fmt::Debug for Shape {
fn fmt(&self, f: &mut std::fm... | candle/candle-core/src/shape.rs/0 | {
"file_path": "candle/candle-core/src/shape.rs",
"repo_id": "candle",
"token_count": 9806
} | 36 |
from pathlib import Path
import pytest
from langchain_community.document_loaders.concurrent import ConcurrentLoader
from langchain_community.document_loaders.generic import GenericLoader
from langchain_community.document_loaders.parsers import LanguageParser
def test_language_loader_for_python() -> None:
"""Tes... | langchain/libs/community/tests/integration_tests/document_loaders/parsers/test_language.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/document_loaders/parsers/test_language.py",
"repo_id": "langchain",
"token_count": 2008
} | 321 |
import json
import tempfile
from copy import deepcopy
from pathlib import Path
from typing import Any, Dict, List, Optional, Sequence, Union
from langchain_core.agents import AgentAction, AgentFinish
from langchain_core.callbacks import BaseCallbackHandler
from langchain_core.outputs import LLMResult
from langchain_c... | langchain/libs/community/langchain_community/callbacks/wandb_callback.py/0 | {
"file_path": "langchain/libs/community/langchain_community/callbacks/wandb_callback.py",
"repo_id": "langchain",
"token_count": 9834
} | 220 |
package kafka
import (
"bytes"
"context"
"encoding/binary"
"fmt"
"math/rand"
"os"
"testing"
"time"
"github.com/confluentinc/confluent-kafka-go/kafka"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"github.com/milvus-io/milvus/pkg/common"
"github.com/milvus-io/milvus/pkg/config"
"github.com/milv... | milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_client_test.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_client_test.go",
"repo_id": "milvus",
"token_count": 4890
} | 1,898 |
# coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | transformers/tests/models/mask2former/test_image_processing_mask2former.py/0 | {
"file_path": "transformers/tests/models/mask2former/test_image_processing_mask2former.py",
"repo_id": "transformers",
"token_count": 10079
} | 771 |
[
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [
{
"id": 1,
"logprob": null,
"text": "<s>"
},
{
"id": 1724,
"logprob": -7.6914062,
"text": "What"
... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_awq_sharded/test_flash_llama_awq_load_sharded.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_awq_sharded/test_flash_llama_awq_load_sharded.json",
"repo_id": "text-generation-inference",
"token_count": 5776
} | 419 |
"""All tests for this package."""
| langchain/libs/langchain/tests/__init__.py/0 | {
"file_path": "langchain/libs/langchain/tests/__init__.py",
"repo_id": "langchain",
"token_count": 9
} | 612 |
<!--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/main_classes/quantization.md/0 | {
"file_path": "transformers/docs/source/ja/main_classes/quantization.md",
"repo_id": "transformers",
"token_count": 10631
} | 479 |
import { OpenAIEmbeddings } from "@langchain/openai";
const embeddings = new OpenAIEmbeddings({
modelName: "text-embedding-3-large",
});
const vectors = await embeddings.embedDocuments(["some text"]);
console.log(vectors[0].length);
const embeddings1024 = new OpenAIEmbeddings({
modelName: "text-embedding-3-large... | langchainjs/examples/src/embeddings/openai_dimensions.ts/0 | {
"file_path": "langchainjs/examples/src/embeddings/openai_dimensions.ts",
"repo_id": "langchainjs",
"token_count": 152
} | 774 |
from typing import ClassVar, Dict, Optional, Sequence
from uuid import UUID
import uuid
from overrides import override
import requests
from chromadb.api import AdminAPI, ClientAPI, ServerAPI
from chromadb.api.types import (
CollectionMetadata,
DataLoader,
Documents,
Embeddable,
EmbeddingFunction,
... | chroma/chromadb/api/client.py/0 | {
"file_path": "chroma/chromadb/api/client.py",
"repo_id": "chroma",
"token_count": 6688
} | 13 |
package httpserver
import (
"encoding/binary"
"encoding/json"
"fmt"
"math"
"github.com/cockroachdb/errors"
"github.com/golang/protobuf/proto"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
)... | milvus/internal/distributed/proxy/httpserver/wrap_request.go/0 | {
"file_path": "milvus/internal/distributed/proxy/httpserver/wrap_request.go",
"repo_id": "milvus",
"token_count": 5515
} | 1,799 |
# 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/swinv2/configuration_swinv2.py/0 | {
"file_path": "transformers/src/transformers/models/swinv2/configuration_swinv2.py",
"repo_id": "transformers",
"token_count": 2994
} | 663 |
from typing import Any, Dict, List, Optional
import requests
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import BaseModel, SecretStr, root_validator
from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env
BAICHUAN_API_URL: str = "http://api.baichuan-ai.com/v1/... | langchain/libs/community/langchain_community/embeddings/baichuan.py/0 | {
"file_path": "langchain/libs/community/langchain_community/embeddings/baichuan.py",
"repo_id": "langchain",
"token_count": 1990
} | 255 |
# Copyright 2024 The Intel Labs Team Authors and the HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | diffusers/examples/community/pipeline_stable_diffusion_upscale_ldm3d.py/0 | {
"file_path": "diffusers/examples/community/pipeline_stable_diffusion_upscale_ldm3d.py",
"repo_id": "diffusers",
"token_count": 17030
} | 210 |
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]
[tool.codespell]
check-filenames = true
check-hidden = true
skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb"
[tool.llamahub]
classes = ["SelfRAGPack", "SelfRAGQueryEngine"]
contains_example = false
import_path = "llama_index.p... | llama_index/llama-index-packs/llama-index-packs-self-rag/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-self-rag/pyproject.toml",
"repo_id": "llama_index",
"token_count": 684
} | 1,683 |
# 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/lora/gptq.py/0 | {
"file_path": "peft/src/peft/tuners/lora/gptq.py",
"repo_id": "peft",
"token_count": 1509
} | 333 |
import argparse
import logging
import os
import random
import sys
from datasets import load_from_disk
from sklearn.metrics import accuracy_score, precision_recall_fscore_support
import torch
from transformers import AutoModelForSequenceClassification, Trainer, TrainingArguments, AutoTokenizer
if __name__ == "__main_... | notebooks/sagemaker/06_sagemaker_metrics/scripts/train.py/0 | {
"file_path": "notebooks/sagemaker/06_sagemaker_metrics/scripts/train.py",
"repo_id": "notebooks",
"token_count": 1415
} | 326 |
from llama_index.vector_stores.postgres.base import PGVectorStore
__all__ = ["PGVectorStore"]
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/llama_index/vector_stores/postgres/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/llama_index/vector_stores/postgres/__init__.py",
"repo_id": "llama_index",
"token_count": 30
} | 1,568 |
#include "binary_op_macros.cuh"
#include<stdint.h>
#if __CUDA_ARCH__ >= 800
BINARY_OP(__nv_bfloat16, badd_bf16, x + y)
BINARY_OP(__nv_bfloat16, bdiv_bf16, x / y)
BINARY_OP(__nv_bfloat16, bmul_bf16, x * y)
BINARY_OP(__nv_bfloat16, bsub_bf16, x - y)
BINARY_OP(__nv_bfloat16, bmaximum_bf16, maxg(x, y))
BINARY_OP(__nv_bflo... | candle/candle-kernels/src/binary.cu/0 | {
"file_path": "candle/candle-kernels/src/binary.cu",
"repo_id": "candle",
"token_count": 2144
} | 56 |
// 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/balance/utils.go/0 | {
"file_path": "milvus/internal/querycoordv2/balance/utils.go",
"repo_id": "milvus",
"token_count": 2645
} | 1,892 |
# coding=utf-8
# Copyright 2021 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/feature_extraction_utils.py/0 | {
"file_path": "transformers/src/transformers/feature_extraction_utils.py",
"repo_id": "transformers",
"token_count": 12786
} | 633 |
//! Attention Based Building Blocks
use candle::{DType, IndexOp, Result, Tensor, D};
use candle_nn as nn;
use candle_nn::Module;
#[derive(Debug)]
struct GeGlu {
proj: nn::Linear,
span: tracing::Span,
}
impl GeGlu {
fn new(vs: nn::VarBuilder, dim_in: usize, dim_out: usize) -> Result<Self> {
let pro... | candle/candle-transformers/src/models/stable_diffusion/attention.rs/0 | {
"file_path": "candle/candle-transformers/src/models/stable_diffusion/attention.rs",
"repo_id": "candle",
"token_count": 9413
} | 75 |
# coding=utf-8
# Copyright 2022 ABEJA, Inc. and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | transformers/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py/0 | {
"file_path": "transformers/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py",
"repo_id": "transformers",
"token_count": 13899
} | 611 |
"""Test Hologres functionality."""
import os
from typing import List
from langchain_core.documents import Document
from langchain_community.vectorstores.hologres import Hologres
from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings
CONNECTION_STRING = Hologres.connection_string_from_db_para... | langchain/libs/community/tests/integration_tests/vectorstores/test_hologres.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_hologres.py",
"repo_id": "langchain",
"token_count": 2178
} | 392 |
// Generated by modified Perl script at https://github.com/google/sentencepiece/blob/master/data/gen_unicode_scripts_code.pl
// Unicode scripts : https://gist.github.com/Narsil/07556f26dc84a6baeff4d499e68d3cd2
// Rust adaptation : https://gist.github.com/Narsil/1df9fbbf5296a8d4d62de55dcb2fe700
#[derive(PartialEq, Debu... | tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/scripts.rs/0 | {
"file_path": "tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/scripts.rs",
"repo_id": "tokenizers",
"token_count": 46440
} | 434 |
"""Wrapper around Minimax APIs."""
from __future__ import annotations
import logging
from typing import (
Any,
Dict,
List,
Optional,
)
import requests
from langchain_core.callbacks import (
CallbackManagerForLLMRun,
)
from langchain_core.language_models.llms import LLM
from langchain_core.pydantic... | langchain/libs/community/langchain_community/llms/minimax.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/minimax.py",
"repo_id": "langchain",
"token_count": 2336
} | 289 |
is_thin_client = True
| chroma/clients/python/is_thin_client.py/0 | {
"file_path": "chroma/clients/python/is_thin_client.py",
"repo_id": "chroma",
"token_count": 8
} | 33 |
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"noEmit": true,
"noUnusedLocals... | langchainjs/environment_tests/test-exports-vite/tsconfig.json/0 | {
"file_path": "langchainjs/environment_tests/test-exports-vite/tsconfig.json",
"repo_id": "langchainjs",
"token_count": 191
} | 779 |
from llama_index.core.llms.base import BaseLLM
from llama_index.llms.mistralai import MistralAI
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in MistralAI.__mro__]
assert BaseLLM.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py",
"repo_id": "llama_index",
"token_count": 94
} | 1,405 |
try:
from torch import _assert
except ImportError:
def _assert(condition: bool, message: str):
assert condition, message
def _float_to_int(x: float) -> int:
"""
Symbolic tracing helper to substitute for inbuilt `int`.
Hint: Inbuilt `int` can't accept an argument of type `Proxy`
"""
... | pytorch-image-models/timm/layers/trace_utils.py/0 | {
"file_path": "pytorch-image-models/timm/layers/trace_utils.py",
"repo_id": "pytorch-image-models",
"token_count": 119
} | 368 |
package utils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSplitBySeparator(t *testing.T) {
tsKey := "435783141193354561_ts435783141193154564"
k, ts, err := SplitBySeparator(tsKey)
assert.NoError(t, err)
assert.Equal(t, "435783141193354561", k)
assert.Equal(t, Timestamp(43578314119315456... | milvus/cmd/tools/migration/utils/util_test.go/0 | {
"file_path": "milvus/cmd/tools/migration/utils/util_test.go",
"repo_id": "milvus",
"token_count": 406
} | 1,726 |
from pathlib import Path
import pytest
from langchain_community.document_loaders.mhtml import MHTMLLoader
HERE = Path(__file__).parent
EXAMPLES = HERE.parent.parent / "integration_tests" / "examples"
@pytest.mark.requires("bs4", "lxml")
def test_mhtml_loader() -> None:
"""Test mhtml loader."""
file_path = ... | langchain/libs/community/tests/unit_tests/document_loaders/test_mhtml.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_mhtml.py",
"repo_id": "langchain",
"token_count": 245
} | 379 |
import { JSDOM, VirtualConsole } from "jsdom";
export async function searchWebLocal(query: string) {
const abortController = new AbortController();
setTimeout(() => abortController.abort(), 10000);
const htmlString = await fetch("https://www.google.com/search?hl=en&q=" + query, {
signal: abortController.signal,
... | chat-ui/src/lib/server/websearch/searchWebLocal.ts/0 | {
"file_path": "chat-ui/src/lib/server/websearch/searchWebLocal.ts",
"repo_id": "chat-ui",
"token_count": 438
} | 91 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/pkg/util/interceptor/server_id_interceptor.go/0 | {
"file_path": "milvus/pkg/util/interceptor/server_id_interceptor.go",
"repo_id": "milvus",
"token_count": 1203
} | 1,916 |
package tasks
import (
"context"
"fmt"
"math/rand"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"go.uber.org/atomic"
"github.com/milvus-io/milvus/pkg/util/conc"
"github.com/milvus-io/milvus/pkg/util/lifetime"
"github.com/milvus-io/milvus/pkg/util/paramtable"
)
... | milvus/internal/querynodev2/tasks/concurrent_safe_scheduler_test.go/0 | {
"file_path": "milvus/internal/querynodev2/tasks/concurrent_safe_scheduler_test.go",
"repo_id": "milvus",
"token_count": 1549
} | 2,051 |
import pytest
from llama_index.legacy.core.llms.types import ChatMessage, MessageRole
from llama_index.legacy.llms.anthropic_utils import (
anthropic_modelname_to_contextsize,
messages_to_anthropic_prompt,
)
def test_messages_to_anthropic_prompt() -> None:
messages = [
ChatMessage(role=MessageRole... | llama_index/llama-index-legacy/tests/llms/test_anthropic_utils.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/llms/test_anthropic_utils.py",
"repo_id": "llama_index",
"token_count": 365
} | 1,558 |
<jupyter_start><jupyter_text>Plan-and-executePlan-and-execute agents accomplish an objective by first planning what to do, then executing the sub tasks. This idea is largely inspired by [BabyAGI](https://github.com/yoheinakajima/babyagi) and then the ["Plan-and-Solve" paper](https://arxiv.org/abs/2305.04091).The planni... | langchain/cookbook/plan_and_execute_agent.ipynb/0 | {
"file_path": "langchain/cookbook/plan_and_execute_agent.ipynb",
"repo_id": "langchain",
"token_count": 925
} | 80 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/mobilevit/test_modeling_tf_mobilevit.py/0 | {
"file_path": "transformers/tests/models/mobilevit/test_modeling_tf_mobilevit.py",
"repo_id": "transformers",
"token_count": 7977
} | 738 |
import logging
import os
import sys
from dataclasses import dataclass, field
from typing import List, Optional
import torch
from datasets import Dataset
from torch import nn
from tqdm.auto import tqdm
from transformers import (
AutoModelForSequenceClassification,
AutoTokenizer,
HfArgumentParser,
Train... | transformers/examples/research_projects/zero-shot-distillation/distill_classifier.py/0 | {
"file_path": "transformers/examples/research_projects/zero-shot-distillation/distill_classifier.py",
"repo_id": "transformers",
"token_count": 4815
} | 608 |
<jupyter_start><jupyter_text>SQL Join Query EngineIn this tutorial, we show you how to use our SQLJoinQueryEngine.This query engine allows you to combine insights from your structured tables with your unstructured data.It first decides whether to query your structured tables for insights.Once it does, it can then infer... | llama_index/docs/examples/query_engine/SQLJoinQueryEngine.ipynb/0 | {
"file_path": "llama_index/docs/examples/query_engine/SQLJoinQueryEngine.ipynb",
"repo_id": "llama_index",
"token_count": 2620
} | 1,102 |
import json
from typing import List, Sequence, Tuple
from langchain_core.agents import AgentAction
from langchain_core.messages import (
AIMessage,
BaseMessage,
ToolMessage,
)
from langchain.agents.output_parsers.openai_tools import OpenAIToolAgentAction
def _create_tool_message(
agent_action: OpenA... | langchain/libs/langchain/langchain/agents/format_scratchpad/openai_tools.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/format_scratchpad/openai_tools.py",
"repo_id": "langchain",
"token_count": 697
} | 467 |
"""Base types for ReAct agent."""
from abc import abstractmethod
from typing import Dict
from llama_index.legacy.bridge.pydantic import BaseModel
class BaseReasoningStep(BaseModel):
"""Reasoning step."""
@abstractmethod
def get_content(self) -> str:
"""Get content."""
@property
@abstra... | llama_index/llama-index-legacy/llama_index/legacy/agent/react/types.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/agent/react/types.py",
"repo_id": "llama_index",
"token_count": 740
} | 1,638 |
# coding=utf-8
# Copyright 2022 NVIDIA and The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | transformers/src/transformers/models/groupvit/modeling_tf_groupvit.py/0 | {
"file_path": "transformers/src/transformers/models/groupvit/modeling_tf_groupvit.py",
"repo_id": "transformers",
"token_count": 39518
} | 614 |
[tool.poetry]
name = "csv-agent"
version = "0.0.1"
description = "Analyze csv data with Pandas and OpenAI"
authors = []
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.9,<3.13"
langchain = "^0.1"
openai = "<2"
tiktoken = "^0.5.1"
faiss-cpu = "^1.7.4"
pandas = "^2.1.1"
setuptools = "^68.2.2"
tabulate = "^... | langchain/templates/csv-agent/pyproject.toml/0 | {
"file_path": "langchain/templates/csv-agent/pyproject.toml",
"repo_id": "langchain",
"token_count": 338
} | 641 |
python_tests()
| llama_index/llama-index-packs/llama-index-packs-rag-cli-local/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-rag-cli-local/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,861 |
use std::fmt::Debug;
use super::{Component, ComponentContext, Handler};
use async_trait::async_trait;
use thiserror::Error;
// Message Wrapper
#[derive(Debug)]
pub(crate) struct Wrapper<C>
where
C: Component,
{
wrapper: Box<dyn WrapperTrait<C>>,
}
impl<C: Component> Wrapper<C> {
pub(super) async fn handl... | chroma/rust/worker/src/system/sender.rs/0 | {
"file_path": "chroma/rust/worker/src/system/sender.rs",
"repo_id": "chroma",
"token_count": 1551
} | 64 |
# retrieval-agent-fireworks
This package uses open source models hosted on FireworksAI to do retrieval using an agent architecture. By default, this does retrieval over Arxiv.
We will use `Mixtral8x7b-instruct-v0.1`, which is shown in this blog to yield reasonable
results with function calling even though it is not f... | langchain/templates/retrieval-agent-fireworks/README.md/0 | {
"file_path": "langchain/templates/retrieval-agent-fireworks/README.md",
"repo_id": "langchain",
"token_count": 737
} | 674 |
"""
An implementation of GhostNet & GhostNetV2 Models as defined in:
GhostNet: More Features from Cheap Operations. https://arxiv.org/abs/1911.11907
GhostNetV2: Enhance Cheap Operation with Long-Range Attention. https://proceedings.neurips.cc/paper_files/paper/2022/file/40b60852a4abdaa696b5a1a78da34635-Paper-Conference... | pytorch-image-models/timm/models/ghostnet.py/0 | {
"file_path": "pytorch-image-models/timm/models/ghostnet.py",
"repo_id": "pytorch-image-models",
"token_count": 7430
} | 398 |
# coding=utf-8
# Copyright The HuggingFace Team 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/LICE... | transformers/src/transformers/models/xglm/tokenization_xglm.py/0 | {
"file_path": "transformers/src/transformers/models/xglm/tokenization_xglm.py",
"repo_id": "transformers",
"token_count": 5538
} | 743 |
# YandexGPT
LangChain.js supports calling [YandexGPT](https://cloud.yandex.com/en/services/yandexgpt) LLMs.
## Setup
First, you should [create service account](https://cloud.yandex.com/en/docs/iam/operations/sa/create) with the `ai.languageModels.user` role.
Next, you have two authentication options:
- [IAM token]... | langchainjs/docs/core_docs/docs/integrations/llms/yandex.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/llms/yandex.mdx",
"repo_id": "langchainjs",
"token_count": 360
} | 710 |
<jupyter_start><jupyter_text>Partager ses démos avec d'autres Installez les bibliothèques 🤗 Transformers et 🤗 Gradio pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece]
!pip install gradio
import gradio as gr
title = "Poser une question (en anglais) à Rick"
description = """
L... | notebooks/course/fr/chapter9/section4.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter9/section4.ipynb",
"repo_id": "notebooks",
"token_count": 1441
} | 304 |
export default `# QA and Chat over Documents
Chat and Question-Answering (QA) over \`data\` are popular LLM use-cases.
\`data\` can include many things, including:
* \`Unstructured data\` (e.g., PDFs)
* \`Structured data\` (e.g., SQL)
* \`Code\` (e.g., Python)
Below we will review Chat and QA on \`Unstructured data... | langchain-nextjs-template/data/DefaultRetrievalText.ts/0 | {
"file_path": "langchain-nextjs-template/data/DefaultRetrievalText.ts",
"repo_id": "langchain-nextjs-template",
"token_count": 5502
} | 70 |
# Self-querying
A self-querying retriever is one that, as the name suggests, has the ability to query itself. Specifically, given any natural language query, the retriever uses a query-constructing LLM chain to write a structured query and then applies that structured query to it's underlying VectorStore. This allows ... | langchainjs/docs/core_docs/docs/modules/data_connection/retrievers/self_query/index.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/retrievers/self_query/index.mdx",
"repo_id": "langchainjs",
"token_count": 720
} | 757 |
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]
[tool.codespell]
check-filenames = true
check-hidden = true
skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb"
[tool.llamahub]
classes = ["AzStorageBlobReader"]
contains_example = false
import_path = "llama_index.readers.azstora... | llama_index/llama-index-integrations/readers/llama-index-readers-azstorage-blob/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-azstorage-blob/pyproject.toml",
"repo_id": "llama_index",
"token_count": 704
} | 1,270 |
from typing import List
from langchain_core.documents import Document
from langchain_community.document_loaders.web_base import WebBaseLoader
class IMSDbLoader(WebBaseLoader):
"""Load `IMSDb` webpages."""
def load(self) -> List[Document]:
"""Load webpage."""
soup = self.scrape()
tex... | langchain/libs/community/langchain_community/document_loaders/imsdb.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/imsdb.py",
"repo_id": "langchain",
"token_count": 173
} | 238 |
"""Test EdenAi's speech to text Tool .
In order to run this test, you need to have an EdenAI api key.
You can get it by registering for free at https://app.edenai.run/user/register.
A test key can be found at https://app.edenai.run/admin/account/settings by
clicking on the 'sandbox' toggle.
(calls will be free, and wi... | langchain/libs/community/tests/integration_tests/tools/edenai/test_audio_speech_to_text.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/tools/edenai/test_audio_speech_to_text.py",
"repo_id": "langchain",
"token_count": 326
} | 379 |
"""Util that calls several NASA APIs."""
import json
import requests
from langchain_core.pydantic_v1 import BaseModel
IMAGE_AND_VIDEO_LIBRARY_URL = "https://images-api.nasa.gov"
class NasaAPIWrapper(BaseModel):
"""Wrapper for NASA API."""
def get_media(self, query: str) -> str:
params = json.loads(... | langchain/libs/community/langchain_community/utilities/nasa.py/0 | {
"file_path": "langchain/libs/community/langchain_community/utilities/nasa.py",
"repo_id": "langchain",
"token_count": 786
} | 323 |
[package]
authors = ["Anthony MOI <m.anthony.moi@gmail.com>", "Nicolas Patry <patry.nicolas@protonmail.com>"]
edition = "2018"
name = "tokenizers"
version = "0.15.3-dev.0"
homepage = "https://github.com/huggingface/tokenizers"
repository = "https://github.com/huggingface/tokenizers"
documentation = "https://docs.rs/tok... | tokenizers/tokenizers/Cargo.toml/0 | {
"file_path": "tokenizers/tokenizers/Cargo.toml",
"repo_id": "tokenizers",
"token_count": 838
} | 448 |
"""Base vector store index query."""
from typing import Any, Dict, List, Optional
from llama_index.core.base.base_retriever import BaseRetriever
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.core.callbacks.base import CallbackManager
from llama_index.core.constants import DEFAULT_S... | llama_index/llama-index-core/llama_index/core/indices/vector_store/retrievers/retriever.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/indices/vector_store/retrievers/retriever.py",
"repo_id": "llama_index",
"token_count": 3364
} | 1,183 |
from langchain_together.embeddings import TogetherEmbeddings
from langchain_together.llms import Together
from langchain_together.version import __version__
__all__ = [
"__version__",
"Together",
"TogetherEmbeddings",
]
| langchain/libs/partners/together/langchain_together/__init__.py/0 | {
"file_path": "langchain/libs/partners/together/langchain_together/__init__.py",
"repo_id": "langchain",
"token_count": 73
} | 643 |
# 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/models/attention_processor.py/0 | {
"file_path": "diffusers/src/diffusers/models/attention_processor.py",
"repo_id": "diffusers",
"token_count": 46806
} | 226 |
build_performance:
collections:
# -
# server:
# db_config.primary_path: /test/milvus/db_data_011/sift_1b_128_l2_sq8h
# cache_config.cpu_cache_capacity: 8GB
# engine_config.use_blas_threshold: 1100
# engine_config.gpu_search_threshold: 1
# gpu_resource_config.enable: true
# ... | milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_build_sift1b.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_build_sift1b.yaml",
"repo_id": "milvus",
"token_count": 705
} | 1,936 |
import { ChatGoogleVertexAI } from "@langchain/community/chat_models/googlevertexai";
// Or, if using the web entrypoint:
// import { ChatGoogleVertexAI } from "@langchain/community/chat_models/googlevertexai/web";
const model = new ChatGoogleVertexAI({
temperature: 0.7,
});
const stream = await model.stream([
["s... | langchainjs/examples/src/models/chat/integration_googlevertexai-streaming.ts/0 | {
"file_path": "langchainjs/examples/src/models/chat/integration_googlevertexai-streaming.ts",
"repo_id": "langchainjs",
"token_count": 249
} | 866 |
# Annoy
> [Annoy](https://github.com/spotify/annoy) (`Approximate Nearest Neighbors Oh Yeah`) is a C++ library with Python bindings to search for points in space that are close to a given query point. It also creates large read-only file-based data structures that are mmapped into memory so that many processes may sha... | langchain/docs/docs/integrations/providers/annoy.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/annoy.mdx",
"repo_id": "langchain",
"token_count": 151
} | 128 |
import torch
import torch.nn as nn
class AsymmetricLossMultiLabel(nn.Module):
def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-8, disable_torch_grad_focal_loss=False):
super(AsymmetricLossMultiLabel, self).__init__()
self.gamma_neg = gamma_neg
self.gamma_pos = gamma_pos
... | pytorch-image-models/timm/loss/asymmetric_loss.py/0 | {
"file_path": "pytorch-image-models/timm/loss/asymmetric_loss.py",
"repo_id": "pytorch-image-models",
"token_count": 1620
} | 349 |
#!/usr/bin/env bash
export VERSION=`python -m setuptools_scm`
if [[ -n `git status --porcelain` ]]; then
VERSION=$VERSION-dirty
fi
echo $VERSION
| chroma/bin/version/0 | {
"file_path": "chroma/bin/version",
"repo_id": "chroma",
"token_count": 59
} | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.