text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
import pytest from datasets.parallel import ParallelBackendConfig, parallel_backend from datasets.utils.py_utils import map_nested from .utils import require_dill_gt_0_3_2, require_joblibspark, require_not_windows def add_one(i): # picklable for multiprocessing return i + 1 @require_dill_gt_0_3_2 @require_jo...
datasets/tests/test_parallel.py/0
{ "file_path": "datasets/tests/test_parallel.py", "repo_id": "datasets", "token_count": 825 }
162
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/tokenizer_summary.md/0
{ "file_path": "transformers/docs/source/en/tokenizer_summary.md", "repo_id": "transformers", "token_count": 4925 }
467
<!--Copyright 2024 The Intel Labs Team Authors and 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...
diffusers/docs/source/en/api/pipelines/stable_diffusion/ldm3d_diffusion.md/0
{ "file_path": "diffusers/docs/source/en/api/pipelines/stable_diffusion/ldm3d_diffusion.md", "repo_id": "diffusers", "token_count": 1199 }
179
import pytest from langserve.playground import _get_mimetype @pytest.mark.parametrize( "file_extension, expected_mimetype", [ ("js", "application/javascript"), ("css", "text/css"), ("htm", "text/html"), ("html", "text/html"), ("txt", "text/plain"), # An example of an ...
langserve/tests/unit_tests/test_playground.py/0
{ "file_path": "langserve/tests/unit_tests/test_playground.py", "repo_id": "langserve", "token_count": 283 }
1,036
""" EfficientViT (by MIT Song Han's Lab) Paper: `Efficientvit: Enhanced linear attention for high-resolution low-computation visual recognition` - https://arxiv.org/abs/2205.14756 Adapted from official impl at https://github.com/mit-han-lab/efficientvit """ __all__ = ['EfficientVit'] from typing import Optional ...
pytorch-image-models/timm/models/efficientvit_mit.py/0
{ "file_path": "pytorch-image-models/timm/models/efficientvit_mit.py", "repo_id": "pytorch-image-models", "token_count": 18668 }
401
"""Base Managed Service index. An index that is built on top of a managed service. """ from abc import ABC, abstractmethod from typing import Any, Dict, Optional, Sequence, Type from llama_index.legacy.core.base_retriever import BaseRetriever from llama_index.legacy.data_structs.data_structs import IndexDict from l...
llama_index/llama-index-legacy/llama_index/legacy/indices/managed/base.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/managed/base.py", "repo_id": "llama_index", "token_count": 1271 }
1,717
import { expect, test, beforeEach } from "@jest/globals"; import chroma from "./initClient"; beforeEach(async () => { await chroma.reset(); }); test("it should list collections", async () => { let collections = await chroma.listCollections(); expect(collections).toBeDefined(); expect(collections).toBeInstance...
chroma/clients/js/test/collection.client.test.ts/0
{ "file_path": "chroma/clients/js/test/collection.client.test.ts", "repo_id": "chroma", "token_count": 1039 }
31
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use anyhow::Error as E; use clap::Parser; use candle::{DType, Device, Result, Tensor}; use candle_examples::token_output_stream::TokenOutputStream; use candle_nn::VarBuilder; use candle_transformers::model...
candle/candle-examples/examples/blip/main.rs/0
{ "file_path": "candle/candle-examples/examples/blip/main.rs", "repo_id": "candle", "token_count": 2437 }
39
<!--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 applicable law or agreed...
transformers/docs/source/ja/perf_infer_gpu_one.md/0
{ "file_path": "transformers/docs/source/ja/perf_infer_gpu_one.md", "repo_id": "transformers", "token_count": 9331 }
520
# 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/examples/pytorch/text-classification/run_glue_no_trainer.py/0
{ "file_path": "transformers/examples/pytorch/text-classification/run_glue_no_trainer.py", "repo_id": "transformers", "token_count": 11971 }
517
# coding=utf-8 # Copyright 2022 Salesforce authors, The EleutherAI, and HuggingFace Teams. 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/l...
transformers/src/transformers/models/codegen/configuration_codegen.py/0
{ "file_path": "transformers/src/transformers/models/codegen/configuration_codegen.py", "repo_id": "transformers", "token_count": 4500 }
594
# ReAct agent formatter import logging from abc import abstractmethod from typing import List, Optional, Sequence from llama_index.core.agent.react.prompts import ( CONTEXT_REACT_CHAT_SYSTEM_HEADER, REACT_CHAT_SYSTEM_HEADER, ) from llama_index.core.agent.react.types import ( BaseReasoningStep, Observa...
llama_index/llama-index-core/llama_index/core/agent/react/formatter.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/agent/react/formatter.py", "repo_id": "llama_index", "token_count": 1764 }
1,243
<jupyter_start><jupyter_text>AwaDB>[AwaDB](https://github.com/awa-ai/awadb) is an AI Native database for the search and storage of embedding vectors used by LLM Applications.This notebook explains how to use `AwaEmbeddings` in LangChain.<jupyter_code># pip install awadb<jupyter_output><empty_output><jupyter_text>import...
langchain/docs/docs/integrations/text_embedding/awadb.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/text_embedding/awadb.ipynb", "repo_id": "langchain", "token_count": 342 }
173
/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Pinecone } from "@pinecone-database/pinecone"; import { Document } from "@langchain/core/documents"; import { OpenAIEmbeddings } from "@langchain/openai"; import { PineconeStore } from "@langchain/pinecone"; // Instantiate a new Pinecone client, wh...
langchainjs/examples/src/indexes/vector_stores/pinecone/index_docs.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/pinecone/index_docs.ts", "repo_id": "langchainjs", "token_count": 411 }
831
syntax = "proto3"; package milvus.proto.indexcgo; option go_package="github.com/milvus-io/milvus/internal/proto/indexcgopb"; import "common.proto"; message TypeParams { repeated common.KeyValuePair params = 1; } message IndexParams { repeated common.KeyValuePair params = 1; } // TypeParams & IndexParams will b...
milvus/internal/proto/index_cgo_msg.proto/0
{ "file_path": "milvus/internal/proto/index_cgo_msg.proto", "repo_id": "milvus", "token_count": 206 }
1,820
# Copyright 2021 AlQuraishi Laboratory # Copyright 2021 DeepMind Technologies Limited # # 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...
transformers/src/transformers/models/esm/openfold_utils/data_transforms.py/0
{ "file_path": "transformers/src/transformers/models/esm/openfold_utils/data_transforms.py", "repo_id": "transformers", "token_count": 1505 }
603
from langchain_community.tools.slack.get_message import ( SlackGetMessage, SlackGetMessageSchema, ) __all__ = ["SlackGetMessageSchema", "SlackGetMessage"]
langchain/libs/langchain/langchain/tools/slack/get_message.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/slack/get_message.py", "repo_id": "langchain", "token_count": 57 }
557
# Label Studio >[Label Studio](https://labelstud.io/guide/get_started) is an open-source data labeling platform that provides LangChain with flexibility when it comes to labeling data for fine-tuning large language models (LLMs). It also enables the preparation of custom training data and the collection and evaluatio...
langchain/docs/docs/integrations/providers/labelstudio.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/labelstudio.mdx", "repo_id": "langchain", "token_count": 204 }
139
<jupyter_start><jupyter_text>Pre-Training a 🤗 Transformers model on TPU with **Flax/JAX**In this notebook, we will see how to pretrain one of the [🤗 Transformers](https://github.com/huggingface/transformers) models on TPU using [**Flax**](https://flax.readthedocs.io/en/latest/index.html). GPT2's causal language model...
notebooks/examples/causal_language_modeling_flax.ipynb/0
{ "file_path": "notebooks/examples/causal_language_modeling_flax.ipynb", "repo_id": "notebooks", "token_count": 8784 }
320
# coding=utf-8 # Copyright 2019 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_modeling_tf_utils.py/0
{ "file_path": "transformers/tests/test_modeling_tf_utils.py", "repo_id": "transformers", "token_count": 14964 }
804
# Structure your repository To host and share your dataset, create a dataset repository on the Hugging Face Hub and upload your data files. This guide will show you how to structure your dataset repository when you upload it. A dataset with a supported structure and file format (`.txt`, `.csv`, `.parquet`, `.jsonl`, ...
datasets/docs/source/repository_structure.mdx/0
{ "file_path": "datasets/docs/source/repository_structure.mdx", "repo_id": "datasets", "token_count": 2588 }
134
# Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor. # # 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....
datasets/metrics/matthews_correlation/matthews_correlation.py/0
{ "file_path": "datasets/metrics/matthews_correlation/matthews_correlation.py", "repo_id": "datasets", "token_count": 1736 }
121
// 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/util/cache/cache_interface.go/0
{ "file_path": "milvus/pkg/util/cache/cache_interface.go", "repo_id": "milvus", "token_count": 718 }
2,101
import utils.util_pymilvus as ut from utils.util_log import test_log as log from common.common_type import CaseLabel, CheckTasks from common import common_type as ct from common import common_func as cf from common.code_mapping import CollectionErrorMessage as clem from common.code_mapping import ConnectionErrorMessage...
milvus/tests/python_client/testcases/test_query.py/0
{ "file_path": "milvus/tests/python_client/testcases/test_query.py", "repo_id": "milvus", "token_count": 76157 }
2,187
<jupyter_start><jupyter_text>Run TemplateIn `server.py`, set -```add_routes(app, chain, path="/sql_llamacpp")```This template includes an example DB of 2023 NBA rosters.We can ask questions related to NBA players.<jupyter_code>from langserve.client import RemoteRunnable sql_app = RemoteRunnable("http://0.0.0.0:8001/s...
langchain/templates/sql-llamacpp/sql-llamacpp.ipynb/0
{ "file_path": "langchain/templates/sql-llamacpp/sql-llamacpp.ipynb", "repo_id": "langchain", "token_count": 149 }
691
"""request parser.""" import json import re from typing import Any from langchain_core.language_models import BaseLanguageModel from langchain_core.output_parsers import BaseOutputParser from langchain_core.prompts.prompt import PromptTemplate from langchain.chains.api.openapi.prompts import REQUEST_TEMPLATE from la...
langchain/libs/langchain/langchain/chains/api/openapi/requests_chain.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/api/openapi/requests_chain.py", "repo_id": "langchain", "token_count": 821 }
456
import { type OpenAIClient, type OpenAICallOptions, type OpenAIInput, type OpenAICoreRequestOptions, OpenAI, } from "@langchain/openai"; import type { BaseLLMParams } from "@langchain/core/language_models/llms"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; type FireworksUnsupportedArgs...
langchainjs/libs/langchain-community/src/llms/fireworks.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/llms/fireworks.ts", "repo_id": "langchainjs", "token_count": 1426 }
991
export { TaskCreationChain } from "./task_creation.js"; export { TaskExecutionChain } from "./task_execution.js"; export { TaskPrioritizationChain } from "./task_prioritization.js"; export { BabyAGI, type Task, type BabyAGIInputs } from "./agent.js";
langchainjs/langchain/src/experimental/babyagi/index.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/babyagi/index.ts", "repo_id": "langchainjs", "token_count": 80 }
985
--- sidebar_position: 2 --- # Testing All of our packages have unit tests and integration tests, and we favor unit tests over integration tests. Unit tests run on every pull request, so they should be fast and reliable. Integration tests run once a day, and they require more setup, so they should be reserved for co...
langchain/docs/docs/contributing/testing.mdx/0
{ "file_path": "langchain/docs/docs/contributing/testing.mdx", "repo_id": "langchain", "token_count": 1105 }
88
#! /usr/bin/python3 import argparse import logging import os import sys from collections import namedtuple import torch from modeling_bertabs import BertAbs, build_predictor from torch.utils.data import DataLoader, SequentialSampler from tqdm import tqdm from transformers import BertTokenizer from .utils_summarizati...
transformers/examples/research_projects/bertabs/run_summarization.py/0
{ "file_path": "transformers/examples/research_projects/bertabs/run_summarization.py", "repo_id": "transformers", "token_count": 4315 }
580
""" trl is an open library for RL with transformer models. Note: VERSION needs to be formatted following the MAJOR.MINOR.PATCH convention (we need to follow this convention to be able to retrieve versioned scripts) Simple check list for release from AllenNLP repo: https://github.com/allenai/allennlp/blob/maste...
trl/setup.py/0
{ "file_path": "trl/setup.py", "repo_id": "trl", "token_count": 1462 }
883
from langchain_community.document_loaders.obs_file import OBSFileLoader __all__ = ["OBSFileLoader"]
langchain/libs/langchain/langchain/document_loaders/obs_file.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/obs_file.py", "repo_id": "langchain", "token_count": 32 }
519
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datacoord/server.go/0
{ "file_path": "milvus/internal/datacoord/server.go", "repo_id": "milvus", "token_count": 14699 }
1,689
<jupyter_start><jupyter_text>Tracing via the REST API[](https://colab.research.google.com/github/langchain-ai/langsmith-cookbook/blob/main/tracing-examples/rest/rest.ipynb)It's likely that your production LLM application is written in a language other than Python or JavaScript. In this case, you can use the REST API to...
langsmith-cookbook/tracing-examples/rest/rest.ipynb/0
{ "file_path": "langsmith-cookbook/tracing-examples/rest/rest.ipynb", "repo_id": "langsmith-cookbook", "token_count": 7187 }
1,016
// eslint-disable-next-line import/no-extraneous-dependencies import Database, { Database as DatabaseType, Statement } from "better-sqlite3"; import { ListKeyOptions, RecordManagerInterface, UpdateOptions, } from "./base.js"; interface TimeRow { epoch: number; } interface KeyRecord { key: string; } /** * ...
langchainjs/libs/langchain-community/src/indexes/sqlite.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/indexes/sqlite.ts", "repo_id": "langchainjs", "token_count": 2552 }
984
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/src/query/generated/ShowPlanNodeVisitor.h/0
{ "file_path": "milvus/internal/core/src/query/generated/ShowPlanNodeVisitor.h", "repo_id": "milvus", "token_count": 518 }
1,795
<!--- Copyright 2021 The Google Flax Team Authors and 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 r...
transformers/examples/flax/token-classification/README.md/0
{ "file_path": "transformers/examples/flax/token-classification/README.md", "repo_id": "transformers", "token_count": 554 }
576
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-deeplake/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-deeplake/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,350
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datacoord/session_manager.go/0
{ "file_path": "milvus/internal/datacoord/session_manager.go", "repo_id": "milvus", "token_count": 5178 }
1,779
--- sidebar_position: 2 --- # JSON Output Functions Parser import CodeBlock from "@theme/CodeBlock"; import JSONFunctions from "@examples/prompts/json_structured_output_parser.ts"; import StreamingJSONFunctions from "@examples/prompts/json_structured_output_parser_streaming.ts"; The JSON Output Functions Parser is a...
langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/json_functions.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/json_functions.mdx", "repo_id": "langchainjs", "token_count": 552 }
771
from langchain_community.agent_toolkits.slack.toolkit import SlackToolkit __all__ = ["SlackToolkit"]
langchain/libs/langchain/langchain/agents/agent_toolkits/slack/toolkit.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/slack/toolkit.py", "repo_id": "langchain", "token_count": 34 }
438
# Evaluation ## Setting the Stage LlamaIndex is meant to connect your data to your LLM applications. Sometimes, even after diagnosing and fixing bugs by looking at traces, more fine-grained evaluation is required to systematically diagnose issues. LlamaIndex aims to provide those tools to make identifying issues an...
llama_index/docs/optimizing/evaluation/evaluation.md/0
{ "file_path": "llama_index/docs/optimizing/evaluation/evaluation.md", "repo_id": "llama_index", "token_count": 998 }
1,234
import { ChatAlibabaTongyi } from "@langchain/community/chat_models/alibaba_tongyi"; import { HumanMessage } from "@langchain/core/messages"; // Default model is qwen-turbo const qwenTurbo = new ChatAlibabaTongyi({ alibabaApiKey: "YOUR-API-KEY", // In Node.js defaults to process.env.ALIBABA_API_KEY }); // Use qwen-...
langchainjs/examples/src/models/chat/integration_alitongyi.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/integration_alitongyi.ts", "repo_id": "langchainjs", "token_count": 349 }
833
[ { "details": { "best_of_sequences": null, "finish_reason": "eos_token", "generated_tokens": 6, "prefill": [ { "id": 0, "logprob": null, "text": "<pad>" } ], "seed": null, "tokens": [ { "id": 259, ...
text-generation-inference/integration-tests/models/__snapshots__/test_mt0_base/test_mt0_base_load.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_mt0_base/test_mt0_base_load.json", "repo_id": "text-generation-inference", "token_count": 2874 }
379
import { jest, expect, describe } from "@jest/globals"; import { LLM } from "@langchain/core/language_models/llms"; import { GoogleCalendarCreateTool, GoogleCalendarViewTool, } from "../google_calendar/index.js"; jest.mock("googleapis", () => ({ google: { auth: { JWT: jest.fn().mockImplementation(() =>...
langchainjs/libs/langchain-community/src/tools/tests/google_calendar.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/tools/tests/google_calendar.test.ts", "repo_id": "langchainjs", "token_count": 1074 }
1,077
from operator import itemgetter from langchain_community.chat_models import ChatOpenAI from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorstores import Neo4jVector from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ( ChatPromptTempla...
langchain/templates/neo4j-vector-memory/neo4j_vector_memory/chain.py/0
{ "file_path": "langchain/templates/neo4j-vector-memory/neo4j_vector_memory/chain.py", "repo_id": "langchain", "token_count": 743 }
653
// 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/indexnode/indexnode.go/0
{ "file_path": "milvus/internal/indexnode/indexnode.go", "repo_id": "milvus", "token_count": 4366 }
1,854
import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { Document } from "@langchain/core/documents"; import { ChatPromptTemplate } from "@langchain/core/prompts"; import { RunnableLambda, RunnableMap, RunnablePassthrough, } fr...
langchainjs/examples/src/guides/expression_language/get_started/rag.ts/0
{ "file_path": "langchainjs/examples/src/guides/expression_language/get_started/rag.ts", "repo_id": "langchainjs", "token_count": 466 }
795
"""Integration test for Connery API Wrapper.""" from langchain_community.tools.connery import ConneryService def test_list_actions() -> None: """Test for listing Connery Actions.""" connery = ConneryService() output = connery._list_actions() assert output is not None assert len(output) > 0 def t...
langchain/libs/community/tests/integration_tests/tools/connery/test_service.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/tools/connery/test_service.py", "repo_id": "langchain", "token_count": 531 }
343
# type: ignore import traceback import requests from urllib3.connectionpool import InsecureRequestWarning import chromadb from chromadb.api.fastapi import FastAPI from chromadb.api.types import QueryResult, EmbeddingFunction, Document from chromadb.config import Settings import chromadb.server.fastapi import pytest im...
chroma/chromadb/test/test_api.py/0
{ "file_path": "chroma/chromadb/test/test_api.py", "repo_id": "chroma", "token_count": 19156 }
25
ENV_LOCAL_PATH=/app/.env.local if test -z "${DOTENV_LOCAL}" ; then if ! test -f "${ENV_LOCAL_PATH}" ; then echo "DOTENV_LOCAL was not found in the ENV variables and .env.local is not set using a bind volume. We are using the default .env config." fi; else echo "DOTENV_LOCAL was found in the ENV var...
chat-ui/entrypoint.sh/0
{ "file_path": "chat-ui/entrypoint.sh", "repo_id": "chat-ui", "token_count": 385 }
81
from langchain_community.document_loaders.conllu import CoNLLULoader __all__ = ["CoNLLULoader"]
langchain/libs/langchain/langchain/document_loaders/conllu.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/conllu.py", "repo_id": "langchain", "token_count": 36 }
478
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "tools/searxng_search", }); export * from "@langchain/community/tools/searxng_search";
langchainjs/langchain/src/tools/searxng_search.ts/0
{ "file_path": "langchainjs/langchain/src/tools/searxng_search.ts", "repo_id": "langchainjs", "token_count": 78 }
996
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/mq/msgdispatcher/dispatcher_test.go/0
{ "file_path": "milvus/pkg/mq/msgdispatcher/dispatcher_test.go", "repo_id": "milvus", "token_count": 1723 }
1,821
python_tests( interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-integrations/llms/llama-index-llms-llama-api/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-llama-api/tests/BUILD", "repo_id": "llama_index", "token_count": 29 }
1,402
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/tutorials/tutorial_overview.md/0
{ "file_path": "diffusers/docs/source/en/tutorials/tutorial_overview.md", "repo_id": "diffusers", "token_count": 412 }
181
# 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/layoutlmv3/tokenization_layoutlmv3_fast.py/0
{ "file_path": "transformers/src/transformers/models/layoutlmv3/tokenization_layoutlmv3_fast.py", "repo_id": "transformers", "token_count": 18716 }
679
#################################################################################################### # Copyright (c) 2021-, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a...
transformers/src/transformers/models/megatron_gpt2/convert_megatron_gpt2_checkpoint.py/0
{ "file_path": "transformers/src/transformers/models/megatron_gpt2/convert_megatron_gpt2_checkpoint.py", "repo_id": "transformers", "token_count": 5493 }
692
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "retrievers/tavily_search_api", }); export * from "@langchain/community/retrievers/tavily_search_api";
langchainjs/langchain/src/retrievers/tavily_search_api.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/tavily_search_api.ts", "repo_id": "langchainjs", "token_count": 84 }
1,012
from llama_index.core.readers.base import BaseReader from llama_index.readers.huggingface_fs import HuggingFaceFSReader def test_class(): names_of_base_classes = [b.__name__ for b in HuggingFaceFSReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-huggingface-fs/tests/test_readers_huggingface.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-huggingface-fs/tests/test_readers_huggingface.py", "repo_id": "llama_index", "token_count": 96 }
1,460
# Turbopuffer ## Setup First you must sign up for a Turbopuffer account [here](https://turbopuffer.com/join). Then, once you have an account you can create an API key. Set your API key as an environment variable: ```bash export TURBOPUFFER_API_KEY=<YOUR_API_KEY> ``` ## Usage import CodeBlock from "@theme/CodeBloc...
langchainjs/docs/core_docs/docs/integrations/vectorstores/turbopuffer.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/turbopuffer.mdx", "repo_id": "langchainjs", "token_count": 225 }
797
from langchain_core.prompts.pipeline import PipelinePromptTemplate, _get_inputs __all__ = ["PipelinePromptTemplate", "_get_inputs"]
langchain/libs/langchain/langchain/prompts/pipeline.py/0
{ "file_path": "langchain/libs/langchain/langchain/prompts/pipeline.py", "repo_id": "langchain", "token_count": 45 }
577
# Templates Highlighting a few different categories of templates ## ⭐ Popular These are some of the more popular templates to get started with. - [Retrieval Augmented Generation Chatbot](../rag-conversation): Build a chatbot over your data. Defaults to OpenAI and Pinecone. - [Extraction with OpenAI Functions](../ex...
langchain/templates/docs/INDEX.md/0
{ "file_path": "langchain/templates/docs/INDEX.md", "repo_id": "langchain", "token_count": 1587 }
652
from llama_index.core.llms.base import BaseLLM from llama_index.llms.portkey import Portkey def test_embedding_class(): names_of_base_classes = [b.__name__ for b in Portkey.__mro__] assert BaseLLM.__name__ in names_of_base_classes
llama_index/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py", "repo_id": "llama_index", "token_count": 91 }
1,277
from langchain_community.llms import Cohere chat = Cohere()
langchain/templates/cohere-librarian/cohere_librarian/chat.py/0
{ "file_path": "langchain/templates/cohere-librarian/cohere_librarian/chat.py", "repo_id": "langchain", "token_count": 19 }
687
from typing import Dict, List from llama_index.legacy.indices.tree.base import TreeIndex from llama_index.legacy.schema import Document from llama_index.legacy.service_context import ServiceContext def test_query( documents: List[Document], mock_service_context: ServiceContext, struct_kwargs: Dict, ) -> ...
llama_index/llama-index-legacy/tests/indices/tree/test_retrievers.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/tree/test_retrievers.py", "repo_id": "llama_index", "token_count": 485 }
1,802
# LlamaIndex Kvstore Integration: Redis Kvstore
llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-redis/README.md/0
{ "file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-redis/README.md", "repo_id": "llama_index", "token_count": 15 }
1,501
# 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/src/transformers/models/vits/convert_original_checkpoint.py/0
{ "file_path": "transformers/src/transformers/models/vits/convert_original_checkpoint.py", "repo_id": "transformers", "token_count": 8722 }
672
# 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 applicabl...
diffusers/examples/community/pipeline_animatediff_controlnet.py/0
{ "file_path": "diffusers/examples/community/pipeline_animatediff_controlnet.py", "repo_id": "diffusers", "token_count": 24518 }
204
import { test, expect, describe } from "@jest/globals"; import { readFileSync } from "fs"; import { getText, parseInputs } from "../webbrowser.js"; describe("webbrowser Test suite", () => { const html = readFileSync("./src/tools/fixtures/wordoftheday.html", "utf8"); test("parse html to text and links", async () =...
langchainjs/langchain/src/tools/tests/webbrowser.test.ts/0
{ "file_path": "langchainjs/langchain/src/tools/tests/webbrowser.test.ts", "repo_id": "langchainjs", "token_count": 609 }
918
// 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/config/file_source.go/0
{ "file_path": "milvus/pkg/config/file_source.go", "repo_id": "milvus", "token_count": 1552 }
1,807
// Default generic "any" values are for backwards compatibility. // Replace with "string" when we are comfortable with a breaking change. import type { InputValues, PartialValues, StringWithAutocomplete, } from "../utils/types.js"; import { type BasePromptValueInterface } from "../prompt_values.js"; import { Bas...
langchainjs/langchain-core/src/prompts/base.ts/0
{ "file_path": "langchainjs/langchain-core/src/prompts/base.ts", "repo_id": "langchainjs", "token_count": 2099 }
877
from typing import Callable, Optional from llama_index.core.bridge.pydantic import BaseModel from llama_index.core.callbacks.base import CallbackManager from llama_index.core.indices.prompt_helper import PromptHelper from llama_index.core.prompts import BasePromptTemplate from llama_index.core.prompts.default_prompt_s...
llama_index/llama-index-core/llama_index/core/response_synthesizers/factory.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/response_synthesizers/factory.py", "repo_id": "llama_index", "token_count": 2862 }
1,174
package lock import ( "sync" "time" "github.com/cockroachdb/errors" "go.uber.org/zap" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/metrics" "github.com/milvus-io/milvus/pkg/util/paramtable" ) type MetricsLockManager struct { rwLocks map[string]*MetricsRWMutex } type MetricsRWMutex...
milvus/pkg/util/lock/metric_mutex.go/0
{ "file_path": "milvus/pkg/util/lock/metric_mutex.go", "repo_id": "milvus", "token_count": 1231 }
1,910
import unittest from unittest.mock import patch import pytest from pytest import CaptureFixture from datasets.utils import ( are_progress_bars_disabled, disable_progress_bars, enable_progress_bars, tqdm, ) class TestTqdmUtils(unittest.TestCase): @pytest.fixture(autouse=True) def capsys(self,...
datasets/tests/test_tqdm.py/0
{ "file_path": "datasets/tests/test_tqdm.py", "repo_id": "datasets", "token_count": 1804 }
159
from langchain_community.chat_models import ChatOpenAI from langchain_community.embeddings import HuggingFaceEmbeddings from langchain_community.vectorstores import Redis from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain_core.pydantic_v1 impor...
langchain/templates/rag-redis/rag_redis/chain.py/0
{ "file_path": "langchain/templates/rag-redis/rag_redis/chain.py", "repo_id": "langchain", "token_count": 541 }
699
import numpy as np import torch import torch.nn as nn from transformers import CLIPConfig, CLIPVisionModelWithProjection, PreTrainedModel from ...utils import logging logger = logging.get_logger(__name__) class IFSafetyChecker(PreTrainedModel): config_class = CLIPConfig _no_split_modules = ["CLIPEncoderLa...
diffusers/src/diffusers/pipelines/deepfloyd_if/safety_checker.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deepfloyd_if/safety_checker.py", "repo_id": "diffusers", "token_count": 913 }
239
# LlamaIndex Llms Integration: Clarifai
llama_index/llama-index-integrations/llms/llama-index-llms-clarifai/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-clarifai/README.md", "repo_id": "llama_index", "token_count": 12 }
1,278
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/auto.md/0
{ "file_path": "transformers/docs/source/en/model_doc/auto.md", "repo_id": "transformers", "token_count": 2594 }
438
python_tests()
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-rankgpt-rerank/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-rankgpt-rerank/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,267
# coding=utf-8 # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved. # # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX # and OPT implementations in this library. It has been modified from its # original forms to accommodate minor architectural differences compared # to G...
text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_config.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/idefics_config.py", "repo_id": "text-generation-inference", "token_count": 6204 }
384
python_sources()
llama_index/llama-index-core/llama_index/core/extractors/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/extractors/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,187
from llama_index.legacy.memory.chat_memory_buffer import ChatMemoryBuffer from llama_index.legacy.memory.types import BaseMemory __all__ = ["BaseMemory", "ChatMemoryBuffer"]
llama_index/llama-index-legacy/llama_index/legacy/memory/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/memory/__init__.py", "repo_id": "llama_index", "token_count": 52 }
1,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/mock_data.go/0
{ "file_path": "milvus/internal/querynodev2/segments/mock_data.go", "repo_id": "milvus", "token_count": 20849 }
1,775
from langchain_community.chat_loaders.whatsapp import WhatsAppChatLoader __all__ = ["WhatsAppChatLoader"]
langchain/libs/langchain/langchain/chat_loaders/whatsapp.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_loaders/whatsapp.py", "repo_id": "langchain", "token_count": 32 }
495
from typing import Any, Dict from llama_index.core.embeddings.mock_embed_model import MockEmbedding from llama_index.core.embeddings.utils import resolve_embed_model from llama_index.embeddings.huggingface import ( HuggingFaceEmbedding, ) from pytest import MonkeyPatch def mock_hf_embeddings(self: Any, *args: An...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface/tests/test_hf_utils.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-huggingface/tests/test_hf_utils.py", "repo_id": "llama_index", "token_count": 443 }
1,313
from .chunk_utils import chunk_layer from .data_transforms import make_atom14_masks from .feats import atom14_to_atom37, frames_and_literature_positions_to_atom14_pos, torsion_angles_to_frames from .loss import compute_predicted_aligned_error, compute_tm from .protein import Protein as OFProtein from .protein import to...
transformers/src/transformers/models/esm/openfold_utils/__init__.py/0
{ "file_path": "transformers/src/transformers/models/esm/openfold_utils/__init__.py", "repo_id": "transformers", "token_count": 144 }
615
"""Wrapper around LiteLLM's model I/O library.""" from __future__ import annotations import logging from typing import ( Any, AsyncIterator, Callable, Dict, Iterator, List, Mapping, Optional, Tuple, Type, Union, ) from langchain_core.callbacks import ( AsyncCallbackMana...
langchain/libs/community/langchain_community/chat_models/litellm.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_models/litellm.py", "repo_id": "langchain", "token_count": 6733 }
245
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/core/src/exec/QueryContext.h/0
{ "file_path": "milvus/internal/core/src/exec/QueryContext.h", "repo_id": "milvus", "token_count": 2816 }
1,866
# The tokenization pipeline When calling `Tokenizer.encode` or `Tokenizer.encode_batch`, the input text(s) go through the following pipeline: - `normalization` - `pre-tokenization` - `model` - `post-processing` We'll see in details what happens during each of those steps in detail, as well as when you want t...
tokenizers/docs/source-doc-builder/pipeline.mdx/0
{ "file_path": "tokenizers/docs/source-doc-builder/pipeline.mdx", "repo_id": "tokenizers", "token_count": 5903 }
412
<jupyter_start><jupyter_text>[Beta] Multi-modal ReAct AgentIn this tutorial we show you how to construct a multi-modal ReAct agent.This is an agent that can take in both text and images as the input task definition, and go through chain-of-thought + tool use to try to solve the task.This is implemented with our lower-l...
llama_index/docs/examples/multi_modal/mm_agent.ipynb/0
{ "file_path": "llama_index/docs/examples/multi_modal/mm_agent.ipynb", "repo_id": "llama_index", "token_count": 2291 }
1,120
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-pgvecto-rs/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-pgvecto-rs/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,531
import sys import time import timeout_decorator from numpy import NaN from pymilvus import Collection from pymilvus import MilvusClient sys.path.append("..") from check.func_check import ResponseChecker from utils.api_request import api_request from utils.wrapper import trace from utils.util_log import test_log as lo...
milvus/tests/python_client/base/high_level_api_wrapper.py/0
{ "file_path": "milvus/tests/python_client/base/high_level_api_wrapper.py", "repo_id": "milvus", "token_count": 16421 }
2,160
from langchain_core.messages import AIMessage, AIMessageChunk, HumanMessage from langchain_community.chat_models.sparkllm import ChatSparkLLM def test_chat_spark_llm() -> None: chat = ChatSparkLLM() message = HumanMessage(content="Hello") response = chat([message]) assert isinstance(response, AIMessa...
langchain/libs/community/tests/integration_tests/chat_models/test_sparkllm.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/chat_models/test_sparkllm.py", "repo_id": "langchain", "token_count": 435 }
325
from langchain.chains import LLMChain from langchain.prompts import PromptTemplate from langchain_core.language_models import BaseLanguageModel class TaskCreationChain(LLMChain): """Chain generating tasks.""" @classmethod def from_llm(cls, llm: BaseLanguageModel, verbose: bool = True) -> LLMChain: ...
langchain/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/task_creation.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/task_creation.py", "repo_id": "langchain", "token_count": 523 }
414
{ "name": "Grace 🧤", "type": "personal_chat", "id": 2730825451, "messages": [ { "id": 1980499, "type": "message", "date": "2020-01-01T00:00:02", "from": "Henry", "from_id": 4325636679, "text": "It's 2020..." }, { "id": 1980500, "type": "message", ...
langchain/docs/docs/integrations/document_loaders/example_data/telegram.json/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/example_data/telegram.json", "repo_id": "langchain", "token_count": 360 }
111
# 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/vit/convert_dino_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/vit/convert_dino_to_pytorch.py", "repo_id": "transformers", "token_count": 3685 }
762
# 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/flaubert/test_modeling_flaubert.py/0
{ "file_path": "transformers/tests/models/flaubert/test_modeling_flaubert.py", "repo_id": "transformers", "token_count": 8596 }
760
python_requirements( name="reqs", ) python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/simple_web/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/simple_web/BUILD", "repo_id": "llama_index", "token_count": 24 }
1,569
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-stackoverflow/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-stackoverflow/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,422