text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datanode/channel_manager_test.go/0
{ "file_path": "milvus/internal/datanode/channel_manager_test.go", "repo_id": "milvus", "token_count": 2135 }
1,919
// 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/metrics.go/0
{ "file_path": "milvus/pkg/metrics/metrics.go", "repo_id": "milvus", "token_count": 1750 }
1,916
<jupyter_start><jupyter_text>OpenAI Assistant Advanced Retrieval CookbookIn this notebook, we try out OpenAI Assistant API for advanced retrieval tasks, by plugging in a variety of query engine tools and datasets. The wrapper abstraction we use is our `OpenAIAssistantAgent` class, which allows us to plug in custom tool...
llama_index/docs/examples/agent/openai_assistant_query_cookbook.ipynb/0
{ "file_path": "llama_index/docs/examples/agent/openai_assistant_query_cookbook.ipynb", "repo_id": "llama_index", "token_count": 5556 }
1,069
// 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/util/funcutil/parallel_test.go/0
{ "file_path": "milvus/pkg/util/funcutil/parallel_test.go", "repo_id": "milvus", "token_count": 1343 }
2,105
"""Get evaluation utils. NOTE: These are beta functions, might change. """ import asyncio from collections import defaultdict from typing import Any, List, Optional, Tuple import numpy as np import pandas as pd from llama_index.legacy.async_utils import asyncio_module from llama_index.legacy.core.base_query_engine...
llama_index/llama-index-legacy/llama_index/legacy/evaluation/eval_utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/evaluation/eval_utils.py", "repo_id": "llama_index", "token_count": 813 }
1,704
"""Tests for the Google Cloud DocAI parser.""" from unittest.mock import ANY, patch import pytest from langchain_community.document_loaders.parsers import DocAIParser @pytest.mark.requires("google.cloud", "google.cloud.documentai") def test_docai_parser_valid_processor_name() -> None: processor_name = "projects...
langchain/libs/community/tests/integration_tests/document_loaders/parsers/test_docai.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/parsers/test_docai.py", "repo_id": "langchain", "token_count": 398 }
321
# 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/tvlt/processing_tvlt.py/0
{ "file_path": "transformers/src/transformers/models/tvlt/processing_tvlt.py", "repo_id": "transformers", "token_count": 1327 }
741
from langchain_core.tracers.schemas import ( BaseRun, ChainRun, LLMRun, Run, RunTypeEnum, ToolRun, TracerSession, TracerSessionBase, TracerSessionV1, TracerSessionV1Base, TracerSessionV1Create, ) __all__ = [ "BaseRun", "ChainRun", "LLMRun", "Run", "RunTyp...
langchain/libs/langchain/langchain/callbacks/tracers/schemas.py/0
{ "file_path": "langchain/libs/langchain/langchain/callbacks/tracers/schemas.py", "repo_id": "langchain", "token_count": 223 }
460
import { WikipediaQueryRun } from "@langchain/community/tools/wikipedia_query_run"; const tool = new WikipediaQueryRun({ topKResults: 3, maxDocContentLength: 4000, }); const res = await tool.call("Langchain"); console.log(res);
langchainjs/examples/src/tools/wikipedia.ts/0
{ "file_path": "langchainjs/examples/src/tools/wikipedia.ts", "repo_id": "langchainjs", "token_count": 73 }
824
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "vectorstores/supabase", }); export * from "@langchain/community/vectorstores/supabase";
langchainjs/langchain/src/vectorstores/supabase.ts/0
{ "file_path": "langchainjs/langchain/src/vectorstores/supabase.ts", "repo_id": "langchainjs", "token_count": 72 }
938
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js"; /* #__PURE__ */ logVersion010MigrationWarning({ oldEntrypointName: "embeddings/cloudflare_workersai", newEntrypointName: "", newPackageName: "@langchain/cloudflare", }); export * from "@langchain/community/embeddings/cloudflare_wo...
langchainjs/langchain/src/embeddings/cloudflare_workersai.ts/0
{ "file_path": "langchainjs/langchain/src/embeddings/cloudflare_workersai.ts", "repo_id": "langchainjs", "token_count": 105 }
874
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-kaltura/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-kaltura/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,467
"""[DEPRECATED] Zapier Toolkit.""" from typing import List from langchain_core._api import warn_deprecated from langchain_community.agent_toolkits.base import BaseToolkit from langchain_community.tools import BaseTool from langchain_community.tools.zapier.tool import ZapierNLARunAction from langchain_community.utilit...
langchain/libs/community/langchain_community/agent_toolkits/zapier/toolkit.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/zapier/toolkit.py", "repo_id": "langchain", "token_count": 914 }
234
"""Chroma Reader.""" from typing import Any, List, Optional, Union from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document class ChromaReader(BaseReader): """Chroma reader. Retrieve documents from existing persisted Chroma collections. Args: collection...
llama_index/llama-index-integrations/readers/llama-index-readers-chroma/llama_index/readers/chroma/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-chroma/llama_index/readers/chroma/base.py", "repo_id": "llama_index", "token_count": 1775 }
1,302
// 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/index/ScalarIndexSort.h/0
{ "file_path": "milvus/internal/core/src/index/ScalarIndexSort.h", "repo_id": "milvus", "token_count": 1430 }
1,787
# This configures KinD to spin up a k8s cluster with trustworthy jwt (Service Account Token Volume Projection) feature. kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 networking: ipFamily: "ipv4" kubeProxyMode: "iptables" podSubnet: "10.247.0.0/16" serviceSubnet: "10.248.0.0/16" nodes: - role: control-plane -...
milvus/build/config/topology/trustworthy-jwt.yaml/0
{ "file_path": "milvus/build/config/topology/trustworthy-jwt.yaml", "repo_id": "milvus", "token_count": 571 }
1,713
// 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/local_worker.go/0
{ "file_path": "milvus/internal/querynodev2/local_worker.go", "repo_id": "milvus", "token_count": 852 }
1,770
""" Logging helpers Hacked together by / Copyright 2020 Ross Wightman """ import logging import logging.handlers class FormatterNoInfo(logging.Formatter): def __init__(self, fmt='%(levelname)s: %(message)s'): logging.Formatter.__init__(self, fmt) def format(self, record): if record.levelno =...
pytorch-image-models/timm/utils/log.py/0
{ "file_path": "pytorch-image-models/timm/utils/log.py", "repo_id": "pytorch-image-models", "token_count": 383 }
354
# LlamaIndex Vector Stores Integration: Docarray
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-docarray/README.md/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-docarray/README.md", "repo_id": "llama_index", "token_count": 11 }
1,523
# This file is autogenerated by the command `make fix-copies`, do not edit. from ..utils import DummyObject, requires_backends class AlbertTokenizerFast(metaclass=DummyObject): _backends = ["tokenizers"] def __init__(self, *args, **kwargs): requires_backends(self, ["tokenizers"]) class BartTokenize...
transformers/src/transformers/utils/dummy_tokenizers_objects.py/0
{ "file_path": "transformers/src/transformers/utils/dummy_tokenizers_objects.py", "repo_id": "transformers", "token_count": 4238 }
736
<jupyter_start><jupyter_text>Weather>[OpenWeatherMap](https://openweathermap.org/) is an open-source weather service providerThis loader fetches the weather data from the OpenWeatherMap's OneCall API, using the pyowm Python package. You must initialize the loader with your OpenWeatherMap API token and the names of the ...
langchain/docs/docs/integrations/document_loaders/weather.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/weather.ipynb", "repo_id": "langchain", "token_count": 242 }
112
## java_client
milvus/tests/java_client/README.md/0
{ "file_path": "milvus/tests/java_client/README.md", "repo_id": "milvus", "token_count": 4 }
1,889
import { z } from "zod"; import { GmailBaseTool, GmailBaseToolParams } from "./base.js"; import { CREATE_DRAFT_DESCRIPTION } from "./descriptions.js"; export class GmailCreateDraft extends GmailBaseTool { name = "create_gmail_draft"; schema = z.object({ message: z.string(), to: z.array(z.string()), su...
langchainjs/libs/langchain-community/src/tools/gmail/create_draft.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/tools/gmail/create_draft.ts", "repo_id": "langchainjs", "token_count": 660 }
1,039
// Copyright 2019 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
milvus/pkg/log/config.go/0
{ "file_path": "milvus/pkg/log/config.go", "repo_id": "milvus", "token_count": 1256 }
1,893
#!/bin/bash namespace="default" root_path="by-dev" operation="migrate" image_tag="milvusdb/milvus:v2.2.0" meta_migration_pod_tag="milvusdb/meta-migration:v2.2.0-bugfix-20230112" remove_migrate_pod_after_migrate="false" storage_class="" external_etcd_svc="" etcd_svc="" #-n namespace: The namespace that Milvus is insta...
milvus/deployments/migrate-meta/migrate.sh/0
{ "file_path": "milvus/deployments/migrate-meta/migrate.sh", "repo_id": "milvus", "token_count": 6225 }
1,626
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/x_clip/test_modeling_x_clip.py/0
{ "file_path": "transformers/tests/models/x_clip/test_modeling_x_clip.py", "repo_id": "transformers", "token_count": 12605 }
834
from typing import Any, Iterable, List, Optional, Tuple from uuid import uuid4 import numpy as np import requests from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.utils import get_from_env from langchain_core.vectorstores import VectorStore from langch...
langchain/libs/community/langchain_community/vectorstores/semadb.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/semadb.py", "repo_id": "langchain", "token_count": 4550 }
329
package storage // Option for setting params used by chunk manager client. type config struct { address string bucketName string accessKeyID string secretAccessKeyID string useSSL bool createBucket bool rootPath string useIAM bool cloudProvider st...
milvus/internal/storage/options.go/0
{ "file_path": "milvus/internal/storage/options.go", "repo_id": "milvus", "token_count": 728 }
1,890
<!--- Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
transformers/docs/source/es/installation.md/0
{ "file_path": "transformers/docs/source/es/installation.md", "repo_id": "transformers", "token_count": 3629 }
514
# coding=utf-8 # Copyright 2021 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
transformers/tests/models/speech_to_text/test_feature_extraction_speech_to_text.py/0
{ "file_path": "transformers/tests/models/speech_to_text/test_feature_extraction_speech_to_text.py", "repo_id": "transformers", "token_count": 6315 }
736
from __future__ import annotations import logging from typing import Any, Dict, Optional from langchain_core.callbacks import CallbackManagerForToolRun from langchain_core.pydantic_v1 import root_validator from langchain_core.tools import BaseTool from langchain_core.utils import get_from_dict_or_env logger = loggin...
langchain/libs/community/langchain_community/tools/azure_cognitive_services/text_analytics_health.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/azure_cognitive_services/text_analytics_health.py", "repo_id": "langchain", "token_count": 1541 }
282
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/blip/test_modeling_blip.py/0
{ "file_path": "transformers/tests/models/blip/test_modeling_blip.py", "repo_id": "transformers", "token_count": 24002 }
750
<jupyter_start><jupyter_text>Huggingface Sagemaker - Vision Transformer Image Classification with the `google/vit` on `cifar10` 1. [Introduction](Introduction) 2. [Development Environment and Permissions](Development-Environment-and-Permissions) 1. [Installation](Installation) 3. [Permissions](Permissions)3. ...
notebooks/sagemaker/09_image_classification_vision_transformer/sagemaker-notebook.ipynb/0
{ "file_path": "notebooks/sagemaker/09_image_classification_vision_transformer/sagemaker-notebook.ipynb", "repo_id": "notebooks", "token_count": 2887 }
308
# 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/auto/modeling_tf_auto.py/0
{ "file_path": "transformers/src/transformers/models/auto/modeling_tf_auto.py", "repo_id": "transformers", "token_count": 12149 }
643
from langchain_exa import ExaSearchResults def test_search_tool() -> None: tool = ExaSearchResults() res = tool.invoke({"query": "best time to visit japan", "num_results": 5}) print(res) # noqa: T201 assert not isinstance(res, str) # str means error for this tool\
langchain/libs/partners/exa/tests/integration_tests/test_search_tool.py/0
{ "file_path": "langchain/libs/partners/exa/tests/integration_tests/test_search_tool.py", "repo_id": "langchain", "token_count": 100 }
663
import { test, expect } from "@jest/globals"; import { StringOutputParser } from "@langchain/core/output_parsers"; import { OpenAI } from "@langchain/openai"; import { PromptTemplate } from "@langchain/core/prompts"; import { PythonInterpreterTool } from "../pyinterpreter.js"; describe("Python Interpreter testsuite", ...
langchainjs/langchain/src/experimental/tools/tests/pyinterpreter.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/tools/tests/pyinterpreter.int.test.ts", "repo_id": "langchainjs", "token_count": 316 }
887
import DocCardList from "@theme/DocCardList"; # Evaluation Building applications with language models involves many moving parts. One of the most critical components is ensuring that the outcomes produced by your models are reliable and useful across a broad array of inputs, and that they work well with your applicat...
langchain/docs/docs/guides/evaluation/index.mdx/0
{ "file_path": "langchain/docs/docs/guides/evaluation/index.mdx", "repo_id": "langchain", "token_count": 796 }
93
from llama_index.core.base.embeddings.base import BaseEmbedding from llama_index.embeddings.bedrock import BedrockEmbedding def test_class(): names_of_base_classes = [b.__name__ for b in BedrockEmbedding.__mro__] assert BaseEmbedding.__name__ in names_of_base_classes
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/tests/test_bedrock_embedding.py/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/tests/test_bedrock_embedding.py", "repo_id": "llama_index", "token_count": 100 }
1,355
""" GitHub repository collaborators reader. Retrieves the list of collaborators in a GitHub repository and converts them to documents. Each collaborator is converted to a document by doing the following: - The text of the document is the login. - The title of the document is also the login. - The extra_i...
llama_index/llama-index-integrations/readers/llama-index-readers-github/llama_index/readers/github/collaborators/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-github/llama_index/readers/github/collaborators/base.py", "repo_id": "llama_index", "token_count": 2569 }
1,370
package tencent import ( "fmt" "github.com/cockroachdb/errors" "github.com/minio/minio-go/v7" minioCred "github.com/minio/minio-go/v7/pkg/credentials" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" ) // NewMinioClient returns a minio.Client which is compatible for tencent OSS func NewMinioCli...
milvus/internal/storage/tencent/tencent.go/0
{ "file_path": "milvus/internal/storage/tencent/tencent.go", "repo_id": "milvus", "token_count": 924 }
1,865
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-awadb/llama_index/readers/awadb/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-awadb/llama_index/readers/awadb/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,467
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datanode/metacache/storagev2_cache.go/0
{ "file_path": "milvus/internal/datanode/metacache/storagev2_cache.go", "repo_id": "milvus", "token_count": 734 }
1,806
--- sidebar_class_name: node-only --- import CodeBlock from "@theme/CodeBlock"; # Rockset [Rockset](https://rockset.com) is a real-time analyitics SQL database that runs in the cloud. Rockset provides vector search capabilities, in the form of [SQL functions](https://rockset.com/docs/vector-functions/#vector-distanc...
langchainjs/docs/core_docs/docs/integrations/vectorstores/rockset.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/rockset.mdx", "repo_id": "langchainjs", "token_count": 279 }
730
import type { Config } from "@jest/types"; const config: Config.InitialOptions = { preset: "ts-jest", testEnvironment: "node", clearMocks: true, collectCoverage: false, testTimeout: 15000, coverageDirectory: "./test/coverage", coverageReporters: ["json", "html", "lcov"], collectCoverageFrom: [ "./s...
chroma/clients/js/jest.config.ts/0
{ "file_path": "chroma/clients/js/jest.config.ts", "repo_id": "chroma", "token_count": 181 }
33
from __future__ import annotations import logging import uuid from typing import Any, Iterable, List, Optional, Tuple from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.vectorstores import VectorStore from langchain_community.vectorstores.utils import D...
langchain/libs/community/langchain_community/vectorstores/kdbai.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/kdbai.py", "repo_id": "langchain", "token_count": 4228 }
337
// 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/session.go/0
{ "file_path": "milvus/internal/datacoord/session.go", "repo_id": "milvus", "token_count": 738 }
1,797
from langchain.agents.openai_assistant.base import OpenAIAssistantRunnable __all__ = ["OpenAIAssistantRunnable"]
langchain/libs/langchain/langchain/agents/openai_assistant/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/openai_assistant/__init__.py", "repo_id": "langchain", "token_count": 39 }
442
# coding=utf-8 # Copyright 2023 The HuggingFace Team and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
transformers/src/transformers/models/fastspeech2_conformer/tokenization_fastspeech2_conformer.py/0
{ "file_path": "transformers/src/transformers/models/fastspeech2_conformer/tokenization_fastspeech2_conformer.py", "repo_id": "transformers", "token_count": 2855 }
671
from langchain_community.graphs.arangodb_graph import ArangoGraph, get_arangodb_client __all__ = [ "ArangoGraph", "get_arangodb_client", ]
langchain/libs/langchain/langchain/graphs/arangodb_graph.py/0
{ "file_path": "langchain/libs/langchain/langchain/graphs/arangodb_graph.py", "repo_id": "langchain", "token_count": 61 }
505
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/tasks/visual_question_answering.md/0
{ "file_path": "transformers/docs/source/en/tasks/visual_question_answering.md", "repo_id": "transformers", "token_count": 4862 }
475
import { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base"; import { AsyncCaller, AsyncCallerCallOptions, } from "@langchain/core/utils/async_caller"; import { GenerationChunk } from "@langchain/core/outputs"; import type { GoogleVertexAIBaseLLMInput, GoogleVertexAIBasePrediction, Goo...
langchainjs/libs/langchain-community/src/utils/googlevertexai-connection.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/utils/googlevertexai-connection.ts", "repo_id": "langchainjs", "token_count": 4414 }
1,045
# notebooks Notebooks using the Hugging Face libraries 🤗
notebooks/README.md/0
{ "file_path": "notebooks/README.md", "repo_id": "notebooks", "token_count": 15 }
282
package console import ( "testing" ) func TestSuccess(t *testing.T) { Success("success") } func TestError(t *testing.T) { Error("error") } func TestWarning(t *testing.T) { Warning("warning") } func TestExitIf(t *testing.T) { ExitIf(nil) }
milvus/cmd/tools/migration/console/console_test.go/0
{ "file_path": "milvus/cmd/tools/migration/console/console_test.go", "repo_id": "milvus", "token_count": 100 }
1,842
python_tests()
llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-dashscope/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-dashscope/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,308
python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/multi_modal_llms/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/multi_modal_llms/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,540
# coding=utf-8 # Copyright 2020 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/utils/check_repo.py/0
{ "file_path": "transformers/utils/check_repo.py", "repo_id": "transformers", "token_count": 19261 }
776
from pathlib import Path from langchain_community.document_loaders import WhatsAppChatLoader def test_whatsapp_chat_loader() -> None: """Test WhatsAppChatLoader.""" file_path = Path(__file__).parent.parent / "examples" / "whatsapp_chat.txt" loader = WhatsAppChatLoader(str(file_path)) docs = loader.lo...
langchain/libs/community/tests/integration_tests/document_loaders/test_whatsapp_chat.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_whatsapp_chat.py", "repo_id": "langchain", "token_count": 416 }
359
import CodeBlock from "@theme/CodeBlock"; # CloseVector :::tip Compatibility available on both browser and Node.js ::: [CloseVector](https://closevector.getmegaportal.com/) is a cross-platform vector database that can run in both the browser and Node.js. For example, you can create your index on Node.js and then loa...
langchainjs/docs/core_docs/docs/integrations/vectorstores/closevector.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/vectorstores/closevector.mdx", "repo_id": "langchainjs", "token_count": 567 }
794
from typing import TYPE_CHECKING from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_transformers_available, is_transformers_version, ) _dummy_objects = {} _import_structure = {} try: if not (is_transformers_available() and is...
diffusers/src/diffusers/pipelines/audioldm/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/audioldm/__init__.py", "repo_id": "diffusers", "token_count": 581 }
250
import logging from typing import Callable, List, Optional, cast from nltk.stem import PorterStemmer from llama_index.legacy.callbacks.base import CallbackManager from llama_index.legacy.constants import DEFAULT_SIMILARITY_TOP_K from llama_index.legacy.core.base_retriever import BaseRetriever from llama_index.legacy....
llama_index/llama-index-legacy/llama_index/legacy/retrievers/bm25_retriever.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/retrievers/bm25_retriever.py", "repo_id": "llama_index", "token_count": 1621 }
1,599
"""DashScope api utils.""" from http import HTTPStatus from typing import Any, Dict, List, Sequence from llama_index.legacy.core.llms.types import ( ChatMessage, ChatResponse, CompletionResponse, ) def dashscope_response_to_completion_response( response: Any, stream: bool = False ) -> CompletionResp...
llama_index/llama-index-legacy/llama_index/legacy/llms/dashscope_utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/dashscope_utils.py", "repo_id": "llama_index", "token_count": 522 }
1,586
import argparse import json import os import tensorstore as ts import torch from flax import serialization from flax.traverse_util import flatten_dict, unflatten_dict from tensorflow.io import gfile from transformers.modeling_utils import dtype_byte_size from transformers.models.switch_transformers.convert_switch_tra...
transformers/src/transformers/models/switch_transformers/convert_big_switch.py/0
{ "file_path": "transformers/src/transformers/models/switch_transformers/convert_big_switch.py", "repo_id": "transformers", "token_count": 3229 }
684
import itertools import json import linecache import os import pickle import re import socket import string from collections import Counter from logging import getLogger from pathlib import Path from typing import Callable, Dict, Iterable, List import git import torch from torch.utils.data import Dataset from transfo...
transformers/examples/research_projects/rag-end2end-retriever/utils_rag.py/0
{ "file_path": "transformers/examples/research_projects/rag-end2end-retriever/utils_rag.py", "repo_id": "transformers", "token_count": 3495 }
598
import { Serializable } from "./load/serializable.js"; /** @deprecated For backwards compatibility only. Remove on next minor version upgrade. */ export interface BaseStoreInterface<K, V> { /** * Method to get multiple values for a set of keys. * @param {K[]} keys - An array of keys. * @returns {Promise<(V ...
langchainjs/langchain-core/src/stores.ts/0
{ "file_path": "langchainjs/langchain-core/src/stores.ts", "repo_id": "langchainjs", "token_count": 798 }
882
from langchain_core.tracers.root_listeners import RootListenersTracer __all__ = ["RootListenersTracer"]
langchain/libs/langchain/langchain/schema/callbacks/tracers/root_listeners.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/callbacks/tracers/root_listeners.py", "repo_id": "langchain", "token_count": 33 }
575
# Language models in RL ## LMs encode useful knowledge for agents **Language models** (LMs) can exhibit impressive abilities when manipulating text such as question-answering or even step-by-step reasoning. Additionally, their training on massive text corpora allowed them to **encode various types of knowledge includi...
deep-rl-class/units/en/unitbonus3/language-models.mdx/0
{ "file_path": "deep-rl-class/units/en/unitbonus3/language-models.mdx", "repo_id": "deep-rl-class", "token_count": 1011 }
177
import re import sys import tempfile import unittest from pathlib import Path import pytest import yaml from huggingface_hub import DatasetCard, DatasetCardData from datasets.config import METADATA_CONFIGS_FIELD from datasets.info import DatasetInfo from datasets.utils.metadata import MetadataConfigs def _dedent(st...
datasets/tests/test_metadata_util.py/0
{ "file_path": "datasets/tests/test_metadata_util.py", "repo_id": "datasets", "token_count": 5453 }
149
#include "compat.cuh" __forceinline__ __device__ half2 dot22_8(half2(&dq)[4], const half* a_ptr, const half2 g_result) { half2 result = {}; const half2* a2_ptr = (const half2*)a_ptr; #pragma unroll for (int i = 0; i < 4; i++) result = __hfma2(dq[i], *a2_ptr++, result); return __hadd2(result, g_resu...
text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_gemm_kernel_gptq.cuh/0
{ "file_path": "text-generation-inference/server/exllamav2_kernels/exllamav2_kernels/cuda/q_gemm_kernel_gptq.cuh", "repo_id": "text-generation-inference", "token_count": 4839 }
439
<jupyter_start><jupyter_text>Figma>[Figma](https://www.figma.com/) is a collaborative web application for interface design.This notebook covers how to load data from the `Figma` REST API into a format that can be ingested into LangChain, along with example usage for code generation.<jupyter_code>import os from langcha...
langchain/docs/docs/integrations/document_loaders/figma.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/figma.ipynb", "repo_id": "langchain", "token_count": 956 }
102
import { LLM, type BaseLLMParams } from "@langchain/core/language_models/llms"; import { getEnvironmentVariable } from "@langchain/core/utils/env"; import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { GenerationChunk } from "@langchain/core/outputs"; import { convertEventStreamToItera...
langchainjs/libs/langchain-cloudflare/src/llms.ts/0
{ "file_path": "langchainjs/libs/langchain-cloudflare/src/llms.ts", "repo_id": "langchainjs", "token_count": 2057 }
988
services: db: image: pgvector/pgvector:pg16 ports: - 5433:5432 volumes: - ./data:/var/lib/postgresql/data environment: - POSTGRES_PASSWORD=ChangeMe - POSTGRES_USER=myuser - POSTGRES_DB=api
langchainjs/examples/src/indexes/vector_stores/pgvector_vectorstore/docker-compose.example.yml/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/pgvector_vectorstore/docker-compose.example.yml", "repo_id": "langchainjs", "token_count": 116 }
787
// 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/garbage_collector_test.go/0
{ "file_path": "milvus/internal/datacoord/garbage_collector_test.go", "repo_id": "milvus", "token_count": 19225 }
1,792
import logging from typing import Any, Callable, Dict, List, Optional, Sequence from tenacity import ( before_sleep_log, retry, retry_if_exception_type, stop_after_attempt, wait_exponential, ) from llama_index.legacy.core.llms.types import ChatMessage COMMAND_MODELS = { "command": 4096, "...
llama_index/llama-index-legacy/llama_index/legacy/llms/cohere_utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/cohere_utils.py", "repo_id": "llama_index", "token_count": 1318 }
1,732
import logging import uuid from typing import Sequence from bs4 import BeautifulSoup as Soup from langchain_core.documents import Document from langchain_core.runnables import Runnable from propositional_retrieval.constants import DOCSTORE_ID_KEY from propositional_retrieval.proposal_chain import proposition_chain fr...
langchain/templates/propositional-retrieval/propositional_retrieval/ingest.py/0
{ "file_path": "langchain/templates/propositional-retrieval/propositional_retrieval/ingest.py", "repo_id": "langchain", "token_count": 1058 }
709
FROM ubuntu:20.04 LABEL maintainer="Hugging Face" LABEL repository="diffusers" ENV DEBIAN_FRONTEND=noninteractive RUN apt update && \ apt install -y bash \ build-essential \ git \ git-lfs \ curl \ ca-certificates \ ...
diffusers/docker/diffusers-flax-cpu/Dockerfile/0
{ "file_path": "diffusers/docker/diffusers-flax-cpu/Dockerfile", "repo_id": "diffusers", "token_count": 666 }
188
# Bedrock > [Amazon Bedrock](https://aws.amazon.com/bedrock/) is a fully managed service that makes Foundation Models (FMs) > from leading AI startups and Amazon available via an API. You can choose from a wide range of FMs to find the model that is best suited for your use case. ## Setup You'll need to install a fe...
langchainjs/docs/core_docs/docs/integrations/llms/bedrock.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/llms/bedrock.mdx", "repo_id": "langchainjs", "token_count": 448 }
731
from langchain.schema.runnable.history import __all__ EXPECTED_ALL = [ "RunnableWithMessageHistory", "GetSessionHistoryCallable", "MessagesOrDictWithMessages", ] def test_all_imports() -> None: assert set(__all__) == set(EXPECTED_ALL)
langchain/libs/langchain/tests/unit_tests/schema/runnable/test_history.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/schema/runnable/test_history.py", "repo_id": "langchain", "token_count": 98 }
640
# 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/vit/convert_vit_timm_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/vit/convert_vit_timm_to_pytorch.py", "repo_id": "transformers", "token_count": 4416 }
746
# Key-Value Stores Key-Value stores are the underlying storage abstractions that power our [Document Stores](./docstores.md) and [Index Stores](./index_stores.md). We provide the following key-value stores: - **Simple Key-Value Store**: An in-memory KV store. The user can choose to call `persist` on this kv store to...
llama_index/docs/module_guides/storing/kv_stores.md/0
{ "file_path": "llama_index/docs/module_guides/storing/kv_stores.md", "repo_id": "llama_index", "token_count": 157 }
1,183
# flake8: noqa from langchain_core.prompts.prompt import PromptTemplate _PROMPT_TEMPLATE = """ You are an agents controlling a browser. You are given: (1) an objective that you are trying to achieve (2) the URL of your current web page (3) a simplified text description of what's visible in the browser window (more...
langchain/libs/langchain/langchain/chains/natbot/prompt.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/natbot/prompt.py", "repo_id": "langchain", "token_count": 1532 }
507
python_tests()
llama_index/llama-index-packs/llama-index-packs-gradio-agent-chat/tests/BUILD/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-gradio-agent-chat/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,705
from llama_index.packs.timescale_vector_autoretrieval.base import ( TimescaleVectorAutoretrievalPack, ) __all__ = ["TimescaleVectorAutoretrievalPack"]
llama_index/llama-index-packs/llama-index-packs-timescale-vector-autoretrieval/llama_index/packs/timescale_vector_autoretrieval/__init__.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-timescale-vector-autoretrieval/llama_index/packs/timescale_vector_autoretrieval/__init__.py", "repo_id": "llama_index", "token_count": 53 }
1,702
// Adapted from turboderp exllama: https://github.com/turboderp/exllama #ifndef _column_remap_cuh #define _column_remap_cuh #include <cuda_runtime.h> #include <cuda_fp16.h> #include <cstdint> void column_remap_cuda ( const half* x, half* x_new, const int x_height, const int x_width, const uint32_...
text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/column_remap.cuh/0
{ "file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/column_remap.cuh", "repo_id": "text-generation-inference", "token_count": 152 }
376
// 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/config/etcd_source.go/0
{ "file_path": "milvus/pkg/config/etcd_source.go", "repo_id": "milvus", "token_count": 1818 }
1,949
"""Init File."""
llama_index/llama-index-legacy/llama_index/legacy/readers/steamship/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/steamship/__init__.py", "repo_id": "llama_index", "token_count": 6 }
1,707
import { HumanMessage } from "../../messages/index.js"; import { applyPatch } from "../../utils/json_patch.js"; import { RemoteRunnable } from "../remote.js"; test("streamLog hosted langserve", async () => { const remote = new RemoteRunnable({ url: `https://chat-langchain-backend.langchain.dev/chat`, }); con...
langchainjs/langchain-core/src/runnables/tests/runnable_remote.int.test.ts/0
{ "file_path": "langchainjs/langchain-core/src/runnables/tests/runnable_remote.int.test.ts", "repo_id": "langchainjs", "token_count": 683 }
881
import { DriaRetriever } from "@langchain/community/retrievers/dria"; // contract of TypeScript Handbook v4.9 uploaded to Dria // https://dria.co/knowledge/-B64DjhUtCwBdXSpsRytlRQCu-bie-vSTvTIT8Ap3g0 const contractId = "-B64DjhUtCwBdXSpsRytlRQCu-bie-vSTvTIT8Ap3g0"; const retriever = new DriaRetriever({ contractId, ...
langchainjs/examples/src/retrievers/dria.ts/0
{ "file_path": "langchainjs/examples/src/retrievers/dria.ts", "repo_id": "langchainjs", "token_count": 217 }
839
from llama_index.core.postprocessor.types import BaseNodePostprocessor from llama_index.postprocessor.rankgpt_rerank import RankGPTRerank def test_class(): names_of_base_classes = [b.__name__ for b in RankGPTRerank.__mro__] assert BaseNodePostprocessor.__name__ in names_of_base_classes
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-rankgpt-rerank/tests/test_postprocessor_rankgpt_rerank.py/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-rankgpt-rerank/tests/test_postprocessor_rankgpt_rerank.py", "repo_id": "llama_index", "token_count": 100 }
1,439
python_tests()
llama_index/llama-index-integrations/agent/llama-index-agent-openai/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/agent/llama-index-agent-openai/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,179
use crate::tokenizer::{Encoding, PostProcessor, Result}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::iter::FromIterator; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] #[serde(tag = "type")] pub struct BertProcessing { sep: (String, u32), cls: (String, u32), } ...
tokenizers/tokenizers/src/processors/bert.rs/0
{ "file_path": "tokenizers/tokenizers/src/processors/bert.rs", "repo_id": "tokenizers", "token_count": 7375 }
480
<jupyter_start><jupyter_text>Building RAG from Scratch (Open-source only!) In this tutorial, we show you how to build a data ingestion pipeline into a vector database, and then build a retrieval pipeline from that vector database, from scratch.Notably, we use a fully open-source stack:- Sentence Transformers as the emb...
llama_index/docs/examples/low_level/oss_ingestion_retrieval.ipynb/0
{ "file_path": "llama_index/docs/examples/low_level/oss_ingestion_retrieval.ipynb", "repo_id": "llama_index", "token_count": 3494 }
1,092
from typing import Any, Dict import requests from llama_index.core.base.base_query_engine import BaseQueryEngine from llama_index.core.base.response.schema import Response from llama_index.core.schema import QueryBundle class CogniswitchQueryEngine(BaseQueryEngine): def __init__(self, cs_token: str, OAI_token: s...
llama_index/llama-index-core/llama_index/core/query_engine/cogniswitch_query_engine.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/query_engine/cogniswitch_query_engine.py", "repo_id": "llama_index", "token_count": 921 }
1,194
from typing import Iterator, List, Optional from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader from langchain_community.utilities.brave_search import BraveSearchWrapper class BraveSearchLoader(BaseLoader): """Load with `Brave Search` engine.""" de...
langchain/libs/community/langchain_community/document_loaders/brave_search.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/brave_search.py", "repo_id": "langchain", "token_count": 422 }
233
// Auto-generated by `scripts/create-entrypoints.js`. Do not edit manually. export const optionalImportEntrypoints: string[] = [ "langchain_community/tools/aws_lambda", "langchain_community/tools/aws_sfn", "langchain_community/tools/discord", "langchain_community/tools/gmail", "langchain_community/tools/goog...
langchainjs/libs/langchain-community/src/load/import_constants.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/load/import_constants.ts", "repo_id": "langchainjs", "token_count": 1771 }
949
python_tests()
llama_index/llama-index-integrations/tools/llama-index-tools-bing-search/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-bing-search/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,472
package indexstat import ( "context" "testing" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/suite" "go.uber.org/zap" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github...
milvus/tests/integration/indexstat/get_index_statistics_test.go/0
{ "file_path": "milvus/tests/integration/indexstat/get_index_statistics_test.go", "repo_id": "milvus", "token_count": 2059 }
1,878
<jupyter_start><jupyter_text>DuckDuckGo SearchThis notebook goes over how to use the duck-duck-go search component.<jupyter_code>%pip install --upgrade --quiet duckduckgo-search from langchain.tools import DuckDuckGoSearchRun search = DuckDuckGoSearchRun() search.run("Obama's first name?")<jupyter_output><empty_output...
langchain/docs/docs/integrations/tools/ddg.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/tools/ddg.ipynb", "repo_id": "langchain", "token_count": 395 }
182
python_sources()
llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-sbert-rerank/llama_index/postprocessor/sbert_rerank/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/postprocessor/llama-index-postprocessor-sbert-rerank/llama_index/postprocessor/sbert_rerank/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,319
#!/usr/bin/env python # coding=utf-8 # 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-...
transformers/examples/flax/language-modeling/run_clm_flax.py/0
{ "file_path": "transformers/examples/flax/language-modeling/run_clm_flax.py", "repo_id": "transformers", "token_count": 16049 }
506
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/schedulers/__init__.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/__init__.py", "repo_id": "diffusers", "token_count": 3836 }
260