text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
from langchain_community.embeddings.tensorflow_hub import (
TensorflowHubEmbeddings,
)
__all__ = ["TensorflowHubEmbeddings"]
| langchain/libs/langchain/langchain/embeddings/tensorflow_hub.py/0 | {
"file_path": "langchain/libs/langchain/langchain/embeddings/tensorflow_hub.py",
"repo_id": "langchain",
"token_count": 47
} | 510 |
<jupyter_start><jupyter_text>Using agentsThis is an agent specifically optimized for doing retrieval when necessary and also holding a conversation.To start, we will set up the retriever we want to use, and then turn it into a retriever tool. Next, we will use the high level constructor for this type of agent. Finally,... | langchain/docs/docs/use_cases/question_answering/conversational_retrieval_agents.ipynb/0 | {
"file_path": "langchain/docs/docs/use_cases/question_answering/conversational_retrieval_agents.ipynb",
"repo_id": "langchain",
"token_count": 983
} | 212 |
python_tests()
| llama_index/llama-index-integrations/readers/llama-index-readers-mangadex/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mangadex/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,377 |
import os
import argparse
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
set_seed,
default_data_collator,
)
from datasets import load_from_disk
import torch
from transformers import Seq2SeqTrainingArguments, Seq2SeqTrainer, DonutProcessor, VisionEncoderDecoderModel,VisionEncoderDecoderC... | notebooks/sagemaker/26_document_ai_donut/scripts/train.py/0 | {
"file_path": "notebooks/sagemaker/26_document_ai_donut/scripts/train.py",
"repo_id": "notebooks",
"token_count": 1878
} | 319 |
import json
import re
from typing import Union
from langchain_core.agents import AgentAction, AgentFinish
from langchain_core.exceptions import OutputParserException
from langchain.agents.agent import AgentOutputParser
from langchain.agents.chat.prompt import FORMAT_INSTRUCTIONS
FINAL_ANSWER_ACTION = "Final Answer:"... | langchain/libs/langchain/langchain/agents/chat/output_parser.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/chat/output_parser.py",
"repo_id": "langchain",
"token_count": 817
} | 442 |
from llama_index.legacy.selectors.embedding_selectors import EmbeddingSingleSelector
from llama_index.legacy.selectors.llm_selectors import (
LLMMultiSelector,
LLMSingleSelector,
)
from llama_index.legacy.selectors.pydantic_selectors import (
PydanticMultiSelector,
PydanticSingleSelector,
)
__all__ = [... | llama_index/llama-index-legacy/llama_index/legacy/selectors/__init__.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/selectors/__init__.py",
"repo_id": "llama_index",
"token_count": 181
} | 1,538 |
# LlamaIndex Vector_Stores Integration: Bagel
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-bagel/README.md",
"repo_id": "llama_index",
"token_count": 13
} | 1,451 |
<jupyter_start><jupyter_text>Bedrock >[Amazon Bedrock](https://aws.amazon.com/bedrock/) is a fully managed service that offers a choice of > high-performing foundation models (FMs) from leading AI companies like `AI21 Labs`, `Anthropic`, `Cohere`, > `Meta`, `Stability AI`, and `Amazon` via a single API, along with a br... | langchain/docs/docs/integrations/llms/bedrock.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/llms/bedrock.ipynb",
"repo_id": "langchain",
"token_count": 1238
} | 117 |
# coding=utf-8
# Copyright 2022 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/x_clip/convert_x_clip_original_pytorch_to_hf.py/0 | {
"file_path": "transformers/src/transformers/models/x_clip/convert_x_clip_original_pytorch_to_hf.py",
"repo_id": "transformers",
"token_count": 8829
} | 753 |
"""LlamaIndex toolkit."""
from typing import List
from llama_index.core.bridge.langchain import BaseTool, BaseToolkit
from llama_index.core.bridge.pydantic import Field
from llama_index.core.langchain_helpers.agents.tools import (
IndexToolConfig,
LlamaIndexTool,
)
class LlamaToolkit(BaseToolkit):
"""To... | llama_index/llama-index-core/llama_index/core/langchain_helpers/agents/toolkits.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/langchain_helpers/agents/toolkits.py",
"repo_id": "llama_index",
"token_count": 313
} | 1,187 |
#!/usr/bin/env bash
set -euxo pipefail
export CI=true
# enable extended globbing for omitting build artifacts
shopt -s extglob
# avoid copying build artifacts from the host
cp -r ../langchain/!(node_modules|dist|dist-cjs|dist-esm|build|.next|.turbo) ./
mkdir -p /updater_script
cp -r /scripts/node/!(node_modules|di... | langchainjs/dependency_range_tests/scripts/test-langchain-with-lowest-deps.sh/0 | {
"file_path": "langchainjs/dependency_range_tests/scripts/test-langchain-with-lowest-deps.sh",
"repo_id": "langchainjs",
"token_count": 241
} | 742 |
# 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/stable_diffusion/pipeline_stable_diffusion_upscale.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py",
"repo_id": "diffusers",
"token_count": 18163
} | 250 |
# coding=utf-8
# Copyright 2022 The OpenAI Team Authors and 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
#
# Unles... | transformers/src/transformers/models/jukebox/modeling_jukebox.py/0 | {
"file_path": "transformers/src/transformers/models/jukebox/modeling_jukebox.py",
"repo_id": "transformers",
"token_count": 54661
} | 631 |
"""Test EdenAi's invoice parser Tool .
In order to run this test, you need to have an EdenAI api key.
You can get it by registering for free at https://app.edenai.run/user/register.
A test key can be found at https://app.edenai.run/admin/account/settings by
clicking on the 'sandbox' toggle.
(calls will be free, and wi... | langchain/libs/community/tests/integration_tests/tools/edenai/test_ocr_invoiceparser.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/tools/edenai/test_ocr_invoiceparser.py",
"repo_id": "langchain",
"token_count": 306
} | 349 |
[
{
"server": "idc-sh002",
"deploy_mode": "cluster",
"suite_params": [
{
"suite": "2_insert_search_sift10m_512.yaml",
"image_type": "cpu"
}
]
},
{
"deploy_mode": "cluster",
"suite_params": [
{... | milvus/tests/benchmark/milvus_benchmark/scheduler/2_cluster_data.json/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/2_cluster_data.json",
"repo_id": "milvus",
"token_count": 612
} | 1,929 |
---
sidebar_class_name: hidden
---
# Debugging chains
It can be hard to debug a `Chain` object solely from its output as most `Chain` objects involve a fair amount of input prompt preprocessing and LLM output post-processing.
Setting `verbose` to `true` will print out some internal states of the `Chain` object while... | langchainjs/docs/core_docs/docs/modules/chains/how_to/debugging.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/modules/chains/how_to/debugging.mdx",
"repo_id": "langchainjs",
"token_count": 1438
} | 753 |
<jupyter_start><jupyter_code># Setup OpenAI Agent
import openai
openai.api_key = "sk-your-key"
from llama_index.agent import OpenAIAgent
from llama_index.tools.azure_cv.base import AzureCVToolSpec
cv_tool = AzureCVToolSpec(api_key="your-key", resource="your-resource")
agent = OpenAIAgent.from_tools(
cv_tool.to_t... | llama_index/llama-index-integrations/tools/llama-index-tools-azure-cv/examples/azure_vision.ipynb/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-azure-cv/examples/azure_vision.ipynb",
"repo_id": "llama_index",
"token_count": 633
} | 1,476 |
package coordinator
import (
"fmt"
"github.com/chroma/chroma-coordinator/internal/types"
"github.com/chroma/chroma-coordinator/internal/utils"
)
type CollectionAssignmentPolicy interface {
AssignCollection(collectionID types.UniqueID) (string, error)
}
// SimpleAssignmentPolicy is a simple assignment policy tha... | chroma/go/coordinator/internal/coordinator/assignment_policy.go/0 | {
"file_path": "chroma/go/coordinator/internal/coordinator/assignment_policy.go",
"repo_id": "chroma",
"token_count": 711
} | 42 |
<jupyter_start><jupyter_text>Partage de modèles pré-entraînés (PyTorch) Installez la bibliothèque 🤗 Transformers pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece]
!apt install git-lfs<jupyter_output><empty_output><jupyter_text>Vous aurez besoin de configurer git, adaptez votre... | notebooks/course/fr/chapter4/section3_pt.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter4/section3_pt.ipynb",
"repo_id": "notebooks",
"token_count": 1050
} | 298 |
# Modern Treasury
>[Modern Treasury](https://www.moderntreasury.com/) simplifies complex payment operations. It is a unified platform to power products and processes that move money.
>- Connect to banks and payment systems
>- Track transactions and balances in real-time
>- Automate payment operations for scale
## Ins... | langchain/docs/docs/integrations/providers/modern_treasury.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/modern_treasury.mdx",
"repo_id": "langchain",
"token_count": 142
} | 150 |
<!--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/api/pipelines/auto_pipeline.md/0 | {
"file_path": "diffusers/docs/source/en/api/pipelines/auto_pipeline.md",
"repo_id": "diffusers",
"token_count": 714
} | 173 |
{
"StorageContext": "llama_index.core",
"ServiceContext": "llama_index.core",
"ComposableGraph": "llama_index.core",
"# indicesSummaryIndex": "llama_index.core",
"VectorStoreIndex": "llama_index.core",
"SimpleKeywordTableIndex": "llama_index.core",
"KeywordTableIndex": "llama_index.core",
"RAKEKeywordTa... | llama_index/llama-index-cli/llama_index/cli/upgrade/mappings.json/0 | {
"file_path": "llama_index/llama-index-cli/llama_index/cli/upgrade/mappings.json",
"repo_id": "llama_index",
"token_count": 17904
} | 1,240 |
<!---
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/docs/source/en/perf_hardware.md/0 | {
"file_path": "transformers/docs/source/en/perf_hardware.md",
"repo_id": "transformers",
"token_count": 2302
} | 521 |
# coding=utf-8
# Copyright 2021 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/speech_encoder_decoder/test_modeling_speech_encoder_decoder.py/0 | {
"file_path": "transformers/tests/models/speech_encoder_decoder/test_modeling_speech_encoder_decoder.py",
"repo_id": "transformers",
"token_count": 11717
} | 749 |
from llama_index.core.llms.base import BaseLLM
from llama_index.llms.ollama import Ollama
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in Ollama.__mro__]
assert BaseLLM.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py",
"repo_id": "llama_index",
"token_count": 93
} | 1,238 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/proxy/segment_test.go/0 | {
"file_path": "milvus/internal/proxy/segment_test.go",
"repo_id": "milvus",
"token_count": 3512
} | 1,744 |
import json
import logging
from typing import Any, Callable, Dict, List, Mapping, Optional
import requests
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.pydantic_v1 import Extra, SecretStr, root_validator
from langchain_core.utils ... | langchain/libs/community/langchain_community/llms/symblai_nebula.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/symblai_nebula.py",
"repo_id": "langchain",
"token_count": 3301
} | 284 |
//! [Byte Pair Encoding](https://www.aclweb.org/anthology/P16-1162/) model.
use std::{iter, mem};
mod model;
mod serialization;
pub mod trainer;
mod word;
type Pair = (u32, u32);
/// Errors that can be encountered while using or constructing a `BPE` model.
#[derive(thiserror::Error, Debug)]
pub enum Error {
/// ... | tokenizers/tokenizers/src/models/bpe/mod.rs/0 | {
"file_path": "tokenizers/tokenizers/src/models/bpe/mod.rs",
"repo_id": "tokenizers",
"token_count": 891
} | 464 |
import { OpenAI } from "@langchain/openai";
import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
import type { LLMResult } from "@langchain/core/outputs";
import { getEnvironmentVariable } from "@langchain/core/utils/env";
import { promptLayerTrackRequest } from "../util/prompt-layer.js";
impo... | langchainjs/langchain/src/llms/openai.ts/0 | {
"file_path": "langchainjs/langchain/src/llms/openai.ts",
"repo_id": "langchainjs",
"token_count": 1125
} | 995 |
// Copyright (C) 2019-2023 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/simd/interface.h/0 | {
"file_path": "milvus/internal/core/src/simd/interface.h",
"repo_id": "milvus",
"token_count": 4858
} | 1,752 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/indices/query/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/query/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,666 |
#####################################################################
# THIS FILE IS AUTOMATICALLY GENERATED BY UNSTRUCTURED API TOOLS.
# DO NOT MODIFY DIRECTLY
#####################################################################
import logging
import os
from fastapi import FastAPI, Request, status
from .section i... | llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/api/app.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/api/app.py",
"repo_id": "llama_index",
"token_count": 447
} | 1,438 |
<!--
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 agree... | transformers/docs/source/ja/benchmarks.md/0 | {
"file_path": "transformers/docs/source/ja/benchmarks.md",
"repo_id": "transformers",
"token_count": 8797
} | 486 |
# [Beta] Multi-modal models
## Concept
Large language models (LLMs) are text-in, text-out. Large Multi-modal Models (LMMs) generalize this beyond the text modalities. For instance, models such as GPT-4V allow you to jointly input both images and text, and output text.
We've included a base `MultiModalLLM` abstractio... | llama_index/docs/module_guides/models/multi_modal.md/0 | {
"file_path": "llama_index/docs/module_guides/models/multi_modal.md",
"repo_id": "llama_index",
"token_count": 4974
} | 1,103 |
poetry_requirements(
name="poetry",
)
python_requirements(
name="reqs",
)
| llama_index/llama-index-packs/llama-index-packs-voyage-query-engine/BUILD/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-voyage-query-engine/BUILD",
"repo_id": "llama_index",
"token_count": 36
} | 1,686 |
<script lang="ts">
import { page } from "$app/stores";
import { base } from "$app/paths";
import { PUBLIC_ORIGIN } from "$env/static/public";
import type { BackendModel } from "$lib/server/models";
import { useSettingsStore } from "$lib/stores/settings";
import CopyToClipBoardBtn from "$lib/components/CopyToClipB... | chat-ui/src/routes/settings/[...model]/+page.svelte/0 | {
"file_path": "chat-ui/src/routes/settings/[...model]/+page.svelte",
"repo_id": "chat-ui",
"token_count": 1517
} | 112 |
"""New unit tests for the evaluation module."""
| langchain/libs/langchain/tests/unit_tests/evaluation/__init__.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/evaluation/__init__.py",
"repo_id": "langchain",
"token_count": 11
} | 604 |
# Hubspot Loader
This loader loads documents from Hubspot. The user specifies an access token to initialize the HubspotReader.
At the moment, this loader only supports access token authentication. To obtain an access token, you will need to create a private app by following instructions [here](https://developers.hubs... | llama_index/llama-index-integrations/readers/llama-index-readers-hubspot/README.md/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-hubspot/README.md",
"repo_id": "llama_index",
"token_count": 268
} | 1,413 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-postgres/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-postgres/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,470 |
python_sources()
| llama_index/llama-index-core/llama_index/core/node_parser/file/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/node_parser/file/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,200 |
"""Leaf query mechanism."""
import logging
from typing import Any, Dict, List, Optional, cast
from llama_index.legacy.callbacks.base import CallbackManager
from llama_index.legacy.core.base_retriever import BaseRetriever
from llama_index.legacy.core.response.schema import Response
from llama_index.legacy.indices.quer... | llama_index/llama-index-legacy/llama_index/legacy/indices/tree/select_leaf_retriever.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/tree/select_leaf_retriever.py",
"repo_id": "llama_index",
"token_count": 7592
} | 1,571 |
import argparse
import itertools
import math
import os
import random
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils import ProjectConfiguration, set... | diffusers/examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint.py/0 | {
"file_path": "diffusers/examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint.py",
"repo_id": "diffusers",
"token_count": 14370
} | 217 |
"""Test the initialize module."""
from langchain_core.tools import tool
from langchain.agents.agent_types import AgentType
from langchain.agents.initialize import initialize_agent
from tests.unit_tests.llms.fake_llm import FakeLLM
@tool
def my_tool(query: str) -> str:
"""A fake tool."""
return "fake tool"
... | langchain/libs/langchain/tests/unit_tests/agents/test_initialize.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/agents/test_initialize.py",
"repo_id": "langchain",
"token_count": 298
} | 592 |
// 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/channel.go/0 | {
"file_path": "milvus/internal/datacoord/channel.go",
"repo_id": "milvus",
"token_count": 788
} | 1,959 |
package common
type StringList []string
func (l StringList) Clone() StringList {
clone := make([]string, 0, len(l))
for _, s := range l {
clone = append(clone, s)
}
return clone
}
func (l StringList) Equal(other StringList) bool {
if len(l) != len(other) {
return false
}
for i := range l {
if l[i] != ot... | milvus/pkg/common/string_list.go/0 | {
"file_path": "milvus/pkg/common/string_list.go",
"repo_id": "milvus",
"token_count": 170
} | 1,910 |
from llama_index.core.vector_stores.types import BasePydanticVectorStore
from llama_index.vector_stores.lantern import LanternVectorStore
def test_class():
names_of_base_classes = [b.__name__ for b in LanternVectorStore.__mro__]
assert BasePydanticVectorStore.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lantern/tests/test_vector_stores_lantern.py/0 | {
"file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lantern/tests/test_vector_stores_lantern.py",
"repo_id": "llama_index",
"token_count": 98
} | 1,561 |
# FastViT for PyTorch
#
# Original implementation and weights from https://github.com/apple/ml-fastvit
#
# For licensing see accompanying LICENSE file at https://github.com/apple/ml-fastvit/tree/main
# Original work is copyright (C) 2023 Apple Inc. All Rights Reserved.
#
import os
from functools import partial
from typ... | pytorch-image-models/timm/models/fastvit.py/0 | {
"file_path": "pytorch-image-models/timm/models/fastvit.py",
"repo_id": "pytorch-image-models",
"token_count": 24916
} | 377 |
from llama_index.legacy.constants import DATA_KEY, TYPE_KEY
from llama_index.legacy.data_structs.data_structs import IndexStruct
from llama_index.legacy.data_structs.registry import (
INDEX_STRUCT_TYPE_TO_INDEX_STRUCT_CLASS,
)
def index_struct_to_json(index_struct: IndexStruct) -> dict:
return {
TYPE_... | llama_index/llama-index-legacy/llama_index/legacy/storage/index_store/utils.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/index_store/utils.py",
"repo_id": "llama_index",
"token_count": 285
} | 1,617 |
<jupyter_start><jupyter_text>Bedrock>[Amazon Bedrock](https://aws.amazon.com/bedrock/) is a fully managed service that offers a choice of > high-performing foundation models (FMs) from leading AI companies like `AI21 Labs`, `Anthropic`, `Cohere`, > `Meta`, `Stability AI`, and `Amazon` via a single API, along with a bro... | langchain/docs/docs/integrations/text_embedding/bedrock.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/text_embedding/bedrock.ipynb",
"repo_id": "langchain",
"token_count": 425
} | 159 |
from typing import Any, Dict, List, Tuple
from langchain_core.agents import AgentAction
from langchain_core.prompts.chat import ChatPromptTemplate
class AgentScratchPadChatPromptTemplate(ChatPromptTemplate):
"""Chat prompt template for the agent scratchpad."""
@classmethod
def is_lc_serializable(cls) ->... | langchain/libs/langchain/langchain/agents/schema.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/schema.py",
"repo_id": "langchain",
"token_count": 479
} | 453 |
""" ResNeSt Models
Paper: `ResNeSt: Split-Attention Networks` - https://arxiv.org/abs/2004.08955
Adapted from original PyTorch impl w/ weights at https://github.com/zhanghang1989/ResNeSt by Hang Zhang
Modified for torchscript compat, and consistency with timm by Ross Wightman
"""
from torch import nn
from timm.data... | pytorch-image-models/timm/models/resnest.py/0 | {
"file_path": "pytorch-image-models/timm/models/resnest.py",
"repo_id": "pytorch-image-models",
"token_count": 4439
} | 357 |
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | transformers/tests/models/vitmatte/test_modeling_vitmatte.py/0 | {
"file_path": "transformers/tests/models/vitmatte/test_modeling_vitmatte.py",
"repo_id": "transformers",
"token_count": 4116
} | 848 |
"""Utility that calls OpenAI's Dall-E Image Generator."""
import logging
import os
from typing import Any, Dict, Mapping, Optional, Tuple, Union
from langchain_core.pydantic_v1 import BaseModel, Extra, Field, root_validator
from langchain_core.utils import (
get_from_dict_or_env,
get_pydantic_field_names,
)
f... | langchain/libs/community/langchain_community/utilities/dalle_image_generator.py/0 | {
"file_path": "langchain/libs/community/langchain_community/utilities/dalle_image_generator.py",
"repo_id": "langchain",
"token_count": 2778
} | 299 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/proxy/channels_time_ticker_test.go/0 | {
"file_path": "milvus/internal/proxy/channels_time_ticker_test.go",
"repo_id": "milvus",
"token_count": 2531
} | 1,958 |
from langchain_core.sys_info import print_sys_info
def test_print_sys_info() -> None:
"""Super simple test to that no exceptions are triggered when calling code."""
print_sys_info()
| langchain/libs/core/tests/unit_tests/test_sys_info.py/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/test_sys_info.py",
"repo_id": "langchain",
"token_count": 59
} | 450 |
#!/usr/bin/env python
# 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/LI... | transformers/examples/tensorflow/language-modeling-tpu/prepare_tfrecord_shards.py/0 | {
"file_path": "transformers/examples/tensorflow/language-modeling-tpu/prepare_tfrecord_shards.py",
"repo_id": "transformers",
"token_count": 2654
} | 623 |
# Pinecone
>[Pinecone](https://docs.pinecone.io/docs/overview) is a vector database with broad functionality.
## Installation and Setup
Install the Python SDK:
```bash
pip install pinecone-client
```
## Vector store
There exists a wrapper around Pinecone indexes, allowing you to use it as a vectorstore,
whether... | langchain/docs/docs/integrations/providers/pinecone.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/pinecone.mdx",
"repo_id": "langchain",
"token_count": 149
} | 153 |
import json
from typing import Any, Dict
import pytest
from langchain_core.exceptions import OutputParserException
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
from langchain_core.outputs import ChatGeneration
from langchain.output_parsers.openai_functions import (
JsonOutputFunctionsP... | langchain/libs/langchain/tests/unit_tests/output_parsers/test_openai_functions.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/output_parsers/test_openai_functions.py",
"repo_id": "langchain",
"token_count": 2639
} | 634 |
Customization Tutorial
======================
.. tip::
If you haven't already, `install LlamaIndex <installation.html>`_ and complete the `starter tutorial <starter_example.html>`_. If you run into terms you don't recognize, check out the `high-level concepts <concepts.html>`_.
In this tutorial, we start with the ... | llama_index/docs/getting_started/customization.rst/0 | {
"file_path": "llama_index/docs/getting_started/customization.rst",
"repo_id": "llama_index",
"token_count": 1990
} | 1,151 |
# candle-repvgg
[RepVGG: Making VGG-style ConvNets Great Again](https://arxiv.org/abs/2101.03697).
This candle implementation uses a pre-trained RepVGG network for inference. The
classification head has been trained on the ImageNet dataset and returns the
probabilities for the top-5 classes.
## Running an example
`... | candle/candle-examples/examples/repvgg/README.md/0 | {
"file_path": "candle/candle-examples/examples/repvgg/README.md",
"repo_id": "candle",
"token_count": 254
} | 46 |
import json
import urllib
from datetime import datetime
from typing import Iterator, List, Optional
from langchain_core.documents import Document
from langchain_core.utils import get_from_env
from langchain_community.document_loaders.base import BaseLoader
LINK_NOTE_TEMPLATE = "joplin://x-callback-url/openNote?id={i... | langchain/libs/community/langchain_community/document_loaders/joplin.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/joplin.py",
"repo_id": "langchain",
"token_count": 1684
} | 258 |
import {expect, test} from "@jest/globals";
import {chromaBasic} from "./initClientWithAuth";
import chromaNoAuth from "./initClient";
import { ChromaClient } from "../src/ChromaClient";
test("it should get the version without auth needed", async () => {
const version = await chromaNoAuth.version();
expect(ver... | chroma/clients/js/test/auth.basic.test.ts/0 | {
"file_path": "chroma/clients/js/test/auth.basic.test.ts",
"repo_id": "chroma",
"token_count": 403
} | 34 |
# Tigris
> [Tigris](https://tigrisdata.com) is an open-source Serverless NoSQL Database and Search Platform designed to simplify building high-performance vector search applications.
> `Tigris` eliminates the infrastructure complexity of managing, operating, and synchronizing multiple tools, allowing you to focus on b... | langchain/docs/docs/integrations/providers/tigris.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/tigris.mdx",
"repo_id": "langchain",
"token_count": 154
} | 150 |
package cgoconverter
/*
#include <stdlib.h>
*/
import "C"
import (
"math"
"sync/atomic"
"unsafe"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)
const maxByteArrayLen = math.MaxInt32
var globalConverter = NewBytesConverter()
type BytesConverter struct {
pointers *typeutil.ConcurrentMap[int32, unsafe.Poin... | milvus/internal/util/cgoconverter/bytes_converter.go/0 | {
"file_path": "milvus/internal/util/cgoconverter/bytes_converter.go",
"repo_id": "milvus",
"token_count": 801
} | 1,875 |
# candle-phi: 1.3b and 2.7b LLM with state of the art performance for <10b models.
[Phi-1.5](https://huggingface.co/microsoft/phi-1_5) and
[Phi-2](https://huggingface.co/microsoft/phi-2) are language models using
only 1.3 and 2.7 billion parameters but with state of the art performance compared to
models with up to 10... | candle/candle-examples/examples/phi/README.md/0 | {
"file_path": "candle/candle-examples/examples/phi/README.md",
"repo_id": "candle",
"token_count": 1011
} | 44 |
# coding=utf-8
# Copyright 2022 Meta Platforms Inc. and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | transformers/src/transformers/models/convnext/modeling_tf_convnext.py/0 | {
"file_path": "transformers/src/transformers/models/convnext/modeling_tf_convnext.py",
"repo_id": "transformers",
"token_count": 11603
} | 615 |
"""Test ChatGLM API wrapper."""
from langchain_core.outputs import LLMResult
from langchain_community.llms.chatglm import ChatGLM
def test_chatglm_call() -> None:
"""Test valid call to chatglm."""
llm = ChatGLM()
output = llm("北京和上海这两座城市有什么不同?")
assert isinstance(output, str)
def test_chatglm_gener... | langchain/libs/community/tests/integration_tests/llms/test_chatglm.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/llms/test_chatglm.py",
"repo_id": "langchain",
"token_count": 222
} | 334 |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: internal.proto
package internalpb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
schemapb "github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
math "math"
)
// Reference imp... | milvus/internal/proto/internalpb/internal.pb.go~parent of ca1349708... Remove time travel ralted testcase (#26119)/0 | {
"file_path": "milvus/internal/proto/internalpb/internal.pb.go~parent of ca1349708... Remove time travel ralted testcase (#26119)",
"repo_id": "milvus",
"token_count": 35794
} | 1,732 |
package console
type exitConfig struct {
abnormal bool
code ErrorCode
msg string
callbacks []func()
}
func defaultExitConfig() exitConfig {
return exitConfig{
abnormal: false,
code: NormalCode,
msg: "",
callbacks: make([]func(), 0),
}
}
type ExitOption func(c *exitConfig)
func ... | milvus/cmd/tools/migration/console/exit_config.go/0 | {
"file_path": "milvus/cmd/tools/migration/console/exit_config.go",
"repo_id": "milvus",
"token_count": 364
} | 1,724 |
<jupyter_start><jupyter_text>Git>[Git](https://en.wikipedia.org/wiki/Git) is a distributed version control system that tracks changes in any set of computer files, usually used for coordinating work among programmers collaboratively developing source code during software development.This notebook shows how to load text... | langchain/docs/docs/integrations/document_loaders/git.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/document_loaders/git.ipynb",
"repo_id": "langchain",
"token_count": 529
} | 112 |
/// Text Generation Inference benchmarking tool
///
/// Inspired by the great Oha app: https://github.com/hatoo/oha
/// and: https://github.com/orhun/rust-tui-template
use clap::Parser;
use std::path::Path;
use text_generation_client::ShardedClient;
use tokenizers::{FromPretrainedParameters, Tokenizer};
use tracing_sub... | text-generation-inference/benchmark/src/main.rs/0 | {
"file_path": "text-generation-inference/benchmark/src/main.rs",
"repo_id": "text-generation-inference",
"token_count": 3113
} | 398 |
poetry_requirements(
name="poetry",
)
| llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/BUILD",
"repo_id": "llama_index",
"token_count": 18
} | 1,230 |
// 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/storage/DataCodec.h/0 | {
"file_path": "milvus/internal/core/src/storage/DataCodec.h",
"repo_id": "milvus",
"token_count": 845
} | 1,755 |
from langchain_core.callbacks.stdout import StdOutCallbackHandler
__all__ = ["StdOutCallbackHandler"]
| langchain/libs/langchain/langchain/schema/callbacks/stdout.py/0 | {
"file_path": "langchain/libs/langchain/langchain/schema/callbacks/stdout.py",
"repo_id": "langchain",
"token_count": 31
} | 574 |
# 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/src/transformers/models/speech_to_text/configuration_speech_to_text.py/0 | {
"file_path": "transformers/src/transformers/models/speech_to_text/configuration_speech_to_text.py",
"repo_id": "transformers",
"token_count": 3953
} | 668 |
<jupyter_start><jupyter_text>Momento Vector Index (MVI)>[MVI](https://gomomento.com): the most productive, easiest to use, serverless vector index for your data. To get started with MVI, simply sign up for an account. There's no need to handle infrastructure, manage servers, or be concerned about scaling. MVI is a serv... | langchain/docs/docs/integrations/vectorstores/momento_vector_index.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/momento_vector_index.ipynb",
"repo_id": "langchain",
"token_count": 1240
} | 183 |
import pytest
from langchain_core.messages import AIMessage, HumanMessage
from langchain_community.chat_models.ernie import ErnieBotChat
def test_chat_ernie_bot() -> None:
chat = ErnieBotChat()
message = HumanMessage(content="Hello")
response = chat([message])
assert isinstance(response, AIMessage)
... | langchain/libs/community/tests/integration_tests/chat_models/test_ernie.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/chat_models/test_ernie.py",
"repo_id": "langchain",
"token_count": 665
} | 318 |
# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# Unless required by applicable law or agreed to in wr... | datasets/src/datasets/arrow_writer.py/0 | {
"file_path": "datasets/src/datasets/arrow_writer.py",
"repo_id": "datasets",
"token_count": 14792
} | 126 |
"""Intercom reader."""
import json
from typing import List
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
class IntercomReader(BaseReader):
"""Intercom reader. Reads data from a Intercom workspace.
Args:
personal_access_token (str): Intercom token.
... | llama_index/llama-index-integrations/readers/llama-index-readers-intercom/llama_index/readers/intercom/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-intercom/llama_index/readers/intercom/base.py",
"repo_id": "llama_index",
"token_count": 1114
} | 1,391 |
"""Tool for the Google Trends"""
from typing import Optional
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.tools import BaseTool
from langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper
class GoogleTrendsQueryRun(BaseTool):
"""Tool that queries the Goo... | langchain/libs/community/langchain_community/tools/google_trends/tool.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/google_trends/tool.py",
"repo_id": "langchain",
"token_count": 297
} | 306 |
import asyncio
from contextlib import contextmanager
from typing import (
Any,
AsyncGenerator,
Callable,
Generator,
Sequence,
cast,
)
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatResponseGen,
CompletionResponse,
Comp... | llama_index/llama-index-core/llama_index/core/llms/callbacks.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/llms/callbacks.py",
"repo_id": "llama_index",
"token_count": 6016
} | 1,228 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/querycoordv2/checkers/segment_checker.go/0 | {
"file_path": "milvus/internal/querycoordv2/checkers/segment_checker.go",
"repo_id": "milvus",
"token_count": 5374
} | 2,028 |
import json
import tarfile
import numpy as np
import pytest
from datasets import Audio, DownloadManager, Features, Image, Value
from datasets.packaged_modules.webdataset.webdataset import WebDataset
from ..utils import require_pil, require_sndfile
@pytest.fixture
def image_wds_file(tmp_path, image_file):
json_... | datasets/tests/packaged_modules/test_webdataset.py/0 | {
"file_path": "datasets/tests/packaged_modules/test_webdataset.py",
"repo_id": "datasets",
"token_count": 2263
} | 152 |
# Segcore Search Design
init: 7.23.2021, by [FluorineDog](https://github.com/FluorineDog)
update: 2.10.2022, by [zhuwenxing](https://github.com/zhuwenxing)
## Search
Search now supports two modes: json DSL mode and Boolean Expr mode. We will talk about the latter one in detail because the former has been deprecated... | milvus/docs/design_docs/segcore/Search.md/0 | {
"file_path": "milvus/docs/design_docs/segcore/Search.md",
"repo_id": "milvus",
"token_count": 481
} | 1,854 |
<!--
Copyright 2023 The HuggingFace Team. All rights reserved.
ライセンス:Apache License、バージョン2.0(「ライセンス」)に基づいています。このファイルは、ライセンスに準拠していない限り、使用できません。ライセンスのコピーは以下から入手できます:
http://www.apache.org/licenses/LICENSE-2.0
適用法に従って必要な場合、または書面で同意した場合を除き、ライセンスの下で配布されるソフトウェアは、「AS IS」の基盤で、明示または黙示を問わず、いかなる保証や条件も含みません。ライセンスの詳細については、ライセンス文... | transformers/docs/source/ja/add_tensorflow_model.md/0 | {
"file_path": "transformers/docs/source/ja/add_tensorflow_model.md",
"repo_id": "transformers",
"token_count": 11994
} | 512 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/kv/mem/mem_kv_test.go/0 | {
"file_path": "milvus/internal/kv/mem/mem_kv_test.go",
"repo_id": "milvus",
"token_count": 2607
} | 1,717 |
<!--Copyright 2020 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | transformers/docs/source/es/converting_tensorflow_models.md/0 | {
"file_path": "transformers/docs/source/es/converting_tensorflow_models.md",
"repo_id": "transformers",
"token_count": 2419
} | 502 |
---
sidebar_label: NIBittensorChatModel
---
# NIBittensorChatModel
LangChain.js offers experimental support for Neural Internet's Bittensor chat models.
Here's an example:
import CodeBlock from "@theme/CodeBlock";
import NIBittensorChatModelExample from "@examples/models/chat/integration_bittensor.ts";
<CodeBlock ... | langchainjs/docs/core_docs/docs/integrations/chat/ni_bittensor.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/chat/ni_bittensor.mdx",
"repo_id": "langchainjs",
"token_count": 115
} | 698 |
<jupyter_start><jupyter_text>Ensemble Query Engine GuideOftentimes when building a RAG application there are different query pipelines you need to experiment with (e.g. top-k retrieval, keyword search, knowledge graphs).Thought: what if we could try a bunch of strategies at once, and have the LLM 1) rate the relevance ... | llama_index/docs/examples/query_engine/ensemble_query_engine.ipynb/0 | {
"file_path": "llama_index/docs/examples/query_engine/ensemble_query_engine.ipynb",
"repo_id": "llama_index",
"token_count": 2013
} | 1,158 |
package indexparamcheck
import (
"strconv"
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus/pkg/util/metric"
)
func Test_baseChecker_CheckTrain(t *testing.T) {
validParams := map[string]string{
DIM: strconv.Itoa(128),
Met... | milvus/pkg/util/indexparamcheck/base_checker_test.go/0 | {
"file_path": "milvus/pkg/util/indexparamcheck/base_checker_test.go",
"repo_id": "milvus",
"token_count": 1008
} | 1,837 |
"""Arg pack components."""
from typing import Any, Callable, Dict, Optional
from llama_index.core.base.query_pipeline.query import (
InputKeys,
OutputKeys,
QueryComponent,
)
from llama_index.core.bridge.pydantic import Field
class ArgPackComponent(QueryComponent):
"""Arg pack component.
Packs a... | llama_index/llama-index-core/llama_index/core/query_pipeline/components/argpacks.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/query_pipeline/components/argpacks.py",
"repo_id": "llama_index",
"token_count": 1444
} | 1,200 |
import { ChatTogetherAI } from "@langchain/community/chat_models/togetherai";
import { ChatPromptTemplate } from "@langchain/core/prompts";
// Define a JSON schema for the response
const responseSchema = {
type: "object",
properties: {
orderedArray: {
type: "array",
items: {
type: "number",... | langchainjs/examples/src/models/chat/integration_togetherai_json.ts/0 | {
"file_path": "langchainjs/examples/src/models/chat/integration_togetherai_json.ts",
"repo_id": "langchainjs",
"token_count": 403
} | 833 |
.PHONY: all clean docs_build docs_clean docs_linkcheck api_docs_build api_docs_clean api_docs_linkcheck format lint test tests test_watch integration_tests docker_tests help extended_tests
# Default target executed when no arguments are given to make.
all: help
######################
# TESTING AND COVERAGE
##########... | langgraph/Makefile/0 | {
"file_path": "langgraph/Makefile",
"repo_id": "langgraph",
"token_count": 1282
} | 1,027 |
# coding=utf-8
# Copyright 2024 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... | diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion.py/0 | {
"file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion.py",
"repo_id": "diffusers",
"token_count": 12006
} | 274 |
"""Download."""
import json
import logging
import os
import subprocess
import sys
from enum import Enum
from importlib import util
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import requests
from llama_index.core.download.utils import (
get_exports,
get_file_content,
initi... | llama_index/llama-index-core/llama_index/core/download/module.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/download/module.py",
"repo_id": "llama_index",
"token_count": 4103
} | 1,183 |
---
hide_table_of_contents: true
---
# Open AI Whisper Audio
:::tip Compatibility
Only available on Node.js.
:::
This covers how to load document objects from an audio file using the [Open AI Whisper](https://platform.openai.com/docs/guides/speech-to-text) API.
## Setup
To run this loader you will need to create a... | langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/openai_whisper_audio.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/document_loaders/file_loaders/openai_whisper_audio.mdx",
"repo_id": "langchainjs",
"token_count": 206
} | 713 |
use super::model::Unigram;
use serde::{
de::{Error, MapAccess, Visitor},
ser::SerializeStruct,
Deserialize, Deserializer, Serialize, Serializer,
};
impl Serialize for Unigram {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
let mut model ... | tokenizers/tokenizers/src/models/unigram/serialization.rs/0 | {
"file_path": "tokenizers/tokenizers/src/models/unigram/serialization.rs",
"repo_id": "tokenizers",
"token_count": 1824
} | 453 |
# coding=utf-8
# 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 requir... | transformers/tests/models/xlm_roberta/test_modeling_flax_xlm_roberta.py/0 | {
"file_path": "transformers/tests/models/xlm_roberta/test_modeling_flax_xlm_roberta.py",
"repo_id": "transformers",
"token_count": 684
} | 746 |
<jupyter_start><jupyter_text>If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets. Uncomment the following cell and run it.<jupyter_code>#! pip install transformers datasets huggingface_hub<jupyter_output><empty_output><jupyter_text>If you're opening this notebook ... | notebooks/examples/multiple_choice-tf.ipynb/0 | {
"file_path": "notebooks/examples/multiple_choice-tf.ipynb",
"repo_id": "notebooks",
"token_count": 7913
} | 281 |
"""Tools for interacting with the user."""
| langchain/libs/langchain/langchain/tools/interaction/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/interaction/__init__.py",
"repo_id": "langchain",
"token_count": 10
} | 563 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.