text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
from langchain_community.document_loaders.parsers.registry import ( get_parser, ) __all__ = ["get_parser"]
langchain/libs/langchain/langchain/document_loaders/parsers/registry.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/parsers/registry.py", "repo_id": "langchain", "token_count": 41 }
535
use crate::console_log; use crate::worker::{ModelData, Worker, WorkerInput, WorkerOutput}; use std::str::FromStr; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::JsFuture; use yew::{html, Component, Context, Html}; use yew_agent::{Bridge, Bridged}; async fn fetch_url(url: &str) -> Result<Vec<u8>, JsValue> { ...
candle/candle-wasm-examples/llama2-c/src/app.rs/0
{ "file_path": "candle/candle-wasm-examples/llama2-c/src/app.rs", "repo_id": "candle", "token_count": 5458 }
77
from typing import Any, Dict, List from unittest.mock import patch import pytest from llama_index.legacy.readers.mongo import SimpleMongoReader from llama_index.legacy.schema import MetadataMode try: from pymongo import MongoClient except ImportError: MongoClient = None # type: ignore @pytest.mark.skipif(M...
llama_index/llama-index-legacy/tests/readers/test_mongo.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/readers/test_mongo.py", "repo_id": "llama_index", "token_count": 1739 }
1,634
from langchain_community.tools.nuclia.tool import NucliaUnderstandingAPI __all__ = ["NucliaUnderstandingAPI"]
langchain/libs/community/langchain_community/tools/nuclia/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/nuclia/__init__.py", "repo_id": "langchain", "token_count": 33 }
305
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all # coding=utf-8 # Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not u...
peft/src/peft/utils/__init__.py/0
{ "file_path": "peft/src/peft/utils/__init__.py", "repo_id": "peft", "token_count": 703 }
352
import json import random import string import threading import traceback import time import copy import numpy as np import requests from sklearn import preprocessing from pymilvus import Milvus, DataType from utils.util_log import test_log as log from utils.util_k8s import init_k8s_client_config port = 19530 epsilon ...
milvus/tests/python_client/utils/util_pymilvus.py/0
{ "file_path": "milvus/tests/python_client/utils/util_pymilvus.py", "repo_id": "milvus", "token_count": 14698 }
2,188
from typing import List import pytest from llama_index.core.schema import Document @pytest.fixture() def documents() -> List[Document]: """Get documents.""" # NOTE: one document for now # NOTE: in this unit test, document text == triplets doc_text = "(foo, is, bar)\n" "(hello, is not, world)\n" "(Jan...
llama_index/llama-index-core/tests/indices/knowledge_graph/conftest.py/0
{ "file_path": "llama_index/llama-index-core/tests/indices/knowledge_graph/conftest.py", "repo_id": "llama_index", "token_count": 349 }
1,157
""" TResNet: High Performance GPU-Dedicated Architecture https://arxiv.org/pdf/2003.13630.pdf Original model: https://github.com/mrT23/TResNet """ from collections import OrderedDict from functools import partial import torch import torch.nn as nn from timm.layers import SpaceToDepth, BlurPool2d, ClassifierHead, SE...
pytorch-image-models/timm/models/tresnet.py/0
{ "file_path": "pytorch-image-models/timm/models/tresnet.py", "repo_id": "pytorch-image-models", "token_count": 6338 }
383
from rag_pinecone.chain import chain __all__ = ["chain"]
langchain/templates/rag-pinecone/rag_pinecone/__init__.py/0
{ "file_path": "langchain/templates/rag-pinecone/rag_pinecone/__init__.py", "repo_id": "langchain", "token_count": 19 }
743
# candle-mistral: 7b LLM with Apache 2.0 licensed weights Mistral-7B-v0.1 is a pretrained generative LLM with 7 billion parameters. It outperforms all the publicly available 13b models as of 2023-09-28. Weights (and the original Python model code) are released under the permissive Apache 2.0 license. - [Blog post](ht...
candle/candle-examples/examples/mistral/README.md/0
{ "file_path": "candle/candle-examples/examples/mistral/README.md", "repo_id": "candle", "token_count": 829 }
39
import { ChromaClient } from "../src/ChromaClient"; const PORT = process.env.PORT || "8000"; const URL = "http://localhost:" + PORT; const chroma = new ChromaClient({ path: URL }); export default chroma;
chroma/clients/js/test/initClient.ts/0
{ "file_path": "chroma/clients/js/test/initClient.ts", "repo_id": "chroma", "token_count": 66 }
34
from llama_index.readers.steamship.base import SteamshipFileReader __all__ = ["SteamshipFileReader"]
llama_index/llama-index-integrations/readers/llama-index-readers-steamship/llama_index/readers/steamship/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-steamship/llama_index/readers/steamship/__init__.py", "repo_id": "llama_index", "token_count": 34 }
1,446
from datetime import datetime from typing import ( Any, AsyncIterator, Dict, Iterable, Iterator, List, Optional, Sequence, Type, ) from unittest.mock import patch import pytest import pytest_asyncio from langchain_community.document_loaders.base import BaseLoader from langchain_core...
langchain/libs/langchain/tests/unit_tests/indexes/test_indexing.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/indexes/test_indexing.py", "repo_id": "langchain", "token_count": 15710 }
641
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-remote-depth/llama_index/readers/remote_depth/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-remote-depth/llama_index/readers/remote_depth/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,434
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/clip/test_modeling_tf_clip.py/0
{ "file_path": "transformers/tests/models/clip/test_modeling_tf_clip.py", "repo_id": "transformers", "token_count": 12017 }
789
from dataclasses import dataclass, field from typing import ClassVar, Dict from ..features import Features, Sequence, Value from .base import TaskTemplate @dataclass(frozen=True) class QuestionAnsweringExtractive(TaskTemplate): # `task` is not a ClassVar since we want it to be part of the `asdict` output for JSO...
datasets/src/datasets/tasks/question_answering.py/0
{ "file_path": "datasets/src/datasets/tasks/question_answering.py", "repo_id": "datasets", "token_count": 437 }
148
python_sources()
llama_index/llama-index-integrations/question_gen/llama-index-question-gen-openai/llama_index/question_gen/openai/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/question_gen/llama-index-question-gen-openai/llama_index/question_gen/openai/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,395
from llama_index.legacy.indices.vector_store.retrievers.auto_retriever.auto_retriever import ( VectorIndexAutoRetriever, ) __all__ = [ "VectorIndexAutoRetriever", ]
llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/auto_retriever/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/auto_retriever/__init__.py", "repo_id": "llama_index", "token_count": 68 }
1,501
import { ChatOpenAI } from "@langchain/openai"; import { ChatPromptTemplate, MessagesPlaceholder, } from "@langchain/core/prompts"; import { RunnableConfig, RunnableWithMessageHistory, } from "@langchain/core/runnables"; import { ChatMessageHistory } from "@langchain/community/stores/message/in_memory"; // Con...
langchainjs/examples/src/guides/expression_language/runnable_history_constructor_config.ts/0
{ "file_path": "langchainjs/examples/src/guides/expression_language/runnable_history_constructor_config.ts", "repo_id": "langchainjs", "token_count": 474 }
780
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,413
import { OpenAI } from "@langchain/openai"; export const run = async () => { const model = new OpenAI(); // `call` is a simple string-in, string-out method for interacting with the model. const resA = await model.call( "What would be a good company name a company that makes colorful socks?" ); console.lo...
langchainjs/examples/src/models/llm/llm_quick_start.ts/0
{ "file_path": "langchainjs/examples/src/models/llm/llm_quick_start.ts", "repo_id": "langchainjs", "token_count": 119 }
854
<!--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 to...
transformers/docs/source/it/converting_tensorflow_models.md/0
{ "file_path": "transformers/docs/source/it/converting_tensorflow_models.md", "repo_id": "transformers", "token_count": 2412 }
538
import time from datetime import datetime import functools from utils.util_log import test_log as log DEFAULT_FMT = '[{start_time}] [{elapsed:0.8f}s] {collection_name} {func_name} -> {res!r}' def trace(fmt=DEFAULT_FMT, prefix='test', flag=True): def decorate(func): @functools.wraps(func) def inne...
milvus/tests/python_client/utils/wrapper.py/0
{ "file_path": "milvus/tests/python_client/utils/wrapper.py", "repo_id": "milvus", "token_count": 1127 }
2,130
package iterator import ( "sync" "go.uber.org/atomic" "go.uber.org/zap" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/log" ) var _ Iterator = (*DeltalogIterator)(nil) type DeltalogIterator struct { disposeCh chan struct{} disposedOnce sync.Once disposed atomic.Bool ...
milvus/internal/datanode/iterators/deltalog_iterator.go/0
{ "file_path": "milvus/internal/datanode/iterators/deltalog_iterator.go", "repo_id": "milvus", "token_count": 745 }
1,840
{ "name": "tokenizers", "version": "0.14.0-dev0", "repository": { "type": "git", "url": "git+https://github.com/huggingface/tokenizers.git" }, "bugs": { "url": "https://github.com/huggingface/tokenizers/issues" }, "homepage": "https://github.com/huggingface/tokenizers/tree/master/bindings/node...
tokenizers/bindings/node/package.json/0
{ "file_path": "tokenizers/bindings/node/package.json", "repo_id": "tokenizers", "token_count": 1532 }
416
from llama_index.core.llms.base import BaseLLM from llama_index.llms.anthropic import Anthropic def test_text_inference_embedding_class(): names_of_base_classes = [b.__name__ for b in Anthropic.__mro__] assert BaseLLM.__name__ in names_of_base_classes
llama_index/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py", "repo_id": "llama_index", "token_count": 96 }
1,214
# Command line interface (experimental) This module providers a way to interactive with llama_index directly in shell. ## Get started Because "experimental" is not included in the package yet (I think it's why it called "experimental"). For now, you need to git clone this repo and run these command in it. Or you can...
llama_index/experimental/cli/README.md/0
{ "file_path": "llama_index/experimental/cli/README.md", "repo_id": "llama_index", "token_count": 684 }
1,106
<p align="center"> <br> <img src="https://huggingface.co/landing/assets/tokenizers/tokenizers-logo.png" width="600"/> <br> <p> <p align="center"> <img alt="Build" src="https://github.com/huggingface/tokenizers/workflows/Rust/badge.svg"> <a href="https://github.com/huggingface/tokenizers/blob/master/...
tokenizers/tokenizers/README.tpl/0
{ "file_path": "tokenizers/tokenizers/README.tpl", "repo_id": "tokenizers", "token_count": 259 }
426
# Generated content DO NOT EDIT class PreTokenizer: """ Base class for all pre-tokenizers This class is not supposed to be instantiated directly. Instead, any implementation of a PreTokenizer will return an instance of this class when instantiated. """ def pre_tokenize(self, pretok): "...
tokenizers/bindings/python/py_src/tokenizers/pre_tokenizers/__init__.pyi/0
{ "file_path": "tokenizers/bindings/python/py_src/tokenizers/pre_tokenizers/__init__.pyi", "repo_id": "tokenizers", "token_count": 9461 }
404
"""Wikidata API toolkit."""
langchain/libs/community/langchain_community/tools/wikidata/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/wikidata/__init__.py", "repo_id": "langchain", "token_count": 10 }
296
# 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/src/transformers/commands/add_new_model.py/0
{ "file_path": "transformers/src/transformers/commands/add_new_model.py", "repo_id": "transformers", "token_count": 5123 }
590
import { Portkey } from "@langchain/community/llms/portkey"; export const run = async () => { const model = new Portkey({ mode: "single", llms: [ { provider: "openai", virtual_key: "open-ai-key-1234", model: "text-davinci-003", max_tokens: 2000, }, ], }); c...
langchainjs/examples/src/llms/portkey.ts/0
{ "file_path": "langchainjs/examples/src/llms/portkey.ts", "repo_id": "langchainjs", "token_count": 207 }
795
from llama_index.vector_stores.weaviate.base import WeaviateVectorStore __all__ = ["WeaviateVectorStore"]
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-weaviate/llama_index/vector_stores/weaviate/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-weaviate/llama_index/vector_stores/weaviate/__init__.py", "repo_id": "llama_index", "token_count": 35 }
1,574
# coding=utf-8 # Copyright 2019-present CNRS, Facebook Inc. and the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
transformers/src/transformers/models/flaubert/tokenization_flaubert.py/0
{ "file_path": "transformers/src/transformers/models/flaubert/tokenization_flaubert.py", "repo_id": "transformers", "token_count": 10882 }
603
import gc import random import unittest import numpy as np import torch from transformers import ( CLIPImageProcessor, CLIPTextConfig, CLIPTextModel, CLIPTokenizer, CLIPVisionConfig, CLIPVisionModelWithProjection, ) from diffusers import AutoencoderKL, DDIMScheduler, DDPMScheduler, StableUnCLI...
diffusers/tests/pipelines/stable_unclip/test_stable_unclip_img2img.py/0
{ "file_path": "diffusers/tests/pipelines/stable_unclip/test_stable_unclip_img2img.py", "repo_id": "diffusers", "token_count": 5046 }
271
# 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/roc_bert/test_tokenization_roc_bert.py/0
{ "file_path": "transformers/tests/models/roc_bert/test_tokenization_roc_bert.py", "repo_id": "transformers", "token_count": 7464 }
768
# flake8: noqa """Test llamacpp embeddings.""" import os from urllib.request import urlretrieve from langchain_community.embeddings.llamacpp import LlamaCppEmbeddings def get_model() -> str: """Download model. From https://huggingface.co/Sosaka/Alpaca-native-4bit-ggml/, convert to new ggml format and ret...
langchain/libs/community/tests/integration_tests/embeddings/test_llamacpp.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_llamacpp.py", "repo_id": "langchain", "token_count": 695 }
331
# Copyright 2021 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/tests/models/speech_to_text_2/test_tokenization_speech_to_text_2.py/0
{ "file_path": "transformers/tests/models/speech_to_text_2/test_tokenization_speech_to_text_2.py", "repo_id": "transformers", "token_count": 1531 }
751
# PubMed # PubMed >[PubMed®](https://pubmed.ncbi.nlm.nih.gov/) by `The National Center for Biotechnology Information, National Library of Medicine` > comprises more than 35 million citations for biomedical literature from `MEDLINE`, life science journals, and online books. > Citations may include links to full text...
langchain/docs/docs/integrations/providers/pubmed.md/0
{ "file_path": "langchain/docs/docs/integrations/providers/pubmed.md", "repo_id": "langchain", "token_count": 220 }
154
import { ListKeyOptions, RecordManager, UpdateOptions } from "./base.js"; interface MemoryRecord { updatedAt: number; groupId: string | null; } export class InMemoryRecordManager extends RecordManager { lc_namespace = ["langchain", "recordmanagers", "memory"]; records: Map<string, MemoryRecord>; construct...
langchainjs/libs/langchain-community/src/indexes/memory.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/indexes/memory.ts", "repo_id": "langchainjs", "token_count": 923 }
1,024
--- sidebar_label: Exploratory Data Analysis sidebar_position: 7 --- # Exploratory Data Analysis Turn your trace data into actionable insights: - [Exporting LLM Runs and Feedback](./exporting-llm-runs-and-feedback/llm_run_etl.ipynb): extract and interpret LangSmith LLM run data, making them ready for various analyt...
langsmith-cookbook/exploratory-data-analysis/README.md/0
{ "file_path": "langsmith-cookbook/exploratory-data-analysis/README.md", "repo_id": "langsmith-cookbook", "token_count": 164 }
1,017
# 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/auto.py/0
{ "file_path": "peft/src/peft/auto.py", "repo_id": "peft", "token_count": 2647 }
315
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/unittest/test_retrieve.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_retrieve.cpp", "repo_id": "milvus", "token_count": 9275 }
1,679
--- sidebar_position: 3 sidebar_class_name: hidden --- # [Beta] Memory Most LLM applications have a conversational interface. An essential component of a conversation is being able to refer to information introduced earlier in the conversation. At bare minimum, a conversational system should be able to access some win...
langchain/docs/docs/modules/memory/index.mdx/0
{ "file_path": "langchain/docs/docs/modules/memory/index.mdx", "repo_id": "langchain", "token_count": 2547 }
202
from langchain_openai.chat_models.azure import AzureChatOpenAI from langchain_openai.chat_models.base import ChatOpenAI __all__ = [ "ChatOpenAI", "AzureChatOpenAI", ]
langchain/libs/partners/openai/langchain_openai/chat_models/__init__.py/0
{ "file_path": "langchain/libs/partners/openai/langchain_openai/chat_models/__init__.py", "repo_id": "langchain", "token_count": 65 }
651
<!--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/ko/optimization/coreml.md/0
{ "file_path": "diffusers/docs/source/ko/optimization/coreml.md", "repo_id": "diffusers", "token_count": 8285 }
195
import os import shutil import tempfile import pytest from typing import Generator, List, Callable, Dict, Union from chromadb.db.impl.grpc.client import GrpcSysDB from chromadb.db.impl.grpc.server import GrpcMockSysDB from chromadb.types import Collection, Segment, SegmentScope from chromadb.db.impl.sqlite import Sqli...
chroma/chromadb/test/db/test_system.py/0
{ "file_path": "chroma/chromadb/test/db/test_system.py", "repo_id": "chroma", "token_count": 10366 }
21
.. _Ref-API_Reference: API Reference ============= API Reference for the ``llama-index`` package. .. toctree:: :maxdepth: 1 agents.rst callbacks.rst composability.rst evaluation.rst example_notebooks.rst indices.rst llms.rst embeddings.rst memory.rst node_postprocessor.rst node.r...
llama_index/docs/api_reference/index.rst/0
{ "file_path": "llama_index/docs/api_reference/index.rst", "repo_id": "llama_index", "token_count": 193 }
1,056
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-graphql/llama_index/readers/graphql/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-graphql/llama_index/readers/graphql/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,361
# SageMaker push to hf.co/models example
notebooks/sagemaker/14_train_and_push_to_hub/README.md/0
{ "file_path": "notebooks/sagemaker/14_train_and_push_to_hub/README.md", "repo_id": "notebooks", "token_count": 12 }
328
src/
langsmith-sdk/js/.npmignore/0
{ "file_path": "langsmith-sdk/js/.npmignore", "repo_id": "langsmith-sdk", "token_count": 2 }
1,044
package grpcclient import ( "context" "github.com/milvus-io/milvus/pkg/util" ) type Token struct { Value string } func (t *Token) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { return map[string]string{util.HeaderSourceID: t.Value}, nil } func (t *Token) RequireTransportSec...
milvus/internal/util/grpcclient/auth.go/0
{ "file_path": "milvus/internal/util/grpcclient/auth.go", "repo_id": "milvus", "token_count": 128 }
2,072
# coding=utf-8 # Copyright 2021 The Fairseq Authors and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
transformers/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py/0
{ "file_path": "transformers/src/transformers/models/speech_to_text/modeling_tf_speech_to_text.py", "repo_id": "transformers", "token_count": 32975 }
731
# 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/tests/models/blip/test_modeling_blip_text.py/0
{ "file_path": "transformers/tests/models/blip/test_modeling_blip_text.py", "repo_id": "transformers", "token_count": 2774 }
734
# plate-chain This template enables parsing of data from laboratory plates. In the context of biochemistry or molecular biology, laboratory plates are commonly used tools to hold samples in a grid-like format. This can parse the resulting data into standardized (e.g., JSON) format for further processing. ## Envi...
langchain/templates/plate-chain/README.md/0
{ "file_path": "langchain/templates/plate-chain/README.md", "repo_id": "langchain", "token_count": 555 }
647
{ "ignore_dirs": [ "langchain/dist", "langchain/dist-cjs", "docs/build", "node_modules", "langchain/.turbo", "docs/.turbo", "test-exports/.turbo", "test-exports-cjs/.turbo" ] }
langchainjs/.watchmanconfig/0
{ "file_path": "langchainjs/.watchmanconfig", "repo_id": "langchainjs", "token_count": 107 }
718
export function getMessageContent(x: unknown) { if (typeof x === "string") return x; if (typeof x === "object" && x != null) { if ("content" in x && typeof x.content === "string") return x.content; } return null; }
langserve/langserve/playground/src/utils/messages.ts/0
{ "file_path": "langserve/langserve/playground/src/utils/messages.ts", "repo_id": "langserve", "token_count": 78 }
1,052
package funcutil import ( "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" ) func Test_GetPrivilegeExtObj(t *testing.T) { request := &milvuspb.LoadCollectionRequest{ DbName: "test", Collectio...
milvus/pkg/util/funcutil/policy_test.go/0
{ "file_path": "milvus/pkg/util/funcutil/policy_test.go", "repo_id": "milvus", "token_count": 840 }
1,910
from langchain_community.llms.anyscale import ( Anyscale, ) __all__ = ["Anyscale"]
langchain/libs/langchain/langchain/llms/anyscale.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/anyscale.py", "repo_id": "langchain", "token_count": 36 }
534
""" ONNX export script Export PyTorch models as ONNX graphs. This export script originally started as an adaptation of code snippets found at https://pytorch.org/tutorials/advanced/super_resolution_with_onnxruntime.html The default parameters work with PyTorch 1.6 and ONNX 1.7 and produce an optimal ONNX graph for h...
pytorch-image-models/onnx_export.py/0
{ "file_path": "pytorch-image-models/onnx_export.py", "repo_id": "pytorch-image-models", "token_count": 1740 }
359
# Model arguments model_name_or_path: mistralai/Mistral-7B-v0.1 model_revision: main torch_dtype: bfloat16 use_flash_attention_2: true # Data training arguments chat_template: "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'...
alignment-handbook/recipes/constitutional-ai/sft/config_anthropic.yaml/0
{ "file_path": "alignment-handbook/recipes/constitutional-ai/sft/config_anthropic.yaml", "repo_id": "alignment-handbook", "token_count": 610 }
24
"""Faithfulness evaluation.""" from __future__ import annotations import asyncio from typing import Any, Optional, Sequence, Union from llama_index.core import ServiceContext from llama_index.core.evaluation.base import BaseEvaluator, EvaluationResult from llama_index.core.indices import SummaryIndex from llama_index...
llama_index/llama-index-core/llama_index/core/evaluation/faithfulness.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/evaluation/faithfulness.py", "repo_id": "llama_index", "token_count": 2365 }
1,209
[Unit] Description=MinIO of Milvus Standalone Server After=network.target syslog.target PartOf=milvus.service [Install] WantedBy=multi-user.target Alias=milvus-minio.service [Service] Type=simple StandardOutput=journal StandardError=inherit Restart=always # Start main service ExecStart=/usr/bin/milvus-minio server /...
milvus/build/deb/scripts/milvus-minio.service/0
{ "file_path": "milvus/build/deb/scripts/milvus-minio.service", "repo_id": "milvus", "token_count": 121 }
1,703
# LlamaIndex Vector_Stores Integration: Azurecosmosmongo
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-azurecosmosmongo/README.md/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-azurecosmosmongo/README.md", "repo_id": "llama_index", "token_count": 16 }
1,546
<jupyter_start><jupyter_text>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 operat...
langchain/docs/docs/integrations/document_loaders/modern_treasury.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/modern_treasury.ipynb", "repo_id": "langchain", "token_count": 715 }
115
# 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/tests/models/swin2sr/test_modeling_swin2sr.py/0
{ "file_path": "transformers/tests/models/swin2sr/test_modeling_swin2sr.py", "repo_id": "transformers", "token_count": 5792 }
816
from langchain_community.tools.office365.send_event import ( O365SendEvent, SendEventSchema, ) __all__ = ["SendEventSchema", "O365SendEvent"]
langchain/libs/langchain/langchain/tools/office365/send_event.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/office365/send_event.py", "repo_id": "langchain", "token_count": 55 }
553
import json import urllib.request import warnings from abc import abstractmethod from enum import Enum from typing import Any, Dict, List, Mapping, Optional from langchain_core.callbacks.manager import CallbackManagerForLLMRun from langchain_core.language_models.llms import BaseLLM from langchain_core.outputs import G...
langchain/libs/community/langchain_community/llms/azureml_endpoint.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/azureml_endpoint.py", "repo_id": "langchain", "token_count": 8506 }
264
# coding=utf-8 # Copyright 2023 Adept 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.0...
transformers/src/transformers/models/persimmon/configuration_persimmon.py/0
{ "file_path": "transformers/src/transformers/models/persimmon/configuration_persimmon.py", "repo_id": "transformers", "token_count": 3071 }
654
locust_random_performance: collections: - milvus: cache_config.insert_buffer_size: 2GB engine_config.use_blas_threshold: 1100 engine_config.gpu_search_threshold: 1 gpu_resource_config.enable: true gpu_resource_config.cache_capacity: 4GB gpu_resource_config.sea...
milvus/tests/benchmark/milvus_benchmark/suites/2_locust_random_load_release.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/2_locust_random_load_release.yaml", "repo_id": "milvus", "token_count": 438 }
2,092
"""Load question answering with sources chains.""" from __future__ import annotations from typing import Any, Mapping, Optional, Protocol from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts import BasePromptTemplate from langchain.chains.combine_documents.base import BaseCombineD...
langchain/libs/langchain/langchain/chains/qa_with_sources/loading.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/qa_with_sources/loading.py", "repo_id": "langchain", "token_count": 2736 }
496
from llama_index.legacy.core.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsyncGen, ChatResponseGen, CompletionResponse, CompletionResponseAsyncGen, CompletionResponseGen, LLMMetadata, MessageRole, ) from llama_index.legacy.llms.ai21 import AI21 from llama_index.legacy....
llama_index/llama-index-legacy/llama_index/legacy/llms/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/__init__.py", "repo_id": "llama_index", "token_count": 1606 }
1,585
apiVersion: chaos-mesh.org/v1alpha1 kind: NetworkChaos metadata: name: test-querycoord-network-partition namespace: chaos-testing spec: action: partition mode: all selector: namespaces: - chaos-testing labelSelectors: app.kubernetes.io/instance: chaos-testing app.kubernetes.io/name: ...
milvus/tests/python_client/chaos/chaos_objects/network_partition/chaos_querycoord_network_partition.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/network_partition/chaos_querycoord_network_partition.yaml", "repo_id": "milvus", "token_count": 240 }
2,167
from typing import Any, Optional, Sequence from langchain_core.documents import BaseDocumentTransformer, Document from langchain_core.utils import get_from_env class DoctranQATransformer(BaseDocumentTransformer): """Extract QA from text documents using doctran. Arguments: openai_api_key: OpenAI API ...
langchain/libs/community/langchain_community/document_transformers/doctran_text_qa.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_transformers/doctran_text_qa.py", "repo_id": "langchain", "token_count": 939 }
272
"""Helper functions for managing the LangChain API. This module is only relevant for LangChain developers, not for users. .. warning:: This module and its submodules are for internal use only. Do not use them in your own code. We may change the API at any time with no warning. """ from .deprecation impor...
langchain/libs/langchain/langchain/_api/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/_api/__init__.py", "repo_id": "langchain", "token_count": 220 }
457
[ { "server": "eros", "suite_params": [ { "suite": "gpu_search_stability.yaml", "image_type": "gpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/stability.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/stability.json", "repo_id": "milvus", "token_count": 133 }
2,084
# coding=utf-8 # Copyright 2022 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/models/donut/test_image_processing_donut.py/0
{ "file_path": "transformers/tests/models/donut/test_image_processing_donut.py", "repo_id": "transformers", "token_count": 3741 }
743
[ { "server": "idc-sh005", "suite_params": [ { "suite": "2_insert_search_sift10m_4096.yaml", "image_type": "cpu" } ] } ]
milvus/tests/benchmark/milvus_benchmark/scheduler/search_debug.json/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/scheduler/search_debug.json", "repo_id": "milvus", "token_count": 125 }
1,932
import { useCallback, useRef, useState } from "react"; import { applyPatch, Operation } from "fast-json-patch"; import { fetchEventSource } from "@microsoft/fetch-event-source"; import { resolveApiUrl } from "./utils/url"; import { StreamCallback } from "./types"; export interface LogEntry { // ID of the sub-run. ...
langserve/langserve/playground/src/useStreamLog.tsx/0
{ "file_path": "langserve/langserve/playground/src/useStreamLog.tsx", "repo_id": "langserve", "token_count": 1072 }
1,131
<jupyter_start><jupyter_text>HugeGraph QA ChainThis notebook shows how to use LLMs to provide a natural language interface to [HugeGraph](https://hugegraph.apache.org/cn/) database. You will need to have a running HugeGraph instance.You can run a local docker container by running the executing the following script:```d...
langchain/docs/docs/use_cases/graph/graph_hugegraph_qa.ipynb/0
{ "file_path": "langchain/docs/docs/use_cases/graph/graph_hugegraph_qa.ipynb", "repo_id": "langchain", "token_count": 1269 }
200
# How to contribute ## How to get started Before you start contributing make sure you installed all the dev tools: ```bash pip install -e ".[dev]" ``` ## Did you find a bug? * Ensure the bug was not already reported by searching on GitHub under Issues. * If you're unable to find an open issue addressing the proble...
trl/CONTRIBUTING.md/0
{ "file_path": "trl/CONTRIBUTING.md", "repo_id": "trl", "token_count": 586 }
850
from llama_index.core.llms.base import BaseLLM from llama_index.llms.bedrock import Bedrock def test_embedding_class(): names_of_base_classes = [b.__name__ for b in Bedrock.__mro__] assert BaseLLM.__name__ in names_of_base_classes
llama_index/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py", "repo_id": "llama_index", "token_count": 91 }
1,347
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/src/segcore/SegmentInterface.h/0
{ "file_path": "milvus/internal/core/src/segcore/SegmentInterface.h", "repo_id": "milvus", "token_count": 3925 }
1,936
# Hugging Face Diffusion Models Course [![License](https://img.shields.io/static/v1?label=License&message=Apache&color=<Yellow>)](https://github.com/huggingface/diffusion-models-class/blob/main/LICENSE) &nbsp; [![GitHub forks](https://img.shields.io/github/forks/huggingface/diffusion-models-class.svg?style=social&labe...
diffusion-models-class/README.md/0
{ "file_path": "diffusion-models-class/README.md", "repo_id": "diffusion-models-class", "token_count": 1535 }
264
import { OpenAI } from "@langchain/openai"; const model = new OpenAI({ maxTokens: 25, }); const stream = await model.stream("Tell me a joke."); for await (const chunk of stream) { console.log(chunk); } /* Q : What did the fish say when it hit the wall ? A : Dam ! */
langchainjs/examples/src/models/llm/llm_streaming_stream_method.ts/0
{ "file_path": "langchainjs/examples/src/models/llm/llm_streaming_stream_method.ts", "repo_id": "langchainjs", "token_count": 111 }
839
# PromptLayer OpenAI LangChain integrates with PromptLayer for logging and debugging prompts and responses. To add support for PromptLayer: 1. Create a PromptLayer account here: [https://promptlayer.com](https://promptlayer.com). 2. Create an API token and pass it either as `promptLayerApiKey` argument in the `Prompt...
langchainjs/docs/core_docs/docs/integrations/llms/prompt_layer_openai.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/llms/prompt_layer_openai.mdx", "repo_id": "langchainjs", "token_count": 821 }
764
/* Our DOM objects */ /* Version control */ .selectors { margin-bottom: 10px; } .dropdown-button { display: inline-block; width: 50%; background-color: #6670FF; color: white; border: none; padding: 5px; font-size: 15px; cursor: pointer; } .dropdown-button:hover, .dropdown-button:...
tokenizers/docs/source/_static/css/huggingface.css/0
{ "file_path": "tokenizers/docs/source/_static/css/huggingface.css", "repo_id": "tokenizers", "token_count": 2708 }
468
ann_accuracy: collections: - milvus: cache_config.cpu_cache_capacity: 16GB engine_config.use_blas_threshold: 1100 server: cpus: 12 source_file: /test/milvus/ann_hdf5/sift-128-euclidean.hdf5 collection_name: sift_128_euclidean index_types: ['flat'] index_...
milvus/tests/benchmark/milvus_benchmark/suites/2_cpu_ann_accuracy.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/2_cpu_ann_accuracy.yaml", "repo_id": "milvus", "token_count": 2804 }
2,090
import { ChatOpenAI, OpenAIEmbeddings } from "@langchain/openai"; import { HNSWLib } from "@langchain/community/vectorstores/hnswlib"; import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; import * as fs from "fs"; import { formatDocumentsAsString } from "langchain/util/document"; import { PromptTem...
langchainjs/examples/src/chains/conversational_qa_streaming.ts/0
{ "file_path": "langchainjs/examples/src/chains/conversational_qa_streaming.ts", "repo_id": "langchainjs", "token_count": 1010 }
775
<jupyter_start><jupyter_text>Astra DB > DataStax [Astra DB](https://docs.datastax.com/en/astra/home/astra.html) is a serverless vector-capable database built on Cassandra and made conveniently available through an easy-to-use JSON API.This notebook goes over how to use Astra DB to store chat message history. Setting u...
langchain/docs/docs/integrations/memory/astradb_chat_message_history.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/memory/astradb_chat_message_history.ipynb", "repo_id": "langchain", "token_count": 559 }
132
[tool.poetry] name = "shopping-assistant" version = "0.0.1" description = "A template for a shopping assistant agent" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.12,<4.0" langchain = "^0.1" openai = "<2" ionic-langchain = "^0.2.2" langchain-openai = "^0.0.5" langchainhub = "^0.1" [too...
langchain/templates/shopping-assistant/pyproject.toml/0
{ "file_path": "langchain/templates/shopping-assistant/pyproject.toml", "repo_id": "langchain", "token_count": 281 }
699
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-pathway/llama_index/readers/pathway/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-pathway/llama_index/readers/pathway/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,414
import { OpenAI } from "@langchain/openai"; import { Calculator } from "langchain/tools/calculator"; import { initializeAgentExecutorWithOptions } from "langchain/agents"; import { loadEvaluator } from "langchain/evaluation"; import { SerpAPI } from "@langchain/community/tools/serpapi"; // Capturing Trajectory // The ...
langchainjs/examples/src/guides/evaluation/agent_trajectory/trajectory.ts/0
{ "file_path": "langchainjs/examples/src/guides/evaluation/agent_trajectory/trajectory.ts", "repo_id": "langchainjs", "token_count": 1400 }
802
package proxy import ( "context" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/pkg/util/paramtable" ) func TestCreateDatabaseTask(t *t...
milvus/internal/proxy/task_database_test.go/0
{ "file_path": "milvus/internal/proxy/task_database_test.go", "repo_id": "milvus", "token_count": 1631 }
1,750
# LlamaIndex Embeddings Integration: Fastembed
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-fastembed/README.md/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-fastembed/README.md", "repo_id": "llama_index", "token_count": 12 }
1,256
# Evaluator Benchmarker Pack A pack for quick computation of benchmark results of your own LLM evaluator on an Evaluation llama-dataset. Specifically, this pack supports benchmarking an appropriate evaluator on the following llama-datasets: - `LabelledEvaluatorDataset` for single-grading evaluations - `LabelledPairwi...
llama_index/llama-index-packs/llama-index-packs-evaluator-benchmarker/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-evaluator-benchmarker/README.md", "repo_id": "llama_index", "token_count": 962 }
1,842
[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 = ["GeminiEmbedding", "GooglePaLMEmbedding", "GoogleUnivSentEncoderEmbedding"] contains_examp...
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-google/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-google/pyproject.toml", "repo_id": "llama_index", "token_count": 724 }
1,274
"""Test __ModuleName__ Chat API wrapper.""" from __module_name__ import __ModuleName__LLM def test_initialization() -> None: """Test integration initialization.""" __ModuleName__LLM()
langchain/libs/cli/langchain_cli/integration_template/tests/unit_tests/test_llms.py/0
{ "file_path": "langchain/libs/cli/langchain_cli/integration_template/tests/unit_tests/test_llms.py", "repo_id": "langchain", "token_count": 58 }
217
import pytest @pytest.fixture(scope="module") def flash_falcon_handle(launcher): with launcher("tiiuae/falcon-7b", trust_remote_code=True) as handle: yield handle @pytest.fixture(scope="module") async def flash_falcon(flash_falcon_handle): await flash_falcon_handle.health(300) return flash_falco...
text-generation-inference/integration-tests/models/test_flash_falcon.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_flash_falcon.py", "repo_id": "text-generation-inference", "token_count": 884 }
411
--- hide_table_of_contents: true --- import CodeBlock from "@theme/CodeBlock"; # Convex Chat Memory For longer-term persistence across chat sessions, you can swap out the default in-memory `chatHistory` that backs chat memory classes like `BufferMemory` for [Convex](https://convex.dev/). ## Setup ### Create projec...
langchainjs/docs/core_docs/docs/integrations/chat_memory/convex.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat_memory/convex.mdx", "repo_id": "langchainjs", "token_count": 578 }
700