text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
MIME-Version: 1.0 Date: Fri, 16 Dec 2022 17:04:16 -0500 Message-ID: <CADc-_xaLB2FeVQ7mNsoX+NJb_7hAJhBKa_zet-rtgPGenj0uVw@mail.gmail.com> Subject: Test Email From: Matthew Robinson <mrobinson@unstructured.io> To: Matthew Robinson <mrobinson@unstructured.io> Content-Type: multipart/alternative; boundary="00000000000095c9...
langchain/docs/docs/integrations/document_loaders/example_data/fake-email.eml/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/example_data/fake-email.eml", "repo_id": "langchain", "token_count": 313 }
98
#!/bin/bash # 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...
milvus/tests/scripts/qa/ci_logs.sh/0
{ "file_path": "milvus/tests/scripts/qa/ci_logs.sh", "repo_id": "milvus", "token_count": 817 }
1,915
from sql_llama2.chain import chain __all__ = ["chain"]
langchain/templates/sql-llama2/sql_llama2/__init__.py/0
{ "file_path": "langchain/templates/sql-llama2/sql_llama2/__init__.py", "repo_id": "langchain", "token_count": 20 }
702
from langchain_community.document_loaders.docusaurus import DocusaurusLoader __all__ = ["DocusaurusLoader"]
langchain/libs/langchain/langchain/document_loaders/docusaurus.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/docusaurus.py", "repo_id": "langchain", "token_count": 32 }
526
import os import re from langchain.sql_database import SQLDatabase from langchain_community.chat_models import ChatOpenAI from langchain_community.embeddings import OpenAIEmbeddings from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain_core.pydan...
langchain/templates/sql-pgvector/sql_pgvector/chain.py/0
{ "file_path": "langchain/templates/sql-pgvector/sql_pgvector/chain.py", "repo_id": "langchain", "token_count": 1245 }
685
from __future__ import annotations import io import json import time from typing import Any, Dict, Iterator, List, Optional, Tuple from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader class AthenaLoader(BaseLoader): """Load documents from `AWS Athena`. ...
langchain/libs/community/langchain_community/document_loaders/athena.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/athena.py", "repo_id": "langchain", "token_count": 2621 }
241
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-papers/llama_index/readers/papers/arxiv/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-papers/llama_index/readers/papers/arxiv/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,424
import * as uuid from "uuid"; import { AstraDB } from "@datastax/astra-db-ts"; import { Collection } from "@datastax/astra-db-ts/dist/collections"; import { CreateCollectionOptions } from "@datastax/astra-db-ts/dist/collections/options.js"; import { AsyncCaller, AsyncCallerParams, } from "@langchain/core/utils/as...
langchainjs/libs/langchain-community/src/vectorstores/astradb.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/astradb.ts", "repo_id": "langchainjs", "token_count": 3423 }
1,021
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors, The HuggingFace Inc. team, and the # Lxmert Authors. # 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....
transformers/src/transformers/models/lxmert/modeling_tf_lxmert.py/0
{ "file_path": "transformers/src/transformers/models/lxmert/modeling_tf_lxmert.py", "repo_id": "transformers", "token_count": 31854 }
625
"""Select and order examples based on ngram overlap score (sentence_bleu score). https://www.nltk.org/_modules/nltk/translate/bleu_score.html https://aclanthology.org/P02-1040.pdf """ from typing import Dict, List import numpy as np from langchain_core.example_selectors import BaseExampleSelector from langchain_core....
langchain/libs/community/langchain_community/example_selectors/ngram_overlap.py/0
{ "file_path": "langchain/libs/community/langchain_community/example_selectors/ngram_overlap.py", "repo_id": "langchain", "token_count": 1566 }
274
""" Qdrant vector store index. An index that is built on top of an existing Qdrant collection. """ import logging from typing import Any, List, Optional, Tuple, cast import qdrant_client from grpc import RpcError from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.schema import Base...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/llama_index/vector_stores/qdrant/base.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/llama_index/vector_stores/qdrant/base.py", "repo_id": "llama_index", "token_count": 16325 }
1,673
// 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/util_test.go/0
{ "file_path": "milvus/internal/datacoord/util_test.go", "repo_id": "milvus", "token_count": 2059 }
1,690
# coding=utf-8 # Copyright 2023, 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 a...
transformers/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py/0
{ "file_path": "transformers/src/transformers/models/gptsan_japanese/configuration_gptsan_japanese.py", "repo_id": "transformers", "token_count": 2956 }
681
"""DashScope llm api.""" from http import HTTPStatus from typing import Any, Dict, List, Optional, Sequence, Tuple from llama_index.legacy.bridge.pydantic import Field from llama_index.legacy.callbacks import CallbackManager from llama_index.legacy.constants import DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE from llama_...
llama_index/llama-index-legacy/llama_index/legacy/llms/dashscope.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/dashscope.py", "repo_id": "llama_index", "token_count": 5279 }
1,615
# SK-ResNet **SK ResNet** is a variant of a [ResNet](https://www.paperswithcode.com/method/resnet) that employs a [Selective Kernel](https://paperswithcode.com/method/selective-kernel) unit. In general, all the large kernel convolutions in the original bottleneck blocks in ResNet are replaced by the proposed [SK convo...
pytorch-image-models/hfdocs/source/models/skresnet.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/models/skresnet.mdx", "repo_id": "pytorch-image-models", "token_count": 2082 }
364
python_sources()
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,313
# DingoDB This page covers how to use the DingoDB ecosystem within LangChain. It is broken into two parts: installation and setup, and then references to specific DingoDB wrappers. ## Installation and Setup - Install the Python SDK with `pip install dingodb` ## VectorStore There exists a wrapper around DingoDB inde...
langchain/docs/docs/integrations/providers/dingo.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/dingo.mdx", "repo_id": "langchain", "token_count": 161 }
135
// 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_bf.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_bf.cpp", "repo_id": "milvus", "token_count": 2378 }
1,816
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datanode/importv2/task_manager.go/0
{ "file_path": "milvus/internal/datanode/importv2/task_manager.go", "repo_id": "milvus", "token_count": 765 }
1,696
# Embeddings ## Concept Embeddings are used in LlamaIndex to represent your documents using a sophisticated numerical representation. Embedding models take text as input, and return a long list of numbers used to capture the semantics of the text. These embedding models have been trained to represent text this way, a...
llama_index/docs/module_guides/models/embeddings.md/0
{ "file_path": "llama_index/docs/module_guides/models/embeddings.md", "repo_id": "llama_index", "token_count": 2652 }
1,095
// Adapted from turboderp exllama: https://github.com/turboderp/exllama #ifndef _q4_matrix_cuh #define _q4_matrix_cuh #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cstdint> class Q4Matrix { public: int device; int height; int width; int groups; int groupsize; uint32_t* cuda_qw...
text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matrix.cuh/0
{ "file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matrix.cuh", "repo_id": "text-generation-inference", "token_count": 419 }
420
package datanode import ( "context" "github.com/golang/protobuf/proto" "github.com/samber/lo" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus/internal/datanode/metacache"...
milvus/internal/datanode/flow_graph_write_node.go/0
{ "file_path": "milvus/internal/datanode/flow_graph_write_node.go", "repo_id": "milvus", "token_count": 1434 }
1,695
import { TavilySearchAPIRetriever } from "@langchain/community/retrievers/tavily_search_api"; const retriever = new TavilySearchAPIRetriever({ k: 3, }); const retrievedDocs = await retriever.getRelevantDocuments( "What did the speaker say about Justice Breyer in the 2022 State of the Union?" ); console.log({ retr...
langchainjs/examples/src/retrievers/tavily.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/tavily.ts", "repo_id": "langchainjs", "token_count": 374 }
817
""" MaxVit and CoAtNet Vision Transformer - CNN Hybrids in PyTorch This is a from-scratch implementation of both CoAtNet and MaxVit in PyTorch. 99% of the implementation was done from papers, however last minute some adjustments were made based on the (as yet unfinished?) public code release https://github.com/google...
pytorch-image-models/timm/models/maxxvit.py/0
{ "file_path": "pytorch-image-models/timm/models/maxxvit.py", "repo_id": "pytorch-image-models", "token_count": 42620 }
365
import {ChromaClient} from "../src/ChromaClient"; import { CloudClient } from "../src/CloudClient"; const PORT = process.env.PORT || "8000"; const URL = "http://localhost:" + PORT; export const chromaBasic = new ChromaClient({path: URL, auth: {provider: "basic", credentials: "admin:admin"}}); export const chromaTokenD...
chroma/clients/js/test/initClientWithAuth.ts/0
{ "file_path": "chroma/clients/js/test/initClientWithAuth.ts", "repo_id": "chroma", "token_count": 281 }
35
from langchain_community.tools.gmail.search import ( GmailSearch, Resource, SearchArgsSchema, ) __all__ = ["Resource", "SearchArgsSchema", "GmailSearch"]
langchain/libs/langchain/langchain/tools/gmail/search.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/gmail/search.py", "repo_id": "langchain", "token_count": 58 }
578
"""Integration test for Sms.""" from langchain_community.utilities.twilio import TwilioAPIWrapper def test_call() -> None: """Test that call runs.""" twilio = TwilioAPIWrapper() output = twilio.run("Message", "+16162904619") assert output
langchain/libs/community/tests/integration_tests/utilities/test_twilio.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/utilities/test_twilio.py", "repo_id": "langchain", "token_count": 93 }
350
<jupyter_start><jupyter_text>[Beta] Text-to-SQL with PGVectorThis notebook demo shows how to perform text-to-SQL with pgvector. This allows us to jointly do both semantic search and structured querying, *all* within SQL!This hypothetically enables more expressive queries than semantic search + metadata filters.**NOTE**...
llama_index/docs/examples/query_engine/pgvector_sql_query_engine.ipynb/0
{ "file_path": "llama_index/docs/examples/query_engine/pgvector_sql_query_engine.ipynb", "repo_id": "llama_index", "token_count": 2283 }
1,104
// 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/coordinator_broker_test.go/0
{ "file_path": "milvus/internal/querycoordv2/meta/coordinator_broker_test.go", "repo_id": "milvus", "token_count": 4961 }
1,977
from typing import List, Optional, Sequence, cast from llama_index.core.llms.llm import LLM from llama_index.core.prompts.mixin import PromptDictType from llama_index.core.question_gen.prompts import build_tools_text from llama_index.core.question_gen.types import ( BaseQuestionGenerator, SubQuestion, SubQ...
llama_index/llama-index-integrations/question_gen/llama-index-question-gen-openai/llama_index/question_gen/openai/base.py/0
{ "file_path": "llama_index/llama-index-integrations/question_gen/llama-index-question-gen-openai/llama_index/question_gen/openai/base.py", "repo_id": "llama_index", "token_count": 1298 }
1,331
loop_stability: collections: - server: db_config.primary_path: /test/milvus/db_data_8/shards_loop_stability engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 10 gpu_resource_config.enable: true gpu_resource_config.cache_capacity: 2GB ...
milvus/tests/benchmark/milvus_benchmark/suites/shards_loop_stability.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/shards_loop_stability.yaml", "repo_id": "milvus", "token_count": 246 }
2,011
import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { OpenAIEmbeddings } from "@langchain/openai"; const vectorStore = await HNSWLib.fromTexts( ["Hello world", "Bye bye", "hello nice world"], [{ id: 2 }, { id: 1 }, { id: 3 }], new OpenAIEmbeddings() ); const resultOne = await vectorStore...
langchainjs/examples/src/indexes/vector_stores/hnswlib.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/hnswlib.ts", "repo_id": "langchainjs", "token_count": 130 }
814
# 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/gpt2/__init__.py/0
{ "file_path": "transformers/src/transformers/models/gpt2/__init__.py", "repo_id": "transformers", "token_count": 2017 }
611
<jupyter_start><jupyter_text>If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets. Uncomment the following cell and run it.<jupyter_code>#! pip install transformers datasets huggingface_hub<jupyter_output><empty_output><jupyter_text>If you're opening this notebook ...
notebooks/examples/question_answering-tf.ipynb/0
{ "file_path": "notebooks/examples/question_answering-tf.ipynb", "repo_id": "notebooks", "token_count": 17339 }
321
## init file from llama_index.tools.azure_speech.base import ( AzureSpeechToolSpec, ) __all__ = ["AzureSpeechToolSpec"]
llama_index/llama-index-integrations/tools/llama-index-tools-azure-speech/llama_index/tools/azure_speech/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-azure-speech/llama_index/tools/azure_speech/__init__.py", "repo_id": "llama_index", "token_count": 47 }
1,478
--- label: "File Loaders" hide_table_of_contents: true sidebar_class_name: node-only-category --- # File Loaders :::tip Compatibility Only available on Node.js. ::: These loaders are used to load files given a filesystem path or a Blob object. import DocCardList from "@theme/DocCardList"; <DocCardList />
langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/index.mdx", "repo_id": "langchainjs", "token_count": 100 }
778
# coding=utf-8 # Copyright 2021 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.apache.org/licenses/LICENSE-2.0 # # Unless required...
transformers/examples/research_projects/quantization-qdqbert/Dockerfile/0
{ "file_path": "transformers/examples/research_projects/quantization-qdqbert/Dockerfile", "repo_id": "transformers", "token_count": 392 }
531
from typing import List, Tuple from langchain_core.agents import AgentAction def format_log_to_str( intermediate_steps: List[Tuple[AgentAction, str]], observation_prefix: str = "Observation: ", llm_prefix: str = "Thought: ", ) -> str: """Construct the scratchpad that lets the agent continue its thoug...
langchain/libs/langchain/langchain/agents/format_scratchpad/log.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/format_scratchpad/log.py", "repo_id": "langchain", "token_count": 176 }
441
"""Prompt types enum.""" from enum import Enum class PromptType(str, Enum): """Prompt type.""" # summarization SUMMARY = "summary" # tree insert node TREE_INSERT = "insert" # tree select query prompt TREE_SELECT = "tree_select" # tree select query prompt (multiple) TREE_SELECT_MU...
llama_index/llama-index-core/llama_index/core/prompts/prompt_type.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/prompts/prompt_type.py", "repo_id": "llama_index", "token_count": 715 }
1,166
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-perplexity/llama_index/llms/perplexity/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-perplexity/llama_index/llms/perplexity/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,417
# NLPCloud >[NLP Cloud](https://docs.nlpcloud.com/#introduction) is an artificial intelligence platform that allows you to use the most advanced AI engines, and even train your own engines with your own data. ## Installation and Setup - Install the `nlpcloud` package. ```bash pip install nlpcloud ``` - Get an NL...
langchain/docs/docs/integrations/providers/nlpcloud.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/nlpcloud.mdx", "repo_id": "langchain", "token_count": 220 }
153
package funcutil import ( "fmt" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/milvus-io/milvus/internal/proto/segcorepb" ) f...
milvus/internal/util/funcutil/count_util.go/0
{ "file_path": "milvus/internal/util/funcutil/count_util.go", "repo_id": "milvus", "token_count": 1078 }
1,800
# 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/layoutlmv3/test_modeling_tf_layoutlmv3.py/0
{ "file_path": "transformers/tests/models/layoutlmv3/test_modeling_tf_layoutlmv3.py", "repo_id": "transformers", "token_count": 9738 }
790
compute_environment: LOCAL_MACHINE deepspeed_config: {} distributed_type: 'NO' downcast_bf16: 'no' fsdp_config: {} machine_rank: 0 main_process_ip: null main_process_port: null main_training_function: main mixed_precision: 'no' num_machines: 1 num_processes: 1 use_cpu: false
accelerate/tests/test_configs/0_12_0.yaml/0
{ "file_path": "accelerate/tests/test_configs/0_12_0.yaml", "repo_id": "accelerate", "token_count": 105 }
20
"""Tests for the string run evaluator.""" from unittest.mock import MagicMock from langchain.evaluation import criteria from langchain.smith.evaluation.string_run_evaluator import ( ChainStringRunMapper, StringRunEvaluatorChain, ) from tests.unit_tests.llms import fake_llm def test_evaluate_run() -> None: ...
langchain/libs/langchain/tests/unit_tests/smith/evaluation/test_string_run_evaluator.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/smith/evaluation/test_string_run_evaluator.py", "repo_id": "langchain", "token_count": 336 }
618
import pytest @pytest.fixture(scope="module") def flash_santacoder_handle(launcher): with launcher("bigcode/santacoder") as handle: yield handle @pytest.fixture(scope="module") async def flash_santacoder(flash_santacoder_handle): await flash_santacoder_handle.health(300) return flash_santacoder_...
text-generation-inference/integration-tests/models/test_flash_santacoder.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_flash_santacoder.py", "repo_id": "text-generation-inference", "token_count": 387 }
412
use pyo3::exceptions; use pyo3::prelude::*; use pyo3::types::*; use tk::tokenizer::{Offsets, PaddingDirection}; use tk::utils::truncation::TruncationDirection; use tokenizers as tk; use crate::error::{deprecation_warning, PyError}; /// The :class:`~tokenizers.Encoding` represents the output of a :class:`~tokenizers.T...
tokenizers/bindings/python/src/encoding.rs/0
{ "file_path": "tokenizers/bindings/python/src/encoding.rs", "repo_id": "tokenizers", "token_count": 7397 }
424
package indexparamcheck import ( "fmt" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" ) type hnswChecker struct { floatVectorBaseChecker } func (c hnswChecker) StaticCheck(params map[string]string) error { if !CheckIntByRange(params, EFConstruction, HNSWMinEfConstruction, HNSWMaxEfConstruction) { retu...
milvus/pkg/util/indexparamcheck/hnsw_checker.go/0
{ "file_path": "milvus/pkg/util/indexparamcheck/hnsw_checker.go", "repo_id": "milvus", "token_count": 477 }
2,109
import { NextRequest, NextResponse } from "next/server"; import { Client } from "langsmith"; export const runtime = "edge"; const langsmithClient = new Client(); /** * This handler creates feedback for a LangSmith trace. */ export async function POST(req: NextRequest) { try { const body = await req.json(); ...
langsmith-cookbook/feedback-examples/nextjs/app/api/feedback/route.ts/0
{ "file_path": "langsmith-cookbook/feedback-examples/nextjs/app/api/feedback/route.ts", "repo_id": "langsmith-cookbook", "token_count": 582 }
1,070
from __future__ import annotations import json import uuid from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union, ) from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core...
langchain/libs/community/langchain_community/vectorstores/marqo.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/marqo.py", "repo_id": "langchain", "token_count": 7495 }
309
import { NodeHandler, ASTParser } from "./base.js"; import { PropertyAssignmentHandler } from "./property_assignment_handler.js"; import { ObjectLiteralType, PropertyAssignmentType } from "./types.js"; /** * Handles object literal expressions in the LangChain Expression * Language. Extends the NodeHandler class. */...
langchainjs/langchain/src/output_parsers/expression_type_handlers/object_literal_expression_handler.ts/0
{ "file_path": "langchainjs/langchain/src/output_parsers/expression_type_handlers/object_literal_expression_handler.ts", "repo_id": "langchainjs", "token_count": 547 }
952
filters: ".*": reviewers: - czs007 - jeffoverflow - scsven - shengjun1985 - sunby - xiaofan-luan - xige-16 - yanliang567 - zwd1208 approvers: - maintainers "Makefile$": labels: - area/compilation "CMakeLists\\.txt$": labels: ...
milvus/OWNERS/0
{ "file_path": "milvus/OWNERS", "repo_id": "milvus", "token_count": 451 }
1,619
[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 = ["LlamaGuardModeratorPack"] contains_example = false import_path = "llama_index.packs.llama...
llama_index/llama-index-packs/llama-index-packs-llama-guard-moderator/pyproject.toml/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-llama-guard-moderator/pyproject.toml", "repo_id": "llama_index", "token_count": 726 }
1,708
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/rootcoord/has_partition_task_test.go/0
{ "file_path": "milvus/internal/rootcoord/has_partition_task_test.go", "repo_id": "milvus", "token_count": 1764 }
1,778
from typing import Callable, Optional from .. import Features from ..packaged_modules.generator.generator import Generator from .abc import AbstractDatasetInputStream class GeneratorDatasetInputStream(AbstractDatasetInputStream): def __init__( self, generator: Callable, features: Optional...
datasets/src/datasets/io/generator.py/0
{ "file_path": "datasets/src/datasets/io/generator.py", "repo_id": "datasets", "token_count": 896 }
131
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/model_doc/detr.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/detr.md", "repo_id": "transformers", "token_count": 7983 }
495
import os from minio import Minio from minio.error import S3Error from utils.util_log import test_log as log def copy_files_to_bucket(client, r_source, target_files, bucket_name, force=False): # check the bucket exist found = client.bucket_exists(bucket_name) if not found: log.error(f"Bucket {buck...
milvus/tests/python_client/common/minio_comm.py/0
{ "file_path": "milvus/tests/python_client/common/minio_comm.py", "repo_id": "milvus", "token_count": 618 }
2,035
python_tests()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,515
# Oracle Cloud Infrastructure (OCI) The `LangChain` integrations related to [Oracle Cloud Infrastructure](https://www.oracle.com/artificial-intelligence/). ## LLMs ### OCI Generative AI > Oracle Cloud Infrastructure (OCI) [Generative AI](https://docs.oracle.com/en-us/iaas/Content/generative-ai/home.htm) is a fully m...
langchain/docs/docs/integrations/providers/oci.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/oci.mdx", "repo_id": "langchain", "token_count": 637 }
143
"""init params."""
llama_index/llama-index-core/llama_index/core/tools/tool_spec/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/tools/tool_spec/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,303
# Multi-Document Agents Pack This LlamaPack provides an example of our multi-document agents. This specific template shows the e2e process of building this. Given a set of documents, the pack will build our multi-document agents architecture. - setup a document agent over agent doc (capable of QA and summarization) ...
llama_index/llama-index-packs/llama-index-packs-multi-document-agents/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-multi-document-agents/README.md", "repo_id": "llama_index", "token_count": 725 }
1,797
# Copyright 2021 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/models/perceiver/__init__.py/0
{ "file_path": "transformers/src/transformers/models/perceiver/__init__.py", "repo_id": "transformers", "token_count": 1222 }
653
#!/usr/bin/env python """Converts a Whisper model in OpenAI format to Hugging Face format.""" # Copyright 2022 The HuggingFace Inc. team and the OpenAI 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 ...
transformers/src/transformers/models/whisper/convert_openai_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/whisper/convert_openai_to_hf.py", "repo_id": "transformers", "token_count": 6393 }
691
# Dependents Dependents stats for `langchain-ai/langchain` [![](https://img.shields.io/static/v1?label=Used%20by&message=41717&color=informational&logo=slickpic)](https://github.com/langchain-ai/langchain/network/dependents) [![](https://img.shields.io/static/v1?label=Used%20by%20(public)&message=538&color=informatio...
langchain/docs/docs/additional_resources/dependents.mdx/0
{ "file_path": "langchain/docs/docs/additional_resources/dependents.mdx", "repo_id": "langchain", "token_count": 18085 }
81
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/index.md/0
{ "file_path": "diffusers/docs/source/en/index.md", "repo_id": "diffusers", "token_count": 1316 }
181
<jupyter_start><jupyter_text>HuggingFace Hub meets Amazon SageMaker Fine-tune a Multi-Class Classification with `Trainer` and `emotion` dataset and push it to the [Hugging Face Hub](https://huggingface.co/models) IntroductionWelcome to our end-to-end multi-class Text-Classification example. In this demo, we will use t...
notebooks/sagemaker/14_train_and_push_to_hub/sagemaker-notebook.ipynb/0
{ "file_path": "notebooks/sagemaker/14_train_and_push_to_hub/sagemaker-notebook.ipynb", "repo_id": "notebooks", "token_count": 3921 }
318
# coding=utf-8 # Copyright 2022 The REALM authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
transformers/src/transformers/models/realm/modeling_realm.py/0
{ "file_path": "transformers/src/transformers/models/realm/modeling_realm.py", "repo_id": "transformers", "token_count": 36138 }
731
<jupyter_start><jupyter_text>Xata> [Xata](https://xata.io) is a serverless data platform, based on PostgreSQL. It provides a Python SDK for interacting with your database, and a UI for managing your data.> Xata has a native vector type, which can be added to any table, and supports similarity search. LangChain inserts ...
langchain/docs/docs/integrations/vectorstores/xata.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/xata.ipynb", "repo_id": "langchain", "token_count": 1222 }
196
# flake8: noqa from langchain_core.prompts.prompt import PromptTemplate _CREATE_DRAFT_ANSWER_TEMPLATE = """{question}\n\n""" CREATE_DRAFT_ANSWER_PROMPT = PromptTemplate( input_variables=["question"], template=_CREATE_DRAFT_ANSWER_TEMPLATE ) _LIST_ASSERTIONS_TEMPLATE = """Here is a statement: {statement} Make a bu...
langchain/libs/langchain/langchain/chains/llm_checker/prompt.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/llm_checker/prompt.py", "repo_id": "langchain", "token_count": 385 }
460
""" Official evaluation script for v1.1 of the SQuAD dataset. """ import argparse import json import re import string import sys from collections import Counter def normalize_answer(s): """Lower text and remove punctuation, articles and extra whitespace.""" def remove_articles(text): return re.sub(r...
datasets/metrics/squad/evaluate.py/0
{ "file_path": "datasets/metrics/squad/evaluate.py", "repo_id": "datasets", "token_count": 1337 }
125
python_sources()
llama_index/llama-index-integrations/tools/llama-index-tools-yahoo-finance/llama_index/tools/yahoo_finance/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-yahoo-finance/llama_index/tools/yahoo_finance/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,505
# Copyright 2024 TSAIL Team and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
diffusers/src/diffusers/schedulers/scheduling_dpmsolver_multistep_flax.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_dpmsolver_multistep_flax.py", "repo_id": "diffusers", "token_count": 13615 }
257
from typing import Callable, Optional from llama_index.legacy.bridge.pydantic import BaseModel from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.prompts import BasePromptTemplate from llama_index.legacy.prompts.default_prompt_selectors import ( DEFAULT_REFINE_PROMPT_SEL, DEF...
llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/factory.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/factory.py", "repo_id": "llama_index", "token_count": 2064 }
1,769
use async_trait::async_trait; pub(crate) mod config; pub(crate) mod s3; #[async_trait] trait Storage { async fn get(&self, key: &str, path: &str) -> Result<(), String>; async fn put(&self, key: &str, path: &str) -> Result<(), String>; }
chroma/rust/worker/src/storage/mod.rs/0
{ "file_path": "chroma/rust/worker/src/storage/mod.rs", "repo_id": "chroma", "token_count": 103 }
62
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/mq/msgstream/mqwrapper/client.go/0
{ "file_path": "milvus/pkg/mq/msgstream/mqwrapper/client.go", "repo_id": "milvus", "token_count": 344 }
2,094
<!--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/ja/internal/modeling_utils.md/0
{ "file_path": "transformers/docs/source/ja/internal/modeling_utils.md", "repo_id": "transformers", "token_count": 821 }
537
#!/usr/bin/env python # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and 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 co...
transformers/examples/legacy/run_openai_gpt.py/0
{ "file_path": "transformers/examples/legacy/run_openai_gpt.py", "repo_id": "transformers", "token_count": 6165 }
556
// 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/querynodev2/tsafe/tsafe_test.go/0
{ "file_path": "milvus/internal/querynodev2/tsafe/tsafe_test.go", "repo_id": "milvus", "token_count": 895 }
1,775
import { NotionDBLoader } from "langchain/document_loaders/web/notiondb"; const loader = new NotionDBLoader({ pageSizeLimit: 10, databaseId: "databaseId", notionIntegrationToken: "<your token here>", // Or set as process.env.NOTION_INTEGRATION_TOKEN }); const docs = await loader.load(); console.log({ docs });
langchainjs/examples/src/document_loaders/notiondb.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/notiondb.ts", "repo_id": "langchainjs", "token_count": 102 }
799
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/output_parsers/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/output_parsers/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,530
from typing import Dict, List import pytest from llama_index.legacy.data_structs.struct_type import IndexStructType from llama_index.legacy.schema import Document from tests.mock_utils.mock_prompts import ( MOCK_INSERT_PROMPT, MOCK_KEYWORD_EXTRACT_PROMPT, MOCK_QUERY_KEYWORD_EXTRACT_PROMPT, MOCK_QUERY_...
llama_index/llama-index-legacy/tests/indices/query/conftest.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/query/conftest.py", "repo_id": "llama_index", "token_count": 925 }
1,620
// 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_always_true_expr.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_always_true_expr.cpp", "repo_id": "milvus", "token_count": 1033 }
1,682
from llama_index.core.storage.index_store.simple_index_store import ( SimpleIndexStore, ) __all__ = [ "SimpleIndexStore", ]
llama_index/llama-index-core/llama_index/core/storage/index_store/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/storage/index_store/__init__.py", "repo_id": "llama_index", "token_count": 50 }
1,250
GO ?= go PWD := $(shell pwd) GOPATH := $(shell $(GO) env GOPATH) ROOTPATH := $(abspath $(dir $(PWD))) SHELL := /bin/bash OBJPREFIX := "github.com/milvus-io/milvus/cmd/milvus" INSTALL_PATH := $(ROOTPATH)/bin # use parent getdeps getdeps: $(MAKE) -C $(ROOTPATH) getdeps generate-mockery: getdeps $(INSTALL_PATH...
milvus/pkg/Makefile/0
{ "file_path": "milvus/pkg/Makefile", "repo_id": "milvus", "token_count": 520 }
1,812
from langchain_community.document_loaders.sitemap import ( SitemapLoader, ) __all__ = [ "SitemapLoader", ]
langchain/libs/langchain/langchain/document_loaders/sitemap.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/sitemap.py", "repo_id": "langchain", "token_count": 47 }
490
from llama_index.callbacks.aim.base import AimCallback from llama_index.core.callbacks.base_handler import BaseCallbackHandler def test_class(): names_of_base_classes = [b.__name__ for b in AimCallback.__mro__] assert BaseCallbackHandler.__name__ in names_of_base_classes
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-aim/tests/test_aim_callback.py/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-aim/tests/test_aim_callback.py", "repo_id": "llama_index", "token_count": 91 }
1,181
import { ChatOpenAI } from "@langchain/openai"; import { z } from "zod"; import { zodToJsonSchema } from "zod-to-json-schema"; import { HumanMessage } from "@langchain/core/messages"; const extractionFunctionSchema = { name: "extractor", description: "Extracts fields from the input.", parameters: zodToJsonSchema...
langchainjs/examples/src/models/chat/openai_functions_zod.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/openai_functions_zod.ts", "repo_id": "langchainjs", "token_count": 625 }
839
import type { readFile as ReadFileT } from "node:fs/promises"; import { Document } from "@langchain/core/documents"; import { getEnv } from "@langchain/core/utils/env"; import { BaseDocumentLoader } from "../base.js"; /** * A class that extends the `BaseDocumentLoader` class. It represents a * document loader that l...
langchainjs/langchain/src/document_loaders/fs/text.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/fs/text.ts", "repo_id": "langchainjs", "token_count": 1312 }
968
/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Pinecone } from "@pinecone-database/pinecone"; import { OpenAIEmbeddings } from "@langchain/openai"; import { PineconeStore } from "@langchain/pinecone"; // Instantiate a new Pinecone client, which will automatically read the // env vars: PINECONE_...
langchainjs/examples/src/indexes/vector_stores/pinecone/mmr.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/pinecone/mmr.ts", "repo_id": "langchainjs", "token_count": 285 }
820
[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 = ["WeaviateRetryEnginePack"] contains_example = false import_path = "llama_index.packs.retry...
llama_index/llama-index-packs/llama-index-packs-retry-engine-weaviate/pyproject.toml/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-retry-engine-weaviate/pyproject.toml", "repo_id": "llama_index", "token_count": 718 }
1,674
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..utils import DummyObject, requires_backends class TFGPT2Tokenizer(metaclass=DummyObject): _backends = ["keras_nlp"] def __init__(self, *args, **kwargs): requires_backends(self, ["keras_nlp"])
transformers/src/transformers/utils/dummy_keras_nlp_objects.py/0
{ "file_path": "transformers/src/transformers/utils/dummy_keras_nlp_objects.py", "repo_id": "transformers", "token_count": 110 }
735
import json import logging import time import urllib.error import urllib.parse import urllib.request from typing import Any, Dict, Iterator, List from langchain_core.documents import Document from langchain_core.pydantic_v1 import BaseModel, root_validator logger = logging.getLogger(__name__) class PubMedAPIWrapper...
langchain/libs/community/langchain_community/utilities/pubmed.py/0
{ "file_path": "langchain/libs/community/langchain_community/utilities/pubmed.py", "repo_id": "langchain", "token_count": 3300 }
321
// 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/http/healthz/content_type.go/0
{ "file_path": "milvus/internal/http/healthz/content_type.go", "repo_id": "milvus", "token_count": 278 }
1,989
from llama_index.core.readers.base import BaseReader from llama_index.readers.metal import MetalReader def test_class(): names_of_base_classes = [b.__name__ for b in MetalReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-metal/tests/test_readers_metal.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-metal/tests/test_readers_metal.py", "repo_id": "llama_index", "token_count": 85 }
1,481
from langchain_community.llms.stochasticai import StochasticAI __all__ = ["StochasticAI"]
langchain/libs/langchain/langchain/llms/stochasticai.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/stochasticai.py", "repo_id": "langchain", "token_count": 31 }
520
--- sidebar_label: Baidu Wenxin --- import CodeBlock from "@theme/CodeBlock"; # ChatBaiduWenxin LangChain.js supports Baidu's ERNIE-bot family of models. Here's an example: import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx"; <IntegrationInstallTooltip></IntegrationInstallToolti...
langchainjs/docs/core_docs/docs/integrations/chat/baidu_wenxin.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat/baidu_wenxin.mdx", "repo_id": "langchainjs", "token_count": 175 }
752
# loading package files: https://stackoverflow.com/a/20885799 import importlib.resources as pkg_resources import logging from pathlib import Path from typing import Any, List, Tuple import yaml from . import resources from .deprecation_utils import deprecated BASE_REF_URL = "https://github.com/huggingface/datasets/...
datasets/src/datasets/utils/readme.py/0
{ "file_path": "datasets/src/datasets/utils/readme.py", "repo_id": "datasets", "token_count": 5742 }
159
[workspace] members = [ "benchmark", "router", "router/client", "router/grpc-metadata", "launcher" ] resolver = "2" [workspace.package] version = "1.4.0" edition = "2021" authors = ["Olivier Dehaene"] homepage = "https://github.com/huggingface/text-generation-inference" [profile.release] debug = 1...
text-generation-inference/Cargo.toml/0
{ "file_path": "text-generation-inference/Cargo.toml", "repo_id": "text-generation-inference", "token_count": 154 }
391
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/finetuning/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/finetuning/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,707
import pytest def test_invalid_auth_cred(api_wrong_cred): with pytest.raises(Exception) as e: api_wrong_cred.list_collections() assert "Unauthorized" in str(e.value) def test_server_basic_auth(api_with_server_auth): cols = api_with_server_auth.list_collections() assert len(cols) == 0
chroma/chromadb/test/auth/test_basic_auth.py/0
{ "file_path": "chroma/chromadb/test/auth/test_basic_auth.py", "repo_id": "chroma", "token_count": 129 }
21