text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
{ "name": "tokenizers-win32-x64-msvc", "version": "0.13.4-rc1", "os": [ "win32" ], "cpu": [ "x64" ], "main": "tokenizers.win32-x64-msvc.node", "files": [ "tokenizers.win32-x64-msvc.node" ], "description": "Tokenizers platform specific bindings", "keywords": [ "napi-rs", "NAPI",...
tokenizers/bindings/node/npm/win32-x64-msvc/package.json/0
{ "file_path": "tokenizers/bindings/node/npm/win32-x64-msvc/package.json", "repo_id": "tokenizers", "token_count": 277 }
436
python_requirements( name="reqs", ) python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/unstructured/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/unstructured/BUILD", "repo_id": "llama_index", "token_count": 24 }
1,319
from langchain_community.chat_message_histories.mongodb import ( MongoDBChatMessageHistory, ) __all__ = ["MongoDBChatMessageHistory"]
langchain/libs/langchain/langchain/memory/chat_message_histories/mongodb.py/0
{ "file_path": "langchain/libs/langchain/langchain/memory/chat_message_histories/mongodb.py", "repo_id": "langchain", "token_count": 45 }
529
python_sources()
llama_index/llama-index-core/llama_index/core/base/query_pipeline/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/base/query_pipeline/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,162
// 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/indexnode_manager.go/0
{ "file_path": "milvus/internal/datacoord/indexnode_manager.go", "repo_id": "milvus", "token_count": 2919 }
1,766
import os from enum import Enum from typing import Any, Dict, List, Optional from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever class SearchDepth(Enum): """Search depth as enumerator.""" BASIC ...
langchain/libs/community/langchain_community/retrievers/tavily_search_api.py/0
{ "file_path": "langchain/libs/community/langchain_community/retrievers/tavily_search_api.py", "repo_id": "langchain", "token_count": 1412 }
289
import { Redis as UpstashRedis, type RedisConfigNodejs } from "@upstash/redis"; import { BaseStore } from "@langchain/core/stores"; /** * Type definition for the input parameters required to initialize an * instance of the UpstashStoreInput class. */ export interface UpstashRedisStoreInput { sessionTTL?: number;...
langchainjs/libs/langchain-community/src/storage/upstash_redis.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/storage/upstash_redis.ts", "repo_id": "langchainjs", "token_count": 1937 }
1,000
python_tests()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-clickhouse/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-clickhouse/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,454
<jupyter_start><jupyter_text>Monster API LLamaIndexMonsterAPI Hosts wide range of popular LLMs as inference service and this notebook serves as a tutorial about how to use llama-index to access MonsterAPI LLMs.Check us out here: https://monsterapi.ai/ Install Required Libraries<jupyter_code>%pip install llama-index-ll...
llama_index/docs/examples/llm/monsterapi.ipynb/0
{ "file_path": "llama_index/docs/examples/llm/monsterapi.ipynb", "repo_id": "llama_index", "token_count": 3068 }
1,089
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/blenderbot/test_modeling_tf_blenderbot.py/0
{ "file_path": "transformers/tests/models/blenderbot/test_modeling_tf_blenderbot.py", "repo_id": "transformers", "token_count": 3935 }
770
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-obsidian/llama_index/readers/obsidian/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-obsidian/llama_index/readers/obsidian/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,417
# 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/setup.py/0
{ "file_path": "diffusers/setup.py", "repo_id": "diffusers", "token_count": 3764 }
222
# coding=utf-8 # Copyright 2020 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 law...
transformers/tests/models/funnel/test_tokenization_funnel.py/0
{ "file_path": "transformers/tests/models/funnel/test_tokenization_funnel.py", "repo_id": "transformers", "token_count": 1257 }
747
# Serving Private & Gated Models If the model you wish to serve is behind gated access or the model repository on Hugging Face Hub is private, and you have access to the model, you can provide your Hugging Face Hub access token. You can generate and copy a read token from [Hugging Face Hub tokens page](https://hugging...
text-generation-inference/docs/source/basic_tutorials/gated_model_access.md/0
{ "file_path": "text-generation-inference/docs/source/basic_tutorials/gated_model_access.md", "repo_id": "text-generation-inference", "token_count": 320 }
419
# 🦜️🧑‍🤝‍🧑 LangChain Community [![CI](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml/badge.svg)](https://github.com/langchain-ai/langchainjs/actions/workflows/ci.yml) ![npm](https://img.shields.io/npm/dw/@langchain/community) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg...
langchainjs/libs/langchain-community/README.md/0
{ "file_path": "langchainjs/libs/langchain-community/README.md", "repo_id": "langchainjs", "token_count": 794 }
978
from langchain_community.callbacks.mlflow_callback import ( MlflowCallbackHandler, MlflowLogger, analyze_text, construct_html_from_prompt_and_generation, ) __all__ = [ "analyze_text", "construct_html_from_prompt_and_generation", "MlflowLogger", "MlflowCallbackHandler", ]
langchain/libs/langchain/langchain/callbacks/mlflow_callback.py/0
{ "file_path": "langchain/libs/langchain/langchain/callbacks/mlflow_callback.py", "repo_id": "langchain", "token_count": 123 }
450
<jupyter_start><jupyter_text>PII Masking If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-openai %pip install llama-index-llms-huggingface !pip install llama-index import logging import sys logging.basicConfig(stream=sys.stdout, level...
llama_index/docs/examples/node_postprocessor/PII.ipynb/0
{ "file_path": "llama_index/docs/examples/node_postprocessor/PII.ipynb", "repo_id": "llama_index", "token_count": 1302 }
1,076
use std::collections::{HashMap, HashSet}; use crate::utils::SysRegex; use serde::{Deserialize, Serialize}; use crate::tokenizer::{ Decoder, Encoding, PostProcessor, PreTokenizedString, PreTokenizer, Result, SplitDelimiterBehavior, }; use crate::utils::macro_rules_attribute; /// Converts bytes to unicode char...
tokenizers/tokenizers/src/pre_tokenizers/byte_level.rs/0
{ "file_path": "tokenizers/tokenizers/src/pre_tokenizers/byte_level.rs", "repo_id": "tokenizers", "token_count": 10930 }
438
from llama_index.legacy.tools.tool_spec.load_and_search.base import ( LoadAndSearchToolSpec, ) __all__ = ["LoadAndSearchToolSpec"]
llama_index/llama-index-legacy/llama_index/legacy/tools/tool_spec/load_and_search/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/tools/tool_spec/load_and_search/__init__.py", "repo_id": "llama_index", "token_count": 50 }
1,649
terraform { required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } } } # Define provider variable "AWS_ACCESS_KEY" {} variable "AWS_SECRET_ACCESS_KEY" {} provider "aws" { access_key = var.AWS_ACCESS_KEY secret_key = var.AWS_SECRET_ACCESS_KEY region = var.region }...
chroma/examples/deployments/aws-terraform/chroma.tf/0
{ "file_path": "chroma/examples/deployments/aws-terraform/chroma.tf", "repo_id": "chroma", "token_count": 1693 }
40
from __future__ import annotations from typing import Any, Callable, Dict, Optional from langchain_core.output_parsers import BaseOutputParser class GuardrailsOutputParser(BaseOutputParser): """Parse the output of an LLM call using Guardrails.""" guard: Any """The Guardrails object.""" api: Optiona...
langchain/libs/community/langchain_community/output_parsers/rail_parser.py/0
{ "file_path": "langchain/libs/community/langchain_community/output_parsers/rail_parser.py", "repo_id": "langchain", "token_count": 1568 }
284
python_tests()
llama_index/llama-index-integrations/llms/llama-index-llms-portkey/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-portkey/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,327
import pytest import time from time import sleep from pathlib import Path from datetime import datetime import json from pymilvus import connections from common.cus_resource_opts import CustomResourceOperations as CusResource from common.milvus_sys import MilvusSys from chaos import chaos_commons as cc import logging a...
milvus/tests/python_client/chaos/test_chaos_apply_to_determined_pod.py/0
{ "file_path": "milvus/tests/python_client/chaos/test_chaos_apply_to_determined_pod.py", "repo_id": "milvus", "token_count": 3541 }
2,174
[ { "server": "idc-sh004", "suite_params": [ { "suite": "2_insert_build.yaml", "image_type": "cpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/build.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/build.json", "repo_id": "milvus", "token_count": 136 }
2,138
"use client"; import { useState, type FormEvent } from "react"; import DEFAULT_RETRIEVAL_TEXT from "@/data/DefaultRetrievalText"; export function UploadDocumentsForm() { const [isLoading, setIsLoading] = useState(false); const [document, setDocument] = useState(DEFAULT_RETRIEVAL_TEXT); const ingest = async (e: ...
langchain-nextjs-template/components/UploadDocumentsForm.tsx/0
{ "file_path": "langchain-nextjs-template/components/UploadDocumentsForm.tsx", "repo_id": "langchain-nextjs-template", "token_count": 1156 }
70
# Copyright 2021 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
accelerate/src/accelerate/utils/deepspeed.py/0
{ "file_path": "accelerate/src/accelerate/utils/deepspeed.py", "repo_id": "accelerate", "token_count": 3992 }
16
export * from "@langchain/core/load/serializable";
langchainjs/libs/langchain-community/src/load/serializable.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/load/serializable.ts", "repo_id": "langchainjs", "token_count": 15 }
976
from typing import List from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts.few_shot import FewShotPromptTemplate from langchain_core.prompts.prompt import PromptTemplate from langchain.chains.llm import LLMChain TEST_GEN_TEMPLATE_SUFFIX = "Add another example." def generate_ex...
langchain/libs/langchain/langchain/chains/example_generator.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/example_generator.py", "repo_id": "langchain", "token_count": 261 }
460
# openai # your api key from https://platform.openai.com/account/api-keys OPENAI_API_KEY=your_openai_api_key_here # searchapi # your api key from https://www.searchapi.io/ SEARCHAPI_API_KEY=your_searchapi_api_key_here # power bi # sign in to azure in order to authenticate with DefaultAzureCredentials # details here...
langchain/libs/langchain/tests/integration_tests/.env.example/0
{ "file_path": "langchain/libs/langchain/tests/integration_tests/.env.example", "repo_id": "langchain", "token_count": 299 }
588
<!--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/en/perf_torch_compile.md/0
{ "file_path": "transformers/docs/source/en/perf_torch_compile.md", "repo_id": "transformers", "token_count": 5859 }
499
python_tests( name="tests", dependencies=[ 'llama-index-core/tests/indices/vector_store/mock_services.py', ] )
llama_index/llama-index-core/tests/indices/response/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/indices/response/BUILD", "repo_id": "llama_index", "token_count": 58 }
1,314
python_tests()
llama_index/llama-index-integrations/output_parsers/llama-index-output-parsers-langchain/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/output_parsers/llama-index-output-parsers-langchain/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,348
<jupyter_start><jupyter_text>GooseAI`GooseAI` is a fully managed NLP-as-a-Service, delivered via API. GooseAI provides access to [these models](https://goose.ai/docs/models).This notebook goes over how to use Langchain with [GooseAI](https://goose.ai/). Install openaiThe `openai` package is required to use the GooseAI...
langchain/docs/docs/integrations/llms/gooseai.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/gooseai.ipynb", "repo_id": "langchain", "token_count": 569 }
129
import gzip import os import datasets import pytest from ..utils import data_dir, train_files class TestTrainFromIterators: @staticmethod def get_tokenizer_trainer(): # START init_tokenizer_trainer from tokenizers import Tokenizer, decoders, models, normalizers, pre_tokenizers, trainers ...
tokenizers/bindings/python/tests/documentation/test_tutorial_train_from_iterators.py/0
{ "file_path": "tokenizers/bindings/python/tests/documentation/test_tutorial_train_from_iterators.py", "repo_id": "tokenizers", "token_count": 1587 }
442
[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 = ["argilla_callback_handler"] contains_example = false import_path = "llama_index.callbacks....
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-argilla/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-argilla/pyproject.toml", "repo_id": "llama_index", "token_count": 647 }
1,169
""" An implementation of RepGhostNet Model as defined in: RepGhost: A Hardware-Efficient Ghost Module via Re-parameterization. https://arxiv.org/abs/2211.06088 Original implementation: https://github.com/ChengpengChen/RepGhost """ import copy from functools import partial import torch import torch.nn as nn import tor...
pytorch-image-models/timm/models/repghost.py/0
{ "file_path": "pytorch-image-models/timm/models/repghost.py", "repo_id": "pytorch-image-models", "token_count": 8148 }
381
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ko/fast_tokenizers.md/0
{ "file_path": "transformers/docs/source/ko/fast_tokenizers.md", "repo_id": "transformers", "token_count": 1829 }
540
FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04 LABEL maintainer="Hugging Face" LABEL repository="diffusers" ENV DEBIAN_FRONTEND=noninteractive RUN apt update && \ apt install -y bash \ build-essential \ git \ git-lfs \ curl \ ca-certificates \ libsndfile1-dev \ libgl1 \ python3.9 \ ...
diffusers/docker/diffusers-pytorch-compile-cuda/Dockerfile/0
{ "file_path": "diffusers/docker/diffusers-pytorch-compile-cuda/Dockerfile", "repo_id": "diffusers", "token_count": 432 }
175
import { test, expect } from "@jest/globals"; import { HumanMessage, AIMessage } from "@langchain/core/messages"; import { ChatMessageHistory } from "@langchain/community/stores/message/in_memory"; import { BufferWindowMemory } from "../buffer_window_memory.js"; test("Test buffer window memory", async () => { const ...
langchainjs/langchain/src/memory/tests/buffer_window_memory.test.ts/0
{ "file_path": "langchainjs/langchain/src/memory/tests/buffer_window_memory.test.ts", "repo_id": "langchainjs", "token_count": 636 }
934
"""Tool for the OpenWeatherMap API.""" from typing import Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.pydantic_v1 import Field from langchain_core.tools import BaseTool from langchain_community.utilities.openweathermap import OpenWeatherMapAPIWrapper class OpenWeathe...
langchain/libs/community/langchain_community/tools/openweathermap/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/openweathermap/tool.py", "repo_id": "langchain", "token_count": 323 }
304
# (Gluon) SE-ResNeXt **SE ResNeXt** is a variant of a [ResNext](https://www.paperswithcode.com/method/resnext) that employs [squeeze-and-excitation blocks](https://paperswithcode.com/method/squeeze-and-excitation-block) to enable the network to perform dynamic channel-wise feature recalibration. The weights from this...
pytorch-image-models/docs/models/.templates/models/gloun-seresnext.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/gloun-seresnext.md", "repo_id": "pytorch-image-models", "token_count": 1705 }
357
<jupyter_start><jupyter_text>AWS DynamoDB>[Amazon AWS DynamoDB](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/index.html) is a fully managed `NoSQL` database service that provides fast and predictable performance with seamless scalability.This notebook goes over how to use `DynamoDB` to st...
langchain/docs/docs/integrations/memory/aws_dynamodb.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/memory/aws_dynamodb.ipynb", "repo_id": "langchain", "token_count": 1753 }
128
# for backwards compatibility from llama_index.legacy.service_context import ServiceContext __all__ = [ "ServiceContext", ]
llama_index/llama-index-legacy/llama_index/legacy/indices/service_context.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/service_context.py", "repo_id": "llama_index", "token_count": 38 }
1,565
"""Test FAISS functionality.""" import datetime import math import tempfile from typing import Union import pytest from langchain_core.documents import Document from langchain_community.docstore.base import Docstore from langchain_community.docstore.in_memory import InMemoryDocstore from langchain_community.vectorsto...
langchain/libs/community/tests/unit_tests/vectorstores/test_faiss.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/vectorstores/test_faiss.py", "repo_id": "langchain", "token_count": 12987 }
395
<jupyter_start><jupyter_text>Introduction to 🤗 Diffusers In this notebook, you'll train your first diffusion model to **generate images of cute butterflies 🦋.** Along the way, you'll learn about the core components of the 🤗 Diffusers library, which will provide a good foundation for the more advanced applications th...
diffusion-models-class/unit1/01_introduction_to_diffusers.ipynb/0
{ "file_path": "diffusion-models-class/unit1/01_introduction_to_diffusers.ipynb", "repo_id": "diffusion-models-class", "token_count": 8549 }
301
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-clickhouse/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-clickhouse/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,349
# These kubernetes manifests are UNDER ACTIVE DEVELOPMENT and are not yet ready for production use. # They will be used for the upcoming distributed version of chroma. They are not even ready # for testing yet. Please do not use them unless you are working on the distributed version of chroma. # Create a memberlist c...
chroma/k8s/test/test_memberlist_cr.yaml/0
{ "file_path": "chroma/k8s/test/test_memberlist_cr.yaml", "repo_id": "chroma", "token_count": 338 }
54
"""Init params."""
llama_index/llama-index-core/tests/indices/query/__init__.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/query/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,158
python_sources()
llama_index/llama-index-packs/llama-index-packs-cogniswitch-agent/examples/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-cogniswitch-agent/examples/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,647
import os from tempfile import TemporaryDirectory from unittest import TestCase import pytest from absl.testing import parameterized from datasets import config from datasets.arrow_reader import HF_GCP_BASE_URL from datasets.builder import DatasetBuilder from datasets.dataset_dict import IterableDatasetDict from data...
datasets/tests/test_hf_gcp.py/0
{ "file_path": "datasets/tests/test_hf_gcp.py", "repo_id": "datasets", "token_count": 1782 }
144
# 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/nougat/tokenization_nougat_fast.py/0
{ "file_path": "transformers/src/transformers/models/nougat/tokenization_nougat_fast.py", "repo_id": "transformers", "token_count": 10582 }
641
# Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
accelerate/examples/inference/llama.py/0
{ "file_path": "accelerate/examples/inference/llama.py", "repo_id": "accelerate", "token_count": 695 }
7
<jupyter_start><jupyter_text>DeepSparseThis page covers how to use the [DeepSparse](https://github.com/neuralmagic/deepsparse) inference runtime within LangChain.It is broken into two parts: installation and setup, and then examples of DeepSparse usage. Installation and Setup- Install the Python package with `pip insta...
langchain/docs/docs/integrations/llms/deepsparse.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/deepsparse.ipynb", "repo_id": "langchain", "token_count": 424 }
127
<!--- 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 ...
transformers/templates/adding_a_new_example_script/README.md/0
{ "file_path": "transformers/templates/adding_a_new_example_script/README.md", "repo_id": "transformers", "token_count": 444 }
710
# coding=utf-8 # Copyright 2023 The Suno AI Authors and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
transformers/src/transformers/models/bark/configuration_bark.py/0
{ "file_path": "transformers/src/transformers/models/bark/configuration_bark.py", "repo_id": "transformers", "token_count": 4847 }
571
"""Common structures for structured indices.""" from dataclasses import dataclass from typing import Dict, Optional from dataclasses_json import DataClassJsonMixin # TODO: migrate this to be a data_struct @dataclass class SQLContextContainer(DataClassJsonMixin): """SQLContextContainer. A container interface...
llama_index/llama-index-legacy/llama_index/legacy/indices/common/struct_store/schema.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/common/struct_store/schema.py", "repo_id": "llama_index", "token_count": 216 }
1,569
"""Code to dynamically create pydantic models for validating requests and responses. Requests share the same basic shape of input, config, and kwargs. Invoke and Batch responses use an `output` key for the output, other keys may be added to the response at a later date. Responses for stream and stream_log are specif...
langserve/langserve/validation.py/0
{ "file_path": "langserve/langserve/validation.py", "repo_id": "langserve", "token_count": 7127 }
1,053
# 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/src/transformers/models/vits/__init__.py/0
{ "file_path": "transformers/src/transformers/models/vits/__init__.py", "repo_id": "transformers", "token_count": 732 }
687
use crate::{ config::{Configurable, WorkerConfig}, errors::ChromaError, }; use super::{ config::{AssignmentPolicyConfig, HasherType}, rendezvous_hash::{assign, AssignmentError, Murmur3Hasher}, }; use async_trait::async_trait; /* =========================================== Interfaces ==================...
chroma/rust/worker/src/assignment/assignment_policy.rs/0
{ "file_path": "chroma/rust/worker/src/assignment/assignment_policy.rs", "repo_id": "chroma", "token_count": 1148 }
60
# Partial prompt templates Like other methods, it can make sense to "partial" a prompt template - eg pass in a subset of the required values, as to create a new prompt template which expects only the remaining subset of values. LangChain supports this in two ways: 1. Partial formatting with string values. 2. Partial...
langchainjs/docs/core_docs/docs/modules/model_io/prompts/partial.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/model_io/prompts/partial.mdx", "repo_id": "langchainjs", "token_count": 906 }
765
from typing import Any, List, Optional from InstructorEmbedding import INSTRUCTOR from llama_index.core.base.embeddings.base import ( DEFAULT_EMBED_BATCH_SIZE, BaseEmbedding, ) from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks import CallbackManager from llama_inde...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-instructor/llama_index/embeddings/instructor/base.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-instructor/llama_index/embeddings/instructor/base.py", "repo_id": "llama_index", "token_count": 1381 }
1,366
# 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/speecht5/feature_extraction_speecht5.py/0
{ "file_path": "transformers/src/transformers/models/speecht5/feature_extraction_speecht5.py", "repo_id": "transformers", "token_count": 7605 }
669
<jupyter_start><jupyter_text>Open City Data [Socrata](https://dev.socrata.com/foundry/data.sfgov.org/vw6y-z8j6) provides an API for city open data. For a dataset such as [SF crime](https://data.sfgov.org/Public-Safety/Police-Department-Incident-Reports-Historical-2003/tmnf-yvry), to to the `API` tab on top right. That ...
langchain/docs/docs/integrations/document_loaders/open_city_data.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/open_city_data.ipynb", "repo_id": "langchain", "token_count": 385 }
116
#!/usr/bin/env python # coding=utf-8 # Copyright 2024 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...
diffusers/examples/dreambooth/train_dreambooth_lora_sdxl.py/0
{ "file_path": "diffusers/examples/dreambooth/train_dreambooth_lora_sdxl.py", "repo_id": "diffusers", "token_count": 34281 }
214
from llama_index.vector_stores.tencentvectordb.base import TencentVectorDB __all__ = ["TencentVectorDB"]
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-tencentvectordb/llama_index/vector_stores/tencentvectordb/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-tencentvectordb/llama_index/vector_stores/tencentvectordb/__init__.py", "repo_id": "llama_index", "token_count": 36 }
1,625
// 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.go/0
{ "file_path": "milvus/internal/querynodev2/segments/reduce.go", "repo_id": "milvus", "token_count": 1490 }
1,776
from llama_index.readers.trello.base import TrelloReader __all__ = ["TrelloReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-trello/llama_index/readers/trello/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-trello/llama_index/readers/trello/__init__.py", "repo_id": "llama_index", "token_count": 31 }
1,386
<jupyter_start><jupyter_text>Building a Tavily Data AgentThis tutorial walks through using the LLM tools provided by the [Tavily API](https://app.tavily.com/) to allow LLMs to easily search and retrieve relevant content from the Internet.To get started, you will need an [OpenAI api key](https://platform.openai.com/acco...
llama_index/llama-index-integrations/tools/llama-index-tools-tavily-research/examples/tavily.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-tavily-research/examples/tavily.ipynb", "repo_id": "llama_index", "token_count": 707 }
1,439
import torch from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel class MCLIPConfig(XLMRobertaConfig): model_type = "M-CLIP" def __init__(self, transformerDimSize=1024, imageDimSize=768, **kwargs): self.transformerDimensions = transformerDimSize self.numDims = imageDimS...
diffusers/src/diffusers/pipelines/kandinsky/text_encoder.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/kandinsky/text_encoder.py", "repo_id": "diffusers", "token_count": 405 }
246
import argparse import csv import evaluate import numpy as np import torch from datasets import load_dataset from tqdm import tqdm from transformers import AutoModelForCausalLM, AutoTokenizer from trl.import_utils import is_npu_available, is_xpu_available toxicity = evaluate.load("ybelkada/toxicity", "DaNLP/da-elec...
trl/examples/research_projects/toxicity/scripts/evaluate-toxicity.py/0
{ "file_path": "trl/examples/research_projects/toxicity/scripts/evaluate-toxicity.py", "repo_id": "trl", "token_count": 2056 }
859
<jupyter_start><jupyter_text>Forward/Backward AugmentationShowcase capabilities of leveraging Node relationships on top of PG's essay If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>!pip install llama-index from llama_index.core import VectorStoreIndex, SimpleDire...
llama_index/docs/examples/node_postprocessor/PrevNextPostprocessorDemo.ipynb/0
{ "file_path": "llama_index/docs/examples/node_postprocessor/PrevNextPostprocessorDemo.ipynb", "repo_id": "llama_index", "token_count": 1303 }
1,071
# 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 this fil...
milvus/tests/benchmark/Dockerfile/0
{ "file_path": "milvus/tests/benchmark/Dockerfile", "repo_id": "milvus", "token_count": 543 }
1,954
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 17934, "logprob": null, "text": "Pour" }, { "id": 49833, "logprob": -10.5390625, "text": " dég" }, { "...
text-generation-inference/integration-tests/models/__snapshots__/test_bloom_560m_sharded/test_bloom_560m_sharded.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_bloom_560m_sharded/test_bloom_560m_sharded.json", "repo_id": "text-generation-inference", "token_count": 1543 }
398
@@@@func_list@struct_name void @@visitor_name@@::visit(@@struct_name@@& @@parameter_name@@) { // TODO } #### @@@@main #error TODO: copy this file out, and modify the content. #include "query/generated/@@visitor_name@@.h" namespace @@namespace@@ { @@func_list@@ } // namespace @@namespace@@ ####
milvus/tools/core_gen/templates/visitor_derived.cpp/0
{ "file_path": "milvus/tools/core_gen/templates/visitor_derived.cpp", "repo_id": "milvus", "token_count": 112 }
1,982
<jupyter_start><jupyter_text>Image to Image Retrieval using CLIP embedding and image correlation reasoning using GPT4VIn this notebook, we show how to build a Image to Image retrieval using LlamaIndex with GPT4-V and CLIP.LlamaIndex Image to Image Retrieval - Images embedding index: [CLIP](https://github.com/openai/CLI...
llama_index/docs/examples/multi_modal/image_to_image_retrieval.ipynb/0
{ "file_path": "llama_index/docs/examples/multi_modal/image_to_image_retrieval.ipynb", "repo_id": "llama_index", "token_count": 3186 }
1,200
import unittest import os from unittest.mock import patch, Mock import pytest import chromadb import chromadb.config from chromadb.db.system import SysDB from chromadb.ingest import Consumer, Producer class GetDBTest(unittest.TestCase): @patch("chromadb.db.impl.sqlite.SqliteDB", autospec=True) def test_defaul...
chroma/chromadb/test/test_chroma.py/0
{ "file_path": "chroma/chromadb/test/test_chroma.py", "repo_id": "chroma", "token_count": 1890 }
26
from langchain_nvidia_trt import __all__ EXPECTED_ALL = ["TritonTensorRTLLM"] def test_all_imports() -> None: assert sorted(EXPECTED_ALL) == sorted(__all__)
langchain/libs/partners/nvidia-trt/tests/unit_tests/test_imports.py/0
{ "file_path": "langchain/libs/partners/nvidia-trt/tests/unit_tests/test_imports.py", "repo_id": "langchain", "token_count": 65 }
634
<jupyter_start><jupyter_text>Google Cloud Text-to-Speech>[Google Cloud Text-to-Speech](https://cloud.google.com/text-to-speech) enables developers to synthesize natural-sounding speech with 100+ voices, available in multiple languages and variants. It applies DeepMind’s groundbreaking research in WaveNet and Google’s p...
langchain/docs/docs/integrations/tools/google_cloud_texttospeech.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/google_cloud_texttospeech.ipynb", "repo_id": "langchain", "token_count": 329 }
186
# Docugami >[Docugami](https://docugami.com) converts business documents into a Document XML Knowledge Graph, generating forests > of XML semantic trees representing entire documents. This is a rich representation that includes the semantic and > structural characteristics of various chunks in the document as an XML...
langchain/docs/docs/integrations/providers/docugami.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/docugami.mdx", "repo_id": "langchain", "token_count": 145 }
145
import pytest from llama_index.legacy.data_structs.data_structs import IndexGraph from llama_index.legacy.storage.index_store.postgres_index_store import ( PostgresIndexStore, ) from llama_index.legacy.storage.kvstore.postgres_kvstore import PostgresKVStore try: import asyncpg # noqa import psycopg2 # no...
llama_index/llama-index-legacy/tests/storage/index_store/test_postgres_index_store.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/storage/index_store/test_postgres_index_store.py", "repo_id": "llama_index", "token_count": 351 }
1,650
// 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/server_test.go/0
{ "file_path": "milvus/internal/querynodev2/server_test.go", "repo_id": "milvus", "token_count": 2926 }
1,878
"""Test OpenLLM wrapper.""" from langchain_community.llms.openllm import OpenLLM def test_openllm_llm_local() -> None: llm = OpenLLM(model_name="flan-t5", model_id="google/flan-t5-small") output = llm("Say foo:") assert isinstance(output, str) def test_openllm_with_kwargs() -> None: llm = OpenLLM( ...
langchain/libs/community/tests/integration_tests/llms/test_openllm.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_openllm.py", "repo_id": "langchain", "token_count": 198 }
340
{ "name": "nextjs", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint", "format": "prettier --write \"app\"" }, "dependencies": { "@types/node": "20.5.0", "@types/react": "18.2.20", "@types/re...
langsmith-cookbook/feedback-examples/nextjs/package.json/0
{ "file_path": "langsmith-cookbook/feedback-examples/nextjs/package.json", "repo_id": "langsmith-cookbook", "token_count": 389 }
1,071
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/fr/autoclass_tutorial.md/0
{ "file_path": "transformers/docs/source/fr/autoclass_tutorial.md", "repo_id": "transformers", "token_count": 2591 }
530
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-firebase-realtimedb/llama_index/readers/firebase_realtimedb/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-firebase-realtimedb/llama_index/readers/firebase_realtimedb/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,298
# LlamaIndex Llms Integration: Ollama
llama_index/llama-index-integrations/llms/llama-index-llms-ollama/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-ollama/README.md", "repo_id": "llama_index", "token_count": 12 }
1,237
<!--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/en/tasks/monocular_depth_estimation.md/0
{ "file_path": "transformers/docs/source/en/tasks/monocular_depth_estimation.md", "repo_id": "transformers", "token_count": 1553 }
498
import fs from "fs"; import { ChatGoogleGenerativeAI } from "@langchain/google-genai"; import { HumanMessage } from "@langchain/core/messages"; // Multi-modal const vision = new ChatGoogleGenerativeAI({ modelName: "gemini-pro-vision", maxOutputTokens: 2048, }); const image = fs.readFileSync("./hotdog.jpg").toStrin...
langchainjs/examples/src/models/chat/googlegenerativeai_multimodal.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/googlegenerativeai_multimodal.ts", "repo_id": "langchainjs", "token_count": 515 }
844
python_tests( interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/tests/BUILD", "repo_id": "llama_index", "token_count": 29 }
1,372
# S3 File or Directory Loader This loader parses any file stored on S3, or the entire Bucket (with an optional prefix filter) if no particular file is specified. When initializing `S3Reader`, you may pass in your [AWS Access Key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html). If non...
llama_index/llama-index-integrations/readers/llama-index-readers-s3/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-s3/README.md", "repo_id": "llama_index", "token_count": 491 }
1,369
<jupyter_start><jupyter_text>Basic Multi-agent CollaborationA single agent can usually operate effectively using a handful of tools within a single domain, but even using powerful models like `gpt-4`, it can be less effective at using many tools. One way to approach complicated tasks is through a "divide-and-conquer" a...
langgraph/examples/multi_agent/multi-agent-collaboration.ipynb/0
{ "file_path": "langgraph/examples/multi_agent/multi-agent-collaboration.ipynb", "repo_id": "langgraph", "token_count": 3659 }
1,074
# 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 this fil...
milvus/configs/milvus.yaml/0
{ "file_path": "milvus/configs/milvus.yaml", "repo_id": "milvus", "token_count": 11412 }
1,716
# 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...
notebooks/sagemaker/22_accelerate_sagemaker_examples/src/text-classification/train_using_s3_data.py/0
{ "file_path": "notebooks/sagemaker/22_accelerate_sagemaker_examples/src/text-classification/train_using_s3_data.py", "repo_id": "notebooks", "token_count": 4657 }
320
import multiprocessing import numbers import random import numpy import threading import pytest import pandas as pd import decimal from decimal import Decimal, getcontext from time import sleep import heapq from base.client_base import TestcaseBase from utils.util_log import test_log as log from common import common_f...
milvus/tests/python_client/milvus_client/test_milvus_client_insert.py/0
{ "file_path": "milvus/tests/python_client/milvus_client/test_milvus_client_insert.py", "repo_id": "milvus", "token_count": 23248 }
1,978
# LlamaIndex Llms Integration: Replicate
llama_index/llama-index-integrations/llms/llama-index-llms-replicate/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-replicate/README.md", "repo_id": "llama_index", "token_count": 11 }
1,278
resource_type_action: # This is here just for reference - tenant:create_tenant - tenant:get_tenant - db:create_database - db:get_database - db:reset - db:list_collections - collection:get_collection - db:create_collection - db:get_or_create_collection - collection:delete_collection - collection:up...
chroma/examples/basic_functionality/authz/authz.yaml/0
{ "file_path": "chroma/examples/basic_functionality/authz/authz.yaml", "repo_id": "chroma", "token_count": 1294 }
37
<!--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/reformer.md/0
{ "file_path": "transformers/docs/source/en/model_doc/reformer.md", "repo_id": "transformers", "token_count": 3186 }
514
use candle::Result; use candle_nn::{batch_norm, Conv2dConfig, Module, VarBuilder}; #[allow(clippy::many_single_char_names)] fn conv2d_same( i: usize, o: usize, k: usize, c: Conv2dConfig, vb: VarBuilder, ) -> Result<impl Module> { let conv2d = candle_nn::conv2d(i, o, k, c, vb)?; let s = c.st...
candle/candle-transformers/src/models/convmixer.rs/0
{ "file_path": "candle/candle-transformers/src/models/convmixer.rs", "repo_id": "candle", "token_count": 1413 }
71
from milvus_benchmark import back_scheduler def job_runner(): print("job_runner") for i in range(30): back_scheduler.add_job(job_runner, args=[], misfire_grace_time=300) back_scheduler.start()
milvus/tests/benchmark/milvus_benchmark/tests/test_scheduler.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/tests/test_scheduler.py", "repo_id": "milvus", "token_count": 76 }
1,885
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/logger/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/logger/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,590