text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
Flare Query Engine ======================= .. automodule:: llama_index.core.query_engine.flare.base :members: :inherited-members:
llama_index/docs/api_reference/query/query_engines/flare_query_engine.rst/0
{ "file_path": "llama_index/docs/api_reference/query/query_engines/flare_query_engine.rst", "repo_id": "llama_index", "token_count": 47 }
1,059
/* * 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...
milvus/pkg/mq/msgstream/msg_for_database.go/0
{ "file_path": "milvus/pkg/mq/msgstream/msg_for_database.go", "repo_id": "milvus", "token_count": 1147 }
2,098
<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/language_modeling_from_scratch-tf.ipynb/0
{ "file_path": "notebooks/examples/language_modeling_from_scratch-tf.ipynb", "repo_id": "notebooks", "token_count": 7396 }
305
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
accelerate/docs/source/usage_guides/ipex.md/0
{ "file_path": "accelerate/docs/source/usage_guides/ipex.md", "repo_id": "accelerate", "token_count": 2313 }
3
import os import sys import argparse import logging import traceback from yaml import full_load, dump from milvus_benchmark.metrics.models.server import Server from milvus_benchmark.metrics.models.hardware import Hardware from milvus_benchmark.metrics.models.env import Env from milvus_benchmark.env import get_env from...
milvus/tests/benchmark/milvus_benchmark/main.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/main.py", "repo_id": "milvus", "token_count": 5222 }
1,958
// 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/drop_alias_task_test.go/0
{ "file_path": "milvus/internal/rootcoord/drop_alias_task_test.go", "repo_id": "milvus", "token_count": 1169 }
2,056
from operator import itemgetter from typing import List, Optional, Tuple from langchain.schema import BaseMessage, format_document from langchain_community.chat_models import ChatOpenAI from langchain_community.embeddings import HuggingFaceEmbeddings from langchain_community.vectorstores.elasticsearch import Elasticse...
langchain/templates/rag-elasticsearch/rag_elasticsearch/chain.py/0
{ "file_path": "langchain/templates/rag-elasticsearch/rag_elasticsearch/chain.py", "repo_id": "langchain", "token_count": 774 }
660
from langchain_nomic import __all__ EXPECTED_ALL = [ "NomicEmbeddings", ] def test_all_imports() -> None: assert sorted(EXPECTED_ALL) == sorted(__all__)
langchain/libs/partners/nomic/tests/unit_tests/test_imports.py/0
{ "file_path": "langchain/libs/partners/nomic/tests/unit_tests/test_imports.py", "repo_id": "langchain", "token_count": 66 }
656
# coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
transformers/tests/models/gpt2/test_tokenization_gpt2.py/0
{ "file_path": "transformers/tests/models/gpt2/test_tokenization_gpt2.py", "repo_id": "transformers", "token_count": 6958 }
762
from llama_index.multi_modal_llms.replicate_multi_modal.base import ReplicateMultiModal __all__ = ["ReplicateMultiModal"]
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/__init__.py", "repo_id": "llama_index", "token_count": 43 }
1,343
import { TimeWeightedVectorStoreRetriever } from "langchain/retrievers/time_weighted"; import { MemoryVectorStore } from "langchain/vectorstores/memory"; import { OpenAIEmbeddings } from "@langchain/openai"; const vectorStore = new MemoryVectorStore(new OpenAIEmbeddings()); const retriever = new TimeWeightedVectorSto...
langchainjs/examples/src/retrievers/time-weighted-retriever.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/time-weighted-retriever.ts", "repo_id": "langchainjs", "token_count": 355 }
914
kind: IOChaos apiVersion: chaos-mesh.org/v1alpha1 metadata: name: test-pulsar-io-latency namespace: chaos-testing spec: selector: namespaces: - chaos-testing labelSelectors: component: bookkeeper release: milvus-chaos mode: all action: latency delay: 10ms methods: - read ...
milvus/tests/python_client/chaos/chaos_objects/io_latency/chaos_pulsar_io_latency.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/io_latency/chaos_pulsar_io_latency.yaml", "repo_id": "milvus", "token_count": 160 }
1,986
"""Generic utility functions.""" import contextlib import datetime import functools import importlib import warnings from importlib.metadata import version from typing import Any, Callable, Dict, Optional, Set, Tuple, Union from packaging.version import parse from requests import HTTPError, Response from langchain_co...
langchain/libs/core/langchain_core/utils/utils.py/0
{ "file_path": "langchain/libs/core/langchain_core/utils/utils.py", "repo_id": "langchain", "token_count": 2606 }
434
#!/usr/bin/env python """Endpoint shows off available playground widgets.""" import base64 from json import dumps from typing import Any, Dict, List, Tuple from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from langchain.chat_models.openai import ChatOpenAI from langchain.document_loaders....
langserve/examples/widgets/server.py/0
{ "file_path": "langserve/examples/widgets/server.py", "repo_id": "langserve", "token_count": 1462 }
1,012
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-stripe/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-stripe/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,455
python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/storage/index_store/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/storage/index_store/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,819
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/opt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/opt.md", "repo_id": "transformers", "token_count": 2500 }
490
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-couchdb/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-couchdb/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,419
# 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...
accelerate/tests/test_tpu.py/0
{ "file_path": "accelerate/tests/test_tpu.py", "repo_id": "accelerate", "token_count": 504 }
22
Delivered-To: llamaindex.test1@gmail.com Received: by 2002:a05:6000:c4:b0:337:3b67:6205 with SMTP id q4csp527938wrx; Fri, 12 Jan 2024 17:01:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDoupsKxhW35Ww3tz2FnAoUY/Jv5jU2qoLLBmO1IUFI00SYWIoFwFDiFTDSzXPS5BXYGev X-Received: by 2002:a05:620a:1009:b0:783:13c8:d5da with SM...
llama_index/docs/examples/data/email/ark-trading-jan-12-2024.eml/0
{ "file_path": "llama_index/docs/examples/data/email/ark-trading-jan-12-2024.eml", "repo_id": "llama_index", "token_count": 28609 }
1,108
# coding=utf-8 # Copyright 2022 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/examples/tensorflow/test_tensorflow_examples.py/0
{ "file_path": "transformers/examples/tensorflow/test_tensorflow_examples.py", "repo_id": "transformers", "token_count": 5442 }
598
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/models/swin/__init__.py/0
{ "file_path": "transformers/src/transformers/models/swin/__init__.py", "repo_id": "transformers", "token_count": 1111 }
697
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/deit/test_modeling_deit.py/0
{ "file_path": "transformers/tests/models/deit/test_modeling_deit.py", "repo_id": "transformers", "token_count": 7230 }
717
"""Mongo client.""" from typing import Dict, Iterable, List, Optional, Union from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class SimpleMongoReader(BaseReader): """Simple mongo reader. Concatenates each Mongo doc into Document used by LlamaIndex. Args...
llama_index/llama-index-integrations/readers/llama-index-readers-mongodb/llama_index/readers/mongodb/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mongodb/llama_index/readers/mongodb/base.py", "repo_id": "llama_index", "token_count": 1624 }
1,490
# coding=utf-8 # Copyright 2021 The Marian Team 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/licen...
transformers/src/transformers/models/marian/configuration_marian.py/0
{ "file_path": "transformers/src/transformers/models/marian/configuration_marian.py", "repo_id": "transformers", "token_count": 8188 }
708
# 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/owlvit/convert_owlvit_original_flax_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/owlvit/convert_owlvit_original_flax_to_hf.py", "repo_id": "transformers", "token_count": 6095 }
643
# coding=utf-8 # Copyright 2022 University of Wisconsin-Madison 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.o...
transformers/src/transformers/models/yoso/modeling_yoso.py/0
{ "file_path": "transformers/src/transformers/models/yoso/modeling_yoso.py", "repo_id": "transformers", "token_count": 23812 }
697
# coding=utf-8 # Copyright 2019 The Google AI Language Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
transformers/src/transformers/models/electra/modeling_electra.py/0
{ "file_path": "transformers/src/transformers/models/electra/modeling_electra.py", "repo_id": "transformers", "token_count": 32259 }
665
# 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/deprecated/mctct/modeling_mctct.py/0
{ "file_path": "transformers/src/transformers/models/deprecated/mctct/modeling_mctct.py", "repo_id": "transformers", "token_count": 14036 }
657
<!--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/ko/add_new_pipeline.md/0
{ "file_path": "transformers/docs/source/ko/add_new_pipeline.md", "repo_id": "transformers", "token_count": 7790 }
492
"""Metaphor Search API toolkit.""" from langchain_community.tools.metaphor_search.tool import MetaphorSearchResults __all__ = ["MetaphorSearchResults"]
langchain/libs/community/langchain_community/tools/metaphor_search/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/metaphor_search/__init__.py", "repo_id": "langchain", "token_count": 47 }
301
"""Generate SQL queries using LlamaIndex.""" import argparse import json import logging import os import re from typing import Any, cast from llama_index import LLMPredictor, SQLDatabase from llama_index.indices import SQLStructStoreIndex from llama_index.llms.openai import OpenAI from sqlalchemy import create_engine,...
llama_index/benchmarks/struct_indices/spider/generate_sql.py/0
{ "file_path": "llama_index/benchmarks/struct_indices/spider/generate_sql.py", "repo_id": "llama_index", "token_count": 2078 }
1,086
# LlamaIndex Llms Integration: Vllm
llama_index/llama-index-integrations/llms/llama-index-llms-vllm/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-vllm/README.md", "repo_id": "llama_index", "token_count": 12 }
1,319
import { BaseOutputParser } from "@langchain/core/output_parsers"; import { ChainValues } from "@langchain/core/utils/types"; import { CallbackManager } from "@langchain/core/callbacks/manager"; import { BaseChain } from "../../chains/base.js"; import { LLMChain } from "../../chains/llm_chain.js"; /** * Represents an...
langchainjs/langchain/src/experimental/plan_and_execute/base.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/plan_and_execute/base.ts", "repo_id": "langchainjs", "token_count": 922 }
899
"""The LangSmith Client.""" from __future__ import annotations import collections import dataclasses import datetime import functools import importlib import io import json import logging import os import random import socket import sys import threading import time import uuid import weakref from dataclasses import d...
langsmith-sdk/python/langsmith/client.py/0
{ "file_path": "langsmith-sdk/python/langsmith/client.py", "repo_id": "langsmith-sdk", "token_count": 59963 }
1,020
import type { WebSearchSource } from "./WebSearch"; export type FinalAnswer = { type: "finalAnswer"; text: string; }; export type TextStreamUpdate = { type: "stream"; token: string; }; export type AgentUpdate = { type: "agent"; agent: string; content: string; binary?: Blob; }; export type WebSearchUpdate = ...
chat-ui/src/lib/types/MessageUpdate.ts/0
{ "file_path": "chat-ui/src/lib/types/MessageUpdate.ts", "repo_id": "chat-ui", "token_count": 273 }
93
<script lang="ts"> import { createEventDispatcher, onMount } from "svelte"; export let value = ""; export let minRows = 1; export let maxRows: null | number = null; export let placeholder = ""; export let disabled = false; // Approximate width from which we disable autofocus const TABLET_VIEWPORT_WIDTH = 768; ...
chat-ui/src/lib/components/chat/ChatInput.svelte/0
{ "file_path": "chat-ui/src/lib/components/chat/ChatInput.svelte", "repo_id": "chat-ui", "token_count": 798 }
88
<!--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/it/add_new_pipeline.md/0
{ "file_path": "transformers/docs/source/it/add_new_pipeline.md", "repo_id": "transformers", "token_count": 4132 }
509
// 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/create_collection_task_test.go/0
{ "file_path": "milvus/internal/rootcoord/create_collection_task_test.go", "repo_id": "milvus", "token_count": 12335 }
1,860
# LangSmith Client SDK This package contains the TypeScript client for interacting with the [LangSmith platform](https://smith.langchain.com/). To install: ```bash yarn add langsmith ``` LangSmith helps you and your team develop and evaluate language models and intelligent agents. It is compatible with any LLM Appl...
langsmith-sdk/js/README.md/0
{ "file_path": "langsmith-sdk/js/README.md", "repo_id": "langsmith-sdk", "token_count": 5092 }
1,024
# Writer This page covers how to use the Writer ecosystem within LangChain. It is broken into two parts: installation and setup, and then references to specific Writer wrappers. ## Installation and Setup - Get an Writer api key and set it as an environment variable (`WRITER_API_KEY`) ## Wrappers ### LLM There exis...
langchain/docs/docs/integrations/providers/writer.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/writer.mdx", "repo_id": "langchain", "token_count": 113 }
153
export { CREATE_EVENT_PROMPT } from "./create-event-prompt.js"; export { VIEW_EVENTS_PROMPT } from "./view-events-prompt.js";
langchainjs/libs/langchain-community/src/tools/google_calendar/prompts/index.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/tools/google_calendar/prompts/index.ts", "repo_id": "langchainjs", "token_count": 49 }
959
from dataclasses import dataclass from ..utils import BaseOutput @dataclass class AutoencoderKLOutput(BaseOutput): """ Output of AutoencoderKL encoding method. Args: latent_dist (`DiagonalGaussianDistribution`): Encoded outputs of `Encoder` represented as the mean and logvar of `Diag...
diffusers/src/diffusers/models/modeling_outputs.py/0
{ "file_path": "diffusers/src/diffusers/models/modeling_outputs.py", "repo_id": "diffusers", "token_count": 178 }
214
# coding=utf-8 # Copyright 2022 EleutherAI The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
transformers/src/transformers/models/gpt_neox/modeling_gpt_neox.py/0
{ "file_path": "transformers/src/transformers/models/gpt_neox/modeling_gpt_neox.py", "repo_id": "transformers", "token_count": 28629 }
672
from __future__ import annotations from typing import TYPE_CHECKING import pytest from langchain_core.documents import Document from langchain_community.document_loaders import GeoDataFrameLoader if TYPE_CHECKING: from geopandas import GeoDataFrame else: GeoDataFrame = "geopandas.GeoDataFrame" @pytest.mar...
langchain/libs/community/tests/integration_tests/document_loaders/test_geodataframe.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_geodataframe.py", "repo_id": "langchain", "token_count": 504 }
344
--- sidebar_position: 1 sidebar_class_name: hidden --- # Retrieval QA This example showcases question answering over an index. import RetrievalQARunnableExample from "@examples/chains/retrieval_qa.ts"; import RetrievalQAExampleCustom from "@examples/chains/retrieval_qa_custom.ts"; import CodeBlock from "@theme/CodeB...
langchainjs/docs/core_docs/docs/modules/chains/popular/vector_db_qa.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/chains/popular/vector_db_qa.mdx", "repo_id": "langchainjs", "token_count": 627 }
753
// 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/metrics/datanode_metrics.go/0
{ "file_path": "milvus/pkg/metrics/datanode_metrics.go", "repo_id": "milvus", "token_count": 3362 }
1,810
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/wav2vec2_conformer/convert_wav2vec2_conformer_original_pytorch_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/wav2vec2_conformer/convert_wav2vec2_conformer_original_pytorch_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 6286 }
768
"""Test empty index.""" from llama_index.legacy.data_structs.data_structs import EmptyIndexStruct from llama_index.legacy.indices.empty.base import EmptyIndex from llama_index.legacy.service_context import ServiceContext def test_empty( mock_service_context: ServiceContext, ) -> None: """Test build list.""" ...
llama_index/llama-index-legacy/tests/indices/empty/test_base.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/empty/test_base.py", "repo_id": "llama_index", "token_count": 188 }
1,530
from langchain_core.tracers.log_stream import ( LogEntry, LogStreamCallbackHandler, RunLog, RunLogPatch, RunState, ) __all__ = ["LogEntry", "RunState", "RunLogPatch", "RunLog", "LogStreamCallbackHandler"]
langchain/libs/langchain/langchain/schema/callbacks/tracers/log_stream.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/callbacks/tracers/log_stream.py", "repo_id": "langchain", "token_count": 84 }
588
def notify() { if (!currentBuild.resultIsBetterOrEqualTo('SUCCESS')) { // Send an email only if the build status has changed from green/unstable to red emailext subject: '$DEFAULT_SUBJECT', body: '$DEFAULT_CONTENT', recipientProviders: [ [$class: 'DevelopersRecipientProvi...
milvus/tests/benchmark/ci/jenkinsfile/notify.groovy/0
{ "file_path": "milvus/tests/benchmark/ci/jenkinsfile/notify.groovy", "repo_id": "milvus", "token_count": 216 }
1,955
<jupyter_start><jupyter_text>OpenWeatherMapThis notebook goes over how to use the `OpenWeatherMap` component to fetch weather information.First, you need to sign up for an `OpenWeatherMap API` key:1. Go to OpenWeatherMap and sign up for an API key [here](https://openweathermap.org/api/)2. pip install pyowmThen we will ...
langchain/docs/docs/integrations/tools/openweathermap.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/openweathermap.ipynb", "repo_id": "langchain", "token_count": 775 }
182
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,334
# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors. # # 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 # # U...
datasets/src/datasets/features/features.py/0
{ "file_path": "datasets/src/datasets/features/features.py", "repo_id": "datasets", "token_count": 39695 }
139
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/unispeech_sat/convert_unispeech_sat_original_pytorch_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/unispeech_sat/convert_unispeech_sat_original_pytorch_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 4200 }
732
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-gong/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-gong/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,365
# Gradient >[Gradient](https://gradient.ai/) allows to fine tune and get completions on LLMs with a simple web API. ## Installation and Setup - Install the Python SDK : ```bash pip install gradientai ``` Get a [Gradient access token and workspace](https://gradient.ai/) and set it as an environment variable (`Gradient...
langchain/docs/docs/integrations/providers/gradient.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/gradient.mdx", "repo_id": "langchain", "token_count": 248 }
134
import os from typing import List, Union import tensorflow as tf from tensorflow_text import BertTokenizer as BertTokenizerLayer from tensorflow_text import FastBertTokenizer, ShrinkLongestTrimmer, case_fold_utf8, combine_segments, pad_model_inputs from ...modeling_tf_utils import keras from .tokenization_bert import...
transformers/src/transformers/models/bert/tokenization_bert_tf.py/0
{ "file_path": "transformers/src/transformers/models/bert/tokenization_bert_tf.py", "repo_id": "transformers", "token_count": 5226 }
608
import { PrismaVectorStore } from "@langchain/community/vectorstores/prisma"; import { OpenAIEmbeddings } from "@langchain/openai"; import { PrismaClient, Prisma, Document } from "@prisma/client"; export const run = async () => { const db = new PrismaClient(); // Use the `withModel` method to get proper type hint...
langchainjs/examples/src/indexes/vector_stores/prisma_vectorstore/prisma.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/prisma_vectorstore/prisma.ts", "repo_id": "langchainjs", "token_count": 633 }
879
from typing import Literal, Optional, Type, TypedDict from langchain_core.pydantic_v1 import BaseModel from langchain_core.utils.json_schema import dereference_refs class FunctionDescription(TypedDict): """Representation of a callable function to the Ernie API.""" name: str """The name of the function."...
langchain/libs/community/langchain_community/utils/ernie_functions.py/0
{ "file_path": "langchain/libs/community/langchain_community/utils/ernie_functions.py", "repo_id": "langchain", "token_count": 509 }
324
"""Tool for asking for human input.""" from langchain_community.tools.human.tool import HumanInputRun __all__ = ["HumanInputRun"]
langchain/libs/langchain/langchain/tools/human/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/human/__init__.py", "repo_id": "langchain", "token_count": 38 }
581
aml target server/transformers server/flash-attention
text-generation-inference/.dockerignore/0
{ "file_path": "text-generation-inference/.dockerignore", "repo_id": "text-generation-inference", "token_count": 16 }
411
# coding=utf-8 # Copyright 2023 The Meta AI Team 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 compliance with the License. # You may obtain a copy of the Li...
transformers/src/transformers/models/xmod/configuration_xmod.py/0
{ "file_path": "transformers/src/transformers/models/xmod/configuration_xmod.py", "repo_id": "transformers", "token_count": 3839 }
758
ann_accuracy: collections: - milvus: cache_config.cpu_cache_capacity: 16GB engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: true gpu_resource_config.cache_capacity: 4GB gpu_resource_config.search_resource...
milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_accuracy_ann.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_accuracy_ann.yaml", "repo_id": "milvus", "token_count": 2691 }
1,864
python_sources()
llama_index/llama-index-core/llama_index/core/embeddings/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/embeddings/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,168
import { zodToJsonSchema } from "zod-to-json-schema"; import { StructuredToolInterface } from "../tools.js"; import { FunctionDefinition, ToolDefinition } from "../language_models/base.js"; /** * Formats a `StructuredTool` instance into a format that is compatible * with OpenAI function calling. It uses the `zodToJs...
langchainjs/langchain-core/src/utils/function_calling.ts/0
{ "file_path": "langchainjs/langchain-core/src/utils/function_calling.ts", "repo_id": "langchainjs", "token_count": 337 }
871
from llama_index.postprocessor.flag_embedding_reranker.base import FlagEmbeddingReranker __all__ = ["FlagEmbeddingReranker"]
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-flag-embedding-reranker/llama_index/postprocessor/flag_embedding_reranker/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-flag-embedding-reranker/llama_index/postprocessor/flag_embedding_reranker/__init__.py", "repo_id": "llama_index", "token_count": 45 }
1,262
from typing import Any, Dict from langchain_core.documents import Document from pytest_mock import MockerFixture from langchain_community.retrievers import RemoteLangChainRetriever class MockResponse: def __init__(self, json_data: Dict, status_code: int): self.json_data = json_data self.status_c...
langchain/libs/community/tests/unit_tests/retrievers/test_remote_retriever.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/retrievers/test_remote_retriever.py", "repo_id": "langchain", "token_count": 798 }
404
<jupyter_start><jupyter_text>EverlyAI If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-everlyai !pip install llama-index from llama_index.llms.everlyai import EverlyAI from llama_index.core.llms import ChatMessage<jupyter_output><empty...
llama_index/docs/examples/llm/everlyai.ipynb/0
{ "file_path": "llama_index/docs/examples/llm/everlyai.ipynb", "repo_id": "llama_index", "token_count": 922 }
1,108
package dao import ( "testing" "github.com/pingcap/log" "go.uber.org/zap" "github.com/chroma/chroma-coordinator/internal/common" "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel" "github.com/chroma/chroma-coordinator/internal/types" "github.com/stretchr/testify/assert" "gorm.io/driver/sqli...
chroma/go/coordinator/internal/metastore/db/dao/collection_test.go/0
{ "file_path": "chroma/go/coordinator/internal/metastore/db/dao/collection_test.go", "repo_id": "chroma", "token_count": 1136 }
49
from typing import Union from ..utils import add_end_docstrings, is_torch_available, is_vision_available, logging from .base import Pipeline, build_pipeline_init_args if is_vision_available(): from PIL import Image from ..image_utils import load_image if is_torch_available(): from ..models.auto.modelin...
transformers/src/transformers/pipelines/visual_question_answering.py/0
{ "file_path": "transformers/src/transformers/pipelines/visual_question_answering.py", "repo_id": "transformers", "token_count": 2734 }
779
"""Test ChatFireworks wrapper.""" import sys from typing import cast import pytest from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage from langchain_core.outputs import ChatGeneration, ChatResult, LLMResult from langchain_community.chat_models.fireworks import ChatFireworks if sys.version_i...
langchain/libs/community/tests/integration_tests/chat_models/test_fireworks.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/chat_models/test_fireworks.py", "repo_id": "langchain", "token_count": 2201 }
349
"""Base vector store index. An index that is built on top of an existing vector store. """ import logging from typing import Any, Dict, List, Optional, Sequence from llama_index.legacy.async_utils import run_async_tasks from llama_index.legacy.core.base_retriever import BaseRetriever from llama_index.legacy.data_st...
llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/base.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/base.py", "repo_id": "llama_index", "token_count": 6287 }
1,579
from typing import Any, List, Tuple from langchain_community.document_loaders.parsers.language.code_segmenter import ( CodeSegmenter, ) class JavaScriptSegmenter(CodeSegmenter): """Code segmenter for JavaScript.""" def __init__(self, code: str): super().__init__(code) self.source_lines =...
langchain/libs/community/langchain_community/document_loaders/parsers/language/javascript.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/parsers/language/javascript.py", "repo_id": "langchain", "token_count": 1019 }
257
import { AzureOpenAIEmbeddings } from "@langchain/azure-openai"; const model = new AzureOpenAIEmbeddings(); const res = await model.embedQuery( "What would be a good company name for a company that makes colorful socks?" ); console.log({ res });
langchainjs/examples/src/embeddings/azure_openai.ts/0
{ "file_path": "langchainjs/examples/src/embeddings/azure_openai.ts", "repo_id": "langchainjs", "token_count": 73 }
773
// eslint-disable-next-line @typescript-eslint/no-explicit-any export function zipEntries<T extends any[]>( ...arrays: { [P in keyof T]: T[P][]; } ): T[] { // Check for empty input if (arrays.length === 0) { return []; } // Find the length of the first input array const firstArrayLength = arrays[...
langchainjs/langchain/src/chains/router/utils.ts/0
{ "file_path": "langchainjs/langchain/src/chains/router/utils.ts", "repo_id": "langchainjs", "token_count": 384 }
894
import { ExaRetriever } from "@langchain/exa"; import Exa from "exa-js"; const retriever = new ExaRetriever({ // @ts-expect-error Some TS Config's will cause this to give a TypeScript error, even though it works. client: new Exa( process.env.EXASEARCH_API_KEY // default API key ), }); const retrievedDocs = ...
langchainjs/examples/src/retrievers/exa.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/exa.ts", "repo_id": "langchainjs", "token_count": 1804 }
820
# coding=utf-8 # Copyright 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 requir...
transformers/src/transformers/models/layoutlmv3/tokenization_layoutlmv3.py/0
{ "file_path": "transformers/src/transformers/models/layoutlmv3/tokenization_layoutlmv3.py", "repo_id": "transformers", "token_count": 32867 }
688
import { CheerioWebBaseLoader } from "langchain/document_loaders/web/cheerio"; export const run = async () => { const loader = new CheerioWebBaseLoader( "https://news.ycombinator.com/item?id=34817881" ); const docs = await loader.load(); console.log({ docs }); };
langchainjs/examples/src/document_loaders/cheerio_web.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/cheerio_web.ts", "repo_id": "langchainjs", "token_count": 97 }
797
from langchain_community.embeddings.mlflow_gateway import ( MlflowAIGatewayEmbeddings, ) __all__ = ["MlflowAIGatewayEmbeddings"]
langchain/libs/langchain/langchain/embeddings/mlflow_gateway.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/mlflow_gateway.py", "repo_id": "langchain", "token_count": 54 }
534
mod hnsw; mod types; mod utils; // Re-export types pub(crate) use hnsw::*; pub(crate) use types::*;
chroma/rust/worker/src/index/mod.rs/0
{ "file_path": "chroma/rust/worker/src/index/mod.rs", "repo_id": "chroma", "token_count": 46 }
61
# coding=utf-8 # Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
alignment-handbook/src/alignment/data.py/0
{ "file_path": "alignment-handbook/src/alignment/data.py", "repo_id": "alignment-handbook", "token_count": 3473 }
23
[comment: Please, a reference example here "docs/integrations/arxiv.md"]:: [comment: Use this template to create a new .md file in "docs/integrations/"]:: # Title_REPLACE_ME [comment: Only one Tile/H1 is allowed!]:: > [comment: Description: After reading this description, a reader should decide if this integration i...
langchain/docs/docs/_templates/integration.mdx/0
{ "file_path": "langchain/docs/docs/_templates/integration.mdx", "repo_id": "langchain", "token_count": 559 }
81
version: '3.5' services: etcd: container_name: milvus-etcd image: quay.io/coreos/etcd:v3.5.0 environment: - ETCD_AUTO_COMPACTION_MODE=revision - ETCD_AUTO_COMPACTION_RETENTION=1000 - ETCD_QUOTA_BACKEND_BYTES=4294967296 volumes: - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etc...
milvus/tests/python_client/deploy/standalone/docker-compose.yml/0
{ "file_path": "milvus/tests/python_client/deploy/standalone/docker-compose.yml", "repo_id": "milvus", "token_count": 648 }
2,123
--- sidebar_label: Tracing sidebar_position: 2 --- # Tracing your code Tracing allows for seamless debugging and improvement of your LLM applications. Here's how: - [Tracing without LangChain](./traceable/tracing_without_langchain.ipynb): learn to trace applications independent of LangChain using the Python SDK's @t...
langsmith-cookbook/tracing-examples/README.md/0
{ "file_path": "langsmith-cookbook/tracing-examples/README.md", "repo_id": "langsmith-cookbook", "token_count": 356 }
1,042
# Guarantee Timestamp in Search Requests [中文文档](./how-guarantee-ts-works-cn.md) Users and developers may feel confused by so many parameters in the search requests, especially for those developers who develop the SDK client for Milvus. This document will explain a special parameter in the search request-"Guarantee T...
milvus/docs/developer_guides/how-guarantee-ts-works.md/0
{ "file_path": "milvus/docs/developer_guides/how-guarantee-ts-works.md", "repo_id": "milvus", "token_count": 1056 }
1,634
# CHANGELOG ## [0.1.0] - 2024-02-15 - Initial release of cli (ripped out from core)
llama_index/llama-index-cli/CHANGELOG.MD/0
{ "file_path": "llama_index/llama-index-cli/CHANGELOG.MD", "repo_id": "llama_index", "token_count": 37 }
1,192
"""Optimization related classes and functions.""" import logging from typing import Callable, List, Optional from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.indices.query.embedding_utils import get_top_k_embeddings f...
llama_index/llama-index-core/llama_index/core/postprocessor/optimizer.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/postprocessor/optimizer.py", "repo_id": "llama_index", "token_count": 2944 }
1,283
#!/usr/bin/env python # HF Trainer benchmarking tool # # This tool can be used to run and compare multiple dimensions of the HF Trainers args. # # It then prints a report once in github format with all the information that needs to be shared # with others and second time in a console-friendly format, so it's easier to...
transformers/scripts/benchmark/trainer-benchmark.py/0
{ "file_path": "transformers/scripts/benchmark/trainer-benchmark.py", "repo_id": "transformers", "token_count": 6336 }
612
"""Test conversation chain and memory.""" from langchain_community.llms.fake import FakeListLLM from langchain_core.documents import Document from langchain_core.prompts.prompt import PromptTemplate from langchain.chains import create_retrieval_chain from tests.unit_tests.retrievers.parrot_retriever import FakeParrotR...
langchain/libs/langchain/tests/unit_tests/chains/test_retrieval.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/chains/test_retrieval.py", "repo_id": "langchain", "token_count": 329 }
626
python_sources()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-weaviate/llama_index/vector_stores/weaviate/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-weaviate/llama_index/vector_stores/weaviate/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,631
from langchain import callbacks from tests.unit_tests import assert_all_importable EXPECTED_ALL = [ "AimCallbackHandler", "ArgillaCallbackHandler", "ArizeCallbackHandler", "PromptLayerCallbackHandler", "ArthurCallbackHandler", "ClearMLCallbackHandler", "CometCallbackHandler", "ContextCa...
langchain/libs/langchain/tests/unit_tests/callbacks/test_imports.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/callbacks/test_imports.py", "repo_id": "langchain", "token_count": 429 }
590
window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-TVSL7JBE9Y');
langchainjs/docs/core_docs/static/js/google_analytics.js/0
{ "file_path": "langchainjs/docs/core_docs/static/js/google_analytics.js", "repo_id": "langchainjs", "token_count": 52 }
828
--- hide_table_of_contents: true --- import CodeBlock from "@theme/CodeBlock"; # Discord Tool The Discord Tool gives your agent the ability to search, read, and write messages to discord channels. It is useful for when you need to interact with a discord channel. ## Setup To use the Discord Tool you need to instal...
langchainjs/docs/core_docs/docs/integrations/tools/discord.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/tools/discord.mdx", "repo_id": "langchainjs", "token_count": 260 }
740
package coordinator import ( "context" "testing" "github.com/chroma/chroma-coordinator/internal/common" "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel" "github.com/chroma/chroma-coordinator/internal/metastore/db/dbmodel/mocks" "github.com/chroma/chroma-coordinator/internal/model" "github.c...
chroma/go/coordinator/internal/metastore/coordinator/table_catalog_test.go/0
{ "file_path": "chroma/go/coordinator/internal/metastore/coordinator/table_catalog_test.go", "repo_id": "chroma", "token_count": 1593 }
45
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-gpt-repo/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-gpt-repo/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,379
<jupyter_start><jupyter_text>Fine-tuning Stable Diffusion XL with DreamBooth and LoRA on a free-tier Colab Notebook 🧨In this notebook, we show how to fine-tune [Stable Diffusion XL (SDXL)](https://huggingface.co/docs/diffusers/main/en/api/pipelines/stable_diffusion/stable_diffusion_xl) with [DreamBooth](https://huggin...
notebooks/diffusers/SDXL_DreamBooth_LoRA_.ipynb/0
{ "file_path": "notebooks/diffusers/SDXL_DreamBooth_LoRA_.ipynb", "repo_id": "notebooks", "token_count": 4896 }
317
"""Tools for interacting with a JSON file."""
langchain/libs/langchain/langchain/tools/json/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/json/__init__.py", "repo_id": "langchain", "token_count": 11 }
592
# Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
transformers/src/transformers/models/speech_to_text/convert_s2t_fairseq_to_tfms.py/0
{ "file_path": "transformers/src/transformers/models/speech_to_text/convert_s2t_fairseq_to_tfms.py", "repo_id": "transformers", "token_count": 1824 }
657
/** * Welcome to Cloudflare Workers! This is your first worker. * * - Run `wrangler dev src/index.ts` in your terminal to start a development server * - Open a browser tab at http://localhost:8787/ to see your worker in action * - Run `wrangler deploy src/index.ts --name my-worker` to publish your worker * * Lea...
langchainjs/environment_tests/test-exports-cf/src/index.ts/0
{ "file_path": "langchainjs/environment_tests/test-exports-cf/src/index.ts", "repo_id": "langchainjs", "token_count": 853 }
775