text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
pub mod text_generation;
candle/candle-transformers/src/pipelines/mod.rs/0
{ "file_path": "candle/candle-transformers/src/pipelines/mod.rs", "repo_id": "candle", "token_count": 7 }
79
# coding=utf-8 # Copyright 2023 Mistral AI 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...
transformers/src/transformers/models/mistral/configuration_mistral.py/0
{ "file_path": "transformers/src/transformers/models/mistral/configuration_mistral.py", "repo_id": "transformers", "token_count": 2757 }
700
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "storage/convex", }); export * from "@langchain/community/storage/convex";
langchainjs/langchain/src/storage/convex.ts/0
{ "file_path": "langchainjs/langchain/src/storage/convex.ts", "repo_id": "langchainjs", "token_count": 72 }
924
""" Class for searching and importing data from OpenAlex. """ import logging from typing import List import requests from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document logging.basicConfig(level=logging.ERROR) class OpenAlexReader(BaseReader): """ This class is...
llama_index/llama-index-integrations/readers/llama-index-readers-openalex/llama_index/readers/openalex/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-openalex/llama_index/readers/openalex/base.py", "repo_id": "llama_index", "token_count": 1939 }
1,418
from langchain_community.embeddings.fastembed import FastEmbedEmbeddings __all__ = ["FastEmbedEmbeddings"]
langchain/libs/langchain/langchain/embeddings/fastembed.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/fastembed.py", "repo_id": "langchain", "token_count": 34 }
524
"""Util that calls Tavily Search API. In order to set this up, follow instructions at: """ import json from typing import Dict, List, Optional import aiohttp import requests from langchain_core.pydantic_v1 import BaseModel, Extra, SecretStr, root_validator from langchain_core.utils import get_from_dict_or_env TAVILY...
langchain/libs/community/langchain_community/utilities/tavily_search.py/0
{ "file_path": "langchain/libs/community/langchain_community/utilities/tavily_search.py", "repo_id": "langchain", "token_count": 3151 }
326
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 50278, "logprob": null, "text": "<|USER|>" }, { "id": 1276, "logprob": -4.5546875, "text": "What" }, { ...
text-generation-inference/integration-tests/models/__snapshots__/test_flash_neox/test_flash_neox.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_flash_neox/test_flash_neox.json", "repo_id": "text-generation-inference", "token_count": 1353 }
406
"""Init file."""
llama_index/llama-index-legacy/tests/indices/vector_store/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/vector_store/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,665
import "react-toastify/dist/ReactToastify.css"; import { Card, CardBody, Heading } from "@chakra-ui/react"; import { sendFeedback } from "../utils/sendFeedback"; export type Source = { url: string; title: string; }; export function SourceBubble({ source, highlighted, onMouseEnter, onMouseLeave, runId, }...
chat-langchain/chat-langchain/app/components/SourceBubble.tsx/0
{ "file_path": "chat-langchain/chat-langchain/app/components/SourceBubble.tsx", "repo_id": "chat-langchain", "token_count": 524 }
6
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 2502, "logprob": null, "text": " red" }, { "id": 13, "logprob": -2.734375, "text": "," }, { "id": 8862...
text-generation-inference/integration-tests/models/__snapshots__/test_mamba/test_mamba_all_params.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_mamba/test_mamba_all_params.json", "repo_id": "text-generation-inference", "token_count": 1156 }
424
pub(crate) mod config; mod memberlist_provider; // Re-export the memberlist provider for use in the worker pub(crate) use memberlist_provider::*;
chroma/rust/worker/src/memberlist/mod.rs/0
{ "file_path": "chroma/rust/worker/src/memberlist/mod.rs", "repo_id": "chroma", "token_count": 47 }
61
<jupyter_start><jupyter_text>Redis Ingestion PipelineThis walkthrough shows how to use Redis for both the vector store, cache, and docstore in an Ingestion Pipeline. DependenciesInstall and start redis, setup OpenAI API key<jupyter_code>%pip install llama-index-storage-docstore-redis %pip install llama-index-vector-st...
llama_index/docs/examples/ingestion/redis_ingestion_pipeline.ipynb/0
{ "file_path": "llama_index/docs/examples/ingestion/redis_ingestion_pipeline.ipynb", "repo_id": "llama_index", "token_count": 1467 }
1,110
import { ChatWindow } from "@/components/ChatWindow"; export default function AgentsPage() { const InfoCard = ( <div className="p-4 md:p-8 rounded bg-[#25252d] w-full max-h-[85%] overflow-hidden"> <h1 className="text-3xl md:text-4xl mb-4"> โ–ฒ Next.js + LangChain.js Retrieval Agent ๐Ÿฆœ๐Ÿ”— </h1> ...
langchain-nextjs-template/app/retrieval_agents/page.tsx/0
{ "file_path": "langchain-nextjs-template/app/retrieval_agents/page.tsx", "repo_id": "langchain-nextjs-template", "token_count": 1737 }
67
from langchain_community.llms.mlflow import Mlflow __all__ = ["Mlflow"]
langchain/libs/langchain/langchain/llms/mlflow.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/mlflow.py", "repo_id": "langchain", "token_count": 28 }
513
//! SAM: Segment Anything Model //! https://github.com/facebookresearch/segment-anything #[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use candle::DType; use candle_nn::VarBuilder; use candle_transformers::models::segment_anything::sam; use clap::Pars...
candle/candle-examples/examples/segment-anything/main.rs/0
{ "file_path": "candle/candle-examples/examples/segment-anything/main.rs", "repo_id": "candle", "token_count": 3129 }
56
# 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/models/embeddings.py/0
{ "file_path": "diffusers/src/diffusers/models/embeddings.py", "repo_id": "diffusers", "token_count": 15916 }
240
python_sources()
llama_index/llama-index-core/llama_index/core/query_pipeline/components/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/query_pipeline/components/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,290
--- sidebar_position: 5 title: Using tools hide_table_of_contents: true --- # Using tools Tools are also runnables, and can therefore be used within a chain: import CodeBlock from "@theme/CodeBlock"; import ToolExample from "@examples/guides/expression_language/cookbook_tools.ts"; import IntegrationInstallTooltip f...
langchainjs/docs/core_docs/docs/expression_language/cookbook/tools.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/expression_language/cookbook/tools.mdx", "repo_id": "langchainjs", "token_count": 167 }
747
<jupyter_start><jupyter_code>from transformers import AutoModelForSeq2SeqLM from peft import PeftModel, PeftConfig import torch from datasets import load_dataset import os from transformers import AutoTokenizer from torch.utils.data import DataLoader from transformers import default_data_collator, get_linear_schedule_w...
peft/examples/conditional_generation/peft_lora_seq2seq_accelerate_big_model_inference.ipynb/0
{ "file_path": "peft/examples/conditional_generation/peft_lora_seq2seq_accelerate_big_model_inference.ipynb", "repo_id": "peft", "token_count": 1695 }
310
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/video_audio/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/video_audio/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,365
# Copyright 2020 The HuggingFace 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
datasets/src/datasets/formatting/torch_formatter.py/0
{ "file_path": "datasets/src/datasets/formatting/torch_formatter.py", "repo_id": "datasets", "token_count": 1679 }
152
#!/usr/bin/env bash python run_asr.py \ --output_dir="./wav2vec2-large-lv60-100h" \ --num_train_epochs="30" \ --per_device_train_batch_size="16" \ --per_device_eval_batch_size="16" \ --evaluation_strategy="steps" \ --save_total_limit="3" \ --save_steps="500" \ --eval_steps="100" \ --logging_steps="50" \ --learning_rate...
transformers/examples/research_projects/wav2vec2/finetune_large_lv60_100.sh/0
{ "file_path": "transformers/examples/research_projects/wav2vec2/finetune_large_lv60_100.sh", "repo_id": "transformers", "token_count": 255 }
593
from typing import Callable, Dict, List, Optional, Union import torch from transformers import T5EncoderModel, T5Tokenizer from ...loaders import LoraLoaderMixin from ...models import Kandinsky3UNet, VQModel from ...schedulers import DDPMScheduler from ...utils import ( deprecate, is_accelerate_available, ...
diffusers/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/kandinsky3/pipeline_kandinsky3.py", "repo_id": "diffusers", "token_count": 12850 }
228
from .constants import ( MODEL_NAME, OPTIMIZER_NAME, RNG_STATE_NAME, SAFE_MODEL_NAME, SAFE_WEIGHTS_INDEX_NAME, SAFE_WEIGHTS_NAME, SAMPLER_NAME, SCALER_NAME, SCHEDULER_NAME, TORCH_DISTRIBUTED_OPERATION_TYPES, TORCH_LAUNCH_PARAMS, WEIGHTS_INDEX_NAME, WEIGHTS_NAME, ) fro...
accelerate/src/accelerate/utils/__init__.py/0
{ "file_path": "accelerate/src/accelerate/utils/__init__.py", "repo_id": "accelerate", "token_count": 2252 }
12
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querynodev2/pipeline/filter_node_test.go/0
{ "file_path": "milvus/internal/querynodev2/pipeline/filter_node_test.go", "repo_id": "milvus", "token_count": 2224 }
1,989
"""Tool for the SearxNG search API.""" from typing import Optional from langchain_core.callbacks import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) from langchain_core.pydantic_v1 import Extra, Field from langchain_core.tools import BaseTool from langchain_community.utilities.searx_search i...
langchain/libs/community/langchain_community/tools/searx_search/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/searx_search/tool.py", "repo_id": "langchain", "token_count": 886 }
292
# LlamaIndex Readers Integration: Weaviate
llama_index/llama-index-integrations/readers/llama-index-readers-weaviate/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-weaviate/README.md", "repo_id": "llama_index", "token_count": 11 }
1,537
import os import logging import numpy as np import sklearn.preprocessing import h5py import random from itertools import product from pymilvus import DataType from milvus_benchmark import config logger = logging.getLogger("milvus_benchmark.runners.utils") DELETE_INTERVAL_TIME = 2 VECTORS_PER_FILE = 1000000 SIFT_VEC...
milvus/tests/benchmark/milvus_benchmark/runners/utils.py/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/runners/utils.py", "repo_id": "milvus", "token_count": 3906 }
1,928
"""Test response utils.""" import asyncio from typing import List from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS from llama_index.core.indices.prompt_helper import PromptHelper from llama_index.core.prompts.base import PromptTemplate from llama_index.core.prompts.prompt_type import...
llama_index/llama-index-core/tests/indices/response/test_response_builder.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/response/test_response_builder.py", "repo_id": "llama_index", "token_count": 4672 }
1,264
<jupyter_start><jupyter_text>Combine agents and vector storesThis notebook covers how to combine agents and vector stores. The use case for this is that you've ingested your data into a vector store and want to interact with it in an agentic manner.The recommended method for doing so is to create a `RetrievalQA` and th...
langchain/cookbook/agent_vectorstore.ipynb/0
{ "file_path": "langchain/cookbook/agent_vectorstore.ipynb", "repo_id": "langchain", "token_count": 2598 }
73
"""Tool for the Metaphor search API.""" from typing import Dict, List, Optional, Union from langchain_core._api.deprecation import deprecated from langchain_core.callbacks import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) from langchain_core.tools import BaseTool from langchain_community....
langchain/libs/community/langchain_community/tools/metaphor_search/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/metaphor_search/tool.py", "repo_id": "langchain", "token_count": 1334 }
304
<jupyter_start><jupyter_text>How to use UpTrain with LlamaIndex **Overview**: In this example, we will see how to use UpTrain with LlamaIndex. **Problem**: There are two main problems:1. The data that most Large Language Models are trained on is not representative of the data that they are used on. This leads to a mis...
llama_index/docs/examples/evaluation/UpTrain.ipynb/0
{ "file_path": "llama_index/docs/examples/evaluation/UpTrain.ipynb", "repo_id": "llama_index", "token_count": 2218 }
1,136
from enum import Enum from typing import Generic, Type, TypeVar from llama_index.core.bridge.pydantic import BaseModel, Field, GenericModel from llama_index.core.vector_stores.types import BasePydanticVectorStore class DataSink(BaseModel): """ A class containing metadata for a type of data sink. """ ...
llama_index/llama-index-core/llama_index/core/ingestion/data_sinks.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/ingestion/data_sinks.py", "repo_id": "llama_index", "token_count": 2427 }
1,196
<jupyter_start><jupyter_text>Launching Multi-Node Training from a Jupyter Environment> Using the `notebook_launcher` to use Accelerate from inside a Jupyter Notebook General OverviewThis notebook covers how to run the `cv_example.py` script as a Jupyter Notebook and train it on a distributed system. It will also cover...
notebooks/examples/accelerate_examples/simple_cv_example.ipynb/0
{ "file_path": "notebooks/examples/accelerate_examples/simple_cv_example.ipynb", "repo_id": "notebooks", "token_count": 3573 }
316
"""Implementation of a record management layer in SQLAlchemy. The management layer uses SQLAlchemy to track upserted records. Currently, this layer only works with SQLite; hopwever, should be adaptable to other SQL implementations with minimal effort. Currently, includes an implementation that uses SQLAlchemy which ...
langchain/libs/community/langchain_community/indexes/_sql_record_manager.py/0
{ "file_path": "langchain/libs/community/langchain_community/indexes/_sql_record_manager.py", "repo_id": "langchain", "token_count": 9554 }
273
# THIS FILE HAS BEEN AUTOGENERATED. To update: # 1. modify the `_deps` dict in setup.py # 2. run `make deps_table_update` deps = { "Pillow": "Pillow", "accelerate": "accelerate>=0.11.0", "compel": "compel==0.1.8", "datasets": "datasets", "filelock": "filelock", "flax": "flax>=0.4.1", "hf-doc...
diffusers/src/diffusers/dependency_versions_table.py/0
{ "file_path": "diffusers/src/diffusers/dependency_versions_table.py", "repo_id": "diffusers", "token_count": 778 }
223
package proxy import ( "context" "os" "strings" "sync" "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" grpcproxyclient "github.com/milvus-io/milvus/internal/distributed/proxy/client" "github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/mi...
milvus/internal/proxy/proxy_rpc_test.go/0
{ "file_path": "milvus/internal/proxy/proxy_rpc_test.go", "repo_id": "milvus", "token_count": 938 }
1,819
from langchain_community.vectorstores.azuresearch import ( AzureSearch, AzureSearchVectorStoreRetriever, ) __all__ = [ "AzureSearch", "AzureSearchVectorStoreRetriever", ]
langchain/libs/langchain/langchain/vectorstores/azuresearch.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/azuresearch.py", "repo_id": "langchain", "token_count": 68 }
573
#!/usr/bin/env groovy // When scheduling a job that gets automatically triggered by changes, // you need to include a [cronjob] tag within the commit message. String cron_timezone = 'TZ=Asia/Shanghai' String cron_string = BRANCH_NAME == "master" ? "50 1 * * * " : "" // Make timeout 4 hours so that we can run two nigh...
milvus/ci/jenkins/Nightly.groovy/0
{ "file_path": "milvus/ci/jenkins/Nightly.groovy", "repo_id": "milvus", "token_count": 12341 }
1,613
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/generation_strategies.md/0
{ "file_path": "transformers/docs/source/en/generation_strategies.md", "repo_id": "transformers", "token_count": 5515 }
450
from .configuration_bert_masked import MaskedBertConfig from .modeling_bert_masked import ( MaskedBertForMultipleChoice, MaskedBertForQuestionAnswering, MaskedBertForSequenceClassification, MaskedBertForTokenClassification, MaskedBertModel, ) from .modules import *
transformers/examples/research_projects/movement-pruning/emmental/__init__.py/0
{ "file_path": "transformers/examples/research_projects/movement-pruning/emmental/__init__.py", "repo_id": "transformers", "token_count": 99 }
568
package compressor import ( "io" "github.com/klauspost/compress/zstd" ) type CompressType string const ( CompressTypeZstd CompressType = "zstd" DefaultCompressAlgorithm CompressType = CompressTypeZstd ) type Compressor interface { Compress(in io.Reader) error CompressBytes(src, dst []byte) []byte ResetWrit...
milvus/pkg/util/compressor/compressor.go/0
{ "file_path": "milvus/pkg/util/compressor/compressor.go", "repo_id": "milvus", "token_count": 1598 }
1,905
<jupyter_start><jupyter_text>Spark DataframeThis notebook shows how to use agents to interact with a `Spark DataFrame` and `Spark Connect`. It is mostly optimized for question answering.**NOTE: this agent calls the Python agent under the hood, which executes LLM generated Python code - this can be bad if the LLM genera...
langchain/docs/docs/integrations/toolkits/spark.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/toolkits/spark.ipynb", "repo_id": "langchain", "token_count": 847 }
170
package metastore import ( "context" "github.com/chroma/chroma-coordinator/internal/model" "github.com/chroma/chroma-coordinator/internal/types" ) // Catalog defines methods for system catalog // //go:generate mockery --name=Catalog type Catalog interface { ResetState(ctx context.Context) error CreateCollection...
chroma/go/coordinator/internal/metastore/catalog.go/0
{ "file_path": "chroma/go/coordinator/internal/metastore/catalog.go", "repo_id": "chroma", "token_count": 552 }
49
from langchain_experimental.graph_transformers.diffbot import DiffbotGraphTransformer __all__ = [ "DiffbotGraphTransformer", ]
langchain/libs/experimental/langchain_experimental/graph_transformers/__init__.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/graph_transformers/__init__.py", "repo_id": "langchain", "token_count": 41 }
442
# 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_k_diffusion/test_stable_diffusion_k_diffusion.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_k_diffusion/test_stable_diffusion_k_diffusion.py", "repo_id": "diffusers", "token_count": 2113 }
275
"""Create a key-value store for any langchain serializable object.""" from typing import Callable, Optional from langchain_core.documents import Document from langchain_core.load import Serializable, dumps, loads from langchain_core.stores import BaseStore, ByteStore from langchain.storage.encoder_backed import Encod...
langchain/libs/langchain/langchain/storage/_lc_store.py/0
{ "file_path": "langchain/libs/langchain/langchain/storage/_lc_store.py", "repo_id": "langchain", "token_count": 878 }
570
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-adapter/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-adapter/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,188
# coding=utf-8 # Copyright 2022 The HuggingFace Team 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 clone of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/tests/quantization/bnb/test_4bit.py/0
{ "file_path": "transformers/tests/quantization/bnb/test_4bit.py", "repo_id": "transformers", "token_count": 10958 }
842
# Copyright 2023-present 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 law or...
peft/scripts/launch_notebook_mp.py/0
{ "file_path": "peft/scripts/launch_notebook_mp.py", "repo_id": "peft", "token_count": 474 }
330
#!/usr/bin/env python # 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...
transformers/scripts/fsmt/gen-card-allenai-wmt16.py/0
{ "file_path": "transformers/scripts/fsmt/gen-card-allenai-wmt16.py", "repo_id": "transformers", "token_count": 1885 }
586
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "llms/ollama", }); export * from "@langchain/community/llms/ollama";
langchainjs/langchain/src/llms/ollama.ts/0
{ "file_path": "langchainjs/langchain/src/llms/ollama.ts", "repo_id": "langchainjs", "token_count": 72 }
903
label: 'How-to' position: 3
langchain/docs/docs/modules/agents/how_to/_category_.yml/0
{ "file_path": "langchain/docs/docs/modules/agents/how_to/_category_.yml", "repo_id": "langchain", "token_count": 12 }
183
<!--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/perf_infer_gpu_one.md/0
{ "file_path": "transformers/docs/source/en/perf_infer_gpu_one.md", "repo_id": "transformers", "token_count": 6350 }
494
/* eslint-disable no-process-env */ import { test, expect, describe } from "@jest/globals"; import { AIMessage, HumanMessage } from "@langchain/core/messages"; import { CassandraClientFactory } from "../../utils/cassandra.js"; import { CassandraChatMessageHistory } from "../message/cassandra.js"; const cassandraConfig...
langchainjs/libs/langchain-community/src/stores/tests/cassandra.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/stores/tests/cassandra.int.test.ts", "repo_id": "langchainjs", "token_count": 1323 }
967
# LlamaIndex Llms Integration: Everlyai
llama_index/llama-index-integrations/llms/llama-index-llms-everlyai/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-everlyai/README.md", "repo_id": "llama_index", "token_count": 12 }
1,394
""" A dataset reader that extracts images from folders Folders are scanned recursively to find image files. Labels are based on the folder hierarchy, just leaf folders by default. Hacked together by / Copyright 2020 Ross Wightman """ import os from typing import Dict, List, Optional, Set, Tuple, Union from timm.util...
pytorch-image-models/timm/data/readers/reader_image_folder.py/0
{ "file_path": "pytorch-image-models/timm/data/readers/reader_image_folder.py", "repo_id": "pytorch-image-models", "token_count": 1510 }
340
#!/bin/bash function replace_image_tag { image_repo=$1 image_tag=$2 image_repo=${image_repo//\//\\\/} platform='unknown' unamestr=$(uname) if [[ "$unamestr" == 'Linux' ]]; then platform='Linux' elif [[ "$unamestr" == 'Darwin' ]]; then platform='Mac' fi echo "before replace: ...
milvus/tests/python_client/deploy/utils.sh/0
{ "file_path": "milvus/tests/python_client/deploy/utils.sh", "repo_id": "milvus", "token_count": 786 }
2,182
[build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] [tool.codespell] check-filenames = true check-hidden = true skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb" [tool.llamahub] classes = ["FeedlyRssReader"] contains_example = false import_path = "llama_index.readers.feedly_rss"...
llama_index/llama-index-integrations/readers/llama-index-readers-feedly-rss/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-feedly-rss/pyproject.toml", "repo_id": "llama_index", "token_count": 673 }
1,358
<html> <head> <!-- Load the latest Swagger UI code and style from npm using unpkg.com --> <script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script> <link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css"/> <title>Text Ge...
text-generation-inference/docs/index.html/0
{ "file_path": "text-generation-inference/docs/index.html", "repo_id": "text-generation-inference", "token_count": 652 }
395
// 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/datanode/syncmgr/storage_serializer_test.go/0
{ "file_path": "milvus/internal/datanode/syncmgr/storage_serializer_test.go", "repo_id": "milvus", "token_count": 3873 }
1,926
import { ChatPromptTemplate } from "@langchain/core/prompts"; import { ChatOpenAI } from "@langchain/openai"; import { createOpenAIFnRunnable } from "langchain/chains/openai_functions"; import { JsonOutputFunctionsParser } from "langchain/output_parsers"; const openAIFunction = { name: "get_person_details", descri...
langchainjs/examples/src/chains/openai_functions_runnable.ts/0
{ "file_path": "langchainjs/examples/src/chains/openai_functions_runnable.ts", "repo_id": "langchainjs", "token_count": 483 }
766
package coordinator import ( "context" "errors" "github.com/chroma/chroma-coordinator/internal/common" "github.com/chroma/chroma-coordinator/internal/model" "github.com/chroma/chroma-coordinator/internal/types" "github.com/pingcap/log" "go.uber.org/zap" ) // ICoordinator is an interface that defines the metho...
chroma/go/coordinator/internal/coordinator/apis.go/0
{ "file_path": "chroma/go/coordinator/internal/coordinator/apis.go", "repo_id": "chroma", "token_count": 2051 }
41
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/examples/legacy/seq2seq/train_distil_marian_enro_tpu.sh/0
{ "file_path": "transformers/examples/legacy/seq2seq/train_distil_marian_enro_tpu.sh", "repo_id": "transformers", "token_count": 559 }
559
import { PromptTemplate } from "../../prompts/prompt.js"; import { FakeChatModel } from "../../utils/testing/index.js"; import { RunnablePassthrough } from "../passthrough.js"; import { JsonOutputParser } from "../../output_parsers/json.js"; import { RunnableSequence } from "../base.js"; import { RunnableConfig } from ...
langchainjs/langchain-core/src/runnables/tests/runnable_passthrough.test.ts/0
{ "file_path": "langchainjs/langchain-core/src/runnables/tests/runnable_passthrough.test.ts", "repo_id": "langchainjs", "token_count": 1166 }
903
""" Layer/Module Helpers Hacked together by / Copyright 2020 Ross Wightman """ from itertools import repeat import collections.abc # From PyTorch internals def _ntuple(n): def parse(x): if isinstance(x, collections.abc.Iterable) and not isinstance(x, str): return tuple(x) return tuple...
pytorch-image-models/timm/layers/helpers.py/0
{ "file_path": "pytorch-image-models/timm/layers/helpers.py", "repo_id": "pytorch-image-models", "token_count": 462 }
393
use candle::quantized::QTensor; use candle::{Device, Result, Shape}; use std::sync::Arc; // VarBuilder specialized for QTensors pub struct VarBuilder { data: Arc<std::collections::HashMap<String, Arc<QTensor>>>, path: Vec<String>, device: Device, } impl VarBuilder { pub fn from_gguf<P: AsRef<std::path...
candle/candle-transformers/src/quantized_var_builder.rs/0
{ "file_path": "candle/candle-transformers/src/quantized_var_builder.rs", "repo_id": "candle", "token_count": 1550 }
79
<jupyter_start><jupyter_text>Hacker News>[Hacker News](https://en.wikipedia.org/wiki/Hacker_News) (sometimes abbreviated as `HN`) is a social news website focusing on computer science and entrepreneurship. It is run by the investment fund and startup incubator `Y Combinator`. In general, content that can be submitted i...
langchain/docs/docs/integrations/document_loaders/hacker_news.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/hacker_news.ipynb", "repo_id": "langchain", "token_count": 211 }
109
# Copyright 2023-present 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 law or...
peft/src/peft/tuners/adaption_prompt/utils.py/0
{ "file_path": "peft/src/peft/tuners/adaption_prompt/utils.py", "repo_id": "peft", "token_count": 2123 }
333
<jupyter_start><jupyter_text>PowerBI DatasetThis notebook showcases an agent interacting with a `Power BI Dataset`. The agent is answering more general questions about a dataset, as well as recover from errors.Note that, as this agent is in active development, all answers might not be correct. It runs against the [exec...
langchain/docs/docs/integrations/toolkits/powerbi.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/toolkits/powerbi.ipynb", "repo_id": "langchain", "token_count": 1112 }
176
# MIT License # # Copyright (c) 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and github/lonePatient # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restricti...
transformers/src/transformers/models/mobilebert/modeling_mobilebert.py/0
{ "file_path": "transformers/src/transformers/models/mobilebert/modeling_mobilebert.py", "repo_id": "transformers", "token_count": 29570 }
634
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/llms/llama-index-llms-portkey/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-portkey/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,370
# coding=utf-8 # Copyright 2021 The Facebook, Inc. and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/L...
transformers/src/transformers/models/blenderbot/configuration_blenderbot.py/0
{ "file_path": "transformers/src/transformers/models/blenderbot/configuration_blenderbot.py", "repo_id": "transformers", "token_count": 8374 }
625
# coding=utf-8 # 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 requir...
transformers/tests/quantization/aqlm_integration/test_aqlm.py/0
{ "file_path": "transformers/tests/quantization/aqlm_integration/test_aqlm.py", "repo_id": "transformers", "token_count": 2765 }
786
python_tests( interpreter_constraints=["==3.9.*", "==3.10.*"], )
llama_index/llama-index-integrations/response_synthesizers/llama-index-response-synthesizers-google/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/response_synthesizers/llama-index-response-synthesizers-google/tests/BUILD", "repo_id": "llama_index", "token_count": 29 }
1,445
/* eslint-disable @typescript-eslint/no-explicit-any */ import { jest, test, expect } from "@jest/globals"; import { type Collection } from "chromadb"; import { FakeEmbeddings } from "@langchain/core/utils/testing"; import { Chroma } from "../chroma.js"; const mockCollection = { count: jest.fn<Collection["count"]>(...
langchainjs/libs/langchain-community/src/vectorstores/tests/chroma.test.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/tests/chroma.test.ts", "repo_id": "langchainjs", "token_count": 1703 }
1,085
python_sources()
llama_index/llama-index-core/llama_index/core/retrievers/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/retrievers/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,205
# Textual inversion [[open-in-colab]] [`StableDiffusionPipeline`]์€ textual-inversion์„ ์ง€์›ํ•˜๋Š”๋ฐ, ์ด๋Š” ๋ช‡ ๊ฐœ์˜ ์ƒ˜ํ”Œ ์ด๋ฏธ์ง€๋งŒ์œผ๋กœ stable diffusion๊ณผ ๊ฐ™์€ ๋ชจ๋ธ์ด ์ƒˆ๋กœ์šด ์ปจ์…‰์„ ํ•™์Šตํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋Š” ๊ธฐ๋ฒ•์ž…๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์ƒ์„ฑ๋œ ์ด๋ฏธ์ง€๋ฅผ ๋” ์ž˜ ์ œ์–ดํ•˜๊ณ  ํŠน์ • ์ปจ์…‰์— ๋งž๊ฒŒ ๋ชจ๋ธ์„ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ปค๋ฎค๋‹ˆํ‹ฐ์—์„œ ๋งŒ๋“ค์–ด์ง„ ์ปจ์…‰๋“ค์˜ ์ปฌ๋ ‰์…˜์€ [Stable Diffusion Conceptualizer](https://huggingface.co/spaces/sd-concepts-libra...
diffusers/docs/source/ko/using-diffusers/textual_inversion_inference.md/0
{ "file_path": "diffusers/docs/source/ko/using-diffusers/textual_inversion_inference.md", "repo_id": "diffusers", "token_count": 2018 }
183
import asyncio import importlib.metadata import os import re import sys import tempfile import unittest from contextlib import contextmanager from copy import deepcopy from distutils.util import strtobool from enum import Enum from importlib.util import find_spec from pathlib import Path from unittest.mock import patch...
datasets/tests/utils.py/0
{ "file_path": "datasets/tests/utils.py", "repo_id": "datasets", "token_count": 6318 }
153
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-preprocess/llama_index/readers/preprocess/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-preprocess/llama_index/readers/preprocess/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,447
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-deeplake/llama_index/readers/deeplake/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-deeplake/llama_index/readers/deeplake/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,306
# CSP-ResNeXt **CSPResNeXt** is a convolutional neural network where we apply the Cross Stage Partial Network (CSPNet) approach to [ResNeXt](https://paperswithcode.com/method/resnext). The CSPNet partitions the feature map of the base layer into two parts and then merges them through a cross-stage hierarchy. The use o...
pytorch-image-models/docs/models/.templates/models/csp-resnext.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/csp-resnext.md", "repo_id": "pytorch-image-models", "token_count": 916 }
342
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { ChainValues } from "@langchain/core/utils/types"; import { CallbackManagerForChainRun } from "@langchain/core/callbacks/manager"; import { BasePromptTemplate } from "@langchain/core/prompts"; import { BaseChain, ChainInputs...
langchainjs/langchain/src/chains/api/api_chain.ts/0
{ "file_path": "langchainjs/langchain/src/chains/api/api_chain.ts", "repo_id": "langchainjs", "token_count": 1535 }
924
from llama_index.core.readers.base import BaseReader from llama_index.readers.mbox import MboxReader def test_class(): names_of_base_classes = [b.__name__ for b in MboxReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-mbox/tests/test_readers_mbox.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mbox/tests/test_readers_mbox.py", "repo_id": "llama_index", "token_count": 88 }
1,334
<jupyter_start><jupyter_text>ClientDemo of a client interacting with a remote retriever. You can interact with this via API directly<jupyter_code>import requests inputs = {"input": "tree"} response = requests.post("http://localhost:8000/invoke", json=inputs) response.json()<jupyter_output><empty_output><jupyter_text...
langserve/examples/retrieval/client.ipynb/0
{ "file_path": "langserve/examples/retrieval/client.ipynb", "repo_id": "langserve", "token_count": 349 }
1,026
// 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/datanode/importv2/hash.go/0
{ "file_path": "milvus/internal/datanode/importv2/hash.go", "repo_id": "milvus", "token_count": 2323 }
1,785
from langchain_community.tools.playwright.extract_hyperlinks import ( ExtractHyperlinksTool, ExtractHyperlinksToolInput, ) __all__ = ["ExtractHyperlinksToolInput", "ExtractHyperlinksTool"]
langchain/libs/langchain/langchain/tools/playwright/extract_hyperlinks.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/playwright/extract_hyperlinks.py", "repo_id": "langchain", "token_count": 61 }
586
import { GoogleAbstractedClient, GoogleBaseLLM, GoogleBaseLLMInput, } from "@langchain/google-common"; import { WebGoogleAuth, WebGoogleAuthOptions } from "./auth.js"; /** * Input to LLM class. */ export interface GoogleLLMInput extends GoogleBaseLLMInput<WebGoogleAuthOptions> {} /** * Integration with an ...
langchainjs/libs/langchain-google-webauth/src/llms.ts/0
{ "file_path": "langchainjs/libs/langchain-google-webauth/src/llms.ts", "repo_id": "langchainjs", "token_count": 252 }
994
// Copyright 2019 PingCAP, 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 agreed to i...
milvus/pkg/log/zap_text_core.go/0
{ "file_path": "milvus/pkg/log/zap_text_core.go", "repo_id": "milvus", "token_count": 909 }
1,894
import json from collections import deque from typing import Any, Dict import pytest import requests from pytest import MonkeyPatch from langchain_community.llms.llamafile import Llamafile def default_generation_params() -> Dict[str, Any]: return { "temperature": 0.8, "seed": -1, "top_k"...
langchain/libs/community/tests/unit_tests/llms/test_llamafile.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/llms/test_llamafile.py", "repo_id": "langchain", "token_count": 2013 }
419
<jupyter_start><jupyter_text>Retriever Router Query EngineIn this tutorial, we define a router query engine based on a retriever. The retriever will select a set of nodes, and we will in turn select the right QueryEngine.We use our new `ToolRetrieverRouterQueryEngine` class for this! Setup If you're opening this Note...
llama_index/docs/examples/query_engine/RetrieverRouterQueryEngine.ipynb/0
{ "file_path": "llama_index/docs/examples/query_engine/RetrieverRouterQueryEngine.ipynb", "repo_id": "llama_index", "token_count": 1777 }
1,157
# LlamaIndex Multi Modal Llms Integration: Dashscope
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-dashscope/README.md/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-dashscope/README.md", "repo_id": "llama_index", "token_count": 14 }
1,252
# Nougat OCR loader This loader reads the equations, symbols, and tables included in the PDF. Users can input the path of the academic PDF document `file` which they want to parse. This OCR understands LaTeX math and tables. ## Usage Here's an example usage of the PDFNougatOCR. ```python from llama_hub.nougat_ocr ...
llama_index/llama-index-integrations/readers/llama-index-readers-nougat-ocr/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-nougat-ocr/README.md", "repo_id": "llama_index", "token_count": 174 }
1,392
import logging import os from dataclasses import dataclass, field from functools import partial from pathlib import Path from tempfile import TemporaryDirectory from typing import List, Optional import faiss import torch from datasets import Features, Sequence, Value, load_dataset from transformers import DPRContextE...
transformers/examples/research_projects/rag-end2end-retriever/use_own_knowledge_dataset.py/0
{ "file_path": "transformers/examples/research_projects/rag-end2end-retriever/use_own_knowledge_dataset.py", "repo_id": "transformers", "token_count": 2578 }
613
package writebuffer import ( "math/rand" "testing" "time" "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/msgpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/...
milvus/internal/datanode/writebuffer/insert_buffer_test.go/0
{ "file_path": "milvus/internal/datanode/writebuffer/insert_buffer_test.go", "repo_id": "milvus", "token_count": 3171 }
1,847
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-semanticscholar/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-semanticscholar/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,428
import getpass import os from langchain.document_loaders import PyPDFLoader from langchain.text_splitter import CharacterTextSplitter from langchain.vectorstores.milvus import Milvus from langchain_nvidia_aiplay import NVIDIAEmbeddings if os.environ.get("NVIDIA_API_KEY", "").startswith("nvapi-"): print("Valid NVI...
langchain/templates/nvidia-rag-canonical/ingest.py/0
{ "file_path": "langchain/templates/nvidia-rag-canonical/ingest.py", "repo_id": "langchain", "token_count": 527 }
646
# Writing a custom kernel
candle/candle-book/src/cuda/writing.md/0
{ "file_path": "candle/candle-book/src/cuda/writing.md", "repo_id": "candle", "token_count": 6 }
22
.. _Ref-Playground: Playground ================= .. automodule:: llama_index.core.playground.base :members: :inherited-members:
llama_index/docs/api_reference/playground.rst/0
{ "file_path": "llama_index/docs/api_reference/playground.rst", "repo_id": "llama_index", "token_count": 49 }
1,092
--- sidebar_class_name: node-only --- import CodeBlock from "@theme/CodeBlock"; # Astra DB :::tip Compatibility Only available on Node.js. ::: DataStax [Astra DB](https://astra.datastax.com/register) is a serverless vector-capable database built on [Apache Cassandra](https://cassandra.apache.org/_/index.html) and m...
langchainjs/docs/core_docs/docs/integrations/vectorstores/astradb.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/astradb.mdx", "repo_id": "langchainjs", "token_count": 582 }
747