text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
/// Inspired by https://github.com/hatoo/oha/blob/bb989ea3cd77727e7743e7daa60a19894bb5e901/src/monitor.rs use crate::generation::{Decode, Message, Prefill}; use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; use text_generation_client::ClientError; use tokio::sync::mpsc; use tui::backend::Backend; use tui::layout...
text-generation-inference/benchmark/src/app.rs/0
{ "file_path": "text-generation-inference/benchmark/src/app.rs", "repo_id": "text-generation-inference", "token_count": 12215 }
357
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/ja/installation.md/0
{ "file_path": "diffusers/docs/source/ja/installation.md", "repo_id": "diffusers", "token_count": 2493 }
198
"""Common utility functions for LLM APIs.""" import re from typing import List def enforce_stop_tokens(text: str, stop: List[str]) -> str: """Cut off the text as soon as any stop words occur.""" return re.split("|".join(stop), text, maxsplit=1)[0]
langchain/libs/community/langchain_community/llms/utils.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/utils.py", "repo_id": "langchain", "token_count": 85 }
293
# coding=utf-8 # Copyright 2023 The Facebook Inc. 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/LI...
transformers/src/transformers/models/speecht5/tokenization_speecht5.py/0
{ "file_path": "transformers/src/transformers/models/speecht5/tokenization_speecht5.py", "repo_id": "transformers", "token_count": 4079 }
733
from unittest.mock import patch from llama_index.legacy.llms import CompletionResponse from llama_index.legacy.selectors.llm_selectors import ( LLMMultiSelector, LLMSingleSelector, ) from llama_index.legacy.service_context import ServiceContext from tests.mock_utils.mock_predict import _mock_single_select d...
llama_index/llama-index-legacy/tests/selectors/test_llm_selectors.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/selectors/test_llm_selectors.py", "repo_id": "llama_index", "token_count": 683 }
1,817
import { unstable_dev } from "wrangler"; import type { UnstableDevWorker } from "wrangler"; import { describe, expect, it, beforeAll, afterAll } from "vitest"; describe("Worker", () => { let worker: UnstableDevWorker; beforeAll(async () => { worker = await unstable_dev("src/index.ts", { experimental: { ...
langchainjs/environment_tests/test-exports-cf/src/index.unit.test.ts/0
{ "file_path": "langchainjs/environment_tests/test-exports-cf/src/index.unit.test.ts", "repo_id": "langchainjs", "token_count": 176 }
761
<?xml version="1.0" encoding="utf-8"?> <dg:chunk cp:version="2.10.10.0.1699162341377-69.0" xmlns:docset="http://www.docugami.com/2021/dgml/TaqiTest20231103/NDA" xmlns:addedChunks="http://www.docugami.com/2021/dgml/TaqiTest20231103/NDA/addedChunks" xmlns:dg="http://www.docugami.com/2021/dgml" xmlns:dgc="...
langchain/libs/community/tests/unit_tests/document_loaders/loaders/vendors/test_data/docugami-example.xml/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/loaders/vendors/test_data/docugami-example.xml", "repo_id": "langchain", "token_count": 16507 }
387
python_tests()
llama_index/llama-index-packs/llama-index-packs-multi-document-agents/tests/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-multi-document-agents/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,798
package syncmgr import ( "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus/pkg/util/conc" "github.com/milvus-io/milvus/pkg/util/lock" ) type Task interface { SegmentID() int64 CalcTargetSegment() (int64, error) Checkpoint() *msgpb.MsgPosition StartPosition() *msgpb.MsgPosition C...
milvus/internal/datanode/syncmgr/key_lock_dispatcher.go/0
{ "file_path": "milvus/internal/datanode/syncmgr/key_lock_dispatcher.go", "repo_id": "milvus", "token_count": 418 }
1,707
<jupyter_start><jupyter_text>OpenAI Fine-Tuning[](https://colab.research.google.com/github/langchain-ai/langsmith-cookbook/blob/main/fine-tuning-examples/export-to-openai/fine-tuning-on-chat-runs.ipynb)Once you've captured run traces from your deployment (production or beta), it's likely you'll want to use that data to...
langsmith-cookbook/fine-tuning-examples/export-to-openai/fine-tuning-on-chat-runs.ipynb/0
{ "file_path": "langsmith-cookbook/fine-tuning-examples/export-to-openai/fine-tuning-on-chat-runs.ipynb", "repo_id": "langsmith-cookbook", "token_count": 4016 }
1,097
#!/usr/bin/env bash # Licensed to the LF AI & Data foundation under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you...
milvus/scripts/devcontainer.sh/0
{ "file_path": "milvus/scripts/devcontainer.sh", "repo_id": "milvus", "token_count": 1485 }
2,127
import { GoogleVertexAI } from "@langchain/community/llms/googlevertexai"; const model = new GoogleVertexAI({ temperature: 0.7, }); const stream = await model.stream( "What would be a good company name for a company that makes colorful socks?" ); for await (const chunk of stream) { console.log("\n---------\nChu...
langchainjs/examples/src/llms/googlevertexai-streaming.ts/0
{ "file_path": "langchainjs/examples/src/llms/googlevertexai-streaming.ts", "repo_id": "langchainjs", "token_count": 252 }
794
"""Test AzureCosmosDBVectorSearch functionality.""" import logging import os from time import sleep from typing import Any, Generator, Optional, Union import pytest from langchain_core.documents import Document from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorstores.azure_cos...
langchain/libs/community/tests/integration_tests/vectorstores/test_azure_cosmos_db.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_azure_cosmos_db.py", "repo_id": "langchain", "token_count": 6746 }
390
from langchain_community.tools.edenai.image_explicitcontent import ( EdenAiExplicitImageTool, ) __all__ = ["EdenAiExplicitImageTool"]
langchain/libs/langchain/langchain/tools/edenai/image_explicitcontent.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/edenai/image_explicitcontent.py", "repo_id": "langchain", "token_count": 49 }
585
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-nougat-ocr/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-nougat-ocr/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,416
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querycoordv2/meta/leader_view_manager_test.go/0
{ "file_path": "milvus/internal/querycoordv2/meta/leader_view_manager_test.go", "repo_id": "milvus", "token_count": 2113 }
1,761
<jupyter_start><jupyter_text>Amazon Textract >[Amazon Textract](https://docs.aws.amazon.com/managedservices/latest/userguide/textract.html) is a machine learning (ML) service that automatically extracts text, handwriting, and data from scanned documents.>>It goes beyond simple optical character recognition (OCR) to ide...
langchain/docs/docs/integrations/document_loaders/amazon_textract.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/amazon_textract.ipynb", "repo_id": "langchain", "token_count": 1284 }
104
{ "extends": "@tsconfig/recommended", "compilerOptions": { "target": "ES2021", "lib": [ "ES2021", "ES2022.Object", "DOM" ], "module": "ES2020", "moduleResolution": "nodenext", "esModuleInterop": true, "declaration": true, "noImplicitReturns": true, "noFallthroug...
langchainjs/tsconfig.json/0
{ "file_path": "langchainjs/tsconfig.json", "repo_id": "langchainjs", "token_count": 353 }
1,050
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-palm/llama_index/llms/palm/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-palm/llama_index/llms/palm/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,275
# LlamaIndex Callbacks Integration: Weights and Biases
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-wandb/README.md/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-wandb/README.md", "repo_id": "llama_index", "token_count": 14 }
1,216
// 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/proxy/accesslog/writer.go/0
{ "file_path": "milvus/internal/proxy/accesslog/writer.go", "repo_id": "milvus", "token_count": 3314 }
1,876
from typing import Any from unittest import mock from langchain_community.vectorstores.nucliadb import NucliaDB class attrdict(dict): def __getitem__(self, key: str) -> Any: value = dict.__getitem__(self, key) return attrdict(value) if isinstance(value, dict) else value __getattr__ = __getit...
langchain/libs/community/tests/integration_tests/vectorstores/test_nucliadb.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_nucliadb.py", "repo_id": "langchain", "token_count": 1904 }
359
# Microsoft OneDrive Loader This loader reads files from: - Microsoft OneDrive Personal [(https://onedrive.live.com/)](https://onedrive.live.com/) and - Microsoft OneDrive for Business [(https://portal.office.com/onedrive)](https://portal.office.com/onedrive). It supports recursively traversing and downloading files...
llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-onedrive/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-onedrive/README.md", "repo_id": "llama_index", "token_count": 1963 }
1,350
--- sidebar_position: 3 --- # Cookbook import DocCardList from "@theme/DocCardList"; Example code for accomplishing common tasks with the LangChain Expression Language (LCEL). These examples show how to compose different Runnable (the core LCEL interface) components to achieve various tasks. If you're just getting a...
langchain/docs/docs/expression_language/cookbook/index.mdx/0
{ "file_path": "langchain/docs/docs/expression_language/cookbook/index.mdx", "repo_id": "langchain", "token_count": 122 }
83
from __future__ import annotations import operator import pickle import uuid from pathlib import Path from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple import numpy as np from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstor...
langchain/libs/community/langchain_community/vectorstores/scann.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/scann.py", "repo_id": "langchain", "token_count": 9169 }
335
// This implementation mirrors the rendezvous hash implementation // in the go and python services. // The go implementation is located go/internal/utils/rendezvous_hash.go // The python implementation is located chromadb/utils/rendezvous_hash.py use crate::errors::{ChromaError, ErrorCodes}; use std::io::Cursor; use t...
chroma/rust/worker/src/assignment/rendezvous_hash.rs/0
{ "file_path": "chroma/rust/worker/src/assignment/rendezvous_hash.rs", "repo_id": "chroma", "token_count": 2231 }
59
from langchain_core.tracers.run_collector import RunCollectorCallbackHandler __all__ = ["RunCollectorCallbackHandler"]
langchain/libs/langchain/langchain/schema/callbacks/tracers/run_collector.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/callbacks/tracers/run_collector.py", "repo_id": "langchain", "token_count": 33 }
565
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/markdown/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/markdown/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,438
from typing import Any from llama_index.legacy.callbacks.base_handler import BaseCallbackHandler def arize_phoenix_callback_handler(**kwargs: Any) -> BaseCallbackHandler: try: from phoenix.trace.llama_index import OpenInferenceTraceCallbackHandler except ImportError: raise ImportError( ...
llama_index/llama-index-legacy/llama_index/legacy/callbacks/arize_phoenix_callback.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/callbacks/arize_phoenix_callback.py", "repo_id": "llama_index", "token_count": 162 }
1,553
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/musicgen/test_processing_musicgen.py/0
{ "file_path": "transformers/tests/models/musicgen/test_processing_musicgen.py", "repo_id": "transformers", "token_count": 2496 }
724
<jupyter_start><jupyter_text>ClearML> [ClearML](https://github.com/allegroai/clearml) is a ML/DL development and production suite, it contains 5 main modules:> - `Experiment Manager` - Automagical experiment tracking, environments and results> - `MLOps` - Orchestration, Automation & Pipelines solution for ML/DL jobs (K...
langchain/docs/docs/integrations/providers/clearml_tracking.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/providers/clearml_tracking.ipynb", "repo_id": "langchain", "token_count": 2148 }
140
<jupyter_start><jupyter_text>Serverless Inference with Hugging Face's Transformers & Amazon SageMaker Welcome to this getting started guide. We will use the Hugging Face Inference DLCs and Amazon SageMaker Python SDK to create a [Serverless Inference](https://docs.aws.amazon.com/sagemaker/latest/dg/serverless-endpoints...
notebooks/sagemaker/19_serverless_inference/sagemaker-notebook.ipynb/0
{ "file_path": "notebooks/sagemaker/19_serverless_inference/sagemaker-notebook.ipynb", "repo_id": "notebooks", "token_count": 1569 }
317
import json from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Union from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader class JSONLoader(BaseLoader): """Load a `JSON` file using a `jq` schema. Example: [{"text...
langchain/libs/community/langchain_community/document_loaders/json_loader.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/json_loader.py", "repo_id": "langchain", "token_count": 2615 }
252
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "embeddings/googlepalm", }); export * from "@langchain/community/embeddings/googlepalm";
langchainjs/langchain/src/embeddings/googlepalm.ts/0
{ "file_path": "langchainjs/langchain/src/embeddings/googlepalm.ts", "repo_id": "langchainjs", "token_count": 76 }
929
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/xglm.md/0
{ "file_path": "transformers/docs/source/en/model_doc/xglm.md", "repo_id": "transformers", "token_count": 1137 }
460
from llama_index.core.readers.base import BaseReader from llama_index.readers.opensearch import OpensearchReader def test_class(): names_of_base_classes = [b.__name__ for b in OpensearchReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-opensearch/tests/test_readers_opensearch.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-opensearch/tests/test_readers_opensearch.py", "repo_id": "llama_index", "token_count": 91 }
1,353
"""A chain for evaluating ReAct style agents. This chain is used to evaluate ReAct style agents by reasoning about the sequence of actions taken and their outcomes. It uses a language model chain (LLMChain) to generate the reasoning and scores. """ import re from typing import ( Any, Dict, List, Optio...
langchain/libs/langchain/langchain/evaluation/agents/trajectory_eval_chain.py/0
{ "file_path": "langchain/libs/langchain/langchain/evaluation/agents/trajectory_eval_chain.py", "repo_id": "langchain", "token_count": 5923 }
505
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querynodev2/segments/reduce_test.go/0
{ "file_path": "milvus/internal/querynodev2/segments/reduce_test.go", "repo_id": "milvus", "token_count": 2366 }
1,770
from langchain_community.vectorstores.lancedb import LanceDB __all__ = ["LanceDB"]
langchain/libs/langchain/langchain/vectorstores/lancedb.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/lancedb.py", "repo_id": "langchain", "token_count": 27 }
584
# coding=utf-8 # Copyright 2021 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/test_feature_extraction_utils.py/0
{ "file_path": "transformers/tests/test_feature_extraction_utils.py", "repo_id": "transformers", "token_count": 2408 }
803
<jupyter_start><jupyter_text>Tongyi QwenTongyi Qwen is a large-scale language model developed by Alibaba's Damo Academy. It is capable of understanding user intent through natural language understanding and semantic analysis, based on user input in natural language. It provides services and assistance to users in diffe...
langchain/docs/docs/integrations/llms/tongyi.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/tongyi.ipynb", "repo_id": "langchain", "token_count": 350 }
127
export { isBrowser, isWebWorker, isJsDom, isDeno, isNode, getEnv, type RuntimeEnvironment, getRuntimeEnvironment, getEnvironmentVariable, } from "@langchain/core/utils/env";
langchainjs/langchain/src/util/env.ts/0
{ "file_path": "langchainjs/langchain/src/util/env.ts", "repo_id": "langchainjs", "token_count": 69 }
961
<jupyter_start><jupyter_text>MosaicML>[MosaicML](https://docs.mosaicml.com/en/latest/inference.html) offers a managed inference service. You can either use a variety of open-source models, or deploy your own.This example goes over how to use LangChain to interact with `MosaicML` Inference for text embedding.<jupyter_co...
langchain/docs/docs/integrations/text_embedding/mosaicml.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/text_embedding/mosaicml.ipynb", "repo_id": "langchain", "token_count": 413 }
175
//! Test suite for the Web and headless browsers. #![cfg(target_arch = "wasm32")] extern crate wasm_bindgen_test; use wasm_bindgen_test::*; wasm_bindgen_test_configure!(run_in_browser); #[wasm_bindgen_test] fn pass() { assert_eq!(1 + 1, 2); }
tokenizers/tokenizers/examples/unstable_wasm/tests/web.rs/0
{ "file_path": "tokenizers/tokenizers/examples/unstable_wasm/tests/web.rs", "repo_id": "tokenizers", "token_count": 109 }
450
"""Default prompt selectors.""" from llama_index.core.prompts import SelectorPromptTemplate from llama_index.core.prompts.chat_prompts import ( CHAT_REFINE_PROMPT, CHAT_REFINE_TABLE_CONTEXT_PROMPT, CHAT_TEXT_QA_PROMPT, CHAT_TREE_SUMMARIZE_PROMPT, ) from llama_index.core.prompts.default_prompts import ( ...
llama_index/llama-index-core/llama_index/core/prompts/default_prompt_selectors.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/prompts/default_prompt_selectors.py", "repo_id": "llama_index", "token_count": 526 }
1,134
[tool.poetry] name = "langsmith" version = "0.1.1" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." authors = ["LangChain <support@langchain.dev>"] license = "MIT" readme = "README.md" repository = "https://github.com/langchain-ai/langsmith-sdk" homepage = "https://smith.l...
langsmith-sdk/python/pyproject.toml/0
{ "file_path": "langsmith-sdk/python/pyproject.toml", "repo_id": "langsmith-sdk", "token_count": 685 }
1,022
{ "annotations": { "list": [ { "builtIn": 1, "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { "limit": 100, "matchAny": false, "t...
milvus/deployments/monitor/grafana/milvus-dashboard.json/0
{ "file_path": "milvus/deployments/monitor/grafana/milvus-dashboard.json", "repo_id": "milvus", "token_count": 216145 }
1,764
import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface import HuggingFace...
transformers/tests/sagemaker/test_single_node_gpu.py/0
{ "file_path": "transformers/tests/sagemaker/test_single_node_gpu.py", "repo_id": "transformers", "token_count": 1584 }
765
"""You Retriever.""" import logging import os from typing import List, Optional import requests from llama_index.core.base.base_retriever import BaseRetriever from llama_index.core.callbacks.base import CallbackManager from llama_index.core.schema import NodeWithScore, QueryBundle, TextNode logger = logging.getLogge...
llama_index/llama-index-integrations/retrievers/llama-index-retrievers-you/llama_index/retrievers/you/base.py/0
{ "file_path": "llama_index/llama-index-integrations/retrievers/llama-index-retrievers-you/llama_index/retrievers/you/base.py", "repo_id": "llama_index", "token_count": 465 }
1,466
# coding=utf-8 # Copyright 2023 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/models/clap/test_feature_extraction_clap.py/0
{ "file_path": "transformers/tests/models/clap/test_feature_extraction_clap.py", "repo_id": "transformers", "token_count": 19243 }
773
from langchain_community.document_loaders.dataframe import ( BaseDataFrameLoader, DataFrameLoader, ) __all__ = ["BaseDataFrameLoader", "DataFrameLoader"]
langchain/libs/langchain/langchain/document_loaders/dataframe.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/dataframe.py", "repo_id": "langchain", "token_count": 52 }
503
from langchain_core.callbacks.streaming_stdout import StreamingStdOutCallbackHandler __all__ = ["StreamingStdOutCallbackHandler"]
langchain/libs/langchain/langchain/schema/callbacks/streaming_stdout.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/callbacks/streaming_stdout.py", "repo_id": "langchain", "token_count": 37 }
564
# LlamaIndex Finetuning A LlamaIndex extension package that contains classes and features for carrying out finetuning of OpenAI LLMs and Embedding models.
llama_index/llama-index-finetuning/README.md/0
{ "file_path": "llama_index/llama-index-finetuning/README.md", "repo_id": "llama_index", "token_count": 39 }
1,160
<jupyter_start><jupyter_text>Réponses aux questions (TensorFlow) Installez les bibliothèques Transformers et Datasets pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece] !apt install git-lfs<jupyter_output><empty_output><jupyter_text>Vous aurez besoin de configurer git, adaptez v...
notebooks/course/fr/chapter7/section7_tf.ipynb/0
{ "file_path": "notebooks/course/fr/chapter7/section7_tf.ipynb", "repo_id": "notebooks", "token_count": 6501 }
297
# coding=utf-8 # Copyright 2022 The OpenBMB 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.apache.org/licenses/LIC...
transformers/src/transformers/models/cpmant/configuration_cpmant.py/0
{ "file_path": "transformers/src/transformers/models/cpmant/configuration_cpmant.py", "repo_id": "transformers", "token_count": 2021 }
584
// File only needed for VSCode users to have proper Docker based interpreters { "name": "accelerate_dev_environment", "build": { // ACTION NEEDED: comment/uncomment the relevant line depending on whether you are in a CPU/GPU environment "dockerfile": "../docker/accelerate-cpu/Dockerfile" // ...
accelerate/.devcontainer/devcontainer.json/0
{ "file_path": "accelerate/.devcontainer/devcontainer.json", "repo_id": "accelerate", "token_count": 459 }
0
# Copyright 2024 Alibaba DAMO-VILAB and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
diffusers/src/diffusers/pipelines/i2vgen_xl/pipeline_i2vgen_xl.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/i2vgen_xl/pipeline_i2vgen_xl.py", "repo_id": "diffusers", "token_count": 17765 }
251
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-clip/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-clip/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,254
<jupyter_start><jupyter_text>ArcGISThis notebook demonstrates the use of the `langchain_community.document_loaders.ArcGISLoader` class.You will need to install the ArcGIS API for Python `arcgis` and, optionally, `bs4.BeautifulSoup`.You can use an `arcgis.gis.GIS` object for authenticated data loading, or leave it blank...
langchain/docs/docs/integrations/document_loaders/arcgis.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/arcgis.ipynb", "repo_id": "langchain", "token_count": 748 }
101
python_tests()
llama_index/llama-index-integrations/question_gen/llama-index-question-gen-guidance/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/question_gen/llama-index-question-gen-guidance/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,362
"""Test text splitter.""" from typing import List import tiktoken from llama_index.core.node_parser.text import TokenTextSplitter from llama_index.core.node_parser.text.utils import truncate_text from llama_index.core.schema import Document, MetadataMode, TextNode def test_split_token() -> None: """Test split no...
llama_index/llama-index-core/tests/text_splitter/test_token_splitter.py/0
{ "file_path": "llama_index/llama-index-core/tests/text_splitter/test_token_splitter.py", "repo_id": "llama_index", "token_count": 1211 }
1,246
python_tests()
llama_index/llama-index-integrations/llms/llama-index-llms-cohere/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-cohere/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,279
<jupyter_start><jupyter_text>S3/R2 Storage If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>!pip install llama-index import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.getLogger().addHandler(logging.StreamHandler(stream=sy...
llama_index/docs/examples/vector_stores/SimpleIndexOnS3.ipynb/0
{ "file_path": "llama_index/docs/examples/vector_stores/SimpleIndexOnS3.ipynb", "repo_id": "llama_index", "token_count": 689 }
1,169
""" GitLab Tool """
langchain/libs/langchain/langchain/tools/gitlab/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/gitlab/__init__.py", "repo_id": "langchain", "token_count": 6 }
575
"""Prompts.""" from abc import ABC, abstractmethod from copy import deepcopy from typing import ( TYPE_CHECKING, Any, Callable, Dict, List, Optional, Sequence, Tuple, Union, ) from llama_index.core.bridge.pydantic import Field if TYPE_CHECKING: from llama_index.core.bridge.lan...
llama_index/llama-index-core/llama_index/core/prompts/base.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/prompts/base.py", "repo_id": "llama_index", "token_count": 8807 }
1,192
from langchain_community.embeddings.mosaicml import MosaicMLInstructorEmbeddings __all__ = ["MosaicMLInstructorEmbeddings"]
langchain/libs/langchain/langchain/embeddings/mosaicml.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/mosaicml.py", "repo_id": "langchain", "token_count": 41 }
525
import type { ObjectId } from "mongodb"; import type { User } from "./User"; import type { Timestamps } from "./Timestamps"; export interface Assistant extends Timestamps { _id: ObjectId; createdById: User["_id"] | string; // user id or session createdByName?: User["username"]; avatar?: string; name: string; des...
chat-ui/src/lib/types/Assistant.ts/0
{ "file_path": "chat-ui/src/lib/types/Assistant.ts", "repo_id": "chat-ui", "token_count": 145 }
102
--- keywords: [AzureOpenAIEmbeddings] --- # Azure OpenAI [Azure OpenAI](https://azure.microsoft.com/products/ai-services/openai-service/) is a cloud service to help you quickly develop generative AI experiences with a diverse set of prebuilt and curated models from OpenAI, Meta and beyond. LangChain.js supports inte...
langchainjs/docs/core_docs/docs/integrations/text_embedding/azure_openai.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/text_embedding/azure_openai.mdx", "repo_id": "langchainjs", "token_count": 1643 }
768
<!--Copyright 2024 The Qwen Team and The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applic...
transformers/docs/source/en/model_doc/qwen2.md/0
{ "file_path": "transformers/docs/source/en/model_doc/qwen2.md", "repo_id": "transformers", "token_count": 920 }
452
{ "example_name": "text classification", "directory_name": "{{cookiecutter.example_name|lower|replace(' ', '-')}}", "example_shortcut": "{{cookiecutter.directory_name}}", "model_class": "AutoModel", "authors": "The HuggingFace Team", "can_train_from_scratch": ["True", "False"], "with_trainer": ["True", "F...
transformers/templates/adding_a_new_example_script/cookiecutter.json/0
{ "file_path": "transformers/templates/adding_a_new_example_script/cookiecutter.json", "repo_id": "transformers", "token_count": 115 }
698
from __future__ import annotations import json import logging import uuid from typing import TYPE_CHECKING, Any, Callable, Iterable, List, Optional, Tuple, Type import numpy as np from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstores import VST...
langchain/libs/community/langchain_community/vectorstores/databricks_vector_search.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/databricks_vector_search.py", "repo_id": "langchain", "token_count": 10140 }
330
# coding=utf-8 # Copyright 2020 Huggingface # # 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/tests/models/reformer/test_modeling_reformer.py/0
{ "file_path": "transformers/tests/models/reformer/test_modeling_reformer.py", "repo_id": "transformers", "token_count": 27091 }
783
from llama_index.readers.file.slides.base import PptxReader __all__ = ["PptxReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/slides/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/slides/__init__.py", "repo_id": "llama_index", "token_count": 33 }
1,440
use serde::Deserialize; #[derive(Deserialize)] /// The type of memberlist provider to use /// # Options /// - CustomResource: Use a custom resource to get the memberlist pub(crate) enum MemberlistProviderType { CustomResource, } /// The configuration for the memberlist provider. /// # Options /// - CustomResource...
chroma/rust/worker/src/memberlist/config.rs/0
{ "file_path": "chroma/rust/worker/src/memberlist/config.rs", "repo_id": "chroma", "token_count": 252 }
61
export const PUBLIC_SEP_TOKEN = "</s>";
chat-ui/src/lib/constants/publicSepToken.ts/0
{ "file_path": "chat-ui/src/lib/constants/publicSepToken.ts", "repo_id": "chat-ui", "token_count": 16 }
95
reviewers: - wayblink - jiaoew1991 - congqixia approvers: - maintainers labels: - area/test - sig/testing - test/integration
milvus/tests/integration/OWNERS/0
{ "file_path": "milvus/tests/integration/OWNERS", "repo_id": "milvus", "token_count": 56 }
1,886
from __future__ import annotations import json import re from typing import ( Any, Callable, Iterable, List, Optional, Tuple, Type, ) from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstores import VectorStore, VectorSt...
langchain/libs/community/langchain_community/vectorstores/singlestoredb.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/singlestoredb.py", "repo_id": "langchain", "token_count": 10405 }
332
# 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/src/transformers/models/dpt/convert_dinov2_depth_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/dpt/convert_dinov2_depth_to_hf.py", "repo_id": "transformers", "token_count": 7347 }
637
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/examples/legacy/seq2seq/old_test_datasets.py/0
{ "file_path": "transformers/examples/legacy/seq2seq/old_test_datasets.py", "repo_id": "transformers", "token_count": 5148 }
509
from typing import Any, Dict from langchain_core.pydantic_v1 import root_validator from langchain_community.llms.openai import BaseOpenAI class OpenLM(BaseOpenAI): """OpenLM models.""" @classmethod def is_lc_serializable(cls) -> bool: return False @property def _invocation_params(self)...
langchain/libs/community/langchain_community/llms/openlm.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/openlm.py", "repo_id": "langchain", "token_count": 383 }
272
<jupyter_start><jupyter_text>Generative Agents in LangChainThis notebook implements a generative agent based on the paper [Generative Agents: Interactive Simulacra of Human Behavior](https://arxiv.org/abs/2304.03442) by Park, et. al.In it, we leverage a time-weighted Memory object backed by a LangChain Retriever.<jupyt...
langchain/cookbook/generative_agents_interactive_simulacra_of_human_behavior.ipynb/0
{ "file_path": "langchain/cookbook/generative_agents_interactive_simulacra_of_human_behavior.ipynb", "repo_id": "langchain", "token_count": 4641 }
78
# The SnowballTarget Environment <img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit7/snowballtarget.gif" alt="SnowballTarget"/> SnowballTarget is an environment we created at Hugging Face using assets from [Kay Lousberg](https://kaylousberg.com/). We have an option...
deep-rl-class/units/en/unit5/snowball-target.mdx/0
{ "file_path": "deep-rl-class/units/en/unit5/snowball-target.mdx", "repo_id": "deep-rl-class", "token_count": 1019 }
172
import { OpenAI } from "@langchain/openai"; import { ConsoleCallbackHandler } from "@langchain/core/tracers/console"; const llm = new OpenAI({ temperature: 0, }); const response = await llm.call("1 + 1 =", { // These tags will be attached only to this call to the LLM. tags: ["example", "callbacks", "request"], ...
langchainjs/examples/src/callbacks/docs_request_callbacks.ts/0
{ "file_path": "langchainjs/examples/src/callbacks/docs_request_callbacks.ts", "repo_id": "langchainjs", "token_count": 126 }
761
package kafka import ( "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/mq/msgstream/mqwrapper" ) type kafkaID struct { messageID int64 } var _ mqwrapper.MessageID = &kafkaID{} func (kid *kafkaID) Serialize() []byte { return SerializeKafkaID(kid.messageID) } func (kid *kafkaID) AtEarli...
milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_id.go/0
{ "file_path": "milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_id.go", "repo_id": "milvus", "token_count": 350 }
1,815
--- anArray: one - two - three tags: 'onetag', 'twotag' ] --- A document with frontmatter that isn't valid.
langchain/libs/community/tests/unit_tests/document_loaders/sample_documents/obsidian/bad_frontmatter.md/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/sample_documents/obsidian/bad_frontmatter.md", "repo_id": "langchain", "token_count": 41 }
405
import { AI, environment } from "@raycast/api"; import { LLM, type BaseLLMParams } from "@langchain/core/language_models/llms"; /** * The input parameters for the RaycastAI class, which extends the BaseLLMParams interface. */ export interface RaycastAIInput extends BaseLLMParams { model?: AI.Model; creativity?: ...
langchainjs/libs/langchain-community/src/llms/raycast.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/llms/raycast.ts", "repo_id": "langchainjs", "token_count": 935 }
946
[req] distinguished_name = req_distinguished_name x509_extensions = usr_cert [req_distinguished_name] CN = localhost [usr_cert] subjectAltName = @alt_names [alt_names] DNS.1 = localhost
chroma/chromadb/test/openssl.cnf/0
{ "file_path": "chroma/chromadb/test/openssl.cnf", "repo_id": "chroma", "token_count": 72 }
24
// 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/proxy/look_aside_balancer.go/0
{ "file_path": "milvus/internal/proxy/look_aside_balancer.go", "repo_id": "milvus", "token_count": 3791 }
1,827
import pytest from langchain_community.embeddings.openai import OpenAIEmbeddings @pytest.mark.requires("openai") def test_openai_invalid_model_kwargs() -> None: with pytest.raises(ValueError): OpenAIEmbeddings(model_kwargs={"model": "foo"}) @pytest.mark.requires("openai") def test_openai_incorrect_fiel...
langchain/libs/community/tests/unit_tests/embeddings/test_openai.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/embeddings/test_openai.py", "repo_id": "langchain", "token_count": 193 }
377
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/readers/steamship/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/steamship/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,766
<!--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/es/add_new_pipeline.md/0
{ "file_path": "transformers/docs/source/es/add_new_pipeline.md", "repo_id": "transformers", "token_count": 4318 }
477
export interface DocumentInput< // eslint-disable-next-line @typescript-eslint/no-explicit-any Metadata extends Record<string, any> = Record<string, any> > { pageContent: string; metadata?: Metadata; } export interface DocumentInterface< // eslint-disable-next-line @typescript-eslint/no-explicit-any Metad...
langchainjs/langchain-core/src/documents/document.ts/0
{ "file_path": "langchainjs/langchain-core/src/documents/document.ts", "repo_id": "langchainjs", "token_count": 305 }
858
[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 = ["ChatGPTRetrievalPluginClient"] contains_example = false import_path = "llama_index.vector...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-chatgpt-plugin/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-chatgpt-plugin/pyproject.toml", "repo_id": "llama_index", "token_count": 649 }
1,517
<div align="center"> # Text Generation Inference benchmarking tool ![benchmark](../assets/benchmark.png) </div> A lightweight benchmarking tool based inspired by [oha](https://github.com/hatoo/oha) and powered by [tui](https://github.com/tui-rs-revival/ratatui). ## Install ```shell make install-benchmark ``` ...
text-generation-inference/benchmark/README.md/0
{ "file_path": "text-generation-inference/benchmark/README.md", "repo_id": "text-generation-inference", "token_count": 189 }
378
# DataNode Recovery Design update: 5.21.2021, by [Goose](https://github.com/XuanYang-cn) update: 6.03.2021, by [Goose](https://github.com/XuanYang-cn) update: 6.21.2021, by [Goose](https://github.com/XuanYang-cn) ## What's DataNode? DataNode processes insert data and persists insert data into storage. DataNode is...
milvus/docs/design_docs/20210521-datanode_recovery_design.md/0
{ "file_path": "milvus/docs/design_docs/20210521-datanode_recovery_design.md", "repo_id": "milvus", "token_count": 1664 }
1,628
from pathlib import Path from typing import Any, List import pytest from langchain_core.documents import Document from langchain_community.document_loaders import DirectoryLoader def test_raise_error_if_path_not_exist() -> None: loader = DirectoryLoader("./not_exist_directory") with pytest.raises(FileNotFou...
langchain/libs/community/tests/unit_tests/document_loaders/test_directory.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/test_directory.py", "repo_id": "langchain", "token_count": 599 }
408
import torch from dataclasses import dataclass from text_generation_server.utils.layers import TensorParallelHead, FastLinear @dataclass class Output: logits: torch.FloatTensor = None speculative_logits: torch.FloatTensor = None class ResBlock(torch.nn.Module): def __init__(self, config, prefix, weights...
text-generation-inference/server/text_generation_server/utils/medusa.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/utils/medusa.py", "repo_id": "text-generation-inference", "token_count": 803 }
429
{ "git": { "deploymentEnabled": { "main": false } } }
chat-langchain/chat-langchain/vercel.json/0
{ "file_path": "chat-langchain/chat-langchain/vercel.json", "repo_id": "chat-langchain", "token_count": 39 }
8
# LlamaIndex Vector_Stores Integration: Awadb
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-awadb/README.md/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-awadb/README.md", "repo_id": "llama_index", "token_count": 14 }
1,592
async function test() { const { default: assert } = await import("assert"); const { OpenAI } = await import("langchain/llms/openai"); const { LLMChain } = await import("langchain/chains"); const { ChatPromptTemplate } = await import("langchain/prompts"); const { loadPrompt } = await import("langchain/prompts/...
langchainjs/environment_tests/test-exports-bun/src/import.cjs/0
{ "file_path": "langchainjs/environment_tests/test-exports-bun/src/import.cjs", "repo_id": "langchainjs", "token_count": 543 }
804