text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
"""Node parsers.""" from llama_index.legacy.node_parser.file.html import HTMLNodeParser from llama_index.legacy.node_parser.file.json import JSONNodeParser from llama_index.legacy.node_parser.file.markdown import MarkdownNodeParser from llama_index.legacy.node_parser.file.simple_file import SimpleFileNodeParser from l...
llama_index/llama-index-legacy/llama_index/legacy/node_parser/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/node_parser/__init__.py", "repo_id": "llama_index", "token_count": 658 }
1,506
--- sidebar_position: 0 sidebar_class_name: hidden --- # LLMs <!-- This file is autogenerated. Do not edit directly. --> <!-- See `scripts/model-docs.table.js` for details --> ## Features (natively supported) All LLMs implement the Runnable interface, which comes with default implementations of all methods, ie. `in...
langchainjs/docs/core_docs/docs/integrations/llms/index.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/llms/index.mdx", "repo_id": "langchainjs", "token_count": 1059 }
718
"""Mock predict.""" import json from typing import Any, Dict from llama_index.core.prompts.base import ( BasePromptTemplate, ) from llama_index.core.prompts.prompt_type import PromptType from tests.mock_utils.mock_utils import mock_extract_keywords_response def _mock_summary_predict(prompt_args: Dict) -> str: ...
llama_index/llama-index-core/tests/mock_utils/mock_predict.py/0
{ "file_path": "llama_index/llama-index-core/tests/mock_utils/mock_predict.py", "repo_id": "llama_index", "token_count": 2968 }
1,268
#!/bin/bash # Copyright 2018 Istio 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 t...
milvus/build/lib.sh/0
{ "file_path": "milvus/build/lib.sh", "repo_id": "milvus", "token_count": 2157 }
1,612
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/sam/processing_sam.py/0
{ "file_path": "transformers/src/transformers/models/sam/processing_sam.py", "repo_id": "transformers", "token_count": 4814 }
691
# coding=utf-8 # Copyright 2022 Meta Platforms authors and 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/LI...
transformers/src/transformers/models/flava/convert_flava_original_pytorch_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/flava/convert_flava_original_pytorch_to_hf.py", "repo_id": "transformers", "token_count": 1622 }
664
"""Tool for the Wikipedia API.""" from typing import Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.tools import BaseTool from langchain_community.utilities.wikipedia import WikipediaAPIWrapper class WikipediaQueryRun(BaseTool): """Tool that searches the Wikipedia A...
langchain/libs/community/langchain_community/tools/wikipedia/tool.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/wikipedia/tool.py", "repo_id": "langchain", "token_count": 292 }
318
<!--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/ja/main_classes/callback.md/0
{ "file_path": "transformers/docs/source/ja/main_classes/callback.md", "repo_id": "transformers", "token_count": 2295 }
541
from typing import Dict, Optional import pytest from langchain_cli.constants import ( DEFAULT_GIT_REF, DEFAULT_GIT_REPO, DEFAULT_GIT_SUBDIRECTORY, ) from langchain_cli.utils.git import DependencySource, parse_dependency_string def _assert_dependency_equals( dep: DependencySource, *, git: Opt...
langchain/libs/cli/tests/test_utils.py/0
{ "file_path": "langchain/libs/cli/tests/test_utils.py", "repo_id": "langchain", "token_count": 1822 }
219
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-mongodb/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-mongodb/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,606
<jupyter_start><jupyter_text>FalkorDB Graph StoreThis notebook walks through configuring `FalkorDB` to be the backend for graph storage in LlamaIndex.<jupyter_code>%pip install llama-index-llms-openai %pip install llama-index-graph-stores-falkordb # My OpenAI Key import os os.environ["OPENAI_API_KEY"] = "API_KEY_HERE"...
llama_index/docs/examples/index_structs/knowledge_graph/FalkorDBGraphDemo.ipynb/0
{ "file_path": "llama_index/docs/examples/index_structs/knowledge_graph/FalkorDBGraphDemo.ipynb", "repo_id": "llama_index", "token_count": 964 }
1,058
{ "monolingual": "contains a single language", "multilingual": "contains multiple languages", "translation": "contains translated or aligned text", "other": "other type of language distribution" }
datasets/src/datasets/utils/resources/multilingualities.json/0
{ "file_path": "datasets/src/datasets/utils/resources/multilingualities.json", "repo_id": "datasets", "token_count": 55 }
147
import re from datetime import datetime from typing import Any, Dict, List, Optional, Tuple from langchain.chains import LLMChain from langchain.prompts import PromptTemplate from langchain_core.language_models import BaseLanguageModel from langchain_experimental.generative_agents.memory import GenerativeAgentMemory ...
langchain/libs/experimental/langchain_experimental/generative_agents/generative_agent.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/generative_agents/generative_agent.py", "repo_id": "langchain", "token_count": 4450 }
461
# 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/test_stable_diffusion_instruction_pix2pix.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion/test_stable_diffusion_instruction_pix2pix.py", "repo_id": "diffusers", "token_count": 7735 }
293
python_tests()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lantern/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-lantern/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,661
<jupyter_start><jupyter_text>Postgres>[PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL) also known as `Postgres`, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance.This notebook goes over how to use Postgres to store chat message history.<jupyter_c...
langchain/docs/docs/integrations/memory/postgres_chat_message_history.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/memory/postgres_chat_message_history.ipynb", "repo_id": "langchain", "token_count": 189 }
129
# Sanity check script to ensure that the Chroma client can connect # and is capable of recieving data. import chromadb # run in in-memory mode chroma_api = chromadb.Client() print(chroma_api.heartbeat())
chroma/bin/test.py/0
{ "file_path": "chroma/bin/test.py", "repo_id": "chroma", "token_count": 62 }
10
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/resnet.md/0
{ "file_path": "transformers/docs/source/en/model_doc/resnet.md", "repo_id": "transformers", "token_count": 1253 }
493
import { OpenAI } from "@langchain/openai"; import { loadQAMapReduceChain } from "langchain/chains"; import { Document } from "@langchain/core/documents"; // Optionally limit the number of concurrent requests to the language model. const model = new OpenAI({ temperature: 0, maxConcurrency: 10 }); const chain = loadQAM...
langchainjs/examples/src/chains/question_answering_map_reduce.ts/0
{ "file_path": "langchainjs/examples/src/chains/question_answering_map_reduce.ts", "repo_id": "langchainjs", "token_count": 243 }
849
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/vitmatte/convert_vitmatte_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/vitmatte/convert_vitmatte_to_hf.py", "repo_id": "transformers", "token_count": 2675 }
738
""" PyTorch Lamb optimizer w/ behaviour similar to NVIDIA FusedLamb This optimizer code was adapted from the following (starting with latest) * https://github.com/HabanaAI/Model-References/blob/2b435114fe8e31f159b1d3063b8280ae37af7423/PyTorch/nlp/bert/pretraining/lamb.py * https://github.com/NVIDIA/DeepLearningExample...
pytorch-image-models/timm/optim/lamb.py/0
{ "file_path": "pytorch-image-models/timm/optim/lamb.py", "repo_id": "pytorch-image-models", "token_count": 3768 }
410
# 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 required by appl...
trl/examples/research_projects/tools/python_interpreter.py/0
{ "file_path": "trl/examples/research_projects/tools/python_interpreter.py", "repo_id": "trl", "token_count": 2604 }
775
import { getEnvironmentVariable } from "@langchain/core/utils/env"; import { LLM, type BaseLLMParams } from "@langchain/core/language_models/llms"; const apiUrl = "https://llm.api.cloud.yandex.net/foundationModels/v1/completion"; export interface YandexGPTInputs extends BaseLLMParams { /** * What sampling temp...
langchainjs/libs/langchain-yandex/src/llms.ts/0
{ "file_path": "langchainjs/libs/langchain-yandex/src/llms.ts", "repo_id": "langchainjs", "token_count": 1694 }
1,049
[tool.poetry] name = "cohere-librarian" version = "0.0.1" description = "Get started with a simple template that acts as a librarian" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" cohere = "^4.37" chromadb = "^0.4.18" [tool.poetry.group.dev.dependencies] langc...
langchain/templates/cohere-librarian/pyproject.toml/0
{ "file_path": "langchain/templates/cohere-librarian/pyproject.toml", "repo_id": "langchain", "token_count": 287 }
706
package writebuffer import ( "fmt" "testing" "time" "github.com/samber/lo" "github.com/stretchr/testify/suite" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" "github.com/milvus-io/milvus/internal/storage" "github.com/milvus-io/milvus/pkg/util/paramtable" "github.com/milvus-io/milvus/pkg/util/tsoutil" )...
milvus/internal/datanode/writebuffer/delta_buffer_test.go/0
{ "file_path": "milvus/internal/datanode/writebuffer/delta_buffer_test.go", "repo_id": "milvus", "token_count": 875 }
1,981
python_test_utils( name="test_utils", ) python_tests( name="tests", )
llama_index/llama-index-core/tests/text_splitter/BUILD/0
{ "file_path": "llama_index/llama-index-core/tests/text_splitter/BUILD", "repo_id": "llama_index", "token_count": 35 }
1,216
apiVersion: chaos-mesh.org/v1alpha1 kind: PodChaos metadata: name: test-pulsar-pod-failure namespace: chaos-testing spec: selector: namespaces: - chaos-testing labelSelectors: release: milvus-chaos app: pulsar mode: fixed value: "1" action: pod-failure duration: 2m gracePeriod:...
milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_pulsar_pod_failure.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_pulsar_pod_failure.yaml", "repo_id": "milvus", "token_count": 133 }
1,888
"""Unit tests for html2text document transformer.""" import pytest from langchain_core.documents import Document from langchain_community.document_transformers import Html2TextTransformer @pytest.mark.requires("html2text") def test_transform_empty_html() -> None: html2text_transformer = Html2TextTransformer() ...
langchain/libs/community/tests/unit_tests/document_transformers/test_html2text_transformer.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_transformers/test_html2text_transformer.py", "repo_id": "langchain", "token_count": 1554 }
393
# MEP: Search By Primary Keys Current state: Under Discussion ISSUE: [[Feature]: Support to search by primary keys #23184](https://github.com/milvus-io/milvus/issues/23184) Keywords: Search, ANN Released: v2.3.0 ## Summary Support to search (ANNS) by the query vectors corresponding to the given primary keys. ## ...
milvus/docs/design_docs/20230403-search_by_pk.md/0
{ "file_path": "milvus/docs/design_docs/20230403-search_by_pk.md", "repo_id": "milvus", "token_count": 714 }
1,630
# Big Transfer (BiT) **Big Transfer (BiT)** is a type of pretraining recipe that pre-trains on a large supervised source dataset, and fine-tunes the weights on the target task. Models are trained on the JFT-300M dataset. The finetuned models contained in this collection are finetuned on ImageNet. {% include 'code_sn...
pytorch-image-models/docs/models/.templates/models/big-transfer.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/big-transfer.md", "repo_id": "pytorch-image-models", "token_count": 3274 }
358
# Fine-tuning for image classification using LoRA and 🤗 PEFT ## Vision Transformer model from transformers [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/peft/blob/main/examples/image_classification/image_classification_peft_lora.ipyn...
peft/examples/image_classification/README.md/0
{ "file_path": "peft/examples/image_classification/README.md", "repo_id": "peft", "token_count": 457 }
326
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "memory/zep", }); export * from "@langchain/community/memory/zep";
langchainjs/langchain/src/memory/zep.ts/0
{ "file_path": "langchainjs/langchain/src/memory/zep.ts", "repo_id": "langchainjs", "token_count": 70 }
935
# 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/tvlt/test_modeling_tvlt.py/0
{ "file_path": "transformers/tests/models/tvlt/test_modeling_tvlt.py", "repo_id": "transformers", "token_count": 11461 }
753
/* * 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...
milvus/pkg/mq/msgstream/msg_for_index.go/0
{ "file_path": "milvus/pkg/mq/msgstream/msg_for_index.go", "repo_id": "milvus", "token_count": 1806 }
1,959
package kafka import ( "testing" "github.com/stretchr/testify/assert" ) func TestKafkaID_Serialize(t *testing.T) { rid := &kafkaID{messageID: 8} bin := rid.Serialize() assert.NotNil(t, bin) assert.NotZero(t, len(bin)) } func TestKafkaID_AtEarliestPosition(t *testing.T) { rid := &kafkaID{messageID: 8} assert...
milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_id_test.go/0
{ "file_path": "milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_id_test.go", "repo_id": "milvus", "token_count": 701 }
2,095
# coding=utf-8 # Copyright 2022 Meta Platforms authors and 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 requi...
transformers/tests/models/flava/test_image_processing_flava.py/0
{ "file_path": "transformers/tests/models/flava/test_image_processing_flava.py", "repo_id": "transformers", "token_count": 7088 }
724
# `auto-evaluator-api` This API includes much of the functionality of the [auto-evaluator Streamlit app](https://github.com/PineappleExpress808/auto-evaluator). And it is the back-end for [the hosted app](https://autoevaluator.langchain.com/). ### `Test locally` - Set API keys: ``` export OPENAI_API_KEY= export A...
auto-evaluator/api/README.md/0
{ "file_path": "auto-evaluator/api/README.md", "repo_id": "auto-evaluator", "token_count": 528 }
0
from langchain_core.tracers.stdout import ( ConsoleCallbackHandler, FunctionCallbackHandler, elapsed, try_json_stringify, ) __all__ = [ "try_json_stringify", "elapsed", "FunctionCallbackHandler", "ConsoleCallbackHandler", ]
langchain/libs/langchain/langchain/schema/callbacks/tracers/stdout.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/callbacks/tracers/stdout.py", "repo_id": "langchain", "token_count": 96 }
543
# Inception v4 **Inception-v4** is a convolutional neural network architecture that builds on previous iterations of the Inception family by simplifying the architecture and using more inception modules than [Inception-v3](https://paperswithcode.com/method/inception-v3). {% include 'code_snippets.md' %} ## How do I t...
pytorch-image-models/docs/models/.templates/models/inception-v4.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/inception-v4.md", "repo_id": "pytorch-image-models", "token_count": 816 }
330
"""Wrapper around in-memory storage.""" from __future__ import annotations from typing import Any, Dict, List, Literal, Optional from langchain_core.embeddings import Embeddings from langchain_community.vectorstores.docarray.base import ( DocArrayIndex, _check_docarray_import, ) class DocArrayInMemorySearc...
langchain/libs/community/langchain_community/vectorstores/docarray/in_memory.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/docarray/in_memory.py", "repo_id": "langchain", "token_count": 1057 }
308
""" Loader Factory, Fast Collate, CUDA Prefetcher Prefetcher and Fast Collate inspired by NVIDIA APEX example at https://github.com/NVIDIA/apex/commit/d5e2bb4bdeedd27b1dfaf5bb2b24d6c000dee9be#diff-cf86c282ff7fba81fad27a559379d5bf Hacked together by / Copyright 2019, Ross Wightman """ import logging import random from...
pytorch-image-models/timm/data/loader.py/0
{ "file_path": "pytorch-image-models/timm/data/loader.py", "repo_id": "pytorch-image-models", "token_count": 6793 }
348
// 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/log/Log.h/0
{ "file_path": "milvus/internal/core/src/log/Log.h", "repo_id": "milvus", "token_count": 1304 }
1,790
# 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/gpt_neo/test_modeling_flax_gpt_neo.py/0
{ "file_path": "transformers/tests/models/gpt_neo/test_modeling_flax_gpt_neo.py", "repo_id": "transformers", "token_count": 6851 }
818
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
trl/tests/test_environments.py/0
{ "file_path": "trl/tests/test_environments.py", "repo_id": "trl", "token_count": 4813 }
785
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/openai/convert_openai_original_tf_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/openai/convert_openai_original_tf_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 987 }
664
"""Test ScaNN functionality.""" import datetime import tempfile import numpy as np import pytest from langchain_core.documents import Document from langchain_community.docstore.in_memory import InMemoryDocstore from langchain_community.vectorstores.scann import ( ScaNN, dependable_scann_import, normalize,...
langchain/libs/community/tests/integration_tests/vectorstores/test_scann.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/test_scann.py", "repo_id": "langchain", "token_count": 4378 }
378
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/tools/llama-index-tools-yelp/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-yelp/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,509
from langchain_community.embeddings.bookend import ( BookendEmbeddings, ) __all__ = ["BookendEmbeddings"]
langchain/libs/langchain/langchain/embeddings/bookend.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/bookend.py", "repo_id": "langchain", "token_count": 40 }
505
#define _USE_MATH_DEFINES #include<math.h> #include<stdint.h> #include "cuda_utils.cuh" #define UNARY_OP(TYPENAME, FN_NAME, FUNC) \ extern "C" __global__ void FN_NAME( \ const size_t numel, \ const size_t num_dims, \ const size_t *info, \ const TYPENAME *inp, \ TYPENAME *out \ ) { \ const size_...
candle/candle-kernels/src/unary.cu/0
{ "file_path": "candle/candle-kernels/src/unary.cu", "repo_id": "candle", "token_count": 3376 }
52
from python_lint.agent_executor import agent_executor __all__ = ["agent_executor"]
langchain/templates/python-lint/python_lint/__init__.py/0
{ "file_path": "langchain/templates/python-lint/python_lint/__init__.py", "repo_id": "langchain", "token_count": 28 }
665
from collections import defaultdict from typing import Optional from ..image_utils import load_image from ..utils import ( add_end_docstrings, is_torch_available, logging, requires_backends, ) from .base import ChunkPipeline, build_pipeline_init_args if is_torch_available(): import torch fro...
transformers/src/transformers/pipelines/mask_generation.py/0
{ "file_path": "transformers/src/transformers/pipelines/mask_generation.py", "repo_id": "transformers", "token_count": 5619 }
700
#!/usr/bin/env python # 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/LI...
transformers/examples/flax/token-classification/run_flax_ner.py/0
{ "file_path": "transformers/examples/flax/token-classification/run_flax_ner.py", "repo_id": "transformers", "token_count": 14777 }
553
# Momento > [Momento Cache](https://docs.momentohq.com/) is the world's first truly serverless caching service, offering instant elasticity, scale-to-zero > capability, and blazing-fast performance. > > [Momento Vector Index](https://docs.momentohq.com/vector-index) stands out as the most productive, easiest-to-use, f...
langchain/docs/docs/integrations/providers/momento.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/momento.mdx", "repo_id": "langchain", "token_count": 603 }
146
"""Test Together API wrapper. In order to run this test, you need to have an Together api key. You can get it by registering for free at https://api.together.xyz/. A test key can be found at https://api.together.xyz/settings/api-keys You'll then need to set TOGETHER_API_KEY environment variable to your api key. """ i...
langchain/libs/partners/together/tests/integration_tests/test_llms.py/0
{ "file_path": "langchain/libs/partners/together/tests/integration_tests/test_llms.py", "repo_id": "langchain", "token_count": 439 }
657
# 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/pipelines/test_pipelines_depth_estimation.py/0
{ "file_path": "transformers/tests/pipelines/test_pipelines_depth_estimation.py", "repo_id": "transformers", "token_count": 1794 }
838
from __future__ import annotations import uuid from abc import ABC, abstractmethod from typing import List, Optional, Sequence NAMESPACE_UUID = uuid.UUID(int=1984) class RecordManager(ABC): """An abstract base class representing the interface for a record manager.""" def __init__( self, nam...
langchain/libs/community/langchain_community/indexes/base.py/0
{ "file_path": "langchain/libs/community/langchain_community/indexes/base.py", "repo_id": "langchain", "token_count": 2091 }
264
import asyncio import logging from concurrent.futures import ThreadPoolExecutor from typing import Any, Dict, List, Mapping, Optional, Sequence, TypedDict import aiohttp import requests from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.languag...
langchain/libs/community/langchain_community/llms/gradient_ai.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/gradient_ai.py", "repo_id": "langchain", "token_count": 6888 }
281
# coding=utf-8 # Copyright 2021 The Google Flax Team Authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
transformers/src/transformers/models/gpt2/modeling_flax_gpt2.py/0
{ "file_path": "transformers/src/transformers/models/gpt2/modeling_flax_gpt2.py", "repo_id": "transformers", "token_count": 14132 }
670
locust_random_performance: collections: - milvus: cache_config.insert_buffer_size: 2GB engine_config.use_blas_threshold: 1100 wal_enable: true collection_name: sift_1m_128_l2 # other_fields: int ni_per: 50000 build_index: false index_type: ivf_sq8 ...
milvus/tests/benchmark/milvus_benchmark/suites/2_locust_random.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/2_locust_random.yaml", "repo_id": "milvus", "token_count": 707 }
2,149
from __future__ import annotations from typing import List, Union from langchain_core.documents import Document from langchain_core.load.serializable import Serializable from langchain_core.pydantic_v1 import Field class Node(Serializable): """Represents a node in a graph with associated properties. Attrib...
langchain/libs/community/langchain_community/graphs/graph_document.py/0
{ "file_path": "langchain/libs/community/langchain_community/graphs/graph_document.py", "repo_id": "langchain", "token_count": 483 }
262
<jupyter_start><jupyter_text>RAG based on Qianfan and BES This notebook is an implementation of Retrieval augmented generation (RAG) using Baidu Qianfan Platform combined with Baidu ElasricSearch, where the original data is located on BOS. Baidu QianfanBaidu AI Cloud Qianfan Platform is a one-stop large model developme...
langchain/cookbook/qianfan_baidu_elasticesearch_RAG.ipynb/0
{ "file_path": "langchain/cookbook/qianfan_baidu_elasticesearch_RAG.ipynb", "repo_id": "langchain", "token_count": 1090 }
75
label: 'Types'
langchain/docs/docs/modules/model_io/output_parsers/types/_category_.yml/0
{ "file_path": "langchain/docs/docs/modules/model_io/output_parsers/types/_category_.yml", "repo_id": "langchain", "token_count": 5 }
212
python_tests()
llama_index/llama-index-packs/llama-index-packs-llama-guard-moderator/tests/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-llama-guard-moderator/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,662
# Contributing to LlamaIndex Interested in contributing to LlamaIndex? Here's how to get started! ## Contribution Guideline The best part of LlamaIndex is our community of users and contributors. ### What should I work on? 1. 🆕 Extend core modules 2. 🐛 Fix bugs 3. 🎉 Add usage examples 4. 🧪 Add experimental fea...
llama_index/llama-index-core/CONTRIBUTING.md/0
{ "file_path": "llama_index/llama-index-core/CONTRIBUTING.md", "repo_id": "llama_index", "token_count": 4318 }
1,241
# hyde This template uses HyDE with RAG. Hyde is a retrieval method that stands for Hypothetical Document Embeddings (HyDE). It is a method used to enhance retrieval by generating a hypothetical document for an incoming query. The document is then embedded, and that embedding is utilized to look up real documents...
langchain/templates/hyde/README.md/0
{ "file_path": "langchain/templates/hyde/README.md", "repo_id": "langchain", "token_count": 668 }
664
from typing import Any, Dict, List, Optional from llama_index.core.base.base_retriever import BaseRetriever from llama_index.core.callbacks.base import CallbackManager from llama_index.core.constants import DEFAULT_SIMILARITY_TOP_K from llama_index.core.schema import NodeWithScore, QueryBundle from llama_index.core.se...
llama_index/llama-index-integrations/indices/llama-index-indices-managed-colbert/llama_index/indices/managed/colbert/retriever.py/0
{ "file_path": "llama_index/llama-index-integrations/indices/llama-index-indices-managed-colbert/llama_index/indices/managed/colbert/retriever.py", "repo_id": "llama_index", "token_count": 981 }
1,285
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-langchain/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-langchain/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,316
# RegNetY **RegNetY** is a convolutional network design space with simple, regular models with parameters: depth $d$, initial width $w\_{0} > 0$, and slope $w\_{a} > 0$, and generates a different block width $u\_{j}$ for each block $j < d$. The key restriction for the RegNet types of model is that there is a linear pa...
pytorch-image-models/docs/models/.templates/models/regnety.md/0
{ "file_path": "pytorch-image-models/docs/models/.templates/models/regnety.md", "repo_id": "pytorch-image-models", "token_count": 5944 }
346
# coding=utf-8 # Copyright 2023 The Kakao Enterprise 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/...
transformers/src/transformers/models/vits/configuration_vits.py/0
{ "file_path": "transformers/src/transformers/models/vits/configuration_vits.py", "repo_id": "transformers", "token_count": 5431 }
673
export function deepestChild(el: HTMLElement): HTMLElement { if (el.lastElementChild && el.lastElementChild.nodeType !== Node.TEXT_NODE) { return deepestChild(el.lastElementChild as HTMLElement); } return el; }
chat-ui/src/lib/utils/deepestChild.ts/0
{ "file_path": "chat-ui/src/lib/utils/deepestChild.ts", "repo_id": "chat-ui", "token_count": 74 }
97
python_sources()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-myscale/llama_index/vector_stores/myscale/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-myscale/llama_index/vector_stores/myscale/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,528
import unittest import pytest from langchain_community.document_loaders.parsers.language.scala import ScalaSegmenter @pytest.mark.requires("tree_sitter", "tree_sitter_languages") class TestScalaSegmenter(unittest.TestCase): def setUp(self) -> None: self.example_code = """def foo() { return 1 } obje...
langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_scala.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_scala.py", "repo_id": "langchain", "token_count": 647 }
387
import type { OpenAI as OpenAIClient } from "openai"; import { TiktokenModel } from "js-tiktoken/lite"; import type { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base"; // reexport this type from the included package so we can easily override and extend it if needed in the future // also make...
langchainjs/libs/langchain-openai/src/types.ts/0
{ "file_path": "langchainjs/libs/langchain-openai/src/types.ts", "repo_id": "langchainjs", "token_count": 1918 }
983
#ifndef _qdq_4_cuh #define _qdq_4_cuh #include "qdq_util.cuh" #include "../../config.h" #if QMODE_4BIT == 1 // Permutation: // // 77775555 33331111 66664444 22220000 __forceinline__ __device__ void shuffle_4bit_8 ( uint32_t* q, int stride ) { uint32_t qa = q[0]; uint32_t qb = 0; #pragma unroll...
text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_4.cuh/0
{ "file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/quant/qdq_4.cuh", "repo_id": "text-generation-inference", "token_count": 3278 }
399
"""Make.com API wrapper. Currently cannot load documents. """ from typing import Any, List, Optional import requests from llama_index.core.base.response.schema import Response from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document, NodeWithScore, TextNode class MakeWrapp...
llama_index/llama-index-integrations/readers/llama-index-readers-make-com/llama_index/readers/make_com/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-make-com/llama_index/readers/make_com/base.py", "repo_id": "llama_index", "token_count": 676 }
1,376
<jupyter_start><jupyter_text>Llama2 + VectorStoreIndexThis notebook walks through the proper setup to use llama-2 with LlamaIndex. Specifically, we look at using a vector store index. Setup If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-...
llama_index/docs/examples/vector_stores/SimpleIndexDemoLlama2.ipynb/0
{ "file_path": "llama_index/docs/examples/vector_stores/SimpleIndexDemoLlama2.ipynb", "repo_id": "llama_index", "token_count": 1079 }
1,085
# 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/ia3/config.py/0
{ "file_path": "peft/src/peft/tuners/ia3/config.py", "repo_id": "peft", "token_count": 1842 }
324
from llama_index.core.vector_stores.types import VectorStore from llama_index.vector_stores.dashvector import DashVectorStore def test_class(): names_of_base_classes = [b.__name__ for b in DashVectorStore.__mro__] assert VectorStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dashvector/tests/test_vector_stores_dashvector.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-dashvector/tests/test_vector_stores_dashvector.py", "repo_id": "llama_index", "token_count": 90 }
1,522
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/hubert/convert_distilhubert_original_s3prl_checkpoint_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/hubert/convert_distilhubert_original_s3prl_checkpoint_to_pytorch.py", "repo_id": "transformers", "token_count": 3907 }
645
"""Autoretriever prompts.""" from llama_index.legacy.prompts.base import PromptTemplate from llama_index.legacy.prompts.prompt_type import PromptType from llama_index.legacy.vector_stores.types import ( FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec, ) # NOTE: ...
llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/auto_retriever/prompts.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/auto_retriever/prompts.py", "repo_id": "llama_index", "token_count": 1463 }
1,608
The ISC License Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS...
langchainjs/langchain-core/src/utils/sax-js/LICENSE.md/0
{ "file_path": "langchainjs/langchain-core/src/utils/sax-js/LICENSE.md", "repo_id": "langchainjs", "token_count": 571 }
865
# 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/deprecated/mctct/feature_extraction_mctct.py/0
{ "file_path": "transformers/src/transformers/models/deprecated/mctct/feature_extraction_mctct.py", "repo_id": "transformers", "token_count": 5577 }
671
"""Common utils for embeddings.""" import json import re import uuid from typing import Dict, List, Tuple from llama_index.core.bridge.pydantic import BaseModel from llama_index.core.llms.utils import LLM from llama_index.core.schema import MetadataMode, TextNode from tqdm import tqdm class EmbeddingQAFinetuneDatase...
llama_index/llama-index-core/llama_index/core/llama_dataset/legacy/embedding.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/llama_dataset/legacy/embedding.py", "repo_id": "llama_index", "token_count": 1269 }
1,274
from neo4j_generation.chain import chain __all__ = ["chain"]
langchain/templates/neo4j-generation/neo4j_generation/__init__.py/0
{ "file_path": "langchain/templates/neo4j-generation/neo4j_generation/__init__.py", "repo_id": "langchain", "token_count": 20 }
712
""" Position Embedding Utilities Hacked together by / Copyright 2022 Ross Wightman """ import logging import math from typing import List, Tuple, Optional, Union import torch import torch.nn.functional as F from .helpers import to_2tuple _logger = logging.getLogger(__name__) def resample_abs_pos_embed( po...
pytorch-image-models/timm/layers/pos_embed.py/0
{ "file_path": "pytorch-image-models/timm/layers/pos_embed.py", "repo_id": "pytorch-image-models", "token_count": 1127 }
395
use super::Cpu; #[cfg(target_arch = "arm")] use core::arch::arm::*; #[cfg(target_arch = "aarch64")] use core::arch::aarch64::*; pub struct CurrentCpu {} const STEP: usize = 16; const EPR: usize = 4; const ARR: usize = STEP / EPR; impl CurrentCpu { #[cfg(target_arch = "aarch64")] unsafe fn reduce_one(x: floa...
candle/candle-core/src/cpu/neon.rs/0
{ "file_path": "candle/candle-core/src/cpu/neon.rs", "repo_id": "candle", "token_count": 897 }
29
<jupyter_start><jupyter_text>This notebook shows how to use the RSpace document loader to import research notes and documents from RSpace ElectronicLab Notebook into Langchain pipelines.To start you'll need an RSpace account and an API key.You can set up a free account at [https://community.researchspace.com](https://c...
langchain/docs/docs/integrations/document_loaders/rspace.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/rspace.ipynb", "repo_id": "langchain", "token_count": 651 }
121
# Custom document loaders If you want to implement your own Document Loader, you have a few options. ### Subclassing `BaseDocumentLoader` You can extend the `BaseDocumentLoader` class directly. The `BaseDocumentLoader` class provides a few convenience methods for loading documents from a variety of sources. ```type...
langchainjs/docs/core_docs/docs/modules/data_connection/document_loaders/custom.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/data_connection/document_loaders/custom.mdx", "repo_id": "langchainjs", "token_count": 314 }
785
# LlamaIndex Llms Integration: Openai Like
llama_index/llama-index-integrations/llms/llama-index-llms-openai-like/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openai-like/README.md", "repo_id": "llama_index", "token_count": 12 }
1,322
from langchain_community.tools.playwright.click import ClickTool, ClickToolInput __all__ = ["ClickToolInput", "ClickTool"]
langchain/libs/langchain/langchain/tools/playwright/click.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/playwright/click.py", "repo_id": "langchain", "token_count": 35 }
608
package etcd import ( "sync" clientv3 "go.etcd.io/etcd/client/v3" "go.etcd.io/etcd/server/v3/embed" "go.etcd.io/etcd/server/v3/etcdserver/api/v3client" "go.uber.org/zap" "github.com/milvus-io/milvus/pkg/log" ) // EtcdServer is the singleton of embedded etcd server var ( initOnce sync.Once closeOnce sync....
milvus/pkg/util/etcd/etcd_server.go/0
{ "file_path": "milvus/pkg/util/etcd/etcd_server.go", "repo_id": "milvus", "token_count": 673 }
1,908
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querynodev2/segments/segment.go/0
{ "file_path": "milvus/internal/querynodev2/segments/segment.go", "repo_id": "milvus", "token_count": 14279 }
1,995
from langchain_community.chat_message_histories.rocksetdb import ( RocksetChatMessageHistory, ) __all__ = ["RocksetChatMessageHistory"]
langchain/libs/langchain/langchain/memory/chat_message_histories/rocksetdb.py/0
{ "file_path": "langchain/libs/langchain/langchain/memory/chat_message_histories/rocksetdb.py", "repo_id": "langchain", "token_count": 46 }
556
<jupyter_start><jupyter_text>Epsilla>[Epsilla](https://www.epsilla.com) is an open-source vector database that leverages the advanced parallel graph traversal techniques for vector indexing. Epsilla is licensed under GPL-3.0.This notebook shows how to use the functionalities related to the `Epsilla` vector database.As ...
langchain/docs/docs/integrations/vectorstores/epsilla.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/epsilla.ipynb", "repo_id": "langchain", "token_count": 622 }
180
#!/usr/bin/env python # coding=utf-8 # 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-...
transformers/examples/pytorch/language-modeling/run_plm.py/0
{ "file_path": "transformers/examples/pytorch/language-modeling/run_plm.py", "repo_id": "transformers", "token_count": 10316 }
525
--- sidebar_class_name: node-only --- import CodeBlock from "@theme/CodeBlock"; # SingleStore [SingleStoreDB](https://singlestore.com/) is a high-performance distributed SQL database that supports deployment both in the [cloud](https://www.singlestore.com/cloud/) and on-premise. It provides vector storage, as well a...
langchainjs/docs/core_docs/docs/integrations/vectorstores/singlestore.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/singlestore.mdx", "repo_id": "langchainjs", "token_count": 659 }
744
import logging import os from langchain_core.documents import Document from langchain_community.document_loaders import RocksetLoader logger = logging.getLogger(__name__) def test_sql_query() -> None: import rockset assert os.environ.get("ROCKSET_API_KEY") is not None assert os.environ.get("ROCKSET_RE...
langchain/libs/community/tests/integration_tests/document_loaders/test_rocksetdb.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_rocksetdb.py", "repo_id": "langchain", "token_count": 779 }
346
# coding=utf-8 # Copyright 2021 Facebook AI Research 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/LIC...
transformers/src/transformers/models/detr/modeling_detr.py/0
{ "file_path": "transformers/src/transformers/models/detr/modeling_detr.py", "repo_id": "transformers", "token_count": 48595 }
676
from typing import Any from llama_index.core.callbacks.base_handler import BaseCallbackHandler def argilla_callback_handler(**kwargs: Any) -> BaseCallbackHandler: try: # lazy import from argilla_llama_index import ArgillaCallbackHandler except ImportError: raise ImportError("Please in...
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-argilla/llama_index/callbacks/argilla/base.py/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-argilla/llama_index/callbacks/argilla/base.py", "repo_id": "llama_index", "token_count": 131 }
1,226
import os from langchain_community.graphs import Neo4jGraph from langchain_community.graphs.neo4j_graph import ( node_properties_query, rel_properties_query, rel_query, ) def test_cypher_return_correct_schema() -> None: """Test that chain returns direct results.""" url = os.environ.get("NEO4J_URI...
langchain/libs/community/tests/integration_tests/graphs/test_neo4j.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/graphs/test_neo4j.py", "repo_id": "langchain", "token_count": 1576 }
334