text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from __future__ import annotations import tempfile from typing import TYPE_CHECKING, Any, Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.tools import BaseTool from langchain_community.utilities.vertexai import get_client_info if TYPE_CHECKING: from google.cloud impor...
langchain/libs/community/langchain_community/tools/google_cloud/texttospeech.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/google_cloud/texttospeech.py", "repo_id": "langchain", "token_count": 1318 }
304
import torch from transformers import AutoTokenizer class FSNERTokenizerUtils(object): def __init__(self, pretrained_model_name_or_path): self.tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path) def tokenize(self, x): """ Wrapper function for tokenizing query and...
transformers/examples/research_projects/fsner/src/fsner/tokenizer_utils.py/0
{ "file_path": "transformers/examples/research_projects/fsner/src/fsner/tokenizer_utils.py", "repo_id": "transformers", "token_count": 2148 }
576
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/deepspeed/test_model_zoo.py/0
{ "file_path": "transformers/tests/deepspeed/test_model_zoo.py", "repo_id": "transformers", "token_count": 5672 }
742
"""Test Google Vertex AI Search retriever. You need to create a Vertex AI Search app and populate it with data to run the integration tests. Follow the instructions in the example notebook: google_vertex_ai_search.ipynb to set up the app and configure authentication. Set the following environment variables before th...
langchain/libs/community/tests/integration_tests/retrievers/test_google_vertex_ai_search.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/retrievers/test_google_vertex_ai_search.py", "repo_id": "langchain", "token_count": 964 }
343
{ "annotations": { "list": [ { "$$hashKey": "object:87", "builtIn": 1, "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { "limit": 100, ...
milvus/deployments/monitor/grafana/kafka-dashboard.json/0
{ "file_path": "milvus/deployments/monitor/grafana/kafka-dashboard.json", "repo_id": "milvus", "token_count": 49375 }
1,849
from typing import ( Any, AsyncIterator, Callable, Dict, Iterator, List, Optional, Type, Union, ) from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.language_models.chat_models import BaseChatModel from langc...
langchain/libs/community/langchain_community/chat_models/fireworks.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_models/fireworks.py", "repo_id": "langchain", "token_count": 5082 }
224
// 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/util/importutil/import_util_test.go/0
{ "file_path": "milvus/internal/util/importutil/import_util_test.go", "repo_id": "milvus", "token_count": 16545 }
2,018
<!--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...
accelerate/docs/source/usage_guides/low_precision_training.md/0
{ "file_path": "accelerate/docs/source/usage_guides/low_precision_training.md", "repo_id": "accelerate", "token_count": 1465 }
6
# Development This document will help to set up your Milvus development environment and to run tests. Please [file an issue](https://github.com/milvus-io/milvus/issues/new/choose) if there's a problem. # Table of contents - [Development](#development) - [Table of contents](#table-of-contents) - [Building Milvus wi...
milvus/DEVELOPMENT.md/0
{ "file_path": "milvus/DEVELOPMENT.md", "repo_id": "milvus", "token_count": 2956 }
1,742
poetry_requirements( name="poetry", module_mapping={"llamaindex-py-client": ["llama_index_client"]}, )
llama_index/llama-index-core/BUILD/0
{ "file_path": "llama_index/llama-index-core/BUILD", "repo_id": "llama_index", "token_count": 47 }
1,108
"""__ModuleName__ chat models.""" from typing import Any, AsyncIterator, Iterator, List, Optional from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.language_models.chat_models import BaseChatModel from langchain_core.messages import BaseMessag...
langchain/libs/cli/langchain_cli/integration_template/integration_template/chat_models.py/0
{ "file_path": "langchain/libs/cli/langchain_cli/integration_template/integration_template/chat_models.py", "repo_id": "langchain", "token_count": 881 }
203
import numpy as np import pytest from langchain_google_genai._common import GoogleGenerativeAIError from langchain_google_genai.embeddings import GoogleGenerativeAIEmbeddings _MODEL = "models/embedding-001" @pytest.mark.parametrize( "query", [ "Hi", "This is a longer query string to test the...
langchain/libs/partners/google-genai/tests/integration_tests/test_embeddings.py/0
{ "file_path": "langchain/libs/partners/google-genai/tests/integration_tests/test_embeddings.py", "repo_id": "langchain", "token_count": 1209 }
666
import json import os from dataclasses import dataclass from functools import partial from typing import Callable import flax.linen as nn import jax import jax.numpy as jnp import joblib import optax import wandb from flax import jax_utils, struct, traverse_util from flax.serialization import from_bytes, to_bytes from...
transformers/examples/research_projects/jax-projects/big_bird/bigbird_flax.py/0
{ "file_path": "transformers/examples/research_projects/jax-projects/big_bird/bigbird_flax.py", "repo_id": "transformers", "token_count": 5480 }
562
import argparse import os from typing import Dict import torch from diffusers import UNet2DConditionModel from safetensors.torch import save_file from transformers import CLIPTextModel from peft import PeftModel, get_peft_model_state_dict # Default kohya_ss LoRA replacement modules # https://github.com/kohya-ss/sd-...
peft/examples/lora_dreambooth/convert_peft_sd_lora_to_kohya_ss.py/0
{ "file_path": "peft/examples/lora_dreambooth/convert_peft_sd_lora_to_kohya_ss.py", "repo_id": "peft", "token_count": 1639 }
342
import type { Session } from "./Session"; import type { Timestamps } from "./Timestamps"; import type { User } from "./User"; export interface MessageEvent extends Pick<Timestamps, "createdAt"> { userId: User["_id"] | Session["sessionId"]; ip?: string; }
chat-ui/src/lib/types/MessageEvent.ts/0
{ "file_path": "chat-ui/src/lib/types/MessageEvent.ts", "repo_id": "chat-ui", "token_count": 80 }
95
"""OpenAI Finetuning.""" import logging import os import time from typing import Any, Optional import openai from openai import OpenAI as SyncOpenAI from openai.types.fine_tuning import FineTuningJob from llama_index.legacy.callbacks import OpenAIFineTuningHandler from llama_index.legacy.finetuning.openai.validate_j...
llama_index/llama-index-legacy/llama_index/legacy/finetuning/openai/base.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/finetuning/openai/base.py", "repo_id": "llama_index", "token_count": 1750 }
1,655
[tool.poetry] name = "retrieval-agent" version = "0.0.1" description = "Retrieval agent for Azure OpenAI" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" openai = "<2" arxiv = "^2.0.0" langchain-openai = "^0.0.2.post1" [tool.poetry.group.dev.dependencies] langch...
langchain/templates/retrieval-agent/pyproject.toml/0
{ "file_path": "langchain/templates/retrieval-agent/pyproject.toml", "repo_id": "langchain", "token_count": 298 }
753
{ "feature_extractor_type": "ViTFeatureExtractor", "size": 30 }
transformers/tests/deepspeed/vit_feature_extractor.json/0
{ "file_path": "transformers/tests/deepspeed/vit_feature_extractor.json", "repo_id": "transformers", "token_count": 32 }
724
"""Utils for pretty print.""" import textwrap from pprint import pprint from typing import Any, Dict from llama_index.core.base.response.schema import Response from llama_index.core.schema import NodeWithScore from llama_index.core.utils import truncate_text def pprint_metadata(metadata: Dict[str, Any]) -> None: ...
llama_index/llama-index-core/llama_index/core/response/pprint_utils.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/response/pprint_utils.py", "repo_id": "llama_index", "token_count": 614 }
1,173
<!--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/using-diffusers/loading_overview.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/loading_overview.md", "repo_id": "diffusers", "token_count": 359 }
186
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/rootcoord/broker.go/0
{ "file_path": "milvus/internal/rootcoord/broker.go", "repo_id": "milvus", "token_count": 4270 }
1,781
<jupyter_start><jupyter_text>Summarization checker chainThis notebook shows some examples of LLMSummarizationCheckerChain in use with different types of texts. It has a few distinct differences from the `LLMCheckerChain`, in that it doesn't have any assumptions to the format of the input text (or summary).Additionally...
langchain/cookbook/llm_summarization_checker.ipynb/0
{ "file_path": "langchain/cookbook/llm_summarization_checker.ipynb", "repo_id": "langchain", "token_count": 1118 }
77
# 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/utils/check_doc_toc.py/0
{ "file_path": "transformers/utils/check_doc_toc.py", "repo_id": "transformers", "token_count": 1732 }
867
<jupyter_start><jupyter_text>Weaviate>[Weaviate](https://weaviate.io/) is an open-source vector database. It allows you to store data objects and vector embeddings from your favorite ML-models, and scale seamlessly into billions of data objects.This notebook shows how to use the functionality related to the `Weaviate` ...
langchain/docs/docs/integrations/vectorstores/weaviate.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/weaviate.ipynb", "repo_id": "langchain", "token_count": 2767 }
197
python_sources()
llama_index/llama-index-core/llama_index/core/indices/empty/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/empty/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,177
# rag-mongo This template performs RAG using MongoDB and OpenAI. ## Environment Setup You should export two environment variables, one being your MongoDB URI, the other being your OpenAI API KEY. If you do not have a MongoDB URI, see the `Setup Mongo` section at the bottom for instructions on how to do so. ```shel...
langchain/templates/rag-mongo/README.md/0
{ "file_path": "langchain/templates/rag-mongo/README.md", "repo_id": "langchain", "token_count": 1658 }
682
# 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/src/diffusers/pipelines/amused/pipeline_amused.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/amused/pipeline_amused.py", "repo_id": "diffusers", "token_count": 6937 }
246
# coding=utf-8 # Copyright 2024 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...
diffusers/scripts/convert_original_stable_diffusion_to_diffusers.py/0
{ "file_path": "diffusers/scripts/convert_original_stable_diffusion_to_diffusers.py", "repo_id": "diffusers", "token_count": 2889 }
228
"""LLM Prompt Program.""" from abc import abstractmethod from typing import Any, Generic, Optional, Type, TypeVar from llama_index.core.bridge.pydantic import BaseModel from llama_index.core.prompts.base import PromptTemplate from llama_index.core.types import BasePydanticProgram, Model LM = TypeVar("LM") class Bas...
llama_index/llama-index-core/llama_index/core/program/llm_prompt_program.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/program/llm_prompt_program.py", "repo_id": "llama_index", "token_count": 341 }
1,284
from llama_index.core.readers.base import BasePydanticReader from llama_index.readers.slack import SlackReader def test_class(): names_of_base_classes = [b.__name__ for b in SlackReader.__mro__] assert BasePydanticReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-slack/tests/test_readers_slack.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-slack/tests/test_readers_slack.py", "repo_id": "llama_index", "token_count": 92 }
1,418
<!--- Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
transformers/examples/tensorflow/token-classification/README.md/0
{ "file_path": "transformers/examples/tensorflow/token-classification/README.md", "repo_id": "transformers", "token_count": 573 }
553
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-metal/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-metal/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,349
# Conclusion [[conclusion]] Congrats on finishing this bonus unit! You can now sit and enjoy playing with your Huggy 🐶. And don't **forget to spread the love by sharing Huggy with your friends 🤗**. And if you share about it on social media, **please tag us @huggingface and me @simoninithomas** <img src="https://hu...
deep-rl-class/units/en/unitbonus1/conclusion.mdx/0
{ "file_path": "deep-rl-class/units/en/unitbonus1/conclusion.mdx", "repo_id": "deep-rl-class", "token_count": 227 }
172
python_sources()
llama_index/llama-index-integrations/indices/llama-index-indices-managed-vectara/llama_index/indices/managed/vectara/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-vectara/llama_index/indices/managed/vectara/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,212
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/cvt.md/0
{ "file_path": "transformers/docs/source/en/model_doc/cvt.md", "repo_id": "transformers", "token_count": 1314 }
441
import pytest from llama_index.legacy.llms.vllm import Vllm try: vllm_init = True except ImportError: vllm_init = False @pytest.mark.skipif(vllm_init is True, reason="vertex not installed") def test_vllm_initialization() -> None: llm = Vllm() assert llm.class_name() == "Vllm" @pytest.mark.skipif(vl...
llama_index/llama-index-legacy/tests/llms/test_vllm.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/llms/test_vllm.py", "repo_id": "llama_index", "token_count": 208 }
1,747
export const config = { entrypoints: { agents: "src/agents/index.ts", utils: "src/utils/index.ts", }, tsConfigPath: "tsconfig.json", cjsSource: "build/cjs", cjsDestination: "dist/cjs", abs: (relativePath) => `/absolute/path/${relativePath}`, requiresOptionalDependency: ["some-optional-package"], ...
langchainjs/libs/langchain-scripts/src/tests/langchain.valid.config.js/0
{ "file_path": "langchainjs/libs/langchain-scripts/src/tests/langchain.valid.config.js", "repo_id": "langchainjs", "token_count": 263 }
1,068
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 pymilvus import DataType from base.client_base import TestcaseBase from utils.util_log import test_log as l...
milvus/tests/python_client/milvus_client/test_milvus_client_partition.py/0
{ "file_path": "milvus/tests/python_client/milvus_client/test_milvus_client_partition.py", "repo_id": "milvus", "token_count": 21866 }
1,972
/* eslint-disable */ // tslint:disable /** * FastAPI * * * OpenAPI spec version: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator+. * https://github.com/karlvr/openapi-generator-plus * Do not edit the class manually. */ export * from "./api"; export * from "./models"; export * from "./conf...
chroma/clients/js/src/generated/index.ts/0
{ "file_path": "chroma/clients/js/src/generated/index.ts", "repo_id": "chroma", "token_count": 139 }
33
package metrics import ( "sync" "github.com/prometheus/client_golang/prometheus" ) var ( infoMutex sync.Mutex mqType string metaType string BuildInfo = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: milvusNamespace, Name: "build_info", Help: "Build information of milvus", ...
milvus/pkg/metrics/info_metrics.go/0
{ "file_path": "milvus/pkg/metrics/info_metrics.go", "repo_id": "milvus", "token_count": 467 }
2,034
import * as fs from "fs"; import * as yaml from "js-yaml"; import { JsonSpec, JsonObject } from "langchain/tools"; import { createOpenApiAgent, OpenApiToolkit } from "langchain/agents"; import { OpenAI } from "@langchain/openai"; export const run = async () => { let data: JsonObject; try { const yamlFile = fs....
langchainjs/examples/src/agents/openapi.ts/0
{ "file_path": "langchainjs/examples/src/agents/openapi.ts", "repo_id": "langchainjs", "token_count": 443 }
840
"""Telegram reader that reads posts/chats and comments to post from Telegram channel or chat.""" import asyncio import re from typing import List, Union from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class TelegramReader(BaseReader): """Telegram posts/chat messa...
llama_index/llama-index-integrations/readers/llama-index-readers-telegram/llama_index/readers/telegram/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-telegram/llama_index/readers/telegram/base.py", "repo_id": "llama_index", "token_count": 1804 }
1,460
from langchain_community.embeddings.awa import AwaEmbeddings __all__ = ["AwaEmbeddings"]
langchain/libs/langchain/langchain/embeddings/awa.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/awa.py", "repo_id": "langchain", "token_count": 31 }
543
<!--- 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 ...
transformers/examples/pytorch/contrastive-image-text/README.md/0
{ "file_path": "transformers/examples/pytorch/contrastive-image-text/README.md", "repo_id": "transformers", "token_count": 1262 }
529
{%- if pagename != 'index' and pagename != 'documentation' %} {%- set nav_bar_class = "sk-docs-navbar" %} {%- set top_container_cls = "sk-docs-container" %} {%- else %} {%- set nav_bar_class = "sk-landing-navbar" %} {%- set top_container_cls = "sk-landing-container" %} {%- endif %} <nav id="navbar" class="{{ n...
langchain/docs/api_reference/themes/scikit-learn-modern/nav.html/0
{ "file_path": "langchain/docs/api_reference/themes/scikit-learn-modern/nav.html", "repo_id": "langchain", "token_count": 1452 }
86
import os from typing import Optional from .reader_image_folder import ReaderImageFolder from .reader_image_in_tar import ReaderImageInTar def create_reader( name: str, root: Optional[str] = None, split: str = 'train', **kwargs, ): kwargs = {k: v for k, v in kwargs.items() if v is...
pytorch-image-models/timm/data/readers/reader_factory.py/0
{ "file_path": "pytorch-image-models/timm/data/readers/reader_factory.py", "repo_id": "pytorch-image-models", "token_count": 694 }
362
# Readers (Loaders) ## Reader Usage (Use `download_loader` from LlamaIndex) You can also use the loaders with `download_loader` from LlamaIndex in a single line of code. For example, see the code snippets below using the Google Docs Loader. ```python from llama_index.core import VectorStoreIndex, download_loader G...
llama_index/llama-index-integrations/readers/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/README.md", "repo_id": "llama_index", "token_count": 208 }
1,396
""" Portkey integration with Llama_index for enhanced monitoring. """ from typing import TYPE_CHECKING, Any, Callable, List, Optional, Sequence, Union, cast from llama_index.legacy.bridge.pydantic import Field, PrivateAttr from llama_index.legacy.core.llms.types import ( ChatMessage, ChatResponse, ChatRes...
llama_index/llama-index-legacy/llama_index/legacy/llms/portkey.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/portkey.py", "repo_id": "llama_index", "token_count": 5111 }
1,737
# coding=utf-8 # Copyright 2024 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...
diffusers/src/diffusers/optimization.py/0
{ "file_path": "diffusers/src/diffusers/optimization.py", "repo_id": "diffusers", "token_count": 5887 }
233
[workspace] members = [ "rust/worker/" ]
chroma/Cargo.toml/0
{ "file_path": "chroma/Cargo.toml", "repo_id": "chroma", "token_count": 20 }
8
python_sources()
llama_index/llama-index-core/llama_index/core/storage/index_store/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/storage/index_store/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,300
package milvus import ( "context" "encoding/json" "flag" "fmt" "io" "os" "path" "runtime" "strconv" "strings" "time" "github.com/cockroachdb/errors" "github.com/gofrs/flock" "github.com/samber/lo" clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/milvus-io/milvus/cmd/roles" "github...
milvus/cmd/milvus/util.go/0
{ "file_path": "milvus/cmd/milvus/util.go", "repo_id": "milvus", "token_count": 3400 }
1,709
<!--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/create_a_model.md/0
{ "file_path": "transformers/docs/source/ja/create_a_model.md", "repo_id": "transformers", "token_count": 8192 }
513
#pragma once #include <chrono> #include <iostream> #include <string> class TimeRecorder { using stdclock = std::chrono::high_resolution_clock; public: // trace = 0, debug = 1, info = 2, warn = 3, error = 4, critical = 5 explicit TimeRecorder(std::string hdr, int64_t log_level = 0) : header_(std:...
milvus/internal/core/thirdparty/tantivy/time_recorder.h/0
{ "file_path": "milvus/internal/core/thirdparty/tantivy/time_recorder.h", "repo_id": "milvus", "token_count": 737 }
1,681
"""Init file."""
llama_index/llama-index-legacy/tests/prompts/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/prompts/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,753
# 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...
transformers/tests/models/wav2vec2/test_modeling_flax_wav2vec2.py/0
{ "file_path": "transformers/tests/models/wav2vec2/test_modeling_flax_wav2vec2.py", "repo_id": "transformers", "token_count": 11180 }
833
// 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/conc/pool_test.go/0
{ "file_path": "milvus/pkg/util/conc/pool_test.go", "repo_id": "milvus", "token_count": 834 }
1,929
<jupyter_start><jupyter_text>Chat Engine - OpenAI Agent Mode 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<jupyter_output><empty_output><jupyter_text>Download Data<jupyter_code>!mkdir -p 'data/paul_gr...
llama_index/docs/examples/chat_engine/chat_engine_openai.ipynb/0
{ "file_path": "llama_index/docs/examples/chat_engine/chat_engine_openai.ipynb", "repo_id": "llama_index", "token_count": 1035 }
1,050
<!--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/ja/model_doc/cvt.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/cvt.md", "repo_id": "transformers", "token_count": 2379 }
483
export { type Branch, type BranchLike, RunnableBranch, } from "@langchain/core/runnables";
langchainjs/langchain/src/schema/runnable/branch.ts/0
{ "file_path": "langchainjs/langchain/src/schema/runnable/branch.ts", "repo_id": "langchainjs", "token_count": 35 }
908
<jupyter_start><jupyter_text>Google combined tools exampleThis notebook features a more advanced usage of Agent Tools, using the Google Calendar, Mail and Search integrations as well as the Load and Search Meta Tool to fufill a more complicated set of tasks for the user. Setup the ToolsFirst we will import OpenAI and s...
llama_index/llama-index-integrations/tools/llama-index-tools-google/examples/advanced_tools_usage.ipynb/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-google/examples/advanced_tools_usage.ipynb", "repo_id": "llama_index", "token_count": 1514 }
1,567
<!--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/pad_truncation.md/0
{ "file_path": "transformers/docs/source/ja/pad_truncation.md", "repo_id": "transformers", "token_count": 4228 }
485
# coding=utf-8 # Copyright 2022, Google 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/LICENSE-2.0 ...
transformers/src/transformers/models/pegasus_x/modeling_pegasus_x.py/0
{ "file_path": "transformers/src/transformers/models/pegasus_x/modeling_pegasus_x.py", "repo_id": "transformers", "token_count": 32980 }
667
import { ChatOpenAI } from "@langchain/openai"; import { AgentExecutor } from "langchain/agents"; import { ChatPromptTemplate } from "@langchain/core/prompts"; import { RunnableSequence } from "@langchain/core/runnables"; import { AgentFinish, AgentAction } from "@langchain/core/agents"; import { BaseMessageChunk } fro...
langchainjs/examples/src/tools/searchapi_google_news.ts/0
{ "file_path": "langchainjs/examples/src/tools/searchapi_google_news.ts", "repo_id": "langchainjs", "token_count": 394 }
865
/* eslint-disable */ var globRequire = require; describe("pipelineExample", () => { // This is a hack to let us require using path similar to what the user has to use function require(mod: string) { if (mod.startsWith("tokenizers")) { // let path = mod.slice("tokenizers".length); ...
tokenizers/bindings/node/examples/documentation/pipeline.test.ts/0
{ "file_path": "tokenizers/bindings/node/examples/documentation/pipeline.test.ts", "repo_id": "tokenizers", "token_count": 2710 }
425
<!--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...
peft/docs/source/tutorial/peft_integrations.md/0
{ "file_path": "peft/docs/source/tutorial/peft_integrations.md", "repo_id": "peft", "token_count": 2014 }
336
import { createClient as createSupabaseClient } from "@supabase/supabase-js"; export function createClient(req: Request) { return createSupabaseClient( // Supabase API URL - env var exported by default. Deno.env.get("SUPABASE_URL") ?? "", // Supabase API ANON KEY - env var exported by default. Deno.e...
langchain-template-supabase/supabase/functions/_shared/supabase-client.ts/0
{ "file_path": "langchain-template-supabase/supabase/functions/_shared/supabase-client.ts", "repo_id": "langchain-template-supabase", "token_count": 200 }
72
from setuptools import setup from torch.utils.cpp_extension import BuildExtension, CUDAExtension import torch extra_cuda_cflags = ["-lineinfo", "-O3"] if torch.version.hip: extra_cuda_cflags += ["-DHIPBLAS_USE_HIP_HALF"] extra_compile_args = { "nvcc": extra_cuda_cflags, } setup( name="exllamav2_kernels"...
text-generation-inference/server/exllamav2_kernels/setup.py/0
{ "file_path": "text-generation-inference/server/exllamav2_kernels/setup.py", "repo_id": "text-generation-inference", "token_count": 363 }
418
[ { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "* **Hoppy Socks:** This name suggests fun and excitement, like hopping around" } ] }, "safetyRatings": [ { "category": "...
langchainjs/libs/langchain-google-common/src/tests/data/llm-2-mock.json/0
{ "file_path": "langchainjs/libs/langchain-google-common/src/tests/data/llm-2-mock.json", "repo_id": "langchainjs", "token_count": 2498 }
1,095
# coding=utf-8 # Copyright 2018 The Google Flax Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
transformers/examples/research_projects/performer/modeling_flax_performer.py/0
{ "file_path": "transformers/examples/research_projects/performer/modeling_flax_performer.py", "repo_id": "transformers", "token_count": 9147 }
569
package segments import ( "context" "testing" "github.com/samber/lo" "github.com/stretchr/testify/suite" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/datapb" "github.com/milvus-io/milvus/internal/prot...
milvus/internal/querynodev2/segments/manager_test.go/0
{ "file_path": "milvus/internal/querynodev2/segments/manager_test.go", "repo_id": "milvus", "token_count": 1953 }
1,853
insert_performance: collections: - milvus: db_config.primary_path: /test/milvus/db_data_2/cluster/sift_1m_128_l2 wal_enable: true collection_name: sift_1m_128_l2 # other_fields: int,float ni_per: 50000 build_index: false index_type: ivf_sq8 index_...
milvus/tests/benchmark/milvus_benchmark/suites/2_insert_data.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/2_insert_data.yaml", "repo_id": "milvus", "token_count": 184 }
1,877
<!--- 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 a...
transformers/examples/pytorch/README.md/0
{ "file_path": "transformers/examples/pytorch/README.md", "repo_id": "transformers", "token_count": 6244 }
522
#!/usr/bin/env python # coding=utf-8 # Copyright 2022 The Microsoft 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.apac...
transformers/examples/research_projects/tapex/run_wikisql_with_tapex.py/0
{ "file_path": "transformers/examples/research_projects/tapex/run_wikisql_with_tapex.py", "repo_id": "transformers", "token_count": 11008 }
591
import { Document } from "@langchain/core/documents"; import { FakeEmbeddings } from "@langchain/core/utils/testing"; import { MemoryVectorStore } from "../../vectorstores/memory.js"; test("Test Memory Retriever with Callback", async () => { const pageContent = "Hello world"; const embeddings = new FakeEmbeddings(...
langchainjs/langchain/src/retrievers/tests/vectorstores.test.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/tests/vectorstores.test.ts", "repo_id": "langchainjs", "token_count": 625 }
907
export * from "./chat_models.js"; export * from "./llms.js";
langchainjs/libs/langchain-google-webauth/src/index.ts/0
{ "file_path": "langchainjs/libs/langchain-google-webauth/src/index.ts", "repo_id": "langchainjs", "token_count": 23 }
1,028
supabase/
langchain-template-supabase/.vercelignore/0
{ "file_path": "langchain-template-supabase/.vercelignore", "repo_id": "langchain-template-supabase", "token_count": 4 }
72
# 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/vision_text_dual_encoder/test_modeling_tf_vision_text_dual_encoder.py/0
{ "file_path": "transformers/tests/models/vision_text_dual_encoder/test_modeling_tf_vision_text_dual_encoder.py", "repo_id": "transformers", "token_count": 7464 }
792
from typing import List, Optional, Type from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.pydantic_v1 import BaseModel, Field from langchain_community.tools.office365.base import O365BaseTool class SendMessageSchema(BaseModel): """Input for SendMessageTool.""" body: str = F...
langchain/libs/community/langchain_community/tools/office365/send_message.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/office365/send_message.py", "repo_id": "langchain", "token_count": 742 }
306
"""Test Anyscale llm""" import pytest from langchain_core.pydantic_v1 import SecretStr from pytest import CaptureFixture, MonkeyPatch from langchain_community.llms.anyscale import Anyscale @pytest.mark.requires("openai") def test_api_key_is_secret_string() -> None: llm = Anyscale(anyscale_api_key="secret-api-ke...
langchain/libs/community/tests/unit_tests/llms/test_anyscale.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/llms/test_anyscale.py", "repo_id": "langchain", "token_count": 469 }
376
use candle::{Device, Result, Tensor}; /// Loads an image from disk using the image crate, this returns a tensor with shape /// (3, 224, 224). imagenet normalization is applied. pub fn load_image224<P: AsRef<std::path::Path>>(p: P) -> Result<Tensor> { let img = image::io::Reader::open(p)? .decode() ...
candle/candle-examples/src/imagenet.rs/0
{ "file_path": "candle/candle-examples/src/imagenet.rs", "repo_id": "candle", "token_count": 12586 }
55
use candle::{IndexOp, Result, Tensor}; use candle_nn::{Module, VarBuilder}; use super::transformer::TwoWayTransformer; #[derive(Debug)] struct MlpMaskDecoder { layers: Vec<super::Linear>, sigmoid_output: bool, span: tracing::Span, } impl MlpMaskDecoder { fn new( input_dim: usize, hidd...
candle/candle-transformers/src/models/segment_anything/mask_decoder.rs/0
{ "file_path": "candle/candle-transformers/src/models/segment_anything/mask_decoder.rs", "repo_id": "candle", "token_count": 4213 }
75
from langchain_community.document_loaders.email import ( OutlookMessageLoader, UnstructuredEmailLoader, ) __all__ = ["UnstructuredEmailLoader", "OutlookMessageLoader"]
langchain/libs/langchain/langchain/document_loaders/email.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/email.py", "repo_id": "langchain", "token_count": 54 }
504
// 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/SubSearchResult.cpp/0
{ "file_path": "milvus/internal/core/src/query/SubSearchResult.cpp", "repo_id": "milvus", "token_count": 1630 }
1,734
<jupyter_start><jupyter_text>Javelin AI Gateway TutorialThis Jupyter Notebook will explore how to interact with the Javelin AI Gateway using the Python SDK. The Javelin AI Gateway facilitates the utilization of large language models (LLMs) like OpenAI, Cohere, Anthropic, and others by providing a secure and unified end...
langchain/docs/docs/integrations/llms/javelin.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/javelin.ipynb", "repo_id": "langchain", "token_count": 1445 }
118
# candle-replit-code: code completion specialized model. [replit-code-v1_5-3b](https://huggingface.co/replit/replit-code-v1_5-3b) is a language model specialized for code completion. This model uses 3.3B parameters in `bfloat16` (so the GPU version will only work on recent nvidia cards). ## Running some example ```b...
candle/candle-examples/examples/replit-code/README.md/0
{ "file_path": "candle/candle-examples/examples/replit-code/README.md", "repo_id": "candle", "token_count": 426 }
49
package indexparamcheck // diskannChecker checks if an diskann index can be built. type diskannChecker struct { floatVectorBaseChecker } func (c diskannChecker) StaticCheck(params map[string]string) error { return c.staticCheck(params) } func newDiskannChecker() IndexChecker { return &diskannChecker{} }
milvus/pkg/util/indexparamcheck/diskann_checker.go/0
{ "file_path": "milvus/pkg/util/indexparamcheck/diskann_checker.go", "repo_id": "milvus", "token_count": 98 }
1,970
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/readers/make_com/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/make_com/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,608
// 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/segcore/FieldIndexing.cpp/0
{ "file_path": "milvus/internal/core/src/segcore/FieldIndexing.cpp", "repo_id": "milvus", "token_count": 6351 }
1,735
import { test } from "@jest/globals"; import { ExpressionParser } from "../expression.js"; const correctExps = [ { type: "call_expression", funcCall: "hello", args: [] }, { type: "call_expression", funcCall: "hello", args: [{ type: "string_literal", value: "world" }], }, { type: "call_expressio...
langchainjs/langchain/src/output_parsers/tests/expression.test.ts/0
{ "file_path": "langchainjs/langchain/src/output_parsers/tests/expression.test.ts", "repo_id": "langchainjs", "token_count": 5001 }
939
import { LunaryHandler } from "@langchain/community/callbacks/handlers/lunary"; import { ChatOpenAI } from "@langchain/openai"; const model = new ChatOpenAI({ callbacks: [new LunaryHandler()], });
langchainjs/examples/src/callbacks/lunary_quickstart.ts/0
{ "file_path": "langchainjs/examples/src/callbacks/lunary_quickstart.ts", "repo_id": "langchainjs", "token_count": 63 }
773
# 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/test_utils/testing.py/0
{ "file_path": "accelerate/src/accelerate/test_utils/testing.py", "repo_id": "accelerate", "token_count": 6836 }
16
# LlamaIndex Vector_Stores Integration: Cassandra
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-cassandra/README.md/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-cassandra/README.md", "repo_id": "llama_index", "token_count": 12 }
1,512
from langchain.schema.chat import __all__ EXPECTED_ALL = ["ChatSession"] def test_all_imports() -> None: assert set(__all__) == set(EXPECTED_ALL)
langchain/libs/langchain/tests/unit_tests/schema/test_chat.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/schema/test_chat.py", "repo_id": "langchain", "token_count": 58 }
641
<!--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/using-diffusers/freeu.md/0
{ "file_path": "diffusers/docs/source/en/using-diffusers/freeu.md", "repo_id": "diffusers", "token_count": 1633 }
190
import abc import json import random import time from functools import partial from queue import Queue from typing import ( Any, Dict, List, Optional, Type, Union, ) import numpy as np import tritonclient.grpc as grpcclient import tritonclient.http as httpclient STOP_WORDS = ["</s>"] RANDOM_SE...
llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/utils.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/utils.py", "repo_id": "llama_index", "token_count": 5345 }
1,291
# LlamaIndex Embeddings Integration: Instructor
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-instructor/README.md/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-instructor/README.md", "repo_id": "llama_index", "token_count": 11 }
1,246
__version__ = '0.9.15dev0'
pytorch-image-models/timm/version.py/0
{ "file_path": "pytorch-image-models/timm/version.py", "repo_id": "pytorch-image-models", "token_count": 14 }
355
<!--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/tokenizer_summary.md/0
{ "file_path": "transformers/docs/source/ko/tokenizer_summary.md", "repo_id": "transformers", "token_count": 15141 }
509
import gzip import json import multiprocessing import os import re import shutil import time from pathlib import Path import numpy as np from arguments import PreprocessingArguments from datasets import load_dataset from huggingface_hub.utils import insecure_hashlib from minhash_deduplication import deduplicate_datase...
transformers/examples/research_projects/codeparrot/scripts/preprocessing.py/0
{ "file_path": "transformers/examples/research_projects/codeparrot/scripts/preprocessing.py", "repo_id": "transformers", "token_count": 2776 }
571