text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
package indexnode import "math/rand" const ( dim = 8 nb = 10000 nprobe = 8 ) func generateFloatVectors() []float32 { vectors := make([]float32, 0) for i := 0; i < nb; i++ { for j := 0; j < dim; j++ { vectors = append(vectors, rand.Float32()) } } return vectors } func generateBinaryVectors() []b...
milvus/internal/indexnode/index_test.go/0
{ "file_path": "milvus/internal/indexnode/index_test.go", "repo_id": "milvus", "token_count": 219 }
1,937
from llama_index.readers.file.html.base import HTMLTagReader __all__ = ["HTMLTagReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/html/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/html/__init__.py", "repo_id": "llama_index", "token_count": 30 }
1,315
"""Module includes a registry of default parser configurations.""" from langchain_community.document_loaders.base import BaseBlobParser from langchain_community.document_loaders.parsers.generic import MimeTypeBasedParser from langchain_community.document_loaders.parsers.msword import MsWordParser from langchain_communi...
langchain/libs/community/langchain_community/document_loaders/parsers/registry.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/parsers/registry.py", "repo_id": "langchain", "token_count": 446 }
241
from langchain_community.document_transformers.doctran_text_translate import ( DoctranTextTranslator, ) __all__ = ["DoctranTextTranslator"]
langchain/libs/langchain/langchain/document_transformers/doctran_text_translate.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_transformers/doctran_text_translate.py", "repo_id": "langchain", "token_count": 48 }
494
python_sources()
llama_index/llama-index-packs/llama-index-packs-neo4j-query-engine/llama_index/packs/neo4j_query_engine/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-neo4j-query-engine/llama_index/packs/neo4j_query_engine/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,596
<jupyter_start><jupyter_code>import openai openai.api_key = "sk-your-key" from llama_index.agent import OpenAIAgent # Import and initialize our tool spec from llama_index.tools.text_to_image.base import TextToImageToolSpec text_to_image_spec = TextToImageToolSpec() tools = text_to_image_spec.to_tool_list() # Create t...
llama_index/llama-index-integrations/tools/llama-index-tools-text-to-image/examples/text_to_image.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-text-to-image/examples/text_to_image.ipynb", "repo_id": "llama_index", "token_count": 791 }
1,440
use crate::models::with_tracing::QMatMul; use crate::quantized_var_builder::VarBuilder; use candle::{Module, Result, Tensor}; #[derive(Debug, Clone)] pub struct Embedding { inner: candle_nn::Embedding, span: tracing::Span, } impl Embedding { pub fn new(d1: usize, d2: usize, vb: VarBuilder) -> Result<Self>...
candle/candle-transformers/src/quantized_nn.rs/0
{ "file_path": "candle/candle-transformers/src/quantized_nn.rs", "repo_id": "candle", "token_count": 1282 }
80
"""Test manifest integration.""" from langchain_community.llms.manifest import ManifestWrapper def test_manifest_wrapper() -> None: """Test manifest wrapper.""" from manifest import Manifest manifest = Manifest(client_name="openai") llm = ManifestWrapper(client=manifest, llm_kwargs={"temperature": 0}...
langchain/libs/community/tests/integration_tests/llms/test_manifest.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_manifest.py", "repo_id": "langchain", "token_count": 126 }
339
// 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/log/mlogger.go/0
{ "file_path": "milvus/pkg/log/mlogger.go", "repo_id": "milvus", "token_count": 857 }
2,089
<!--- 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 ...
transformers/examples/pytorch/speech-pretraining/README.md/0
{ "file_path": "transformers/examples/pytorch/speech-pretraining/README.md", "repo_id": "transformers", "token_count": 2600 }
552
"""Gmail tools.""" from langchain_community.tools.gmail.create_draft import GmailCreateDraft from langchain_community.tools.gmail.get_message import GmailGetMessage from langchain_community.tools.gmail.get_thread import GmailGetThread from langchain_community.tools.gmail.search import GmailSearch from langchain_commun...
langchain/libs/community/langchain_community/tools/gmail/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/gmail/__init__.py", "repo_id": "langchain", "token_count": 186 }
287
"""Pandas output parser.""" import logging from typing import Any, Dict, Optional import numpy as np import pandas as pd from llama_index.core.exec_utils import safe_eval, safe_exec from llama_index.core.output_parsers.base import ChainableOutputParser from llama_index.core.output_parsers.utils import parse_code_mark...
llama_index/llama-index-core/llama_index/core/query_engine/pandas/output_parser.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/query_engine/pandas/output_parser.py", "repo_id": "llama_index", "token_count": 1201 }
1,169
from pathlib import Path from typing import Dict, List, Optional from llama_index.legacy.readers.base import BaseReader from llama_index.legacy.schema import Document, ImageDocument from llama_index.legacy.utils import infer_torch_device class ImageVisionLLMReader(BaseReader): """Image parser. Caption image...
llama_index/llama-index-legacy/llama_index/legacy/readers/file/image_vision_llm_reader.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/file/image_vision_llm_reader.py", "repo_id": "llama_index", "token_count": 1407 }
1,761
from llama_index.legacy.prompts.base import PromptTemplate from llama_index.legacy.prompts.prompt_type import PromptType """Single select prompt. PromptTemplate to select one out of `num_choices` options provided in `context_list`, given a query `query_str`. Required template variables: `num_chunks`, `context_list`,...
llama_index/llama-index-legacy/llama_index/legacy/selectors/prompts.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/selectors/prompts.py", "repo_id": "llama_index", "token_count": 1001 }
1,713
"""Utilities to init Vertex AI.""" from importlib import metadata from typing import TYPE_CHECKING, Any, Callable, Optional, Union from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.language_models.llms import BaseLLM, create_base_retry_decorat...
langchain/libs/community/langchain_community/utilities/vertexai.py/0
{ "file_path": "langchain/libs/community/langchain_community/utilities/vertexai.py", "repo_id": "langchain", "token_count": 1528 }
305
<jupyter_start><jupyter_text><jupyter_code># DashScope Embeddings<jupyter_output><empty_output><jupyter_text>If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index %pip install -U dashscope # Set API key %env DASHSCOPE_API_KEY=YOUR_DASHSCOPE_API_...
llama_index/docs/examples/embeddings/dashscope_embeddings.ipynb/0
{ "file_path": "llama_index/docs/examples/embeddings/dashscope_embeddings.ipynb", "repo_id": "llama_index", "token_count": 1463 }
1,133
<jupyter_start><jupyter_text>ManifestThis notebook goes over how to use Manifest and LangChain. For more detailed information on `manifest`, and how to use it with local huggingface models like in this example, see https://github.com/HazyResearch/manifestAnother example of [using Manifest with Langchain](https://github...
langchain/docs/docs/integrations/llms/manifest.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/manifest.ipynb", "repo_id": "langchain", "token_count": 991 }
119
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use anyhow::{Error as E, Result}; use clap::Parser; use candle_transformers::models::mpt::{Config, Model as M}; use candle_transformers::models::quantized_mpt::Model as Q; use candle::{DType, Device, Tens...
candle/candle-examples/examples/replit-code/main.rs/0
{ "file_path": "candle/candle-examples/examples/replit-code/main.rs", "repo_id": "candle", "token_count": 3752 }
46
import { test } from "@jest/globals"; import { FakeLLM } from "../../utils/testing/index.js"; test("Test FakeLLM uses callbacks", async () => { const model = new FakeLLM({}); let acc = ""; const response = await model.invoke("Hello there!", { callbacks: [ { handleLLMNewToken: (token: string) =>...
langchainjs/langchain-core/src/language_models/tests/llms.test.ts/0
{ "file_path": "langchainjs/langchain-core/src/language_models/tests/llms.test.ts", "repo_id": "langchainjs", "token_count": 379 }
862
<!--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/es/preprocessing.md/0
{ "file_path": "transformers/docs/source/es/preprocessing.md", "repo_id": "transformers", "token_count": 13015 }
504
python_tests( interpreter_constraints=["==3.10.*"], )
llama_index/llama-index-integrations/llms/llama-index-llms-watsonx/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-watsonx/tests/BUILD", "repo_id": "llama_index", "token_count": 22 }
1,243
"""Init file."""
llama_index/llama-index-legacy/tests/readers/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/readers/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,565
# coding=utf-8 # Copyright 2023 The Fairseq Authors, Microsoft Research, 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...
transformers/src/transformers/models/speecht5/configuration_speecht5.py/0
{ "file_path": "transformers/src/transformers/models/speecht5/configuration_speecht5.py", "repo_id": "transformers", "token_count": 9376 }
724
// 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/observers/task_dispatcher.go/0
{ "file_path": "milvus/internal/querycoordv2/observers/task_dispatcher.go", "repo_id": "milvus", "token_count": 1071 }
1,834
# coding=utf-8 # Copyright 2018 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/auto/tokenization_auto.py/0
{ "file_path": "transformers/src/transformers/models/auto/tokenization_auto.py", "repo_id": "transformers", "token_count": 20599 }
619
<jupyter_start><jupyter_text>LOTR (Merger Retriever)`Lord of the Retrievers`, also known as `MergerRetriever`, takes a list of retrievers as input and merges the results of their get_relevant_documents() methods into a single list. The merged results will be a list of documents that are relevant to the query and that h...
langchain/docs/docs/integrations/retrievers/merger_retriever.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/retrievers/merger_retriever.ipynb", "repo_id": "langchain", "token_count": 1521 }
154
# Contributing to LangChain 👋 Hi there! Thank you for being interested in contributing to LangChain. As an open source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infra, or better documentation. To contribute to this project, ple...
langchainjs/CONTRIBUTING.md/0
{ "file_path": "langchainjs/CONTRIBUTING.md", "repo_id": "langchainjs", "token_count": 3928 }
740
from dataclasses import dataclass from typing import TYPE_CHECKING, List, Optional, Union import numpy as np import PIL from PIL import Image from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_torch_available, is_transformers_...
diffusers/src/diffusers/pipelines/paint_by_example/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/paint_by_example/__init__.py", "repo_id": "diffusers", "token_count": 599 }
260
"""Guardrails output parser. See https://github.com/ShreyaR/guardrails. """ from deprecated import deprecated from llama_index.legacy.output_parsers.base import ChainableOutputParser try: from guardrails import Guard except ImportError: Guard = None PromptCallable = None from copy import deepcopy from...
llama_index/llama-index-legacy/llama_index/legacy/output_parsers/guardrails.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/output_parsers/guardrails.py", "repo_id": "llama_index", "token_count": 1272 }
1,691
import { HNLoader } from "langchain/document_loaders/web/hn"; export const run = async () => { const loader = new HNLoader("https://news.ycombinator.com/item?id=34817881"); const docs = await loader.load(); console.log({ docs }); };
langchainjs/examples/src/document_loaders/hn.ts/0
{ "file_path": "langchainjs/examples/src/document_loaders/hn.ts", "repo_id": "langchainjs", "token_count": 81 }
770
syntax = "proto3"; package milvus.proto.plan; option go_package = "github.com/milvus-io/milvus/internal/proto/planpb"; import "schema.proto"; enum OpType { Invalid = 0; GreaterThan = 1; GreaterEqual = 2; LessThan = 3; LessEqual = 4; Equal = 5; NotEqual = 6; PrefixMatch = 7; // startsWith PostfixMat...
milvus/internal/proto/plan.proto/0
{ "file_path": "milvus/internal/proto/plan.proto", "repo_id": "milvus", "token_count": 1606 }
2,010
"""Merriam-Webster API toolkit."""
langchain/libs/langchain/langchain/tools/merriam_webster/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/merriam_webster/__init__.py", "repo_id": "langchain", "token_count": 13 }
564
# `tokenizers-android-arm-eabi` This is the **armv7-linux-androideabi** binary for `tokenizers`
tokenizers/bindings/node/npm/android-arm-eabi/README.md/0
{ "file_path": "tokenizers/bindings/node/npm/android-arm-eabi/README.md", "repo_id": "tokenizers", "token_count": 35 }
427
// 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/kv/tikv/txn_tikv_test.go/0
{ "file_path": "milvus/internal/kv/tikv/txn_tikv_test.go", "repo_id": "milvus", "token_count": 7276 }
1,719
<jupyter_start><jupyter_text>Telegram>[Telegram Messenger](https://web.telegram.org/a/) is a globally accessible freemium, cross-platform, encrypted, cloud-based and centralized instant messaging service. The application also provides optional end-to-end encrypted chats and video calling, VoIP, file sharing and several...
langchain/docs/docs/integrations/document_loaders/telegram.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/telegram.ipynb", "repo_id": "langchain", "token_count": 398 }
115
{ "name": "core_docs", "version": "0.0.0", "private": true, "scripts": { "docusaurus": "docusaurus", "start": "yarn build:typedoc && rimraf ./docs/api && NODE_OPTIONS=--max-old-space-size=7168 docusaurus start", "build": "yarn clean && yarn build:typedoc && yarn quarto && rimraf ./build && NODE_OPTI...
langchainjs/docs/core_docs/package.json/0
{ "file_path": "langchainjs/docs/core_docs/package.json", "repo_id": "langchainjs", "token_count": 1426 }
771
"""Tool for the SearchApi.io search API.""" from typing import Optional from langchain_core.callbacks import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) from langchain_core.pydantic_v1 import Field from langchain_core.tools import BaseTool from langchain_community.utilities.searchapi impor...
langchain/libs/community/langchain_community/tools/searchapi/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/searchapi/tool.py", "repo_id": "langchain", "token_count": 804 }
294
from __future__ import annotations import json from abc import ABC, abstractmethod from pathlib import Path from typing import ( TYPE_CHECKING, Any, Callable, Dict, Generic, List, Mapping, Optional, Type, TypeVar, Union, ) import yaml from langchain_core.output_parsers.bas...
langchain/libs/core/langchain_core/prompts/base.py/0
{ "file_path": "langchain/libs/core/langchain_core/prompts/base.py", "repo_id": "langchain", "token_count": 3883 }
395
# Copyright 2022 The HuggingFace 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 # # Unless required by applicable law or ...
datasets/metrics/mean_iou/mean_iou.py/0
{ "file_path": "datasets/metrics/mean_iou/mean_iou.py", "repo_id": "datasets", "token_count": 5236 }
131
// If you want to import the browser version, use the following line instead: // import { CloseVectorWeb } from "@langchain/community/vectorstores/closevector/web"; import { CloseVectorNode } from "@langchain/community/vectorstores/closevector/node"; import { OpenAIEmbeddings } from "@langchain/openai"; export const r...
langchainjs/examples/src/indexes/vector_stores/closevector.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/closevector.ts", "repo_id": "langchainjs", "token_count": 223 }
846
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-twitter/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-twitter/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,561
/* eslint-disable spaced-comment */ // eslint-disable-next-line import/no-extraneous-dependencies import { internalQueryGeneric as internalQuery, internalMutationGeneric as internalMutation, } from "convex/server"; // eslint-disable-next-line import/no-extraneous-dependencies import { GenericId, v } from "convex/v...
langchainjs/libs/langchain-community/src/utils/convex.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/utils/convex.ts", "repo_id": "langchainjs", "token_count": 938 }
963
""" **LangChain NVIDIA AI Foundation Model Playground Integration** This comprehensive module integrates NVIDIA's state-of-the-art AI Foundation Models, featuring advanced models for conversational AI and semantic embeddings, into the LangChain framework. It provides robust classes for seamless interaction with NVIDIA...
langchain/libs/partners/nvidia-ai-endpoints/langchain_nvidia_ai_endpoints/__init__.py/0
{ "file_path": "langchain/libs/partners/nvidia-ai-endpoints/langchain_nvidia_ai_endpoints/__init__.py", "repo_id": "langchain", "token_count": 499 }
630
import { byteLevelPreTokenizer, metaspacePreTokenizer, punctuationPreTokenizer, sequencePreTokenizer, splitPreTokenizer, whitespaceSplitPreTokenizer, } from '../../' describe('byteLevelPreTokenizer', () => { it('instantiates correctly', () => { const processor = byteLevelPreTokenizer() expect(pro...
tokenizers/bindings/node/lib/bindings/pre-tokenizers.test.ts/0
{ "file_path": "tokenizers/bindings/node/lib/bindings/pre-tokenizers.test.ts", "repo_id": "tokenizers", "token_count": 728 }
453
<jupyter_start><jupyter_text>Unit 2: Q-Learning with FrozenLake-v1 ⛄ and Taxi-v3 🚕In this notebook, **you'll code your first Reinforcement Learning agent from scratch** to play FrozenLake ❄️ using Q-Learning, share it with the community, and experiment with different configurations.⬇️ Here is an example of what **you ...
deep-rl-class/notebooks/unit2/unit2.ipynb/0
{ "file_path": "deep-rl-class/notebooks/unit2/unit2.ipynb", "repo_id": "deep-rl-class", "token_count": 11160 }
155
import { GoogleAuth, GoogleAuthOptions } from "google-auth-library"; import { Embeddings, EmbeddingsParams } from "@langchain/core/embeddings"; import { AsyncCallerCallOptions } from "@langchain/core/utils/async_caller"; import { chunkArray } from "@langchain/core/utils/chunk_array"; import { GoogleVertexAIBasePredic...
langchainjs/libs/langchain-community/src/embeddings/googlevertexai.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/embeddings/googlevertexai.ts", "repo_id": "langchainjs", "token_count": 1568 }
986
package proxy import ( "context" "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/planpb" ) type milvusReducer interface { Reduce([]*internalpb.Retrie...
milvus/internal/proxy/reducer.go/0
{ "file_path": "milvus/internal/proxy/reducer.go", "repo_id": "milvus", "token_count": 286 }
1,850
import { OpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; import * as fs from "fs"; import { loadQAMapReduceChain } from "langchain/chains"; // Initialize the LLM to use to...
langchainjs/examples/src/chains/retrieval_qa_custom.ts/0
{ "file_path": "langchainjs/examples/src/chains/retrieval_qa_custom.ts", "repo_id": "langchainjs", "token_count": 356 }
793
from langchain_core.utils.json_schema import ( _dereference_refs_helper, _infer_skip_keys, _retrieve_ref, dereference_refs, ) __all__ = [ "_retrieve_ref", "_dereference_refs_helper", "_infer_skip_keys", "dereference_refs", ]
langchain/libs/langchain/langchain/utils/json_schema.py/0
{ "file_path": "langchain/libs/langchain/langchain/utils/json_schema.py", "repo_id": "langchain", "token_count": 122 }
571
"""Hugging Face Chat Wrapper.""" from typing import Any, List, Optional, Union from langchain_core.callbacks.manager import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.language_models.chat_models import BaseChatModel from langchain_core.messages import ( AIMessage, ...
langchain/libs/community/langchain_community/chat_models/huggingface.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_models/huggingface.py", "repo_id": "langchain", "token_count": 2304 }
239
"""Utilities for response.""" from typing import Generator def get_response_text(response_gen: Generator) -> str: """Get response text.""" response_text = "" for response in response_gen: response_text += response return response_text
llama_index/llama-index-legacy/llama_index/legacy/response/utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/response/utils.py", "repo_id": "llama_index", "token_count": 83 }
1,709
BENCHMARK_SCRIPT="benchmark/benchmark_level1.sh" \ BENCHMARK_PLOT_SCRIPT="benchmark/benchmark_level1_plot.sh" \ bash benchmark/benchmark_and_report.sh
trl/benchmark/regression_test.sh/0
{ "file_path": "trl/benchmark/regression_test.sh", "repo_id": "trl", "token_count": 60 }
862
package model const ( NotificationTypeCreateCollection = "create_collection" NotificationTypeDeleteCollection = "delete_collection" ) const ( NotificationStatusPending = "pending" ) type Notification struct { ID int64 CollectionID string Type string Status string }
chroma/go/coordinator/internal/model/notification.go/0
{ "file_path": "chroma/go/coordinator/internal/model/notification.go", "repo_id": "chroma", "token_count": 103 }
49
version: '3' services: langchain-streamlit-agent: image: langchain-streamlit-agent:latest build: ./app command: streamlit run streamlit_agent/chat_pandas_df.py --server.port 8051 volumes: - ./streamlit_agent/:/app/streamlit_agent ports: - 8051:8051
streamlit-agent/docker-compose.yml/0
{ "file_path": "streamlit-agent/docker-compose.yml", "repo_id": "streamlit-agent", "token_count": 116 }
1,918
# Node Parser Usage Pattern Node parsers are a simple abstraction that take a list of documents, and chunk them into `Node` objects, such that each node is a specific chunk of the parent document. When a document is broken into nodes, all of it's attributes are inherited to the children nodes (i.e. `metadata`, text an...
llama_index/docs/module_guides/loading/node_parsers/root.md/0
{ "file_path": "llama_index/docs/module_guides/loading/node_parsers/root.md", "repo_id": "llama_index", "token_count": 590 }
1,143
<jupyter_start><jupyter_text>OpaquePrompts[OpaquePrompts](https://opaqueprompts.readthedocs.io/en/latest/) is a service that enables applications to leverage the power of language models without compromising user privacy. Designed for composability and ease of integration into existing applications and services, Opaque...
langchain/docs/docs/integrations/llms/opaqueprompts.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/opaqueprompts.ipynb", "repo_id": "langchain", "token_count": 2394 }
132
{ "name": "tokenizers-linux-x64-gnu", "version": "0.13.4-rc1", "os": [ "linux" ], "cpu": [ "x64" ], "main": "tokenizers.linux-x64-gnu.node", "files": [ "tokenizers.linux-x64-gnu.node" ], "description": "Tokenizers platform specific bindings", "keywords": [ "napi-rs", "NAPI", ...
tokenizers/bindings/node/npm/linux-x64-gnu/package.json/0
{ "file_path": "tokenizers/bindings/node/npm/linux-x64-gnu/package.json", "repo_id": "tokenizers", "token_count": 289 }
435
import torch import torch.distributed from typing import Optional from transformers import ( AutoTokenizer, AutoConfig, ) from text_generation_server.models.custom_modeling.opt_modeling import OPTForCausalLM from text_generation_server.models import CausalLM from text_generation_server.utils import ( init...
text-generation-inference/server/text_generation_server/models/opt.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/opt.py", "repo_id": "text-generation-inference", "token_count": 1171 }
431
# isort: skip_file # This is the module that test_patching.py uses to test patch_submodule() import os # noqa: F401 - this is just for tests import os as renamed_os # noqa: F401 - this is just for tests from os import path # noqa: F401 - this is just for tests from os import path as renamed_path # noqa: F401 - th...
datasets/tests/_test_patching.py/0
{ "file_path": "datasets/tests/_test_patching.py", "repo_id": "datasets", "token_count": 175 }
149
#!/usr/bin/env python # coding=utf-8 # Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.ap...
transformers/examples/research_projects/onnx/summarization/run_onnx_exporter.py/0
{ "file_path": "transformers/examples/research_projects/onnx/summarization/run_onnx_exporter.py", "repo_id": "transformers", "token_count": 2861 }
609
# Azure Storage Blob Loader This loader parses any file stored as an Azure Storage blob or the entire container (with an optional prefix / attribute filter) if no particular file is specified. When initializing `AzStorageBlobReader`, you may pass in your account url with a SAS token or crdentials to authenticate. All...
llama_index/llama-index-integrations/readers/llama-index-readers-azstorage-blob/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-azstorage-blob/README.md", "repo_id": "llama_index", "token_count": 1031 }
1,382
# `langchain` **Usage**: ```console $ langchain [OPTIONS] COMMAND [ARGS]... ``` **Options**: * `--help`: Show this message and exit. * `-v, --version`: Print current CLI version. **Commands**: * `app`: Manage LangChain apps * `serve`: Start the LangServe app, whether it's a... * `template`: Develop installable te...
langchain/libs/cli/DOCS.md/0
{ "file_path": "langchain/libs/cli/DOCS.md", "repo_id": "langchain", "token_count": 1199 }
202
<jupyter_start><jupyter_text>Modèles (PyTorch) Installez la bibliothèque 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install transformers[sentencepiece] from transformers import CamembertConfig, CamembertModel # Construire la configuration config = CamembertConfig() # Construire le modèle à parti...
notebooks/course/fr/chapter2/section3_pt.ipynb/0
{ "file_path": "notebooks/course/fr/chapter2/section3_pt.ipynb", "repo_id": "notebooks", "token_count": 341 }
299
# coding=utf-8 # Copyright 2021 Google Research and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
transformers/src/transformers/models/fnet/modeling_fnet.py/0
{ "file_path": "transformers/src/transformers/models/fnet/modeling_fnet.py", "repo_id": "transformers", "token_count": 20358 }
665
<jupyter_start><jupyter_text>DatabricksThe [Databricks](https://www.databricks.com/) Lakehouse Platform unifies data, analytics, and AI on one platform.This example notebook shows how to wrap Databricks endpoints as LLMs in LangChain.It supports two endpoint types:* Serving endpoint, recommended for production and deve...
langchain/docs/docs/integrations/llms/databricks.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/databricks.ipynb", "repo_id": "langchain", "token_count": 2875 }
117
# 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/vit_hybrid/convert_vit_hybrid_timm_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/vit_hybrid/convert_vit_hybrid_timm_to_pytorch.py", "repo_id": "transformers", "token_count": 5670 }
747
import time import pdb import logging import traceback import grpc import numpy as np from milvus_benchmark.env import get_env from milvus_benchmark.client import MilvusClient from . import utils logger = logging.getLogger("milvus_benchmark.runners.base") class BaseRunner(object): """runner is actually the exec...
milvus/tests/benchmark/milvus_benchmark/runners/base.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/runners/base.py", "repo_id": "milvus", "token_count": 2812 }
1,855
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/mgp_str/test_processor_mgp_str.py/0
{ "file_path": "transformers/tests/models/mgp_str/test_processor_mgp_str.py", "repo_id": "transformers", "token_count": 3186 }
825
[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 = ["EarningsCallTranscript"] contains_example = false import_path = "llama_index.readers.earn...
llama_index/llama-index-integrations/readers/llama-index-readers-earnings-call-transcript/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-earnings-call-transcript/pyproject.toml", "repo_id": "llama_index", "token_count": 701 }
1,355
# Decision Transformers The Decision Transformer model was introduced by ["Decision Transformer: Reinforcement Learning via Sequence Modeling” by Chen L. et al](https://arxiv.org/abs/2106.01345). It abstracts Reinforcement Learning as a conditional-sequence modeling problem. The main idea is that instead of training ...
deep-rl-class/units/en/unitbonus3/decision-transformers.mdx/0
{ "file_path": "deep-rl-class/units/en/unitbonus3/decision-transformers.mdx", "repo_id": "deep-rl-class", "token_count": 543 }
171
# coding=utf-8 # Copyright 2023 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/utils/check_docstrings.py/0
{ "file_path": "transformers/utils/check_docstrings.py", "repo_id": "transformers", "token_count": 16792 }
854
from chromadb.utils.rendezvous_hash import assign, murmur3hasher def test_rendezvous_hash() -> None: # Tests the assign works as expected members = ["a", "b", "c"] key = "key" def mock_hasher(member: str, key: str) -> int: return members.index(member) # Highest index wins assert assign(...
chroma/chromadb/test/segment/distributed/test_rendezvous_hash.py/0
{ "file_path": "chroma/chromadb/test/segment/distributed/test_rendezvous_hash.py", "repo_id": "chroma", "token_count": 337 }
28
import { XataVectorSearch } from "@langchain/community/vectorstores/xata"; import { OpenAIEmbeddings } from "@langchain/openai"; import { BaseClient } from "@xata.io/client"; import { Document } from "@langchain/core/documents"; // First, follow set-up instructions at // https://js.langchain.com/docs/modules/data_conn...
langchainjs/examples/src/indexes/vector_stores/xata_metadata.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/xata_metadata.ts", "repo_id": "langchainjs", "token_count": 667 }
822
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-zep/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-zep/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,544
from __future__ import annotations import os from typing import Any, Dict, Optional def env_var_is_set(env_var: str) -> bool: """Check if an environment variable is set. Args: env_var (str): The name of the environment variable. Returns: bool: True if the environment variable is set, Fa...
langchain/libs/core/langchain_core/utils/env.py/0
{ "file_path": "langchain/libs/core/langchain_core/utils/env.py", "repo_id": "langchain", "token_count": 526 }
410
from langchain_community.document_loaders.obs_directory import OBSDirectoryLoader __all__ = ["OBSDirectoryLoader"]
langchain/libs/langchain/langchain/document_loaders/obs_directory.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/obs_directory.py", "repo_id": "langchain", "token_count": 32 }
532
from langchain_community.graphs import Neo4jGraph # Instantiate connection to Neo4j graph = Neo4jGraph() # Define unique constraints graph.query("CREATE CONSTRAINT IF NOT EXISTS FOR (m:Movie) REQUIRE m.id IS UNIQUE;") graph.query("CREATE CONSTRAINT IF NOT EXISTS FOR (u:User) REQUIRE u.id IS UNIQUE;") graph.query("CRE...
langchain/templates/neo4j-semantic-layer/ingest.py/0
{ "file_path": "langchain/templates/neo4j-semantic-layer/ingest.py", "repo_id": "langchain", "token_count": 786 }
714
stable
tokenizers/bindings/python/rust-toolchain/0
{ "file_path": "tokenizers/bindings/python/rust-toolchain", "repo_id": "tokenizers", "token_count": 2 }
416
from llama_index.readers.faiss.base import FaissReader __all__ = ["FaissReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-faiss/llama_index/readers/faiss/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-faiss/llama_index/readers/faiss/__init__.py", "repo_id": "llama_index", "token_count": 29 }
1,356
<jupyter_start><jupyter_text>Neo4j Vector Index>[Neo4j](https://neo4j.com/) is an open-source graph database with integrated support for vector similarity searchIt supports:- approximate nearest neighbor search- Euclidean similarity and cosine similarity- Hybrid search combining vector and keyword searchesThis notebook...
langchain/docs/docs/integrations/vectorstores/neo4jvector.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/neo4jvector.ipynb", "repo_id": "langchain", "token_count": 2167 }
193
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
transformers/src/transformers/models/openai/modeling_openai.py/0
{ "file_path": "transformers/src/transformers/models/openai/modeling_openai.py", "repo_id": "transformers", "token_count": 16309 }
649
// 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/storage/utils_test.go/0
{ "file_path": "milvus/internal/storage/utils_test.go", "repo_id": "milvus", "token_count": 20519 }
1,893
// 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/storage/data_codec.go/0
{ "file_path": "milvus/internal/storage/data_codec.go", "repo_id": "milvus", "token_count": 14376 }
1,869
# Usage Pattern ## Get Started Build a chat engine from index: ```python chat_engine = index.as_chat_engine() ``` ```{tip} To learn how to build an index, see [Indexing](/module_guides/indexing/indexing.md) ``` Have a conversation with your data: ```python response = chat_engine.chat("Tell me a joke.") ``` Reset...
llama_index/docs/module_guides/deploying/chat_engines/usage_pattern.md/0
{ "file_path": "llama_index/docs/module_guides/deploying/chat_engines/usage_pattern.md", "repo_id": "llama_index", "token_count": 1259 }
1,139
# LangChain as an AIPlugin ## Introduction [LangChain](https://python.langchain.com/en/latest/index.html) can flexibly integrate with the ChatGPT AI plugin ecosystem. LangChain chains and agents can themselves be deployed as a plugin that can communicate with other agents or with ChatGPT itself. For more informati...
langchain-aiplugin/README.md/0
{ "file_path": "langchain-aiplugin/README.md", "repo_id": "langchain-aiplugin", "token_count": 1169 }
65
package main import ( "os" "github.com/milvus-io/milvus/cmd/tools/migration/command" ) func main() { command.Execute(os.Args) }
milvus/cmd/tools/migration/main.go/0
{ "file_path": "milvus/cmd/tools/migration/main.go", "repo_id": "milvus", "token_count": 59 }
1,898
export { type PromptTemplateInput, type ParamsFromFString, PromptTemplate, } from "@langchain/core/prompts";
langchainjs/langchain/src/prompts/prompt.ts/0
{ "file_path": "langchainjs/langchain/src/prompts/prompt.ts", "repo_id": "langchainjs", "token_count": 37 }
956
package indexcgowrapper import ( "math" "math/rand" "os" "strconv" "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/indexpb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/commo...
milvus/internal/util/indexcgowrapper/codec_index_test.go/0
{ "file_path": "milvus/internal/util/indexcgowrapper/codec_index_test.go", "repo_id": "milvus", "token_count": 5088 }
1,884
import os from typing import Any, Dict, Iterable, List, Optional, Type from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstores import VST, VectorStore FIELD_TYPES = { "f": "files", "t": "texts", "l": "links", } class NucliaDB(Vector...
langchain/libs/community/langchain_community/vectorstores/nucliadb.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/nucliadb.py", "repo_id": "langchain", "token_count": 2762 }
310
from langchain_community.document_loaders.markdown import UnstructuredMarkdownLoader __all__ = ["UnstructuredMarkdownLoader"]
langchain/libs/langchain/langchain/document_loaders/markdown.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/markdown.py", "repo_id": "langchain", "token_count": 35 }
508
python_sources()
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-deepeval/llama_index/callbacks/deepeval/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-deepeval/llama_index/callbacks/deepeval/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,210
#![warn(clippy::all)] #![allow(clippy::upper_case_acronyms)] #![doc(html_favicon_url = "https://huggingface.co/favicon.ico")] #![doc(html_logo_url = "https://huggingface.co/landing/assets/huggingface_logo.svg")] //! The core of `tokenizers`, written in Rust. //! Provides an implementation of today's most used tokenize...
tokenizers/tokenizers/src/lib.rs/0
{ "file_path": "tokenizers/tokenizers/src/lib.rs", "repo_id": "tokenizers", "token_count": 2175 }
475
# Using local models Relevant Resources: - [Using LlamaIndex with Local Models](https://colab.research.google.com/drive/16QMQePkONNlDpgiltOi7oRQgmB8dU5fl?usp=sharing)
llama_index/docs/module_guides/models/llms/local.md/0
{ "file_path": "llama_index/docs/module_guides/models/llms/local.md", "repo_id": "llama_index", "token_count": 66 }
1,179
""" Framework agnostic tests for generate()-related methods. """ import numpy as np from transformers import AutoTokenizer from transformers.testing_utils import slow, torch_device class GenerationIntegrationTestsMixin: # To be populated by the child classes framework_dependent_parameters = { "AutoM...
transformers/tests/generation/test_framework_agnostic.py/0
{ "file_path": "transformers/tests/generation/test_framework_agnostic.py", "repo_id": "transformers", "token_count": 14154 }
703
# Obsidian >[Obsidian](https://obsidian.md/) is a powerful and extensible knowledge base that works on top of your local folder of plain text files. ## Installation and Setup All instructions are in examples below. ## Document Loader See a [usage example](/docs/integrations/document_loaders/obsidian). ```python...
langchain/docs/docs/integrations/providers/obsidian.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/obsidian.mdx", "repo_id": "langchain", "token_count": 105 }
143
from langchain_community.document_loaders.parsers.language.code_segmenter import ( CodeSegmenter, ) __all__ = ["CodeSegmenter"]
langchain/libs/langchain/langchain/document_loaders/parsers/language/code_segmenter.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/parsers/language/code_segmenter.py", "repo_id": "langchain", "token_count": 48 }
513
import { type ClientOptions, OpenAI as OpenAIClient } from "openai"; import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { AIMessage, AIMessageChunk, type BaseMessage, ChatMessage, ChatMessageChunk, FunctionMessageChunk, HumanMessageChunk, SystemMessageChunk, ToolMess...
langchainjs/libs/langchain-openai/src/chat_models.ts/0
{ "file_path": "langchainjs/libs/langchain-openai/src/chat_models.ts", "repo_id": "langchainjs", "token_count": 10023 }
1,019
[tool.poetry] name = "cassandra-entomology-rag" version = "0.0.1" description = "RAG using Apache Cassandra® or Astra DB" authors = [ "Stefano Lottini <stefano.lottini@datastax.com>", ] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" openai = "<2" tiktoken = "^0.5.1" cass...
langchain/templates/cassandra-entomology-rag/pyproject.toml/0
{ "file_path": "langchain/templates/cassandra-entomology-rag/pyproject.toml", "repo_id": "langchain", "token_count": 309 }
648
// Code generated by mockery v2.32.4. DO NOT EDIT. package syncmgr import mock "github.com/stretchr/testify/mock" // MockMetaWriter is an autogenerated mock type for the MetaWriter type type MockMetaWriter struct { mock.Mock } type MockMetaWriter_Expecter struct { mock *mock.Mock } func (_m *MockMetaWriter) EXPE...
milvus/internal/datanode/syncmgr/mock_meta_writer.go/0
{ "file_path": "milvus/internal/datanode/syncmgr/mock_meta_writer.go", "repo_id": "milvus", "token_count": 1682 }
1,844
from typing import Any, Dict, List, Literal, Optional, Union from exa_py import Exa # type: ignore from exa_py.api import HighlightsContentsOptions, TextContentsOptions # type: ignore from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core...
langchain/libs/partners/exa/langchain_exa/retrievers.py/0
{ "file_path": "langchain/libs/partners/exa/langchain_exa/retrievers.py", "repo_id": "langchain", "token_count": 1389 }
624