text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
from llama_index.core.readers.base import BaseReader
from llama_index.readers.kaltura_esearch import KalturaESearchReader
def test_class():
names_of_base_classes = [b.__name__ for b in KalturaESearchReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-kaltura/tests/test_readers_kaltura.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-kaltura/tests/test_readers_kaltura.py",
"repo_id": "llama_index",
"token_count": 98
} | 1,399 |
import "@/styles/globals.css";
import { useState } from "react";
import type { AppProps } from "next/app";
import { createBrowserSupabaseClient } from "@supabase/auth-helpers-nextjs";
import { SessionContextProvider } from "@supabase/auth-helpers-react";
function App({ Component, pageProps }: AppProps) {
return <Com... | langchain-template-supabase/src/pages/_app.tsx/0 | {
"file_path": "langchain-template-supabase/src/pages/_app.tsx",
"repo_id": "langchain-template-supabase",
"token_count": 224
} | 73 |
- sections:
- local: index
title: Home
- local: quickstart
title: Quickstart
- local: installation
title: Installation
title: Get started
- sections:
- local: feature_extraction
title: Using Pretrained Models as Feature Extractors
- local: training_script
title: Training With The Offici... | pytorch-image-models/hfdocs/source/_toctree.yml/0 | {
"file_path": "pytorch-image-models/hfdocs/source/_toctree.yml",
"repo_id": "pytorch-image-models",
"token_count": 1686
} | 357 |
# Atlas
>[Nomic Atlas](https://docs.nomic.ai/index.html) is a platform for interacting with both
> small and internet scale unstructured datasets.
## Installation and Setup
- Install the Python package with `pip install nomic`
- `Nomic` is also included in langchains poetry extras `poetry install -E all`
## Vect... | langchain/docs/docs/integrations/providers/atlas.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/atlas.mdx",
"repo_id": "langchain",
"token_count": 129
} | 129 |
from llama_index.embeddings.bedrock.base import BedrockEmbedding, Models
__all__ = ["BedrockEmbedding", "Models"]
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/llama_index/embeddings/bedrock/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/llama_index/embeddings/bedrock/__init__.py",
"repo_id": "llama_index",
"token_count": 40
} | 1,302 |
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [
{
"id": 1,
"logprob": null,
"text": "<s>"
},
{
"id": 3735,
"logprob": -12.9140625,
"text": "Test"
},
{
"id": 2... | text-generation-inference/integration-tests/models/__snapshots__/test_flash_mistral/test_flash_mistral.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_mistral/test_flash_mistral.json",
"repo_id": "text-generation-inference",
"token_count": 1050
} | 375 |
from langchain_community.document_loaders.modern_treasury import (
ModernTreasuryLoader,
)
__all__ = ["ModernTreasuryLoader"]
| langchain/libs/langchain/langchain/document_loaders/modern_treasury.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/modern_treasury.py",
"repo_id": "langchain",
"token_count": 41
} | 518 |
from langchain_community.utilities.scenexplain import SceneXplainAPIWrapper
__all__ = ["SceneXplainAPIWrapper"]
| langchain/libs/langchain/langchain/utilities/scenexplain.py/0 | {
"file_path": "langchain/libs/langchain/langchain/utilities/scenexplain.py",
"repo_id": "langchain",
"token_count": 35
} | 568 |
// Code generated by mockery v2.32.4. DO NOT EDIT.
package datacoord
import (
datapb "github.com/milvus-io/milvus/internal/proto/datapb"
mock "github.com/stretchr/testify/mock"
)
// MockScheduler is an autogenerated mock type for the Scheduler type
type MockScheduler struct {
mock.Mock
}
type MockScheduler_Expec... | milvus/internal/datacoord/mock_scheduler.go/0 | {
"file_path": "milvus/internal/datacoord/mock_scheduler.go",
"repo_id": "milvus",
"token_count": 2497
} | 1,777 |
from typing import Any, Dict, List, Sequence, Set
from uuid import UUID
from chromadb.config import Settings, System
from chromadb.ingest import CollectionAssignmentPolicy, Consumer
from chromadb.proto.chroma_pb2_grpc import (
# SegmentServerServicer,
# add_SegmentServerServicer_to_server,
VectorReaderServi... | chroma/chromadb/segment/impl/distributed/server.py/0 | {
"file_path": "chroma/chromadb/segment/impl/distributed/server.py",
"repo_id": "chroma",
"token_count": 3112
} | 17 |
from langchain_community.embeddings.jina import JinaEmbeddings
__all__ = ["JinaEmbeddings"]
| langchain/libs/langchain/langchain/embeddings/jina.py/0 | {
"file_path": "langchain/libs/langchain/langchain/embeddings/jina.py",
"repo_id": "langchain",
"token_count": 32
} | 525 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/controlnet/test_controlnet_sdxl_img2img.py/0 | {
"file_path": "diffusers/tests/pipelines/controlnet/test_controlnet_sdxl_img2img.py",
"repo_id": "diffusers",
"token_count": 5978
} | 276 |
import type { OpenAIClient } from "@langchain/openai";
import {
BaseChatModel,
type BaseChatModelParams,
} from "@langchain/core/language_models/chat_models";
import {
AIMessage,
BaseMessage,
ChatMessage,
HumanMessage,
} from "@langchain/core/messages";
import { ChatResult, ChatGeneration } from "@langchai... | langchainjs/libs/langchain-community/src/chat_models/minimax.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/chat_models/minimax.ts",
"repo_id": "langchainjs",
"token_count": 9354
} | 1,051 |
<!--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/en/transformers_agents.md/0 | {
"file_path": "transformers/docs/source/en/transformers_agents.md",
"repo_id": "transformers",
"token_count": 4397
} | 513 |
"""Module for defining/enumerating the common sections from SEC forms."""
import re
from enum import Enum
from typing import List
class SECSection(Enum):
PROSPECTUS_SUMMARY = re.compile(r"^(?:prospectus )?summary$")
ABOUT_PROSPECTUS = re.compile(r"about this prospectus")
FORWARD_LOOKING_STATEMENTS = re.co... | llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/sections.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/sections.py",
"repo_id": "llama_index",
"token_count": 2540
} | 1,518 |
package proxy
import (
"context"
"github.com/cockroachdb/errors"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"
"github.com/milvus-io/milvus/internal/types"
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/util/merr"
)
// type pickShardPolicy func(ctx context.Context, mgr shardClientMgr... | milvus/internal/proxy/task_policies.go/0 | {
"file_path": "milvus/internal/proxy/task_policies.go",
"repo_id": "milvus",
"token_count": 736
} | 1,746 |
from langchain_community.utilities.pubmed import PubMedAPIWrapper
__all__ = ["PubMedAPIWrapper"]
| langchain/libs/langchain/langchain/utilities/pubmed.py/0 | {
"file_path": "langchain/libs/langchain/langchain/utilities/pubmed.py",
"repo_id": "langchain",
"token_count": 30
} | 597 |
<jupyter_start><jupyter_text>Managed Index with Zilliz Cloud Pipelines[Zilliz Cloud Pipelines](https://docs.zilliz.com/docs/pipelines) is a scalable API service for retrieval. You can use Zilliz Cloud Pipelines as managed index in `llama-index`. This service can transform documents into vector embeddings and store them... | llama_index/docs/examples/managed/zcpDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/managed/zcpDemo.ipynb",
"repo_id": "llama_index",
"token_count": 2697
} | 1,093 |
"""Test Neo4jVector functionality."""
import os
from typing import List
from langchain_core.documents import Document
from langchain_community.vectorstores.neo4j_vector import (
Neo4jVector,
SearchType,
_get_search_index_query,
)
from langchain_community.vectorstores.utils import DistanceStrategy
from tes... | langchain/libs/community/tests/integration_tests/vectorstores/test_neo4jvector.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_neo4jvector.py",
"repo_id": "langchain",
"token_count": 9324
} | 379 |
<jupyter_start><jupyter_text>Evaluation using [Prometheus](https://huggingface.co/TheBloke/prometheus-13B-v1.0-GPTQ) model Evaluation is a crucial aspect of iterating over your RAG (Retrieval-Augmented Generation) pipeline. This process has relied heavily on GPT-4. However, a new open-source model named [Prometheus](ht... | llama_index/docs/examples/evaluation/prometheus_evaluation.ipynb/0 | {
"file_path": "llama_index/docs/examples/evaluation/prometheus_evaluation.ipynb",
"repo_id": "llama_index",
"token_count": 10354
} | 1,104 |
# Process audio data
This guide shows specific methods for processing audio datasets. Learn how to:
- Resample the sampling rate.
- Use [`~Dataset.map`] with audio datasets.
For a guide on how to process any type of dataset, take a look at the <a class="underline decoration-sky-400 decoration-2 font-semibold" href="... | datasets/docs/source/audio_process.mdx/0 | {
"file_path": "datasets/docs/source/audio_process.mdx",
"repo_id": "datasets",
"token_count": 1186
} | 111 |
from langchain_community.tools.azure_cognitive_services.image_analysis import (
AzureCogsImageAnalysisTool,
)
__all__ = ["AzureCogsImageAnalysisTool"]
| langchain/libs/langchain/langchain/tools/azure_cognitive_services/image_analysis.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/azure_cognitive_services/image_analysis.py",
"repo_id": "langchain",
"token_count": 50
} | 582 |
<!--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/custom_models.md/0 | {
"file_path": "transformers/docs/source/ja/custom_models.md",
"repo_id": "transformers",
"token_count": 7501
} | 489 |
"""DuckDuckGo Search API toolkit."""
from langchain_community.tools.ddg_search.tool import DuckDuckGoSearchRun
__all__ = ["DuckDuckGoSearchRun"]
| langchain/libs/langchain/langchain/tools/ddg_search/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/ddg_search/__init__.py",
"repo_id": "langchain",
"token_count": 51
} | 584 |
import contextlib
import os
import sqlite3
import pytest
from datasets import Dataset, Features, Value
from datasets.io.sql import SqlDatasetReader, SqlDatasetWriter
from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases, require_sqlalchemy
def _check_sql_dataset(dataset, expected_f... | datasets/tests/io/test_sql.py/0 | {
"file_path": "datasets/tests/io/test_sql.py",
"repo_id": "datasets",
"token_count": 1628
} | 157 |
<jupyter_start><jupyter_text>SQLite-VSS>[SQLite-VSS](https://alexgarcia.xyz/sqlite-vss/) is an `SQLite` extension designed for vector search, emphasizing local-first operations and easy integration into applications without external servers. Leveraging the `Faiss` library, it offers efficient similarity search and clus... | langchain/docs/docs/integrations/vectorstores/sqlitevss.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/sqlitevss.ipynb",
"repo_id": "langchain",
"token_count": 939
} | 198 |
import { Document } from "@langchain/core/documents";
import { getEnvironmentVariable } from "@langchain/core/utils/env";
import { BaseDocumentLoader } from "../base.js";
/**
* Interface representing the parameters for the SerpAPI loader. It
* includes properties such as the search query and the API key.
*/
interfa... | langchainjs/langchain/src/document_loaders/web/serpapi.ts/0 | {
"file_path": "langchainjs/langchain/src/document_loaders/web/serpapi.ts",
"repo_id": "langchainjs",
"token_count": 1381
} | 914 |
# LlamaIndex Embeddings Integration: Adapter
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-adapter/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-adapter/README.md",
"repo_id": "llama_index",
"token_count": 11
} | 1,350 |
python_sources()
| llama_index/llama-index-core/llama_index/core/langchain_helpers/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/langchain_helpers/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,135 |
"""Test Aleph Alpha specific stuff."""
import pytest
from langchain_core.pydantic_v1 import SecretStr
from pytest import CaptureFixture, MonkeyPatch
from langchain_community.llms.aleph_alpha import AlephAlpha
@pytest.mark.requires("aleph_alpha_client")
def test_api_key_is_secret_string() -> None:
llm = AlephAlp... | langchain/libs/community/tests/unit_tests/llms/test_aleph_alpha.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/llms/test_aleph_alpha.py",
"repo_id": "langchain",
"token_count": 430
} | 386 |
from typing import Any, Dict, Optional
from llama_index.core.base.llms.types import LLMMetadata
from llama_index.core.bridge.pydantic import Field
from llama_index.core.constants import (
DEFAULT_CONTEXT_WINDOW,
DEFAULT_NUM_OUTPUTS,
DEFAULT_TEMPERATURE,
)
from llama_index.core.llms.generic_utils import get... | llama_index/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py",
"repo_id": "llama_index",
"token_count": 908
} | 1,325 |
[tool.poetry]
name = "rag-gpt-crawler"
version = "0.1.0"
description = "Use gpt-crawler to build a chat app for any website"
authors = [
"Lance Martin <lance@langchain.dev>",
]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
openai = "<2"
tiktoken = ">=0.5.1"
chromadb = "... | langchain/templates/rag-gpt-crawler/pyproject.toml/0 | {
"file_path": "langchain/templates/rag-gpt-crawler/pyproject.toml",
"repo_id": "langchain",
"token_count": 302
} | 733 |
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | milvus/internal/mq/mqimpl/rocksmq/client/error.go/0 | {
"file_path": "milvus/internal/mq/mqimpl/rocksmq/client/error.go",
"repo_id": "milvus",
"token_count": 431
} | 1,832 |
from .cosine_lr import CosineLRScheduler
from .multistep_lr import MultiStepLRScheduler
from .plateau_lr import PlateauLRScheduler
from .poly_lr import PolyLRScheduler
from .step_lr import StepLRScheduler
from .tanh_lr import TanhLRScheduler
from .scheduler_factory import create_scheduler, create_scheduler_v2, schedul... | pytorch-image-models/timm/scheduler/__init__.py/0 | {
"file_path": "pytorch-image-models/timm/scheduler/__init__.py",
"repo_id": "pytorch-image-models",
"token_count": 112
} | 373 |
"""Tool for Steam Web API"""
from typing import Optional
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.tools import BaseTool
from langchain_community.utilities.steam import SteamWebAPIWrapper
class SteamWebAPIQueryRun(BaseTool):
"""Tool that searches the Steam Web API."""
... | langchain/libs/community/langchain_community/tools/steam/tool.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/steam/tool.py",
"repo_id": "langchain",
"token_count": 296
} | 295 |
from importlib import metadata
from langchain_core._api import (
surface_langchain_beta_warnings,
surface_langchain_deprecation_warnings,
)
try:
__version__ = metadata.version(__package__)
except metadata.PackageNotFoundError:
# Case where package metadata is not available.
__version__ = ""
surfa... | langchain/libs/core/langchain_core/__init__.py/0 | {
"file_path": "langchain/libs/core/langchain_core/__init__.py",
"repo_id": "langchain",
"token_count": 125
} | 428 |
[tool.poetry]
name = "langchain-community"
version = "0.0.20"
description = "Community contributed LangChain integrations."
authors = []
license = "MIT"
readme = "README.md"
repository = "https://github.com/langchain-ai/langchain"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain-core = ">=0.1.21,<0.2"
SQLA... | langchain/libs/community/pyproject.toml/0 | {
"file_path": "langchain/libs/community/pyproject.toml",
"repo_id": "langchain",
"token_count": 4129
} | 322 |
import builtins
import json
from typing import Optional, Type
from langchain_core.callbacks import AsyncCallbackManagerForToolRun
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_community.tools.ainetwork.base import AINBaseTool, OperationType
class RuleSchema(BaseModel):
"""Schema for own... | langchain/libs/community/langchain_community/tools/ainetwork/rule.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/ainetwork/rule.py",
"repo_id": "langchain",
"token_count": 1038
} | 280 |
# LlamaIndex Embeddings Integration: Llm Rails
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-llm-rails/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-llm-rails/README.md",
"repo_id": "llama_index",
"token_count": 13
} | 1,192 |
# Multi Subject Dreambooth for Inpainting Models
Please note that this project is not actively maintained. However, you can open an issue and tag @gzguevara.
[DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few(3~5) images of a subject. Thi... | diffusers/examples/research_projects/multi_subject_dreambooth_inpainting/README.md/0 | {
"file_path": "diffusers/examples/research_projects/multi_subject_dreambooth_inpainting/README.md",
"repo_id": "diffusers",
"token_count": 1665
} | 210 |
from langchain_community.llms.forefrontai import ForefrontAI
__all__ = ["ForefrontAI"]
| langchain/libs/langchain/langchain/llms/forefrontai.py/0 | {
"file_path": "langchain/libs/langchain/langchain/llms/forefrontai.py",
"repo_id": "langchain",
"token_count": 28
} | 537 |
# 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/examples/consistency_distillation/test_lcm_lora.py/0 | {
"file_path": "diffusers/examples/consistency_distillation/test_lcm_lora.py",
"repo_id": "diffusers",
"token_count": 2105
} | 192 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/llms/llama-index-llms-replicate/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-replicate/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,329 |
{
"dataPrompt": {
"preamble": "Given a product description, you should return a name for that product that includes something about rainbows.",
"columns": [
{
"columnId": "CFA438B7-313B-4A50-AF74-3ACBC9216A4B",
"displayName": "description:",
"isInput": true
},
{
... | langchainjs/langchain/src/experimental/hubs/makersuite/tests/googlemakersuite-files/dataPrompt.json/0 | {
"file_path": "langchainjs/langchain/src/experimental/hubs/makersuite/tests/googlemakersuite-files/dataPrompt.json",
"repo_id": "langchainjs",
"token_count": 1757
} | 922 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/readers/llama-index-readers-dad-jokes/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-dad-jokes/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,336 |
package msgstream
import (
"context"
"fmt"
"math/rand"
"os"
"sync"
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/mq/msgstream/mqwrapper"
"github.com/milvus-io/milvus/pkg/mq/msgstream/mqwrapper/nmq"
"github.com/milvus-io/milvus/pkg/util/funcutil"
"github.com/milvus-io/milv... | milvus/pkg/mq/msgstream/stream_bench_test.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/stream_bench_test.go",
"repo_id": "milvus",
"token_count": 998
} | 1,925 |
<jupyter_start><jupyter_text>Slack>[Slack](https://slack.com/) is an instant messaging program.This notebook covers how to load documents from a Zipfile generated from a `Slack` export.In order to get this `Slack` export, follow these instructions: 🧑 Instructions for ingesting your own datasetExport your Slack data. Y... | langchain/docs/docs/integrations/document_loaders/slack.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/slack.ipynb",
"repo_id": "langchain",
"token_count": 331
} | 106 |
<jupyter_start><jupyter_text>Azure OpenAI If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-azure-openai
!pip install llama-index<jupyter_output><empty_output><jupyter_text>Prerequisites 1. Setup an Azure subscription - you can create o... | llama_index/docs/examples/llm/azure_openai.ipynb/0 | {
"file_path": "llama_index/docs/examples/llm/azure_openai.ipynb",
"repo_id": "llama_index",
"token_count": 1572
} | 1,192 |
import type { CloseVectorSaveableVectorStore } from "closevector-common";
import type { EmbeddingsInterface } from "@langchain/core/embeddings";
import { Document } from "@langchain/core/documents";
import { SaveableVectorStore } from "@langchain/core/vectorstores";
type CloseVectorCredentials = {
key?: string;
s... | langchainjs/libs/langchain-community/src/vectorstores/closevector/common.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/vectorstores/closevector/common.ts",
"repo_id": "langchainjs",
"token_count": 1797
} | 1,081 |
<jupyter_start><jupyter_text>Azure CosmosDB MongoDB Vector StoreIn this notebook we are going to show how to use Azure Cosmosdb Mongodb vCore to perform vector searches in LlamaIndex. We will create the embedding using Azure Open AI. If you're opening this Notebook on colab, you will probably need to install LlamaInde... | llama_index/docs/examples/vector_stores/AzureCosmosDBMongoDBvCoreDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/AzureCosmosDBMongoDBvCoreDemo.ipynb",
"repo_id": "llama_index",
"token_count": 1294
} | 1,109 |
---
sidebar_label: Fireworks
---
import CodeBlock from "@theme/CodeBlock";
# Fireworks
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>
```bash npm2yarn
npm install @langchain/community
```
You can use models provided ... | langchainjs/docs/core_docs/docs/integrations/llms/fireworks.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/llms/fireworks.mdx",
"repo_id": "langchainjs",
"token_count": 219
} | 708 |
from __future__ import annotations
import time
from itertools import repeat
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type
from langchain_core.documents import Document
from langchain_core.embeddings import Embeddings
from langchain_core.vectorstores import VectorStore
class XataVectorStore(Vec... | langchain/libs/community/langchain_community/vectorstores/xata.py/0 | {
"file_path": "langchain/libs/community/langchain_community/vectorstores/xata.py",
"repo_id": "langchain",
"token_count": 4243
} | 343 |
<jupyter_start><jupyter_text>TF-IDF>[TF-IDF](https://scikit-learn.org/stable/modules/feature_extraction.htmltfidf-term-weighting) means term-frequency times inverse document-frequency.This notebook goes over how to use a retriever that under the hood uses [TF-IDF](https://en.wikipedia.org/wiki/Tf%E2%80%93idf) using `sc... | langchain/docs/docs/integrations/retrievers/tf_idf.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/retrievers/tf_idf.ipynb",
"repo_id": "langchain",
"token_count": 612
} | 169 |
from typing import Any, Callable, Dict, Optional, Sequence
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatResponseGen,
CompletionResponse,
CompletionResponseAsyncGen,
CompletionResponseGen,
LLMMetadata,
MessageRole,
)
from llama_i... | llama_index/llama-index-integrations/llms/llama-index-llms-vertex/llama_index/llms/vertex/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-vertex/llama_index/llms/vertex/base.py",
"repo_id": "llama_index",
"token_count": 5655
} | 1,423 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2022 {{cookiecutter.authors}} and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | transformers/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py/0 | {
"file_path": "transformers/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py",
"repo_id": "transformers",
"token_count": 15166
} | 693 |
"""Test CerebriumAI API wrapper."""
from langchain_community.llms.cerebriumai import CerebriumAI
def test_cerebriumai_call() -> None:
"""Test valid call to cerebriumai."""
llm = CerebriumAI(max_length=10)
output = llm("Say foo:")
assert isinstance(output, str)
| langchain/libs/community/tests/integration_tests/llms/test_cerebriumai.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/llms/test_cerebriumai.py",
"repo_id": "langchain",
"token_count": 104
} | 339 |
from llama_index.legacy.extractors.interface import BaseExtractor
from llama_index.legacy.extractors.marvin_metadata_extractor import (
MarvinMetadataExtractor,
)
from llama_index.legacy.extractors.metadata_extractors import (
EntityExtractor,
KeywordExtractor,
PydanticProgramExtractor,
QuestionsAns... | llama_index/llama-index-legacy/llama_index/legacy/extractors/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/extractors/__init__.py",
"repo_id": "llama_index",
"token_count": 223
} | 1,563 |
"""Wrapper around EdenAI's Generation API."""
import logging
from typing import Any, Dict, List, Literal, Optional
from aiohttp import ClientSession
from langchain_core.callbacks import (
AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun,
)
from langchain_core.language_models.llms import LLM
from langcha... | langchain/libs/community/langchain_community/llms/edenai.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/edenai.py",
"repo_id": "langchain",
"token_count": 4100
} | 280 |
"""MongoDB Vector store index.
An index that is built on top of an existing vector store.
"""
import logging
import os
from importlib.metadata import version
from typing import Any, Dict, List, Optional, cast
from llama_index.core.bridge.pydantic import PrivateAttr
from llama_index.core.schema import BaseNode, Meta... | llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-mongodb/llama_index/vector_stores/mongodb/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-mongodb/llama_index/vector_stores/mongodb/base.py",
"repo_id": "llama_index",
"token_count": 3586
} | 1,610 |
<jupyter_start><jupyter_text>BabyAGI User GuideThis notebook demonstrates how to implement [BabyAGI](https://github.com/yoheinakajima/babyagi/tree/main) by [Yohei Nakajima](https://twitter.com/yoheinakajima). BabyAGI is an AI agent that can generate and pretend to execute tasks based on a given objective.This guide wil... | langchain/cookbook/baby_agi.ipynb/0 | {
"file_path": "langchain/cookbook/baby_agi.ipynb",
"repo_id": "langchain",
"token_count": 853
} | 76 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/clvp/test_modeling_clvp.py/0 | {
"file_path": "transformers/tests/models/clvp/test_modeling_clvp.py",
"repo_id": "transformers",
"token_count": 11682
} | 790 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.discord import DiscordReader
def test_class():
names_of_base_classes = [b.__name__ for b in DiscordReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-discord/tests/test_readers_discord_reader.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-discord/tests/test_readers_discord_reader.py",
"repo_id": "llama_index",
"token_count": 86
} | 1,352 |
package planparserv2
import "testing"
func Test_floatingEqual(t *testing.T) {
type args struct {
a float64
b float64
}
tests := []struct {
name string
args args
want bool
}{
{
args: args{
a: 1.0,
b: 1.0,
},
want: true,
},
{
args: args{
a: 1.0,
b: 2.0,
},
want: fal... | milvus/internal/parser/planparserv2/floating_comparision_test.go/0 | {
"file_path": "milvus/internal/parser/planparserv2/floating_comparision_test.go",
"repo_id": "milvus",
"token_count": 337
} | 1,952 |
# coding=utf-8
# Copyright 2022 Google SwitchTransformers Authors and HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | transformers/tests/models/switch_transformers/test_modeling_switch_transformers.py/0 | {
"file_path": "transformers/tests/models/switch_transformers/test_modeling_switch_transformers.py",
"repo_id": "transformers",
"token_count": 21272
} | 753 |
package model
type SegmentMetadataValueType interface {
IsSegmentMetadataValueType()
}
type SegmentMetadataValueStringType struct {
Value string
}
func (s *SegmentMetadataValueStringType) IsSegmentMetadataValueType() {}
type SegmentMetadataValueInt64Type struct {
Value int64
}
func (s *SegmentMetadataValueInt64... | chroma/go/coordinator/internal/model/segment_metadata.go/0 | {
"file_path": "chroma/go/coordinator/internal/model/segment_metadata.go",
"repo_id": "chroma",
"token_count": 439
} | 53 |
import { OpenAI, OpenAIEmbeddings } from "@langchain/openai";
import { HNSWLib } from "@langchain/community/vectorstores/hnswlib";
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";
import * as fs from "fs";
import {
VectorStoreToolkit,
createVectorStoreAgent,
VectorStoreInfo,
} from "langc... | langchainjs/examples/src/agents/vectorstore.ts/0 | {
"file_path": "langchainjs/examples/src/agents/vectorstore.ts",
"repo_id": "langchainjs",
"token_count": 418
} | 757 |
import datetime
import torch
import os
from loguru import logger
from pathlib import Path
from safetensors.torch import save_file, load_file, _find_shared_tensors, _is_complete
from typing import List, Dict
from collections import defaultdict
def _remove_duplicate_names(
state_dict: Dict[str, torch.Tensor],
... | text-generation-inference/server/text_generation_server/utils/convert.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/utils/convert.py",
"repo_id": "text-generation-inference",
"token_count": 1769
} | 401 |
# Vearch
[Vearch](https://github.com/vearch/vearch) is a scalable distributed system for efficient similarity search of deep learning vectors.
# Installation and Setup
Vearch Python SDK enables vearch to use locally. Vearch python sdk can be installed easily by pip install vearch.
# Vectorstore
Vearch also can use... | langchain/docs/docs/integrations/providers/vearch.md/0 | {
"file_path": "langchain/docs/docs/integrations/providers/vearch.md",
"repo_id": "langchain",
"token_count": 126
} | 162 |
import logging
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional, Type
import numpy as np
from llama_index.core.bridge.pydantic import Field
from llama_index.core.schema import BaseNode, MetadataMode, TextNode
from llama_index.core.vector_stores.types import (
VectorStore,
Vector... | llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-docarray/llama_index/vector_stores/docarray/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-docarray/llama_index/vector_stores/docarray/base.py",
"repo_id": "llama_index",
"token_count": 3043
} | 1,602 |
import { z } from "zod";
import { createMetadataTaggerFromZod } from "langchain/document_transformers/openai_functions";
import { ChatOpenAI } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
import { PromptTemplate } from "@langchain/core/prompts";
const taggingChainTemplate = `Extract ... | langchainjs/examples/src/document_transformers/metadata_tagger_custom_prompt.ts/0 | {
"file_path": "langchainjs/examples/src/document_transformers/metadata_tagger_custom_prompt.ts",
"repo_id": "langchainjs",
"token_count": 731
} | 812 |
## Appendix B. API Reference
In this section, we introduce the RPCs of milvus service. A brief description of the RPCs is listed as follows.
| RPC | description |
| :---------------------- | -------------------------... | milvus/docs/developer_guides/appendix_b_api_reference.md/0 | {
"file_path": "milvus/docs/developer_guides/appendix_b_api_reference.md",
"repo_id": "milvus",
"token_count": 8993
} | 1,737 |
from llama_index.finetuning.gradient.base import GradientFinetuneEngine
__all__ = ["GradientFinetuneEngine"]
| llama_index/llama-index-finetuning/llama_index/finetuning/gradient/__init__.py/0 | {
"file_path": "llama_index/llama-index-finetuning/llama_index/finetuning/gradient/__init__.py",
"repo_id": "llama_index",
"token_count": 35
} | 1,335 |
# Dev container
This project includes a [dev container](https://containers.dev/), which lets you use a container as a full-featured dev environment.
You can use the dev container configuration in this folder to build and run the app without needing to install any of its tools locally! You can use it in [GitHub Codesp... | langchain/.devcontainer/README.md/0 | {
"file_path": "langchain/.devcontainer/README.md",
"repo_id": "langchain",
"token_count": 1020
} | 73 |
import torch
from text_generation_server.utils.tokens import (
StopSequenceCriteria,
StoppingCriteria,
FinishReason,
batch_top_tokens,
)
def test_stop_sequence_criteria():
criteria = StopSequenceCriteria("/test;")
assert not criteria("/")
assert not criteria("/test")
assert criteria("... | text-generation-inference/server/tests/utils/test_tokens.py/0 | {
"file_path": "text-generation-inference/server/tests/utils/test_tokens.py",
"repo_id": "text-generation-inference",
"token_count": 1427
} | 412 |
from llama_index.readers.airbyte_typeform.base import AirbyteTypeformReader
__all__ = ["AirbyteTypeformReader"]
| llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-typeform/llama_index/readers/airbyte_typeform/__init__.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-typeform/llama_index/readers/airbyte_typeform/__init__.py",
"repo_id": "llama_index",
"token_count": 36
} | 1,335 |
"""Obsidian reader class.
Pass in the path to an Obsidian vault and it will parse all markdown
files into a List of Documents,
with each Document containing text from under an Obsidian header.
"""
import os
from pathlib import Path
from typing import Any, List
from llama_index.legacy.readers.base import BaseReader
... | llama_index/llama-index-legacy/llama_index/legacy/readers/obsidian.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/obsidian.py",
"repo_id": "llama_index",
"token_count": 505
} | 1,595 |
// Copyright 2019 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... | milvus/pkg/log/global.go/0 | {
"file_path": "milvus/pkg/log/global.go",
"repo_id": "milvus",
"token_count": 2024
} | 1,884 |
import glob
import importlib
from pathlib import Path
def test_importable_all() -> None:
for path in glob.glob("../core/langchain_core/*"):
relative_path = Path(path).parts[-1]
if relative_path.endswith(".typed"):
continue
module_name = relative_path.split(".")[0]
modul... | langchain/libs/core/tests/unit_tests/test_imports.py/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/test_imports.py",
"repo_id": "langchain",
"token_count": 213
} | 420 |
from typing import Any, Dict, List, Optional, Union
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import BaseLLM
from langchain_core.outputs import Generation, LLMResult
from langchain_core.pydantic_v1 import Field, root_validator
class CTranslate2(BaseLLM):
... | langchain/libs/community/langchain_community/llms/ctranslate2.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/ctranslate2.py",
"repo_id": "langchain",
"token_count": 1672
} | 267 |
"""Serialization and deserialization."""
from langchain_core.load.dump import dumpd, dumps
from langchain_core.load.load import load, loads
__all__ = [
"dumpd",
"dumps",
"load",
"loads",
]
| langchain/libs/langchain/langchain/load/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/load/__init__.py",
"repo_id": "langchain",
"token_count": 78
} | 544 |
<jupyter_start><jupyter_text>Knowledge Graph Query EngineCreating a Knowledge Graph usually involves specialized and complex tasks. However, by utilizing the Llama Index (LLM), the KnowledgeGraphIndex, and the GraphStore, we can facilitate the creation of a relatively effective Knowledge Graph from any data source supp... | llama_index/docs/examples/query_engine/knowledge_graph_query_engine.ipynb/0 | {
"file_path": "llama_index/docs/examples/query_engine/knowledge_graph_query_engine.ipynb",
"repo_id": "llama_index",
"token_count": 3061
} | 1,103 |
# 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/tokenization_marian.py/0 | {
"file_path": "transformers/src/transformers/models/marian/tokenization_marian.py",
"repo_id": "transformers",
"token_count": 7701
} | 628 |
import { QdrantVectorStore } from "@langchain/community/vectorstores/qdrant";
import { OpenAIEmbeddings } from "@langchain/openai";
// text sample from Godel, Escher, Bach
const vectorStore = await QdrantVectorStore.fromTexts(
[
`Tortoise: Labyrinth? Labyrinth? Could it Are we in the notorious Little
Harmonic Lab... | langchainjs/examples/src/indexes/vector_stores/qdrant/fromTexts.ts/0 | {
"file_path": "langchainjs/examples/src/indexes/vector_stores/qdrant/fromTexts.ts",
"repo_id": "langchainjs",
"token_count": 462
} | 789 |
[
{
"details": {
"best_of_sequences": null,
"finish_reason": "length",
"generated_tokens": 10,
"prefill": [
{
"id": 1276,
"logprob": null,
"text": "What"
},
{
"id": 310,
"logprob": -0.83984375,
"text": " is... | text-generation-inference/integration-tests/models/__snapshots__/test_mamba/test_mamba_load.json/0 | {
"file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_mamba/test_mamba_load.json",
"repo_id": "text-generation-inference",
"token_count": 5458
} | 409 |
import getopt
import json
import os
# import numpy as np
import sys
from collections import OrderedDict
import datasets
import numpy as np
import torch
from modeling_frcnn import GeneralizedRCNN
from processing_image import Preprocess
from utils import Config
"""
USAGE:
``python extracting_data.py -i <img_dir> -o ... | transformers/examples/research_projects/lxmert/extracting_data.py/0 | {
"file_path": "transformers/examples/research_projects/lxmert/extracting_data.py",
"repo_id": "transformers",
"token_count": 2528
} | 580 |
"""Main module for DocstringWalker loader for Llama Hub."""
import ast
import logging
import os
from typing import List
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
TYPES_TO_PROCESS = {ast.FunctionDef, ast.ClassDef}
log = logging.getLogger(__name__)
class Docst... | llama_index/llama-index-integrations/readers/llama-index-readers-docstring-walker/llama_index/readers/docstring_walker/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-docstring-walker/llama_index/readers/docstring_walker/base.py",
"repo_id": "llama_index",
"token_count": 3321
} | 1,340 |
import { BaseLLM } from "@langchain/core/language_models/llms";
import {
Generation,
GenerationChunk,
LLMResult,
} from "@langchain/core/outputs";
import type { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base";
import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";... | langchainjs/libs/langchain-community/src/llms/googlevertexai/common.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/llms/googlevertexai/common.ts",
"repo_id": "langchainjs",
"token_count": 2207
} | 945 |
package typeutil
import (
"sync"
"go.uber.org/atomic"
)
// MapEqual returns true if the two map contain the same keys and values
func MapEqual(left, right map[int64]int64) bool {
if len(left) != len(right) {
return false
}
for k, v := range left {
if v2, ok := right[k]; !ok || v != v2 {
return false
}... | milvus/pkg/util/typeutil/map.go/0 | {
"file_path": "milvus/pkg/util/typeutil/map.go",
"repo_id": "milvus",
"token_count": 1018
} | 1,854 |
from llama_index.legacy.node_parser.relational.hierarchical import (
HierarchicalNodeParser,
)
from llama_index.legacy.node_parser.relational.markdown_element import (
MarkdownElementNodeParser,
)
from llama_index.legacy.node_parser.relational.unstructured_element import (
UnstructuredElementNodeParser,
)
... | llama_index/llama-index-legacy/llama_index/legacy/node_parser/relational/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/node_parser/relational/__init__.py",
"repo_id": "llama_index",
"token_count": 151
} | 1,621 |
<jupyter_start><jupyter_text>Stable Conceptualizer - Stable Diffusion using learned conceptsThe Stable Conceptualizer enables you to use pre-learned concepts on Stable Diffusion via textual-inversion using 🤗 Hugging Face [🧨 Diffusers library](https://github.com/huggingface/diffusers). Navigate the [library of pre-lea... | notebooks/diffusers/stable_conceptualizer_inference.ipynb/0 | {
"file_path": "notebooks/diffusers/stable_conceptualizer_inference.ipynb",
"repo_id": "notebooks",
"token_count": 949
} | 319 |
import { Document, type DocumentInterface } from "@langchain/core/documents";
import {
RemoteRetriever,
RemoteRetrieverValues,
RemoteRetrieverParams,
} from "./remote/base.js";
export interface VespaRetrieverParams extends RemoteRetrieverParams {
/**
* The body of the query to send to Vespa
*/
query_bo... | langchainjs/libs/langchain-community/src/retrievers/vespa.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/retrievers/vespa.ts",
"repo_id": "langchainjs",
"token_count": 884
} | 964 |
package observers
import (
"context"
"sync"
"testing"
"time"
"github.com/stretchr/testify/suite"
"github.com/milvus-io/milvus/pkg/util/paramtable"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)
type taskDispatcherSuite struct {
suite.Suite
}
func (s *taskDispatcherSuite) SetupSuite() {
paramtable.Get()... | milvus/internal/querycoordv2/observers/task_dispatcher_test.go/0 | {
"file_path": "milvus/internal/querycoordv2/observers/task_dispatcher_test.go",
"repo_id": "milvus",
"token_count": 386
} | 1,764 |
"""Read Arxiv Papers."""
import hashlib
import logging
import os
from typing import List, Optional, Tuple
from llama_index.core.readers import SimpleDirectoryReader
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
class ArxivReader(BaseReader):
"""Arxiv Reader.
... | llama_index/llama-index-integrations/readers/llama-index-readers-papers/llama_index/readers/papers/arxiv/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-papers/llama_index/readers/papers/arxiv/base.py",
"repo_id": "llama_index",
"token_count": 2804
} | 1,356 |
# 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/tests/utils/test_versions_utils.py/0 | {
"file_path": "transformers/tests/utils/test_versions_utils.py",
"repo_id": "transformers",
"token_count": 1539
} | 853 |
import { ChatAnthropic } from "@langchain/anthropic";
const model = new ChatAnthropic({
temperature: 0.9,
anthropicApiKey: "YOUR-API-KEY", // In Node.js defaults to process.env.ANTHROPIC_API_KEY
maxTokensToSample: 1024,
});
| langchainjs/examples/src/models/chat/integration_anthropic_legacy.ts/0 | {
"file_path": "langchainjs/examples/src/models/chat/integration_anthropic_legacy.ts",
"repo_id": "langchainjs",
"token_count": 82
} | 829 |
# coding=utf-8
# Copyright 2022 KAIST and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | transformers/src/transformers/models/glpn/configuration_glpn.py/0 | {
"file_path": "transformers/src/transformers/models/glpn/configuration_glpn.py",
"repo_id": "transformers",
"token_count": 2440
} | 676 |
package optimizers
import (
"context"
"testing"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
"github.com/milvus-io/milvus/internal/proto/internalpb"
"github.com/milvus-io/milvus/internal/proto/planpb"
"github.com/milvus-io/milvus/internal/proto/que... | milvus/internal/querynodev2/optimizers/query_hook_test.go/0 | {
"file_path": "milvus/internal/querynodev2/optimizers/query_hook_test.go",
"repo_id": "milvus",
"token_count": 2102
} | 1,850 |
# coding=utf-8
# Copyright 2024 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | diffusers/tests/pipelines/controlnet/test_controlnet.py/0 | {
"file_path": "diffusers/tests/pipelines/controlnet/test_controlnet.py",
"repo_id": "diffusers",
"token_count": 19057
} | 250 |
<!--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/ko/perf_train_cpu_many.md/0 | {
"file_path": "transformers/docs/source/ko/perf_train_cpu_many.md",
"repo_id": "transformers",
"token_count": 4046
} | 496 |
""" Squeeze-and-Excitation Channel Attention
An SE implementation originally based on PyTorch SE-Net impl.
Has since evolved with additional functionality / configuration.
Paper: `Squeeze-and-Excitation Networks` - https://arxiv.org/abs/1709.01507
Also included is Effective Squeeze-Excitation (ESE).
Paper: `CenterMa... | pytorch-image-models/timm/layers/squeeze_excite.py/0 | {
"file_path": "pytorch-image-models/timm/layers/squeeze_excite.py",
"repo_id": "pytorch-image-models",
"token_count": 1859
} | 396 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.