text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
import unittest import warnings from datasets.utils import experimental @experimental def dummy_function(): return "success" class TestExperimentalFlag(unittest.TestCase): def test_experimental_warning(self): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always"...
datasets/tests/test_experimental.py/0
{ "file_path": "datasets/tests/test_experimental.py", "repo_id": "datasets", "token_count": 152 }
149
[tool.poetry] name = "mongo-parent-document-retrieval" version = "0.0.1" description = "RAG using MongoDB and OpenAI" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" openai = "<2" pymongo = "^4.6.0" pypdf = "^3.17.0" tiktoken = "^0.5.1" [tool.poetry.group.dev.de...
langchain/templates/mongo-parent-document-retrieval/pyproject.toml/0
{ "file_path": "langchain/templates/mongo-parent-document-retrieval/pyproject.toml", "repo_id": "langchain", "token_count": 314 }
645
export * from "./chat_models.js";
langchainjs/libs/langchain-anthropic/src/index.ts/0
{ "file_path": "langchainjs/libs/langchain-anthropic/src/index.ts", "repo_id": "langchainjs", "token_count": 12 }
972
<div style="text-align: center"> <img src="https://huggingface.co/datasets/trl-internal-testing/example-images/resolve/main/images/trl_banner_dark.png"> </div> # TRL - Transformer Reinforcement Learning > Full stack transformer language models with reinforcement learning. <p align="center"> <a href="https://githu...
trl/README.md/0
{ "file_path": "trl/README.md", "repo_id": "trl", "token_count": 2455 }
780
[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 = ["WeaviateVectorStore"] contains_example = false import_path = "llama_index.vector_stores.w...
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-weaviate/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-weaviate/pyproject.toml", "repo_id": "llama_index", "token_count": 656 }
1,500
import { Neo4jGraph } from "@langchain/community/graphs/neo4j_graph"; import { OpenAI } from "@langchain/openai"; import { GraphCypherQAChain } from "langchain/chains/graph_qa/cypher"; /** * This example uses Neo4j database, which is native graph database. * To set it up follow the instructions on https://neo4j.com/...
langchainjs/examples/src/chains/graph_db_neo4j.ts/0
{ "file_path": "langchainjs/examples/src/chains/graph_db_neo4j.ts", "repo_id": "langchainjs", "token_count": 327 }
764
"""Feedly Rss Reader.""" import json from pathlib import Path from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class FeedlyRssReader(BaseReader): """Feedly Rss Reader. Get entries from Feedly Rss Reader Uses Feedly Official python-api-client: https://gi...
llama_index/llama-index-integrations/readers/llama-index-readers-feedly-rss/llama_index/readers/feedly_rss/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-feedly-rss/llama_index/readers/feedly_rss/base.py", "repo_id": "llama_index", "token_count": 887 }
1,432
<jupyter_start><jupyter_text>Finetuner un modèle de language masqué (PyTorch) Installez les bibliothèques 🤗 *Datasets*, 🤗 *Transformers* et 🤗 *Accelerate* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece] !pip install accelerate # Pour exécuter l'entraînement sur TPU, vous ...
notebooks/course/fr/chapter7/section3_pt.ipynb/0
{ "file_path": "notebooks/course/fr/chapter7/section3_pt.ipynb", "repo_id": "notebooks", "token_count": 4290 }
310
from langchain_community.document_loaders.parsers.txt import TextParser __all__ = ["TextParser"]
langchain/libs/langchain/langchain/document_loaders/parsers/txt.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/parsers/txt.py", "repo_id": "langchain", "token_count": 30 }
522
"""Init file of Playground.""" # playground from llama_index.legacy.playground.base import ( DEFAULT_INDEX_CLASSES, DEFAULT_MODES, Playground, ) __all__ = ["Playground", "DEFAULT_INDEX_CLASSES", "DEFAULT_MODES"]
llama_index/llama-index-legacy/llama_index/legacy/playground/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/playground/__init__.py", "repo_id": "llama_index", "token_count": 88 }
1,625
import torch import torch.distributed from torch import nn from transformers.modeling_utils import PreTrainedModel from transformers.configuration_utils import PretrainedConfig from typing import Optional, List, Tuple from text_generation_server.utils import paged_attention, flash_attn from text_generation_server.uti...
text-generation-inference/server/text_generation_server/models/custom_modeling/flash_rw_modeling.py/0
{ "file_path": "text-generation-inference/server/text_generation_server/models/custom_modeling/flash_rw_modeling.py", "repo_id": "text-generation-inference", "token_count": 10032 }
422
.. _Ref-Indices-List: Summary Index ========== Building the Summary Index .. automodule:: llama_index.core.indices.list :members: :inherited-members: :exclude-members: delete, docstore, index_struct, index_struct_cls
llama_index/docs/api_reference/indices/list.rst/0
{ "file_path": "llama_index/docs/api_reference/indices/list.rst", "repo_id": "llama_index", "token_count": 81 }
1,158
from .value_guided_sampling import ValueGuidedRLPipeline
diffusers/src/diffusers/experimental/rl/__init__.py/0
{ "file_path": "diffusers/src/diffusers/experimental/rl/__init__.py", "repo_id": "diffusers", "token_count": 17 }
239
# coding:utf-8 import os import tempfile from typing import Any, List, Optional from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.document_loaders.unstructured import UnstructuredFileLoader class OBSFileLoader(BaseLoader): ""...
langchain/libs/community/langchain_community/document_loaders/obs_file.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/obs_file.py", "repo_id": "langchain", "token_count": 2022 }
255
# 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/mgp_str/test_modeling_mgp_str.py/0
{ "file_path": "transformers/tests/models/mgp_str/test_modeling_mgp_str.py", "repo_id": "transformers", "token_count": 4252 }
722
# Load import uuid from langchain.retrievers.multi_vector import MultiVectorRetriever from langchain.storage import InMemoryStore from langchain_community.chat_models import ChatOpenAI from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorstores import Chroma from langchain_core.do...
langchain/templates/rag-semi-structured/rag_semi_structured/chain.py/0
{ "file_path": "langchain/templates/rag-semi-structured/rag_semi_structured/chain.py", "repo_id": "langchain", "token_count": 1281 }
747
import pytest import requests from datasets.utils.file_utils import http_head from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline @pytest.mark.integration def test_offline_with_timeout(): with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT): with pytest.raises(Reques...
datasets/tests/test_offline_util.py/0
{ "file_path": "datasets/tests/test_offline_util.py", "repo_id": "datasets", "token_count": 382 }
169
module github.com/milvus-io/milvus go 1.20 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.1.0 github.com/aliyun/credenti...
milvus/go.mod/0
{ "file_path": "milvus/go.mod", "repo_id": "milvus", "token_count": 6083 }
1,858
import CodeBlock from "@theme/CodeBlock"; # Google Vertex AI The `GoogleVertexAIEmbeddings` class uses Google's Vertex AI PaLM models to generate embeddings for a given text. The Vertex AI implementation is meant to be used in Node.js and not directly in a browser, since it requires a service account to use. Before...
langchainjs/docs/core_docs/docs/integrations/text_embedding/google_vertex_ai.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/text_embedding/google_vertex_ai.mdx", "repo_id": "langchainjs", "token_count": 400 }
714
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [0.13.2] - [#1096] Python 3.11 support ## [0.13.1] - [#1072]...
tokenizers/bindings/python/CHANGELOG.md/0
{ "file_path": "tokenizers/bindings/python/CHANGELOG.md", "repo_id": "tokenizers", "token_count": 7408 }
444
# coding=utf-8 # Copyright 2020 The Microsoft 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 # # Unl...
transformers/src/transformers/models/prophetnet/tokenization_prophetnet.py/0
{ "file_path": "transformers/src/transformers/models/prophetnet/tokenization_prophetnet.py", "repo_id": "transformers", "token_count": 9509 }
710
# 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/prefix_tuning/config.py/0
{ "file_path": "peft/src/peft/tuners/prefix_tuning/config.py", "repo_id": "peft", "token_count": 447 }
337
# coding=utf-8 # Copyright 2023 The LAION-AI Team 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/LICENSE...
transformers/src/transformers/models/clap/modeling_clap.py/0
{ "file_path": "transformers/src/transformers/models/clap/modeling_clap.py", "repo_id": "transformers", "token_count": 44304 }
578
# 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/pvt/test_modeling_pvt.py/0
{ "file_path": "transformers/tests/models/pvt/test_modeling_pvt.py", "repo_id": "transformers", "token_count": 5180 }
781
--- hide_table_of_contents: true --- # Metal Retriever This example shows how to use the Metal Retriever in a retrieval chain to retrieve documents from a Metal index. ## Setup import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx"; <IntegrationInstallTooltip></IntegrationInstallTo...
langchainjs/docs/core_docs/docs/integrations/retrievers/metal-retriever.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/retrievers/metal-retriever.mdx", "repo_id": "langchainjs", "token_count": 171 }
721
# 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/src/transformers/models/seamless_m4t/tokenization_seamless_m4t.py/0
{ "file_path": "transformers/src/transformers/models/seamless_m4t/tokenization_seamless_m4t.py", "repo_id": "transformers", "token_count": 11109 }
718
# 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/test_pipelines_flax.py/0
{ "file_path": "diffusers/tests/pipelines/test_pipelines_flax.py", "repo_id": "diffusers", "token_count": 4559 }
272
# coding=utf-8 # Copyright 2022 The BAAI Teams 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/licens...
transformers/src/transformers/models/altclip/modeling_altclip.py/0
{ "file_path": "transformers/src/transformers/models/altclip/modeling_altclip.py", "repo_id": "transformers", "token_count": 33182 }
617
from langchain_community.document_loaders.polars_dataframe import PolarsDataFrameLoader __all__ = ["PolarsDataFrameLoader"]
langchain/libs/langchain/langchain/document_loaders/polars_dataframe.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/polars_dataframe.py", "repo_id": "langchain", "token_count": 36 }
513
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/mq/msgdispatcher/client_test.go/0
{ "file_path": "milvus/pkg/mq/msgdispatcher/client_test.go", "repo_id": "milvus", "token_count": 985 }
1,895
<jupyter_start><jupyter_text>Multimodal RetrievalChroma supports multimodal collections, i.e. collections which contain, and can be queried by, multiple modalities of data.This notebook shows an example of how to create and query a collection with both text and images, using Chroma's built-in features. DatasetWe us a...
chroma/examples/multimodal/multimodal_retrieval.ipynb/0
{ "file_path": "chroma/examples/multimodal/multimodal_retrieval.ipynb", "repo_id": "chroma", "token_count": 1628 }
44
python_sources()
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-faiss/llama_index/vector_stores/faiss/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-faiss/llama_index/vector_stores/faiss/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,557
[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 = ["OpenLLM", "OpenLLMAPI"] contains_example = false import_path = "llama_index.llms.openllm"...
llama_index/llama-index-integrations/llms/llama-index-llms-openllm/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openllm/pyproject.toml", "repo_id": "llama_index", "token_count": 670 }
1,311
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/kv/kv.go/0
{ "file_path": "milvus/internal/kv/kv.go", "repo_id": "milvus", "token_count": 1090 }
1,795
import torch from text_generation_server.utils.layers import ( TensorParallelEmbedding, ) class ProcessGroup: def __init__(self, rank: int, world_size: int): self._rank = rank self.world_size = world_size def size(self) -> int: return self.world_size def rank(self) -> int: ...
text-generation-inference/server/tests/utils/test_layers.py/0
{ "file_path": "text-generation-inference/server/tests/utils/test_layers.py", "repo_id": "text-generation-inference", "token_count": 1111 }
425
<jupyter_start><jupyter_text>Hippo>[Transwarp Hippo](https://www.transwarp.cn/en/subproduct/hippo) is an enterprise-level cloud-native distributed vector database that supports storage, retrieval, and management of massive vector-based datasets. It efficiently solves problems such as vector similarity search and high-d...
langchain/docs/docs/integrations/vectorstores/hippo.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/hippo.ipynb", "repo_id": "langchain", "token_count": 1857 }
176
[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 = ["FirestoreKVStore"] contains_example = false import_path = "llama_index.storage.kvstore.fi...
llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-firestore/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-firestore/pyproject.toml", "repo_id": "llama_index", "token_count": 658 }
1,466
from typing import Optional, Type from langchain.callbacks.manager import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, ) from langchain.pydantic_v1 import BaseModel, Field from langchain.tools import BaseTool from neo4j_semantic_ollama.utils import get_candidates, get_user_id, graph recommend...
langchain/templates/neo4j-semantic-ollama/neo4j_semantic_ollama/recommendation_tool.py/0
{ "file_path": "langchain/templates/neo4j-semantic-ollama/neo4j_semantic_ollama/recommendation_tool.py", "repo_id": "langchain", "token_count": 2103 }
672
#!/usr/bin/env python # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in co...
transformers/examples/legacy/run_transfo_xl.py/0
{ "file_path": "transformers/examples/legacy/run_transfo_xl.py", "repo_id": "transformers", "token_count": 2275 }
545
package proxy import ( "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/milvus-io/milvus/internal/util/funcutil" ) type cntReducer struct { collectionName string } func (r *cntReducer) Reduce(results []*internalpb.RetrieveResults) (*milvus...
milvus/internal/proxy/count_reducer.go/0
{ "file_path": "milvus/internal/proxy/count_reducer.go", "repo_id": "milvus", "token_count": 249 }
1,878
<jupyter_start><jupyter_text>Finetuner un modèle avec Keras Installez les bibliothèques 🤗 Transformers et 🤗 Datasets pour exécuter ce notebook.<jupyter_code>!pip install datasets transformers[sentencepiece] from datasets import load_dataset from transformers import AutoTokenizer, DataCollatorWithPadding import numpy ...
notebooks/course/fr/chapter3/section3_tf.ipynb/0
{ "file_path": "notebooks/course/fr/chapter3/section3_tf.ipynb", "repo_id": "notebooks", "token_count": 1107 }
311
metrics: serviceMonitor: enabled: true pulsar: bookkeeper: volumes: ledgers: existingStorageClassName: local-path zookeeper: volumes: data: existingStorageClassName: local-path kafka: metrics: kafka: enabled: true jmx: enabled: true serviceMonitor...
milvus/tests/scripts/values/nightly.yaml/0
{ "file_path": "milvus/tests/scripts/values/nightly.yaml", "repo_id": "milvus", "token_count": 151 }
2,050
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/core/src/storage/ChunkManager.h/0
{ "file_path": "milvus/internal/core/src/storage/ChunkManager.h", "repo_id": "milvus", "token_count": 1245 }
1,805
import { loadEvaluator } from "langchain/evaluation"; import { PRINCIPLES } from "langchain/chains"; import { ChatAnthropic } from "@langchain/anthropic"; const model = new ChatAnthropic(); const chain = await loadEvaluator("criteria", { criteria: PRINCIPLES.harmful1, llm: model, }); const res = await chain.eval...
langchainjs/examples/src/guides/evaluation/string/configuring_criteria_llm.ts/0
{ "file_path": "langchainjs/examples/src/guides/evaluation/string/configuring_criteria_llm.ts", "repo_id": "langchainjs", "token_count": 340 }
803
# LlamaIndex Experimental This is the experimental LlamaIndex extension to core. Experimental features and classes can be found in this package. Features that reside in this project are more volatile, but indeed can be promoted to core once they've stabilized.
llama_index/llama-index-experimental/README.md/0
{ "file_path": "llama_index/llama-index-experimental/README.md", "repo_id": "llama_index", "token_count": 54 }
1,332
# coding=utf-8 # Copyright Studio Ousia 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 # # Unless required b...
transformers/src/transformers/models/luke/configuration_luke.py/0
{ "file_path": "transformers/src/transformers/models/luke/configuration_luke.py", "repo_id": "transformers", "token_count": 2585 }
624
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-string-iterable/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,447
<jupyter_start><jupyter_text>SQL Query Engine with LlamaIndex + DuckDBThis guide showcases the core LlamaIndex SQL capabilities with DuckDB. We go through some core LlamaIndex data structures, including the `NLSQLTableQueryEngine` and `SQLTableRetrieverQueryEngine`. If you're opening this Notebook on colab, you will p...
llama_index/docs/examples/index_structs/struct_indices/duckdb_sql_query.ipynb/0
{ "file_path": "llama_index/docs/examples/index_structs/struct_indices/duckdb_sql_query.ipynb", "repo_id": "llama_index", "token_count": 2346 }
1,105
# __init__.py from llama_index.tools.openapi.base import ( OpenAPIToolSpec, ) __all__ = ["OpenAPIToolSpec"]
llama_index/llama-index-integrations/tools/llama-index-tools-openapi/llama_index/tools/openapi/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-openapi/llama_index/tools/openapi/__init__.py", "repo_id": "llama_index", "token_count": 47 }
1,494
"""Prompt display utils.""" from llama_index.core.prompts.mixin import PromptDictType # define prompt viewing function def display_prompt_dict(prompts_dict: PromptDictType) -> None: """Display prompt dict. Args: prompts_dict: prompt dict """ from IPython.display import Markdown, display ...
llama_index/llama-index-core/llama_index/core/prompts/display_utils.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/prompts/display_utils.py", "repo_id": "llama_index", "token_count": 211 }
1,238
from pathlib import Path import pytest from langchain_community.graphs import OntotextGraphDBGraph """ cd libs/community/tests/integration_tests/graphs/docker-compose-ontotext-graphdb ./start.sh """ def test_query_method_with_valid_query() -> None: graph = OntotextGraphDBGraph( query_endpoint="http://l...
langchain/libs/community/tests/integration_tests/graphs/test_ontotext_graphdb_graph.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/graphs/test_ontotext_graphdb_graph.py", "repo_id": "langchain", "token_count": 3073 }
338
kind: NetworkChaos apiVersion: chaos-mesh.org/v1alpha1 metadata: name: test-proxy-network-latency namespace: chaos-testing spec: selector: namespaces: - chaos-testing labelSelectors: app.kubernetes.io/instance: milvus-chaos component: proxy mode: all action: delay delay: latenc...
milvus/tests/python_client/chaos/chaos_objects/network_latency/chaos_proxy_network_latency.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/network_latency/chaos_proxy_network_latency.yaml", "repo_id": "milvus", "token_count": 224 }
2,022
from llama_index.core.readers.base import BaseReader from llama_index.readers.chatgpt_plugin import ChatGPTRetrievalPluginReader def test_class(): names_of_base_classes = [b.__name__ for b in ChatGPTRetrievalPluginReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-chatgpt-plugin/tests/test_readers_chatgpt_plugin.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-chatgpt-plugin/tests/test_readers_chatgpt_plugin.py", "repo_id": "llama_index", "token_count": 101 }
1,301
use super::{Cpu, CpuF16}; #[cfg(target_arch = "x86")] use core::arch::x86::*; #[cfg(target_arch = "x86_64")] use core::arch::x86_64::*; use half::f16; pub struct CurrentCpu {} const STEP: usize = 32; const EPR: usize = 8; const ARR: usize = STEP / EPR; impl Cpu<ARR> for CurrentCpu { type Unit = __m256; type...
candle/candle-core/src/cpu/avx.rs/0
{ "file_path": "candle/candle-core/src/cpu/avx.rs", "repo_id": "candle", "token_count": 2094 }
34
import { MainApi } from "@rockset/client"; import type { CreateCollectionRequest } from "@rockset/client/dist/codegen/api.d.ts"; import { Collection } from "@rockset/client/dist/codegen/api.js"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { VectorStore } from "@langchain/core/vectorst...
langchainjs/libs/langchain-community/src/vectorstores/rockset.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/rockset.ts", "repo_id": "langchainjs", "token_count": 5532 }
1,015
// 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/mq/mqimpl/rocksmq/client/client_impl.go/0
{ "file_path": "milvus/internal/mq/mqimpl/rocksmq/client/client_impl.go", "repo_id": "milvus", "token_count": 1884 }
1,731
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/api/pipelines/amused.md/0
{ "file_path": "diffusers/docs/source/en/api/pipelines/amused.md", "repo_id": "diffusers", "token_count": 771 }
176
from langchain_community.chat_models import ChatAnthropic from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain_core.pydantic_v1 import BaseModel from langchain_core.runnables import ConfigurableField from .prompts import answer_prompt from .retr...
langchain/templates/anthropic-iterative-search/anthropic_iterative_search/chain.py/0
{ "file_path": "langchain/templates/anthropic-iterative-search/anthropic_iterative_search/chain.py", "repo_id": "langchain", "token_count": 327 }
682
<jupyter_start><jupyter_text>DataFrame Structured Data Extraction This demo shows how you can extract tabular DataFrames from raw text.This was directly inspired by jxnl's dataframe example here: https://github.com/jxnl/openai_function_call/blob/main/auto_dataframe.py.We show this with different levels of complexity, a...
llama_index/docs/examples/output_parsing/df_program.ipynb/0
{ "file_path": "llama_index/docs/examples/output_parsing/df_program.ipynb", "repo_id": "llama_index", "token_count": 2310 }
1,204
# coding=utf-8 # Copyright 2023 Microsoft Research & University of Wisconsin-Madison 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 # # ...
transformers/src/transformers/models/vipllava/configuration_vipllava.py/0
{ "file_path": "transformers/src/transformers/models/vipllava/configuration_vipllava.py", "repo_id": "transformers", "token_count": 2161 }
691
{ "object": "page", "id": "7a1c25f2-d8a7-46d9-a2da-c9e39e018a56", "created_time": "2023-06-14T10:29:00.000Z", "last_edited_time": "2023-09-27T09:11:00.000Z", "created_by": { "object": "user", "id": "c9b34ba3-5b62-4aa9-aae2-ed6024ffb0fd" }, "last_edited_by": { "object": "user", "id": "c9b34...
langchainjs/langchain/src/document_loaders/tests/example_data/notion_api/notion_page_response.json/0
{ "file_path": "langchainjs/langchain/src/document_loaders/tests/example_data/notion_api/notion_page_response.json", "repo_id": "langchainjs", "token_count": 8627 }
878
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-rankgpt-rerank/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-rankgpt-rerank/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,266
import { Redis } from "ioredis"; import { BaseCache, getCacheKey, serializeGeneration, deserializeStoredGeneration, } from "@langchain/core/caches"; import { Generation } from "@langchain/core/outputs"; /** * Cache LLM results using Redis. * @example * ```typescript * const model = new ChatOpenAI({ * ca...
langchainjs/libs/langchain-community/src/caches/ioredis.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/caches/ioredis.ts", "repo_id": "langchainjs", "token_count": 957 }
934
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/proxy/interface_def.go/0
{ "file_path": "milvus/internal/proxy/interface_def.go", "repo_id": "milvus", "token_count": 434 }
2,016
//! The MNIST hand-written digit dataset. //! //! The files can be obtained from the following link: //! <http://yann.lecun.com/exdb/mnist/> use candle::{DType, Device, Error, Result, Tensor}; use hf_hub::{api::sync::Api, Repo, RepoType}; use parquet::file::reader::{FileReader, SerializedFileReader}; use std::fs::File;...
candle/candle-datasets/src/vision/mnist.rs/0
{ "file_path": "candle/candle-datasets/src/vision/mnist.rs", "repo_id": "candle", "token_count": 2129 }
37
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/agent/legacy/react/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/agent/legacy/react/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,486
"""Test Vertex AI API wrapper. Your end-user credentials would be used to make the calls (make sure you've run `gcloud auth login` first). """ import os from typing import Optional import pytest from langchain_core.outputs import LLMResult from langchain_google_vertexai.llms import VertexAI, VertexAIModelGarden mo...
langchain/libs/partners/google-vertexai/tests/integration_tests/test_llms.py/0
{ "file_path": "langchain/libs/partners/google-vertexai/tests/integration_tests/test_llms.py", "repo_id": "langchain", "token_count": 2484 }
688
import { test } from "@jest/globals"; import { OpenAIModerationChain } from "../openai_moderation.js"; test("OpenAI Moderation Test", async () => { const badString = "I hate myself and want to do harm to myself"; const goodString = "The cat (Felis catus) is a domestic species of small carnivorous mammal."; ...
langchainjs/langchain/src/chains/tests/openai_moderation.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/chains/tests/openai_moderation.int.test.ts", "repo_id": "langchainjs", "token_count": 798 }
962
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-packs/llama-index-packs-timescale-vector-autoretrieval/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-timescale-vector-autoretrieval/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,612
[tool.poetry] name = "langchain-experimental" version = "0.0.51" description = "Building applications with LLMs through composability" authors = [] license = "MIT" readme = "README.md" repository = "https://github.com/langchain-ai/langchain" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain-core = "^0.1.16...
langchain/libs/experimental/pyproject.toml/0
{ "file_path": "langchain/libs/experimental/pyproject.toml", "repo_id": "langchain", "token_count": 1414 }
426
from __future__ import annotations import logging import os from typing import Any, Callable, Dict, List, Mapping, Optional, Union import openai from langchain_core.pydantic_v1 import Field, SecretStr, root_validator from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env from langchain_openai.l...
langchain/libs/partners/openai/langchain_openai/llms/azure.py/0
{ "file_path": "langchain/libs/partners/openai/langchain_openai/llms/azure.py", "repo_id": "langchain", "token_count": 3432 }
660
# Sprint Dreambooth en Keras Cette paget résume toutes les informations pertinentes requises pour l'événement. 📋. ## Introduction Dreambooth est une technique de *finetuning* permettant d'enseigner de nouveaux concepts visuels à des modèles de diffusion conditionnés par le texte en utilisant seulement 3 à 5 images....
diffusion-models-class/units/fr/events/3.mdx/0
{ "file_path": "diffusion-models-class/units/fr/events/3.mdx", "repo_id": "diffusion-models-class", "token_count": 4273 }
289
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ja/testing.md/0
{ "file_path": "transformers/docs/source/ja/testing.md", "repo_id": "transformers", "token_count": 22732 }
537
# DocArray > [DocArray](https://docarray.jina.ai/) is a library for nested, unstructured, multimodal data in transit, > including text, image, audio, video, 3D mesh, etc. It allows deep-learning engineers to efficiently process, > embed, search, recommend, store, and transfer multimodal data with a Pythonic API. #...
langchain/docs/docs/integrations/providers/docarray.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/docarray.mdx", "repo_id": "langchain", "token_count": 249 }
134
apiVersion: chaos-mesh.org/v1alpha1 kind: PodChaos metadata: name: test-rootcoord-pod-failure namespace: chaos-testing spec: selector: namespaces: - chaos-testing labelSelectors: app.kubernetes.io/instance: milvus-chaos component: rootcoord mode: fixed value: "1" action: pod-failur...
milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_rootcoord_pod_failure.yaml/0
{ "file_path": "milvus/tests/python_client/chaos/chaos_objects/pod_failure/chaos_rootcoord_pod_failure.yaml", "repo_id": "milvus", "token_count": 141 }
2,026
from typing import Any, Dict, List, Mapping, Optional import requests from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, Extra, SecretStr, root_validator from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env from requests.adapters import HTTPAdapte...
langchain/libs/community/langchain_community/embeddings/embaas.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/embaas.py", "repo_id": "langchain", "token_count": 2322 }
269
# LlamaIndex Readers Integration: Elasticsearch
llama_index/llama-index-integrations/readers/llama-index-readers-elasticsearch/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-elasticsearch/README.md", "repo_id": "llama_index", "token_count": 10 }
1,341
# 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/lora/test_lora_layers_peft.py/0
{ "file_path": "diffusers/tests/lora/test_lora_layers_peft.py", "repo_id": "diffusers", "token_count": 46712 }
269
import pytest @pytest.fixture(scope="module") def idefics_handle(launcher): with launcher( "HuggingFaceM4/idefics-9b-instruct", num_shard=2, dtype="float16" ) as handle: yield handle @pytest.fixture(scope="module") async def idefics(idefics_handle): await idefics_handle.health(300) r...
text-generation-inference/integration-tests/models/test_idefics.py/0
{ "file_path": "text-generation-inference/integration-tests/models/test_idefics.py", "repo_id": "text-generation-inference", "token_count": 552 }
370
<!--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/model_doc/dialogpt.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/dialogpt.md", "repo_id": "transformers", "token_count": 1571 }
549
# Jaguar This page describes how to use Jaguar vector database within LangChain. It contains three sections: introduction, installation and setup, and Jaguar API. ## Introduction Jaguar vector database has the following characteristics: 1. It is a distributed vector database 2. The “ZeroMove” feature of JaguarDB e...
langchain/docs/docs/integrations/providers/jaguar.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/jaguar.mdx", "repo_id": "langchain", "token_count": 517 }
149
<jupyter_start><jupyter_text>Arxiv>[arXiv](https://arxiv.org/) is an open-access archive for 2 million scholarly articles in the fields of physics, mathematics, computer science, quantitative biology, quantitative finance, statistics, electrical engineering and systems science, and economics.This notebook shows how to ...
langchain/docs/docs/integrations/document_loaders/arxiv.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/arxiv.ipynb", "repo_id": "langchain", "token_count": 445 }
93
def test_version_available() -> None: """Test that a version is available.""" from langserve import __version__ # noqa: F401
langserve/tests/unit_tests/test_version.py/0
{ "file_path": "langserve/tests/unit_tests/test_version.py", "repo_id": "langserve", "token_count": 43 }
1,092
from langchain_community.tools.slack.schedule_message import ( ScheduleMessageSchema, SlackScheduleMessage, ) __all__ = ["ScheduleMessageSchema", "SlackScheduleMessage"]
langchain/libs/langchain/langchain/tools/slack/schedule_message.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/slack/schedule_message.py", "repo_id": "langchain", "token_count": 58 }
560
<jupyter_start><jupyter_text>Huggingface TextGen Inference[Text Generation Inference](https://github.com/huggingface/text-generation-inference) is a Rust, Python and gRPC server for text generation inference. Used in production at [HuggingFace](https://huggingface.co/) to power LLMs api-inference widgets.This notebooks...
langchain/docs/docs/integrations/llms/huggingface_textgen_inference.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/huggingface_textgen_inference.ipynb", "repo_id": "langchain", "token_count": 485 }
119
search_performance: collections: - milvus: db_config.primary_path: /test/milvus/db_data_7/not_exist cache_config.cpu_cache_capacity: 64 engine_config.use_blas_threshold: 0 engine_config.gpu_search_threshold: 200 gpu_resource_config.enable: true gpu_resource_co...
milvus/tests/benchmark/milvus_benchmark/suites/clean.yaml/0
{ "file_path": "milvus/tests/benchmark/milvus_benchmark/suites/clean.yaml", "repo_id": "milvus", "token_count": 356 }
1,870
{ "input_variables": ["foo"], "template": "This is a {foo} test." }
langchain/libs/core/tests/unit_tests/data/prompts/simple_prompt.json/0
{ "file_path": "langchain/libs/core/tests/unit_tests/data/prompts/simple_prompt.json", "repo_id": "langchain", "token_count": 28 }
435
from typing import Optional from llama_index.core.storage.index_store.keyval_index_store import KVIndexStore from llama_index.core.storage.kvstore.postgres_kvstore import PostgresKVStore class PostgresIndexStore(KVIndexStore): """Mongo Index store. Args: mongo_kvstore (MongoDBKVStore): MongoDB key-v...
llama_index/llama-index-core/llama_index/core/storage/index_store/postgres_index_store.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/storage/index_store/postgres_index_store.py", "repo_id": "llama_index", "token_count": 1073 }
1,209
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datacoord/channel_checker.go/0
{ "file_path": "milvus/internal/datacoord/channel_checker.go", "repo_id": "milvus", "token_count": 2635 }
1,909
package proxy import ( "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/milvus-io/milvus/internal/util/funcutil" ) func Test_cntReducer_Reduce(t *testing.T) { t.Run("invalid", func(t *testi...
milvus/internal/proxy/count_reducer_test.go/0
{ "file_path": "milvus/internal/proxy/count_reducer_test.go", "repo_id": "milvus", "token_count": 446 }
1,844
## init from llama_index.tools.yahoo_finance.base import ( YahooFinanceToolSpec, ) __all__ = ["YahooFinanceToolSpec"]
llama_index/llama-index-integrations/tools/llama-index-tools-yahoo-finance/llama_index/tools/yahoo_finance/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-yahoo-finance/llama_index/tools/yahoo_finance/__init__.py", "repo_id": "llama_index", "token_count": 46 }
1,508
import { collections } from "$lib/server/database"; import { ObjectId } from "mongodb"; import type { LayoutServerLoad } from "./$types"; export const load = (async ({ locals, parent }) => { const { settings } = await parent(); // find assistants matching the settings assistants const assistants = await collection...
chat-ui/src/routes/settings/+layout.server.ts/0
{ "file_path": "chat-ui/src/routes/settings/+layout.server.ts", "repo_id": "chat-ui", "token_count": 329 }
119
"""Test composing indices.""" from typing import Dict, List from llama_index.legacy.indices.composability.graph import ComposableGraph from llama_index.legacy.indices.keyword_table.simple_base import ( SimpleKeywordTableIndex, ) from llama_index.legacy.indices.list.base import SummaryIndex from llama_index.legacy...
llama_index/llama-index-legacy/tests/indices/query/test_compose.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/indices/query/test_compose.py", "repo_id": "llama_index", "token_count": 2613 }
1,737
# coding=utf-8 # Copyright 2022 Microsoft Research, Inc. and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lice...
transformers/src/transformers/models/resnet/modeling_tf_resnet.py/0
{ "file_path": "transformers/src/transformers/models/resnet/modeling_tf_resnet.py", "repo_id": "transformers", "token_count": 10058 }
662
import { ChatOpenAI } from "@langchain/openai"; import { RunnableSequence } from "@langchain/core/runnables"; import { AgentExecutor, type AgentStep } from "langchain/agents"; import { formatToOpenAIFunctionMessages } from "langchain/agents/format_scratchpad"; import { ChatPromptTemplate, MessagesPlaceholder, } fro...
langchainjs/examples/src/agents/custom_agent.ts/0
{ "file_path": "langchainjs/examples/src/agents/custom_agent.ts", "repo_id": "langchainjs", "token_count": 1288 }
838
import { LLMChain } from "langchain/chains"; import { OpenAI } from "@langchain/openai"; import { PromptTemplate } from "@langchain/core/prompts"; const chain = new LLMChain({ llm: new OpenAI({ temperature: 0 }), prompt: PromptTemplate.fromTemplate("Hello, world!"), // This will enable logging of all Chain *and*...
langchainjs/examples/src/callbacks/docs_verbose.ts/0
{ "file_path": "langchainjs/examples/src/callbacks/docs_verbose.ts", "repo_id": "langchainjs", "token_count": 113 }
843
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/metrics/datacoord_metrics.go/0
{ "file_path": "milvus/pkg/metrics/datacoord_metrics.go", "repo_id": "milvus", "token_count": 4042 }
1,819
--- hide_table_of_contents: true sidebar_class_name: hidden --- import CodeBlock from "@theme/CodeBlock"; # Structured Output with OpenAI functions :::tip Compatibility Must be used with an [OpenAI functions](https://platform.openai.com/docs/guides/gpt/function-calling) model. ::: This example shows how to leverage...
langchainjs/docs/core_docs/docs/modules/chains/popular/structured_output.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/chains/popular/structured_output.mdx", "repo_id": "langchainjs", "token_count": 555 }
754
use candle::{DType, IndexOp, Result, Tensor, D}; use candle_nn::{batch_norm, conv2d, conv2d_no_bias, Conv2d, Conv2dConfig, Module, VarBuilder}; #[derive(Clone, Copy, PartialEq, Debug)] pub struct Multiples { depth: f64, width: f64, ratio: f64, } impl Multiples { pub fn n() -> Self { Self { ...
candle/candle-examples/examples/yolo-v8/model.rs/0
{ "file_path": "candle/candle-examples/examples/yolo-v8/model.rs", "repo_id": "candle", "token_count": 12422 }
49
import type { StructuredToolInterface, ToolInterface, } from "@langchain/core/tools"; import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { CallbackManager, Callbacks } from "@langchain/core/callbacks/manager"; import { BasePromptTemplate } from "@langchain/core/prompts"; ...
langchainjs/langchain/src/agents/agent.ts/0
{ "file_path": "langchainjs/langchain/src/agents/agent.ts", "repo_id": "langchainjs", "token_count": 4592 }
940