text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
# DataForSEO
>[DataForSeo](https://dataforseo.com/) provides comprehensive SEO and digital marketing data solutions via API.
This page provides instructions on how to use the DataForSEO search APIs within LangChain.
## Installation and Setup
Get a [DataForSEO API Access login and password](https://app.dataforseo.co... | langchain/docs/docs/integrations/providers/dataforseo.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/dataforseo.mdx",
"repo_id": "langchain",
"token_count": 381
} | 144 |
## Appendix D. Error Code
**ErrorCode**
```protobuf
enum ErrorCode {
Success = 0;
UnexpectedError = 1;
ConnectFailed = 2;
PermissionDenied = 3;
CollectionNotExists = 4;
IllegalArgument = 5;
IllegalDimension = 7;
IllegalIndexType = 8;
IllegalCollectionName = 9;
IllegalTOPK = 10;... | milvus/docs/developer_guides/appendix_d_error_code.md/0 | {
"file_path": "milvus/docs/developer_guides/appendix_d_error_code.md",
"repo_id": "milvus",
"token_count": 310
} | 1,716 |
"""Init file."""
| llama_index/llama-index-core/tests/token_predictor/__init__.py/0 | {
"file_path": "llama_index/llama-index-core/tests/token_predictor/__init__.py",
"repo_id": "llama_index",
"token_count": 6
} | 1,201 |
use candle::Tensor;
pub struct Dataset {
pub train_images: Tensor,
pub train_labels: Tensor,
pub test_images: Tensor,
pub test_labels: Tensor,
pub labels: usize,
}
pub mod cifar;
pub mod mnist;
| candle/candle-datasets/src/vision/mod.rs/0 | {
"file_path": "candle/candle-datasets/src/vision/mod.rs",
"repo_id": "candle",
"token_count": 92
} | 34 |
export const examples = [
{ input: "List all artists.", query: "SELECT * FROM Artist;" },
{
input: "Find all albums for the artist 'AC/DC'.",
query:
"SELECT * FROM Album WHERE ArtistId = (SELECT ArtistId FROM Artist WHERE Name = 'AC/DC');",
},
{
input: "List all tracks in the 'Rock' genre.",
... | langchainjs/examples/src/use_cases/sql/agents/examples.ts/0 | {
"file_path": "langchainjs/examples/src/use_cases/sql/agents/examples.ts",
"repo_id": "langchainjs",
"token_count": 501
} | 846 |
//load Candle Bert Module wasm module
import init, { Model } from "./build/m.js";
async function fetchArrayBuffer(url) {
const cacheName = "bert-candle-cache";
const cache = await caches.open(cacheName);
const cachedResponse = await cache.match(url);
if (cachedResponse) {
const data = await cachedResponse.... | candle/candle-wasm-examples/bert/bertWorker.js/0 | {
"file_path": "candle/candle-wasm-examples/bert/bertWorker.js",
"repo_id": "candle",
"token_count": 779
} | 80 |
import unicodedata
from dataclasses import dataclass
from typing import Optional, Union
import numpy as np
from transformers.data.data_collator import DataCollatorMixin
from transformers.file_utils import PaddingStrategy
from transformers.tokenization_utils_base import PreTrainedTokenizerBase
def padding_tensor(seq... | transformers/examples/research_projects/luke/luke_utils.py/0 | {
"file_path": "transformers/examples/research_projects/luke/luke_utils.py",
"repo_id": "transformers",
"token_count": 2049
} | 527 |
use crate::errors::{ChromaError, ErrorCodes};
use crate::types::{MetadataValue, Segment};
use thiserror::Error;
#[derive(Clone, Debug)]
pub(crate) struct IndexConfig {
pub(crate) dimensionality: i32,
pub(crate) distance_function: DistanceFunction,
}
#[derive(Error, Debug)]
pub(crate) enum IndexConfigFromSegme... | chroma/rust/worker/src/index/types.rs/0 | {
"file_path": "chroma/rust/worker/src/index/types.rs",
"repo_id": "chroma",
"token_count": 1670
} | 60 |
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)
var (
// RootCoordProxyCounter counts the num of registered proxy nodes
RootCoordProxyCounter = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: milvusNamespace,
Subsystem: ... | milvus/pkg/metrics/rootcoord_metrics.go/0 | {
"file_path": "milvus/pkg/metrics/rootcoord_metrics.go",
"repo_id": "milvus",
"token_count": 2742
} | 1,953 |
"""Firebase Realtime Database Loader."""
from typing import Dict, List, Optional
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
class FirebaseRealtimeDatabaseReader(BaseReader):
"""Firebase Realtime Database reader.
Retrieves data from Firebase Realtime Da... | llama_index/llama-index-integrations/readers/llama-index-readers-firebase-realtimedb/llama_index/readers/firebase_realtimedb/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-firebase-realtimedb/llama_index/readers/firebase_realtimedb/base.py",
"repo_id": "llama_index",
"token_count": 1227
} | 1,444 |
// 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/distributed/rootcoord/client/client.go/0 | {
"file_path": "milvus/internal/distributed/rootcoord/client/client.go",
"repo_id": "milvus",
"token_count": 10256
} | 1,853 |
import { GoogleVertexAI } from "@langchain/community/llms/googlevertexai";
/*
* Before running this, you should make sure you have created a
* Google Cloud Project that is permitted to the Vertex AI API.
*
* You will also need permission to access this project / API.
* Typically, this is done in one of three ways... | langchainjs/examples/src/llms/googlevertexai-code-bison.ts/0 | {
"file_path": "langchainjs/examples/src/llms/googlevertexai-code-bison.ts",
"repo_id": "langchainjs",
"token_count": 225
} | 812 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-twitter/llama_index/readers/twitter/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-twitter/llama_index/readers/twitter/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,428 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/core/src/storage/ThreadPool.h/0 | {
"file_path": "milvus/internal/core/src/storage/ThreadPool.h",
"repo_id": "milvus",
"token_count": 1949
} | 1,759 |
/*!
**************************************************************************************************
* Deformable DETR
* Copyright (c) 2020 SenseTime. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 [see LICENSE for details]
***********************************************************************... | transformers/src/transformers/kernels/deformable_detr/ms_deform_attn.h/0 | {
"file_path": "transformers/src/transformers/kernels/deformable_detr/ms_deform_attn.h",
"repo_id": "transformers",
"token_count": 667
} | 557 |
import pytest
from langchain_community.chat_models.zhipuai import ChatZhipuAI
@pytest.mark.requires("zhipuai")
def test_integration_initialization() -> None:
chat = ChatZhipuAI(model="chatglm_turbo", streaming=False)
assert chat.model == "chatglm_turbo"
assert chat.streaming is False
| langchain/libs/community/tests/unit_tests/chat_models/test_zhipuai.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/chat_models/test_zhipuai.py",
"repo_id": "langchain",
"token_count": 107
} | 369 |
import importlib
import os
import time
import uuid
from typing import TYPE_CHECKING, List
import numpy as np
import pytest
from langchain_core.documents import Document
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores.pinecone import Pinecone
if TYPE_CHECKING:
imp... | langchain/libs/community/tests/integration_tests/vectorstores/test_pinecone.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_pinecone.py",
"repo_id": "langchain",
"token_count": 4832
} | 357 |
package lock
import (
"sync"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/util/paramtable"
)
func TestMetricsLockLock(t *testing.T) {
params := paramtable.Get()
lManager := &MetricsLockManager{
rwLocks: make(map[string]*MetricsRWMutex, 0),
}
params.Init(paramtabl... | milvus/pkg/util/lock/metrics_mutex_test.go/0 | {
"file_path": "milvus/pkg/util/lock/metrics_mutex_test.go",
"repo_id": "milvus",
"token_count": 792
} | 1,844 |
# Guidelines for Test Framework
This document guides you through the Pytest-based PyMilvus test framework.
> You can find the test code on [GitHub](https://github.com/milvus-io/milvus/tree/master/tests/python_client).
## Quick Start
### Deploy Milvus
To accommodate the variety of requirements, Milvus offers as m... | milvus/tests/python_client/README.md/0 | {
"file_path": "milvus/tests/python_client/README.md",
"repo_id": "milvus",
"token_count": 3493
} | 2,102 |
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University 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://ww... | transformers/src/transformers/models/xlnet/tokenization_xlnet.py/0 | {
"file_path": "transformers/src/transformers/models/xlnet/tokenization_xlnet.py",
"repo_id": "transformers",
"token_count": 7058
} | 681 |
/* eslint-disable no-process-env */
import { Index } from "@upstash/vector";
import { Document } from "@langchain/core/documents";
import { SyntheticEmbeddings } from "@langchain/core/utils/testing";
import { EmbeddingsInterface } from "@langchain/core/embeddings";
import { UpstashVectorStore } from "../upstash.js";
im... | langchainjs/libs/langchain-community/src/vectorstores/tests/upstash.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/upstash.int.test.ts",
"repo_id": "langchainjs",
"token_count": 955
} | 1,001 |
<script lang="ts">
import { page } from "$app/stores";
import { PUBLIC_APP_ASSETS, PUBLIC_APP_NAME, PUBLIC_ORIGIN } from "$env/static/public";
import { base } from "$app/paths";
export let classNames = "";
</script>
{#if PUBLIC_APP_ASSETS === "chatui"}
<svg
height="30"
width="30"
viewBox="0 0 30 30"
xmln... | chat-ui/src/lib/components/icons/Logo.svelte/0 | {
"file_path": "chat-ui/src/lib/components/icons/Logo.svelte",
"repo_id": "chat-ui",
"token_count": 550
} | 104 |
# coding=utf-8
# Copyright 2022 The OFA-Sys 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/... | transformers/src/transformers/models/chinese_clip/configuration_chinese_clip.py/0 | {
"file_path": "transformers/src/transformers/models/chinese_clip/configuration_chinese_clip.py",
"repo_id": "transformers",
"token_count": 8885
} | 590 |
"""Init params."""
| llama_index/llama-index-core/llama_index/core/query_engine/flare/__init__.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/query_engine/flare/__init__.py",
"repo_id": "llama_index",
"token_count": 6
} | 1,287 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/indices/managed/vectara/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/managed/vectara/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,664 |
import os
from pathlib import Path
from typing import Optional, Union
HERE = Path(__file__).parent
# Get directory of langchain package
PACKAGE_DIR = HERE.parent
SEPARATOR = os.sep
def get_relative_path(
file: Union[Path, str], *, relative_to: Path = PACKAGE_DIR
) -> str:
"""Get the path of the file as a re... | langchain/libs/core/langchain_core/_api/path.py/0 | {
"file_path": "langchain/libs/core/langchain_core/_api/path.py",
"repo_id": "langchain",
"token_count": 368
} | 397 |
from llama_index.core.indices.managed.base import BaseManagedIndex
from llama_index.indices.managed.vectara import VectaraIndex
def test_class():
names_of_base_classes = [b.__name__ for b in VectaraIndex.__mro__]
assert BaseManagedIndex.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/indices/llama-index-indices-managed-vectara/tests/test_indices_managed_vectara.py/0 | {
"file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-vectara/tests/test_indices_managed_vectara.py",
"repo_id": "llama_index",
"token_count": 99
} | 1,385 |
# 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/llava/test_modeling_llava.py/0 | {
"file_path": "transformers/tests/models/llava/test_modeling_llava.py",
"repo_id": "transformers",
"token_count": 7138
} | 734 |
from abc import abstractmethod
from collections import deque
from typing import Any, Deque, Dict, List, Optional, Union, cast
from llama_index.legacy.agent.types import (
BaseAgent,
BaseAgentWorker,
Task,
TaskStep,
TaskStepOutput,
)
from llama_index.legacy.bridge.pydantic import BaseModel, Field
fr... | llama_index/llama-index-legacy/llama_index/legacy/agent/runner/base.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/agent/runner/base.py",
"repo_id": "llama_index",
"token_count": 9414
} | 1,690 |
from operator import itemgetter
from typing import Any, Callable, List, Mapping, Optional, Union
from langchain_core.messages import BaseMessage
from langchain_core.runnables import RouterRunnable, Runnable
from langchain_core.runnables.base import RunnableBindingBase
from typing_extensions import TypedDict
from lang... | langchain/libs/langchain/langchain/runnables/openai_functions.py/0 | {
"file_path": "langchain/libs/langchain/langchain/runnables/openai_functions.py",
"repo_id": "langchain",
"token_count": 602
} | 563 |
/* eslint-disable no-process-env */
// eslint-disable-next-line import/no-extraneous-dependencies
import { BaseClient } from "@xata.io/client";
import { AIMessage, HumanMessage } from "@langchain/core/messages";
import { XataChatMessageHistory } from "../message/xata.js";
describe("XataChatMessageHistory", () => {
c... | langchainjs/libs/langchain-community/src/stores/tests/xata.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/stores/tests/xata.int.test.ts",
"repo_id": "langchainjs",
"token_count": 990
} | 983 |
"""Test NVIDIA AI Foundation Model Embeddings.
Note: These tests are designed to validate the functionality of NVIDIAEmbeddings.
"""
from langchain_nvidia_ai_endpoints import NVIDIAEmbeddings
def test_nvai_play_embedding_documents() -> None:
"""Test NVIDIA embeddings for documents."""
documents = ["foo bar"]... | langchain/libs/partners/nvidia-ai-endpoints/tests/integration_tests/test_embeddings.py/0 | {
"file_path": "langchain/libs/partners/nvidia-ai-endpoints/tests/integration_tests/test_embeddings.py",
"repo_id": "langchain",
"token_count": 597
} | 635 |
"""LlamaIndex objects."""
from llama_index.legacy.objects.base import ObjectIndex, ObjectRetriever
from llama_index.legacy.objects.base_node_mapping import SimpleObjectNodeMapping
from llama_index.legacy.objects.table_node_mapping import (
SQLTableNodeMapping,
SQLTableSchema,
)
from llama_index.legacy.objects.... | llama_index/llama-index-legacy/llama_index/legacy/objects/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/objects/__init__.py",
"repo_id": "llama_index",
"token_count": 221
} | 1,690 |
[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 = ["OptimumEmbedding"]
contains_example = false
import_path = "llama_index.embeddings.hugging... | llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface-optimum/pyproject.toml",
"repo_id": "llama_index",
"token_count": 706
} | 1,197 |
# Welcome to the 🤗 Deep Reinforcement Learning Course [[introduction]]
<img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit0/thumbnail.jpg" alt="Deep RL Course thumbnail" width="100%"/>
Welcome to the most fascinating topic in Artificial Intelligence: **Deep Reinfor... | deep-rl-class/units/en/unit0/introduction.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit0/introduction.mdx",
"repo_id": "deep-rl-class",
"token_count": 2554
} | 174 |
<jupyter_start><jupyter_text>Pathway Reader > [Pathway](https://pathway.com/) is an open data processing framework. It allows you to easily develop data transformation pipelines and Machine Learning applications that work with live data sources and changing data.This notebook demonstrates how to set up a live data inde... | llama_index/docs/examples/data_connectors/PathwayReaderDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/data_connectors/PathwayReaderDemo.ipynb",
"repo_id": "llama_index",
"token_count": 1690
} | 1,129 |
# coding=utf-8
# Copyright 2020 Google Research and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | transformers/src/transformers/models/tapas/tokenization_tapas.py/0 | {
"file_path": "transformers/src/transformers/models/tapas/tokenization_tapas.py",
"repo_id": "transformers",
"token_count": 53968
} | 687 |
from langchain_community.document_loaders.airtable import AirtableLoader
__all__ = ["AirtableLoader"]
| langchain/libs/langchain/langchain/document_loaders/airtable.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/airtable.py",
"repo_id": "langchain",
"token_count": 31
} | 521 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/core/src/storage/PayloadReader.cpp/0 | {
"file_path": "milvus/internal/core/src/storage/PayloadReader.cpp",
"repo_id": "milvus",
"token_count": 1163
} | 1,666 |
python_sources()
| llama_index/llama-index-core/llama_index/core/response_synthesizers/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/response_synthesizers/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,147 |
# Airbyte
>[Airbyte](https://github.com/airbytehq/airbyte) is a data integration platform for ELT pipelines from APIs,
> databases & files to warehouses & lakes. It has the largest catalog of ELT connectors to data warehouses and databases.
## Installation and Setup
This instruction shows how to load any source fro... | langchain/docs/docs/integrations/providers/airbyte.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/airbyte.mdx",
"repo_id": "langchain",
"token_count": 338
} | 136 |
<!DOCTYPE html>
<html>
<head><title>Test Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
| langchain/docs/docs/integrations/document_loaders/example_data/fake-content.html/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/example_data/fake-content.html",
"repo_id": "langchain",
"token_count": 65
} | 108 |
# coding=utf-8
# Copyright 2021 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/imagegpt/test_image_processing_imagegpt.py/0 | {
"file_path": "transformers/tests/models/imagegpt/test_image_processing_imagegpt.py",
"repo_id": "transformers",
"token_count": 4306
} | 805 |
import { defaultModel } from "$lib/server/models";
import type { Assistant } from "./Assistant";
import type { Timestamps } from "./Timestamps";
import type { User } from "./User";
export interface Settings extends Timestamps {
userId?: User["_id"];
sessionId?: string;
/**
* Note: Only conversations with this se... | chat-ui/src/lib/types/Settings.ts/0 | {
"file_path": "chat-ui/src/lib/types/Settings.ts",
"repo_id": "chat-ui",
"token_count": 289
} | 101 |
components:
schemas:
Cautiousness:
description: An enumeration.
enum:
- low
- medium
- high
title: Cautiousness
type: string
Direction:
description: An enumeration.
enum:
- north
- south
- east
- west
title: Dire... | langchain/libs/langchain/tests/unit_tests/examples/test_specs/robot/apispec.yaml/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/examples/test_specs/robot/apispec.yaml",
"repo_id": "langchain",
"token_count": 4188
} | 659 |
"""Test LLM Bash functionality."""
import sys
from typing import Type
import pytest
from langchain.chains.llm import LLMChain
from langchain.evaluation.qa.eval_chain import (
ContextQAEvalChain,
CotQAEvalChain,
QAEvalChain,
_parse_string_eval_output,
)
from langchain.evaluation.schema import StringEva... | langchain/libs/langchain/tests/unit_tests/evaluation/qa/test_eval_chain.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/evaluation/qa/test_eval_chain.py",
"repo_id": "langchain",
"token_count": 1703
} | 630 |
SQL Join Query Engine
=======================
.. automodule:: llama_index.core.query_engine.sql_join_query_engine
:members:
:inherited-members:
| llama_index/docs/api_reference/query/query_engines/sql_join_query_engine.rst/0 | {
"file_path": "llama_index/docs/api_reference/query/query_engines/sql_join_query_engine.rst",
"repo_id": "llama_index",
"token_count": 50
} | 1,060 |
"""Init file."""
| llama_index/llama-index-legacy/llama_index/legacy/readers/weaviate/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/weaviate/__init__.py",
"repo_id": "llama_index",
"token_count": 6
} | 1,519 |
<jupyter_start><jupyter_text>IDEFICS: A Flamingo-based model, trained at scale for the community Finetuning Demo Notebook: Credit: [Flamingo blog](https://www.deepmind.com/blog/tackling-multiple-tasks-with-a-single-visual-language-model)This google colab notebook shows how to run predictions with the 4-bit quantized... | notebooks/examples/idefics/finetune_image_captioning_peft.ipynb/0 | {
"file_path": "notebooks/examples/idefics/finetune_image_captioning_peft.ipynb",
"repo_id": "notebooks",
"token_count": 3875
} | 309 |
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.a... | transformers/src/transformers/benchmark/benchmark_args_utils.py/0 | {
"file_path": "transformers/src/transformers/benchmark/benchmark_args_utils.py",
"repo_id": "transformers",
"token_count": 2417
} | 548 |
"""Wrapper around subprocess to run commands."""
from __future__ import annotations
import platform
import re
import subprocess
from typing import TYPE_CHECKING, List, Union
from uuid import uuid4
if TYPE_CHECKING:
import pexpect
class BashProcess:
"""
Wrapper class for starting subprocesses.
Uses t... | langchain/libs/experimental/langchain_experimental/llm_bash/bash.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/llm_bash/bash.py",
"repo_id": "langchain",
"token_count": 2524
} | 419 |
# Stable Diffusion
## Overview
Stable Diffusion was proposed in [Stable Diffusion Announcement](https://stability.ai/blog/stable-diffusion-announcement) by Patrick Esser and Robin Rombach and the Stability AI team.
The summary of the model is the following:
*Stable Diffusion is a text-to-image model that will empow... | diffusers/src/diffusers/pipelines/stable_diffusion/README.md/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/README.md",
"repo_id": "diffusers",
"token_count": 2465
} | 248 |
import pytest
import time
from pymilvus import connections
from utils.util_log import test_log as log
from base.collection_wrapper import ApiCollectionWrapper
from common import common_func as cf
from common import common_type as ct
from milvus_operator import MilvusOperator
from common.milvus_sys import MilvusSys
fro... | milvus/tests/python_client/customize/test_simd_compat.py/0 | {
"file_path": "milvus/tests/python_client/customize/test_simd_compat.py",
"repo_id": "milvus",
"token_count": 2951
} | 2,036 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/indices/managed/zilliz/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/managed/zilliz/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,499 |
"""
Test of Cassandra document loader class `CassandraLoader`
"""
import os
from typing import Any, Iterator
import pytest
from langchain_core.documents import Document
from langchain_community.document_loaders.cassandra import CassandraLoader
CASSANDRA_DEFAULT_KEYSPACE = "docloader_test_keyspace"
CASSANDRA_TABLE = ... | langchain/libs/community/tests/integration_tests/document_loaders/test_cassandra.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_cassandra.py",
"repo_id": "langchain",
"token_count": 1641
} | 322 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.graphdb_cypher import GraphDBCypherReader
def test_class():
names_of_base_classes = [b.__name__ for b in GraphDBCypherReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-graphdb-cypher/tests/test_readers_graphdb_cypher.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-graphdb-cypher/tests/test_readers_graphdb_cypher.py",
"repo_id": "llama_index",
"token_count": 97
} | 1,329 |
# mypy: disable-error-code="attr-defined, union-attr, arg-type, call-overload"
import time
from unittest import mock
import pytest
from langsmith.wrappers import wrap_openai
@mock.patch("langsmith.client.requests.Session")
@pytest.mark.parametrize("stream", [False, True])
def test_chat_sync_api(mock_session: mock.M... | langsmith-sdk/python/tests/integration_tests/wrappers/test_openai.py/0 | {
"file_path": "langsmith-sdk/python/tests/integration_tests/wrappers/test_openai.py",
"repo_id": "langsmith-sdk",
"token_count": 2458
} | 1,073 |
"""Test ingestion utilities."""
from typing import Any, Dict, Iterable, List, Optional, Sequence, Type
from langchain.schema import Document
from langchain.schema.embeddings import Embeddings
from langchain.schema.vectorstore import VST, VectorStore
class InMemoryVectorStore(VectorStore):
"""In-memory implementa... | opengpts/backend/tests/unit_tests/utils.py/0 | {
"file_path": "opengpts/backend/tests/unit_tests/utils.py",
"repo_id": "opengpts",
"token_count": 1555
} | 2,020 |
# deprecated, please use datasets.download.download_manager
| datasets/src/datasets/utils/download_manager.py/0 | {
"file_path": "datasets/src/datasets/utils/download_manager.py",
"repo_id": "datasets",
"token_count": 13
} | 140 |
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | milvus/internal/core/unittest/test_range_search_sort.cpp/0 | {
"file_path": "milvus/internal/core/unittest/test_range_search_sort.cpp",
"repo_id": "milvus",
"token_count": 2827
} | 1,954 |
<!--Copyright 2020 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/model_doc/ibert.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/ibert.md",
"repo_id": "transformers",
"token_count": 947
} | 492 |
# The “Deep” in Reinforcement Learning [[deep-rl]]
<Tip>
What we've talked about so far is Reinforcement Learning. But where does the "Deep" come into play?
</Tip>
Deep Reinforcement Learning introduces **deep neural networks to solve Reinforcement Learning problems** — hence the name “deep”.
For instance, in the ne... | deep-rl-class/units/en/unit1/deep-rl.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit1/deep-rl.mdx",
"repo_id": "deep-rl-class",
"token_count": 310
} | 160 |
from langchain_community.chat_message_histories.file import FileChatMessageHistory
__all__ = ["FileChatMessageHistory"]
| langchain/libs/langchain/langchain/memory/chat_message_histories/file.py/0 | {
"file_path": "langchain/libs/langchain/langchain/memory/chat_message_histories/file.py",
"repo_id": "langchain",
"token_count": 32
} | 555 |
// 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/datacoord/index_service_test.go/0 | {
"file_path": "milvus/internal/datacoord/index_service_test.go",
"repo_id": "milvus",
"token_count": 30172
} | 1,775 |
apiVersion: v1
kind: Pod
metadata:
labels:
app: meta-migration-builder
namespace: milvus-ci
spec:
enableServiceLinks: false
containers:
- name: main
image: milvusdb/krte:20211213-dcc15e9
env:
- name: DOCKER_IN_DOCKER_ENABLED
value: "true"
- name: DOCKER_VOLUME_DIRECTORY
value: ... | milvus/ci/jenkins/pod/meta-builder.yaml/0 | {
"file_path": "milvus/ci/jenkins/pod/meta-builder.yaml",
"repo_id": "milvus",
"token_count": 557
} | 1,626 |
# GooseAI
This page covers how to use the GooseAI ecosystem within LangChain.
It is broken into two parts: installation and setup, and then references to specific GooseAI wrappers.
## Installation and Setup
- Install the Python SDK with `pip install openai`
- Get your GooseAI api key from this link [here](https://goo... | langchain/docs/docs/integrations/providers/gooseai.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/gooseai.mdx",
"repo_id": "langchain",
"token_count": 181
} | 145 |
"""The Chain runs a self-review of logical fallacies as determined by this paper \
categorizing and defining logical fallacies https://arxiv.org/pdf/2212.07425.pdf. \
Modeled after Constitutional AI and in same format, but applying logical \
fallacies as generalized rules to remove in output"""
| langchain/libs/experimental/langchain_experimental/fallacy_removal/__init__.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/fallacy_removal/__init__.py",
"repo_id": "langchain",
"token_count": 74
} | 441 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Team All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | transformers/examples/research_projects/jax-projects/dataset-streaming/run_mlm_flax_stream.py/0 | {
"file_path": "transformers/examples/research_projects/jax-projects/dataset-streaming/run_mlm_flax_stream.py",
"repo_id": "transformers",
"token_count": 10617
} | 564 |
poetry_requirements(
name="poetry",
)
python_requirements(
name="reqs",
)
| llama_index/llama-index-integrations/readers/llama-index-readers-firestore/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-firestore/BUILD",
"repo_id": "llama_index",
"token_count": 36
} | 1,445 |
import random
import pytest
import requests
from langchain_community.document_loaders import NewsURLLoader
def get_random_news_url() -> str:
from bs4 import BeautifulSoup
response = requests.get("https://news.google.com")
soup = BeautifulSoup(response.text, "html.parser")
article_links = [
... | langchain/libs/community/tests/integration_tests/document_loaders/test_news.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_news.py",
"repo_id": "langchain",
"token_count": 689
} | 356 |
from langchain_community.retrievers.chatgpt_plugin_retriever import (
ChatGPTPluginRetriever,
)
__all__ = ["ChatGPTPluginRetriever"]
| langchain/libs/langchain/langchain/retrievers/chatgpt_plugin_retriever.py/0 | {
"file_path": "langchain/libs/langchain/langchain/retrievers/chatgpt_plugin_retriever.py",
"repo_id": "langchain",
"token_count": 51
} | 531 |
"""Test for CombinedMemory class"""
# from langchain_core.prompts import PromptTemplate
from typing import List
import pytest
from langchain.memory import CombinedMemory, ConversationBufferMemory
@pytest.fixture()
def example_memory() -> List[ConversationBufferMemory]:
example_1 = ConversationBufferMemory(memor... | langchain/libs/langchain/tests/unit_tests/memory/test_combined_memory.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/memory/test_combined_memory.py",
"repo_id": "langchain",
"token_count": 501
} | 643 |
import CodeBlock from "@theme/CodeBlock";
# HuggingFace Transformers
The `TransformerEmbeddings` class uses the [Transformers.js](https://huggingface.co/docs/transformers.js/index) package to generate embeddings for a given text.
It runs locally and even works directly in the browser, allowing you to create web apps... | langchainjs/docs/core_docs/docs/integrations/text_embedding/transformers.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/text_embedding/transformers.mdx",
"repo_id": "langchainjs",
"token_count": 363
} | 770 |
import torch
import torch.distributed
from opentelemetry import trace
from transformers import AutoTokenizer
from typing import Optional
from text_generation_server.models import FlashCausalLM
from text_generation_server.models.custom_modeling.flash_rw_modeling import (
RWConfig,
FlashRWForCausalLM,
)
from te... | text-generation-inference/server/text_generation_server/models/flash_rw.py/0 | {
"file_path": "text-generation-inference/server/text_generation_server/models/flash_rw.py",
"repo_id": "text-generation-inference",
"token_count": 1158
} | 446 |
# 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/mobilenet_v2/test_modeling_mobilenet_v2.py/0 | {
"file_path": "transformers/tests/models/mobilenet_v2/test_modeling_mobilenet_v2.py",
"repo_id": "transformers",
"token_count": 5513
} | 798 |
from typing import Any, Dict, List, Optional
from langchain.callbacks.manager import (
AsyncCallbackManagerForChainRun,
CallbackManagerForChainRun,
)
from langchain.chains.base import Chain
from langchain_experimental.plan_and_execute.executors.base import BaseExecutor
from langchain_experimental.plan_and_exe... | langchain/libs/experimental/langchain_experimental/plan_and_execute/agent_executor.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/plan_and_execute/agent_executor.py",
"repo_id": "langchain",
"token_count": 1704
} | 446 |
from typing import Any, AsyncIterator, Iterator
from langchain_core.messages import AIMessageChunk
from langchain.output_parsers.openai_functions import JsonOutputFunctionsParser
GOOD_JSON = """```json
{
"foo": "bar"
}
```"""
JSON_WITH_NEW_LINES = """
```json
{
"foo": "bar"
}
```
"""
JSON_WITH_NEW_LINES_... | langchain/libs/langchain/tests/unit_tests/output_parsers/test_json.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/output_parsers/test_json.py",
"repo_id": "langchain",
"token_count": 4853
} | 644 |
# coding=utf-8
# Copyright 2021 The Fairseq 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://www.apache.org/licenses/... | transformers/src/transformers/models/data2vec/modeling_data2vec_audio.py/0 | {
"file_path": "transformers/src/transformers/models/data2vec/modeling_data2vec_audio.py",
"repo_id": "transformers",
"token_count": 27881
} | 641 |
"""Unit tests for the Constitutional AI chain."""
from langchain.chains.constitutional_ai.base import ConstitutionalChain
TEXT_ONE = """ This text is bad.
Revision request: Make it better.
Revision:"""
TEXT_TWO = """ This text is bad.\n\n"""
TEXT_THREE = """ This text is bad.
Revision request: Make it better.
Re... | langchain/libs/langchain/tests/unit_tests/chains/test_constitutional_ai.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/chains/test_constitutional_ai.py",
"repo_id": "langchain",
"token_count": 227
} | 624 |
<!--Copyright 2020 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/en/model_doc/xlm-roberta.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/xlm-roberta.md",
"repo_id": "transformers",
"token_count": 3907
} | 519 |
import { test, expect } from "@jest/globals";
import { GoogleGenerativeAIEmbeddings } from "../embeddings.js";
test("Test GooglePalmEmbeddings.embedQuery", async () => {
const embeddings = new GoogleGenerativeAIEmbeddings({
maxRetries: 1,
});
const res = await embeddings.embedQuery("Hello world");
console.... | langchainjs/libs/langchain-google-genai/src/tests/embeddings.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-google-genai/src/tests/embeddings.int.test.ts",
"repo_id": "langchainjs",
"token_count": 297
} | 992 |
<jupyter_start><jupyter_text>Query Transform Cookbook A user query can be transformed and decomposed in many ways before being executed as part of a RAG query engine, agent, or any other pipeline.In this guide we show you different ways to transform, decompose queries, and find the set of relevant tools. Each technique... | llama_index/docs/examples/query_transformations/query_transform_cookbook.ipynb/0 | {
"file_path": "llama_index/docs/examples/query_transformations/query_transform_cookbook.ipynb",
"repo_id": "llama_index",
"token_count": 2943
} | 1,129 |
from typing import Any, Dict, List, Optional
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 import BaseModel, Extra, root_validator
from langchain_core.utils import get_from_dict_or_env
from packaging.version import parse
__all__ = ["GradientEmbeddings"]
class GradientEmbeddings(Ba... | langchain/libs/community/langchain_community/embeddings/gradient_ai.py/0 | {
"file_path": "langchain/libs/community/langchain_community/embeddings/gradient_ai.py",
"repo_id": "langchain",
"token_count": 2226
} | 252 |
<jupyter_start><jupyter_text>Tigris> [Tigris](htttps://tigrisdata.com) is an open-source Serverless NoSQL Database and Search Platform designed to simplify building high-performance vector search applications.> `Tigris` eliminates the infrastructure complexity of managing, operating, and synchronizing multiple tools, a... | langchain/docs/docs/integrations/vectorstores/tigris.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/tigris.ipynb",
"repo_id": "langchain",
"token_count": 824
} | 185 |
FROM python:3.11-slim-bookworm AS builder
ARG REBUILD_HNSWLIB
RUN apt-get update --fix-missing && apt-get install -y --fix-missing \
build-essential \
gcc \
g++ \
cmake \
autoconf && \
rm -rf /var/lib/apt/lists/* && \
mkdir /install
WORKDIR /install
COPY ./requirements.txt requirements.txt... | chroma/Dockerfile/0 | {
"file_path": "chroma/Dockerfile",
"repo_id": "chroma",
"token_count": 483
} | 10 |
"""Test vector store utility functions."""
import numpy as np
from langchain_core.documents import Document
from langchain_community.vectorstores.utils import (
filter_complex_metadata,
maximal_marginal_relevance,
)
def test_maximal_marginal_relevance_lambda_zero() -> None:
query_embedding = np.random.ra... | langchain/libs/community/tests/unit_tests/vectorstores/test_utils.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/vectorstores/test_utils.py",
"repo_id": "langchain",
"token_count": 1849
} | 396 |
from rag_ollama_multi_query.chain import chain
__all__ = ["chain"]
| langchain/templates/rag-ollama-multi-query/rag_ollama_multi_query/__init__.py/0 | {
"file_path": "langchain/templates/rag-ollama-multi-query/rag_ollama_multi_query/__init__.py",
"repo_id": "langchain",
"token_count": 23
} | 685 |
//! Convolution Layers.
use crate::BatchNorm;
use candle::{Result, Tensor};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Conv1dConfig {
pub padding: usize,
pub stride: usize,
pub dilation: usize,
pub groups: usize,
}
impl Default for Conv1dConfig {
fn default() -> Self {
Self {
... | candle/candle-nn/src/conv.rs/0 | {
"file_path": "candle/candle-nn/src/conv.rs",
"repo_id": "candle",
"token_count": 5440
} | 67 |
import os
import weaviate
from langchain.retrievers.weaviate_hybrid_search import WeaviateHybridSearchRetriever
from langchain_community.chat_models import ChatOpenAI
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import Run... | langchain/templates/hybrid-search-weaviate/hybrid_search_weaviate/chain.py/0 | {
"file_path": "langchain/templates/hybrid-search-weaviate/hybrid_search_weaviate/chain.py",
"repo_id": "langchain",
"token_count": 781
} | 638 |
import { ChatMinimax } from "@langchain/community/chat_models/minimax";
import { AIMessage, HumanMessage } from "@langchain/core/messages";
const model = new ChatMinimax({
modelName: "abab5.5-chat",
botSetting: [
{
bot_name: "MM Assistant",
content: "MM Assistant is an AI Assistant developed by min... | langchainjs/examples/src/models/chat/minimax_sample_messages.ts/0 | {
"file_path": "langchainjs/examples/src/models/chat/minimax_sample_messages.ts",
"repo_id": "langchainjs",
"token_count": 401
} | 807 |
.PHONY: deps_table_update modified_only_fixup extra_style_checks quality style fixup fix-copies test test-examples
# make sure to test the local checkout in scripts and not the pre-installed one (don't use quotes!)
export PYTHONPATH = src
check_dirs := examples tests src utils
exclude_folders := examples/research_pr... | transformers/Makefile/0 | {
"file_path": "transformers/Makefile",
"repo_id": "transformers",
"token_count": 1325
} | 485 |
{
"runSettings": {
"temperature": 0.25,
"model": "models/chat-bison-001",
"candidateCount": 1,
"topP": 0.95,
"topK": 40,
"maxOutputTokens": 1024
},
"multiturnPrompt": {
"preamble": "You are responsible for returning date and time information based on the user\u0027s input. All your dat... | langchainjs/langchain/src/experimental/hubs/makersuite/tests/googlemakersuite-files/chatPrompt.json/0 | {
"file_path": "langchainjs/langchain/src/experimental/hubs/makersuite/tests/googlemakersuite-files/chatPrompt.json",
"repo_id": "langchainjs",
"token_count": 709
} | 910 |
use std::{env, path::PathBuf};
fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let package_name = env::var("CARGO_PKG_NAME").unwrap();
let output_file = PathBuf::from(&crate_dir)
.join("include")
.join(format!("{}.h", package_name));
cbindgen::generate(&crate_dir)
... | milvus/internal/core/thirdparty/tantivy/tantivy-binding/build.rs/0 | {
"file_path": "milvus/internal/core/thirdparty/tantivy/tantivy-binding/build.rs",
"repo_id": "milvus",
"token_count": 172
} | 1,751 |
# 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/groupvit/convert_groupvit_nvlab_to_hf.py/0 | {
"file_path": "transformers/src/transformers/models/groupvit/convert_groupvit_nvlab_to_hf.py",
"repo_id": "transformers",
"token_count": 4252
} | 644 |
import base64
import io
import os
import uuid
from io import BytesIO
from pathlib import Path
import pypdfium2 as pdfium
from langchain.retrievers.multi_vector import MultiVectorRetriever
from langchain.storage import LocalFileStore, UpstashRedisByteStore
from langchain_community.chat_models import ChatOpenAI
from lan... | langchain/templates/rag-chroma-multi-modal-multi-vector/ingest.py/0 | {
"file_path": "langchain/templates/rag-chroma-multi-modal-multi-vector/ingest.py",
"repo_id": "langchain",
"token_count": 2501
} | 668 |
import os
from typing import Any, AsyncIterator, Dict, Iterator, List, Optional, Tuple
import anthropic
from langchain_core.callbacks import (
AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun,
)
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.messages import (
... | langchain/libs/partners/anthropic/langchain_anthropic/chat_models.py/0 | {
"file_path": "langchain/libs/partners/anthropic/langchain_anthropic/chat_models.py",
"repo_id": "langchain",
"token_count": 2801
} | 640 |
"""Test Bytedance Volcano Embedding."""
from langchain_community.embeddings import VolcanoEmbeddings
def test_embedding_documents() -> None:
"""Test embeddings for documents."""
documents = ["foo", "bar"]
embedding = VolcanoEmbeddings()
output = embedding.embed_documents(documents)
assert len(outp... | langchain/libs/community/tests/integration_tests/embeddings/test_volcano.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_volcano.py",
"repo_id": "langchain",
"token_count": 193
} | 357 |
import { test, expect } from "@jest/globals";
import { OpenAIEmbeddings } from "../embeddings.js";
test("Test OpenAIEmbeddings.embedQuery", async () => {
const embeddings = new OpenAIEmbeddings();
const res = await embeddings.embedQuery("Hello world");
expect(typeof res[0]).toBe("number");
});
test("Test OpenAI... | langchainjs/libs/langchain-openai/src/tests/embeddings.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-openai/src/tests/embeddings.int.test.ts",
"repo_id": "langchainjs",
"token_count": 982
} | 1,010 |
"""PDF Table reader."""
from pathlib import Path
from typing import Any, Dict, List, Optional
import pandas as pd
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
class PDFTableReader(BaseReader):
"""PDF Table Reader. Reads table from PDF.
Args:
row_s... | llama_index/llama-index-integrations/readers/llama-index-readers-pdf-table/llama_index/readers/pdf_table/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-pdf-table/llama_index/readers/pdf_table/base.py",
"repo_id": "llama_index",
"token_count": 791
} | 1,504 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/querycoordv2/meta/failed_load_cache.go/0 | {
"file_path": "milvus/internal/querycoordv2/meta/failed_load_cache.go",
"repo_id": "milvus",
"token_count": 1116
} | 1,861 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.