text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
# coding=utf-8 # Copyright 2023 Authors: Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, # Kaitao Song, Ding Liang, Tong Lu, Ping Luo, Ling Shao 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...
transformers/src/transformers/models/pvt/configuration_pvt.py/0
{ "file_path": "transformers/src/transformers/models/pvt/configuration_pvt.py", "repo_id": "transformers", "token_count": 2810 }
670
// 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/etcd/etcd_kv.go/0
{ "file_path": "milvus/internal/kv/etcd/etcd_kv.go", "repo_id": "milvus", "token_count": 10108 }
1,716
--- sidebar_class_name: hidden --- # SQL This example demonstrates the use of the `SQLDatabaseChain` for answering questions over a SQL database. import CodeBlock from "@theme/CodeBlock"; import SqlDBExample from "@examples/chains/sql_db_legacy.ts"; import SqlDBSqlOutputExample from "@examples/chains/sql_db_sql_outp...
langchainjs/docs/core_docs/docs/modules/chains/popular/sqlite_legacy.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/chains/popular/sqlite_legacy.mdx", "repo_id": "langchainjs", "token_count": 695 }
760
from langchain_community.utilities.google_jobs import GoogleJobsAPIWrapper __all__ = ["GoogleJobsAPIWrapper"]
langchain/libs/langchain/langchain/utilities/google_jobs.py/0
{ "file_path": "langchain/libs/langchain/langchain/utilities/google_jobs.py", "repo_id": "langchain", "token_count": 34 }
562
<jupyter_start><jupyter_text>Wikipedia>[Wikipedia](https://wikipedia.org/) is a multilingual free online encyclopedia written and maintained by a community of volunteers, known as Wikipedians, through open collaboration and using a wiki-based editing system called MediaWiki. `Wikipedia` is the largest and most-read ref...
langchain/docs/docs/integrations/retrievers/wikipedia.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/retrievers/wikipedia.ipynb", "repo_id": "langchain", "token_count": 962 }
161
# LlamaIndex Retrievers Integration: You Retriever
llama_index/llama-index-integrations/retrievers/llama-index-retrievers-you/README.md/0
{ "file_path": "llama_index/llama-index-integrations/retrievers/llama-index-retrievers-you/README.md", "repo_id": "llama_index", "token_count": 14 }
1,485
package command import "fmt" var ( usageLineV2 = fmt.Sprintf("Usage:\n"+ "%s\n", runLineV2) runLineV2 = ` migration -config=config.yaml ` )
milvus/cmd/tools/migration/command/help.go/0
{ "file_path": "milvus/cmd/tools/migration/command/help.go", "repo_id": "milvus", "token_count": 67 }
1,755
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The Google Research Authors and The HuggingFace Team All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://...
transformers/examples/research_projects/jax-projects/model_parallel/partitions.py/0
{ "file_path": "transformers/examples/research_projects/jax-projects/model_parallel/partitions.py", "repo_id": "transformers", "token_count": 1130 }
578
from llama_index.core.tools.tool_spec.base import BaseToolSpec from llama_index.tools.wikipedia import WikipediaToolSpec def test_class(): names_of_base_classes = [b.__name__ for b in WikipediaToolSpec.__mro__] assert BaseToolSpec.__name__ in names_of_base_classes
llama_index/llama-index-integrations/tools/llama-index-tools-wikipedia/tests/test_tools_wikipedia.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-wikipedia/tests/test_tools_wikipedia.py", "repo_id": "llama_index", "token_count": 91 }
1,638
<jupyter_start><jupyter_text>Math chainThis notebook showcases using LLMs and Python REPLs to do complex word math problems.<jupyter_code>from langchain.chains import LLMMathChain from langchain_openai import OpenAI llm = OpenAI(temperature=0) llm_math = LLMMathChain.from_llm(llm, verbose=True) llm_math.run("What is ...
langchain/cookbook/llm_math.ipynb/0
{ "file_path": "langchain/cookbook/llm_math.ipynb", "repo_id": "langchain", "token_count": 242 }
78
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-hwp/llama_index/readers/hwp/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-hwp/llama_index/readers/hwp/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,335
<jupyter_start><jupyter_text>Unit 8: Proximal Policy Gradient (PPO) with PyTorch 🤖In this notebook, you'll learn to **code your PPO agent from scratch with PyTorch using CleanRL implementation as model**.To test its robustness, we're going to train it in:- [LunarLander-v2 🚀](https://www.gymlibrary.dev/environments/bo...
deep-rl-class/notebooks/unit8/unit8_part1.ipynb/0
{ "file_path": "deep-rl-class/notebooks/unit8/unit8_part1.ipynb", "repo_id": "deep-rl-class", "token_count": 15492 }
164
<!--- 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 ...
transformers/examples/pytorch/language-modeling/README.md/0
{ "file_path": "transformers/examples/pytorch/language-modeling/README.md", "repo_id": "transformers", "token_count": 2592 }
576
import { Tool, ToolInterface } from "@langchain/core/tools"; import { Toolkit } from "../base.js"; import { ConneryService } from "../../../tools/connery.js"; /** * ConneryToolkit provides access to all the available actions from the Connery Runner. * @extends Toolkit */ export class ConneryToolkit extends Toolkit ...
langchainjs/libs/langchain-community/src/agents/toolkits/connery/index.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/agents/toolkits/connery/index.ts", "repo_id": "langchainjs", "token_count": 326 }
979
"""Outlook local calendar reader for Windows. Created on Sun Apr 16 12:03:19 2023 @author: tevslin """ import datetime import importlib import platform from typing import List, Optional, Union from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document # Copyright 2023 Evslin C...
llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-outlook/llama_index/readers/microsoft_outlook/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-microsoft-outlook/llama_index/readers/microsoft_outlook/base.py", "repo_id": "llama_index", "token_count": 1487 }
1,339
<!--- 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 ...
transformers/docs/README.md/0
{ "file_path": "transformers/docs/README.md", "repo_id": "transformers", "token_count": 4835 }
442
libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: Milvus Common Description: Common modules for Milvus Version: @MILVUS_VERSION@ Libs: -L${libdir} -lmilvus_common Cflags: -I${includedir}
milvus/internal/core/src/common/milvus_common.pc.in/0
{ "file_path": "milvus/internal/core/src/common/milvus_common.pc.in", "repo_id": "milvus", "token_count": 96 }
1,922
# TruLens-Eval Llama-Pack ![TruLens](https://www.trulens.org/assets/images/Neural_Network_Explainability.png) The best way to support TruLens is to give us a ⭐ on [GitHub](https://www.github.com/truera/trulens) and join our [slack community](https://communityinviter.com/apps/aiqualityforum/josh)! TruLens provides th...
llama_index/llama-index-packs/llama-index-packs-trulens-eval-packs/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-trulens-eval-packs/README.md", "repo_id": "llama_index", "token_count": 1163 }
1,692
from typing import Any, Dict, List, Mapping, Optional from langchain_core.callbacks import CallbackManagerForLLMRun from langchain_core.language_models.llms import LLM from langchain_core.pydantic_v1 import Extra, root_validator class ManifestWrapper(LLM): """HazyResearch's Manifest library.""" client: Any ...
langchain/libs/community/langchain_community/llms/manifest.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/manifest.py", "repo_id": "langchain", "token_count": 843 }
265
pub fn set_panic_hook() { // When the `console_error_panic_hook` feature is enabled, we can call the // `set_panic_hook` function at least once during initialization, and then // we will get better error messages if our code ever panics. // // For more details see // https://github.com/rustwasm/...
tokenizers/tokenizers/examples/unstable_wasm/src/utils.rs/0
{ "file_path": "tokenizers/tokenizers/examples/unstable_wasm/src/utils.rs", "repo_id": "tokenizers", "token_count": 150 }
461
# LlamaIndex Readers Integration: Database
llama_index/llama-index-integrations/readers/llama-index-readers-database/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-database/README.md", "repo_id": "llama_index", "token_count": 9 }
1,480
// 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/log/log_test.go/0
{ "file_path": "milvus/pkg/log/log_test.go", "repo_id": "milvus", "token_count": 2890 }
1,809
from datetime import datetime, timedelta from typing import List, Optional from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader class DatadogLogsLoader(BaseLoader): """Load `Datadog` logs. Logs are written into the `page_content` and into the `metad...
langchain/libs/community/langchain_community/document_loaders/datadog_logs.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/datadog_logs.py", "repo_id": "langchain", "token_count": 2324 }
248
{ "extends": "next/core-web-vitals" }
langchain-nextjs-template/.eslintrc.json/0
{ "file_path": "langchain-nextjs-template/.eslintrc.json", "repo_id": "langchain-nextjs-template", "token_count": 20 }
67
from langchain_core.utils.loading import try_load_from_hub __all__ = ["try_load_from_hub"]
langchain/libs/langchain/langchain/utils/loading.py/0
{ "file_path": "langchain/libs/langchain/langchain/utils/loading.py", "repo_id": "langchain", "token_count": 33 }
623
python_tests()
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-nomic/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-nomic/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,235
# coding=utf-8 # Copyright 2024 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...
diffusers/src/diffusers/models/modeling_flax_utils.py/0
{ "file_path": "diffusers/src/diffusers/models/modeling_flax_utils.py", "repo_id": "diffusers", "token_count": 11975 }
228
{ "eslint.workingDirectories": [ "./langchain", "./langchain-core", "./examples", "./docs", "./test-exports-vercel" ], "yaml.schemas": { "https://json.schemastore.org/github-workflow.json": "./.github/workflows/deploy.yml" }, "typescript.tsdk": "node_modules/typescript/lib", "cSpell....
langchainjs/.vscode/settings.json/0
{ "file_path": "langchainjs/.vscode/settings.json", "repo_id": "langchainjs", "token_count": 184 }
739
import { ImportSpecifier, Project, SourceFile, SyntaxKind } from "ts-morph"; import { glob } from "glob"; import path from "node:path"; import { LangChainConfig } from "../types.js"; type ExportedSymbol = { symbol: string; kind: SyntaxKind }; type EntrypointAndSymbols = { entrypoint: string; exportedSymbols: Arra...
langchainjs/libs/langchain-scripts/src/migrations/0_1.ts/0
{ "file_path": "langchainjs/libs/langchain-scripts/src/migrations/0_1.ts", "repo_id": "langchainjs", "token_count": 4436 }
1,013
import { test } from "@jest/globals"; import { HumanMessage } from "@langchain/core/messages"; import { NIBittensorChatModel } from "../bittensor.js"; test.skip("Test", async () => { const chat = new NIBittensorChatModel(); const message = new HumanMessage("What is bittensor?"); const res = await chat.call([mess...
langchainjs/langchain/src/experimental/chat_models/tests/bittensor_chat_model.int.test.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/chat_models/tests/bittensor_chat_model.int.test.ts", "repo_id": "langchainjs", "token_count": 112 }
921
from typing import Any, Dict, List, Union import numpy as np from ..utils import add_end_docstrings, is_torch_available, is_vision_available, logging, requires_backends from .base import Pipeline, build_pipeline_init_args if is_vision_available(): from PIL import Image from ..image_utils import load_image ...
transformers/src/transformers/pipelines/image_segmentation.py/0
{ "file_path": "transformers/src/transformers/pipelines/image_segmentation.py", "repo_id": "transformers", "token_count": 3828 }
748
<jupyter_start><jupyter_text>Shared memory across agents and toolsThis notebook goes over adding memory to **both** an Agent and its tools. Before going through this notebook, please walk through the following notebooks, as this will build on top of both of them:- [Adding memory to an LLM Chain](/docs/modules/memory/in...
langchain/cookbook/sharedmemory_for_tools.ipynb/0
{ "file_path": "langchain/cookbook/sharedmemory_for_tools.ipynb", "repo_id": "langchain", "token_count": 2839 }
81
python_sources()
llama_index/llama-index-core/llama_index/core/output_parsers/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/output_parsers/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,281
# Copyright 2024 Open AI 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-2.0 # # Unless required ...
diffusers/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py", "repo_id": "diffusers", "token_count": 5665 }
264
import { GetResponse, QueryResponse, AddResponse, CollectionMetadata, ConfigOptions, GetParams, AddParams, UpsertParams, ModifyCollectionParams, UpdateParams, QueryParams, PeekParams, DeleteParams } from "./types"; import { IEmbeddingFunction } from './embeddings/IEmb...
chroma/clients/js/src/Collection.ts/0
{ "file_path": "chroma/clients/js/src/Collection.ts", "repo_id": "chroma", "token_count": 8253 }
28
# Creating apps
candle/candle-book/src/apps/README.md/0
{ "file_path": "candle/candle-book/src/apps/README.md", "repo_id": "candle", "token_count": 4 }
25
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/src/query/generated/ShowExprVisitor.h/0
{ "file_path": "milvus/internal/core/src/query/generated/ShowExprVisitor.h", "repo_id": "milvus", "token_count": 787 }
1,880
# 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 applicabl...
transformers/src/transformers/utils/import_utils.py/0
{ "file_path": "transformers/src/transformers/utils/import_utils.py", "repo_id": "transformers", "token_count": 17892 }
772
// 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/util/grpcclient/client_test.go/0
{ "file_path": "milvus/internal/util/grpcclient/client_test.go", "repo_id": "milvus", "token_count": 6218 }
1,935
import type { SupabaseClient } from "@supabase/supabase-js"; import type { PostgrestFilterBuilder } from "@supabase/postgrest-js"; import { MaxMarginalRelevanceSearchOptions, VectorStore, } from "@langchain/core/vectorstores"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { Document ...
langchainjs/libs/langchain-community/src/vectorstores/supabase.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/supabase.ts", "repo_id": "langchainjs", "token_count": 3444 }
968
# Trello >[Trello](https://www.atlassian.com/software/trello) is a web-based project management and collaboration tool that allows individuals and teams to organize and track their tasks and projects. It provides a visual interface known as a "board" where users can create lists and cards to represent their tasks and ...
langchain/docs/docs/integrations/providers/trello.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/trello.mdx", "repo_id": "langchain", "token_count": 196 }
161
# coding=utf-8 # Copyright 2020 The HuggingFace Team All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
transformers/examples/pytorch/question-answering/trainer_qa.py/0
{ "file_path": "transformers/examples/pytorch/question-answering/trainer_qa.py", "repo_id": "transformers", "token_count": 2662 }
532
python_sources() python_requirements( name="reqs", )
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/knowledge_base/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/knowledge_base/BUILD", "repo_id": "llama_index", "token_count": 24 }
1,466
interactions: - request: body: '{"input": [[8134], [2308], [43673]], "encoding_format": "base64"}' headers: Accept: - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive Content-Length: - '65' Content-Type: - application/json User-Age...
langchain/libs/community/tests/integration_tests/vectorstores/cassettes/test_weaviate/TestWeaviate.test_max_marginal_relevance_search_with_filter.yaml/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/cassettes/test_weaviate/TestWeaviate.test_max_marginal_relevance_search_with_filter.yaml", "repo_id": "langchain", "token_count": 38070 }
385
<jupyter_start><jupyter_text>Supabase>[Supabase](https://supabase.com/docs) is an open-source `Firebase` alternative. > `Supabase` is built on top of `PostgreSQL`, which offers strong `SQL` > querying capabilities and enables a simple interface with already-existing tools and frameworks.>[PostgreSQL](https://en.wikiped...
langchain/docs/docs/integrations/retrievers/self_query/supabase_self_query.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/retrievers/self_query/supabase_self_query.ipynb", "repo_id": "langchain", "token_count": 2965 }
164
# Learning Rate Schedulers This page contains the API reference documentation for learning rate schedulers included in `timm`. ## Schedulers ### Factory functions [[autodoc]] timm.scheduler.scheduler_factory.create_scheduler [[autodoc]] timm.scheduler.scheduler_factory.create_scheduler_v2 ### Scheduler Classes [[...
pytorch-image-models/hfdocs/source/reference/schedulers.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/reference/schedulers.mdx", "repo_id": "pytorch-image-models", "token_count": 242 }
344
{ "openapi": "3.1.0", "info": { "title": "Urlbox API", "description": "A plugin that allows the user to capture screenshots of a web page from a URL or HTML using ChatGPT.", "version": "v1" }, "servers": [ { "url": "https://api.urlbox.io" } ], "paths": { "/...
langchain/libs/community/tests/unit_tests/examples/test_specs/urlbox/apispec.json/0
{ "file_path": "langchain/libs/community/tests/unit_tests/examples/test_specs/urlbox/apispec.json", "repo_id": "langchain", "token_count": 8626 }
374
# MainContentExtractor Website Loader This loader is a web scraper that fetches the text from static websites using the `MainContentExtractor` Python package. For information on how to extract main content, README in the following github repository [HawkClaws/main_content_extractor](https://github.com/HawkClaws/main...
llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/main_content_extractor/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-web/llama_index/readers/web/main_content_extractor/README.md", "repo_id": "llama_index", "token_count": 591 }
1,567
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/commands/train.py/0
{ "file_path": "transformers/src/transformers/commands/train.py", "repo_id": "transformers", "token_count": 2535 }
590
from contextlib import asynccontextmanager, contextmanager from typing import ( Any, AsyncContextManager, AsyncGenerator, Callable, ContextManager, Generator, Generic, Optional, Sequence, Type, ) from typing_extensions import Self from langgraph.channels.base import ( BaseC...
langgraph/langgraph/channels/context.py/0
{ "file_path": "langgraph/langgraph/channels/context.py", "repo_id": "langgraph", "token_count": 1332 }
1,036
import argparse import sys sys.path.append(".") from base_classes import TextToImageBenchmark, TurboTextToImageBenchmark # noqa: E402 ALL_T2I_CKPTS = [ "runwayml/stable-diffusion-v1-5", "segmind/SSD-1B", "stabilityai/stable-diffusion-xl-base-1.0", "kandinsky-community/kandinsky-2-2-decoder", "w...
diffusers/benchmarks/benchmark_text_to_image.py/0
{ "file_path": "diffusers/benchmarks/benchmark_text_to_image.py", "repo_id": "diffusers", "token_count": 480 }
174
# Stable Diffusion XL for JAX + TPUv5e [TPU v5e](https://cloud.google.com/blog/products/compute/how-cloud-tpu-v5e-accelerates-large-scale-ai-inference) is a new generation of TPUs from Google Cloud. It is the most cost-effective, versatile, and scalable Cloud TPU to date. This makes them ideal for serving and scaling ...
diffusers/examples/research_projects/sdxl_flax/README.md/0
{ "file_path": "diffusers/examples/research_projects/sdxl_flax/README.md", "repo_id": "diffusers", "token_count": 3342 }
224
<jupyter_start><jupyter_text>GmailThis notebook walks through connecting a LangChain email to the `Gmail API`.To use this toolkit, you will need to set up your credentials explained in the [Gmail API docs](https://developers.google.com/gmail/api/quickstart/pythonauthorize_credentials_for_a_desktop_application). Once yo...
langchain/docs/docs/integrations/toolkits/gmail.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/toolkits/gmail.ipynb", "repo_id": "langchain", "token_count": 1219 }
181
from typing import Any, List, Optional # noqa: E501 from langchain_core.language_models import BaseLanguageModel from langchain_core.memory import BaseMemory from langchain_core.messages import SystemMessage from langchain_core.prompts.chat import MessagesPlaceholder from langchain.agents.agent import AgentExecutor ...
langchain/libs/langchain/langchain/agents/agent_toolkits/conversational_retrieval/openai_functions.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/conversational_retrieval/openai_functions.py", "repo_id": "langchain", "token_count": 1184 }
457
from langchain_community.agent_toolkits.sql.prompt import ( SQL_FUNCTIONS_SUFFIX, SQL_PREFIX, SQL_SUFFIX, ) __all__ = ["SQL_PREFIX", "SQL_SUFFIX", "SQL_FUNCTIONS_SUFFIX"]
langchain/libs/langchain/langchain/agents/agent_toolkits/sql/prompt.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/sql/prompt.py", "repo_id": "langchain", "token_count": 86 }
439
# flake8: noqa PREFIX = """Assistant is a large language model trained by OpenAI. Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human...
langchain/libs/langchain/langchain/agents/conversational/prompt.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/conversational/prompt.py", "repo_id": "langchain", "token_count": 439 }
472
.PHONY: build build: go build -v -o bin/chroma ./cmd test: build go test -cover -race ./... lint: #brew install golangci-lint golangci-lint run clean: rm -f bin/chroma docker: docker build -t chroma-coordinator:latest .
chroma/go/coordinator/Makefile/0
{ "file_path": "chroma/go/coordinator/Makefile", "repo_id": "chroma", "token_count": 95 }
44
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-llm-rails/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-llm-rails/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,250
python_sources()
llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,242
# Copyright 2024 Open AI 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-2.0 # # Unless required ...
diffusers/src/diffusers/pipelines/shap_e/camera.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/shap_e/camera.py", "repo_id": "diffusers", "token_count": 2274 }
231
<jupyter_start><jupyter_text>Anyscale If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-anyscale !pip install llama-index from llama_index.llms.anyscale import Anyscale from llama_index.core.llms import ChatMessage<jupyter_output><empty...
llama_index/docs/examples/llm/anyscale.ipynb/0
{ "file_path": "llama_index/docs/examples/llm/anyscale.ipynb", "repo_id": "llama_index", "token_count": 1324 }
1,065
"""Structured LLM Predictor.""" import logging from typing import Any, Optional from deprecated import deprecated from llama_index.legacy.llm_predictor.base import LLMPredictor from llama_index.legacy.prompts.base import BasePromptTemplate from llama_index.legacy.types import TokenGen logger = logging.getLogger(__n...
llama_index/llama-index-legacy/llama_index/legacy/llm_predictor/structured.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llm_predictor/structured.py", "repo_id": "llama_index", "token_count": 1182 }
1,612
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/datanode/syncmgr/serializer.go/0
{ "file_path": "milvus/internal/datanode/syncmgr/serializer.go", "repo_id": "milvus", "token_count": 1116 }
1,702
"""Init file.""" from llama_index.legacy.response_synthesizers.accumulate import Accumulate from llama_index.legacy.response_synthesizers.base import BaseSynthesizer from llama_index.legacy.response_synthesizers.compact_and_refine import CompactAndRefine from llama_index.legacy.response_synthesizers.factory import get...
llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/response_synthesizers/__init__.py", "repo_id": "llama_index", "token_count": 327 }
1,612
import { test, expect } from "@jest/globals"; import Exa from "exa-js"; import { ExaRetriever } from "../retrievers.js"; test("ExaRetriever can retrieve some data", async () => { const exaRetriever = new ExaRetriever<{ text: true }>({ // @ts-expect-error type errors client: new Exa(), }); const results ...
langchainjs/libs/langchain-exa/src/tests/retrievers.int.test.ts/0
{ "file_path": "langchainjs/libs/langchain-exa/src/tests/retrievers.int.test.ts", "repo_id": "langchainjs", "token_count": 240 }
1,058
import pg, { type Pool, type PoolClient, type PoolConfig } from "pg"; import { VectorStore } from "@langchain/core/vectorstores"; import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import { Document } from "@langchain/core/documents"; import { getEnvironmentVariable } from "@langchain/core/utils/env...
langchainjs/libs/langchain-community/src/vectorstores/pgvector.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/vectorstores/pgvector.ts", "repo_id": "langchainjs", "token_count": 5981 }
1,083
from langchain_community.chat_loaders.slack import SlackChatLoader __all__ = ["SlackChatLoader"]
langchain/libs/langchain/langchain/chat_loaders/slack.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_loaders/slack.py", "repo_id": "langchain", "token_count": 30 }
468
# Robust Speech Challenge 🤗 Welcome to the robust speech recognition challenge 🎙️ ! The goal of this event is to build **robust**, **real-world** speech recognition (ASR) systems in as many languages as possible 🌏🌍🌎. If necessary and available, free access to a V100S 32 GB GPU will kindly be provided by the [OVH...
transformers/examples/research_projects/robust-speech-event/README.md/0
{ "file_path": "transformers/examples/research_projects/robust-speech-event/README.md", "repo_id": "transformers", "token_count": 12255 }
573
import unittest from langchain_community.document_loaders.duckdb_loader import DuckDBLoader try: import duckdb # noqa: F401 duckdb_installed = True except ImportError: duckdb_installed = False @unittest.skipIf(not duckdb_installed, "duckdb not installed") def test_duckdb_loader_no_options() -> None: ...
langchain/libs/community/tests/integration_tests/document_loaders/test_duckdb.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_duckdb.py", "repo_id": "langchain", "token_count": 565 }
323
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_upscale.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_2/test_stable_diffusion_upscale.py", "repo_id": "diffusers", "token_count": 9036 }
275
from llama_index.core.llama_pack import BaseLlamaPack from llama_index.packs.node_parser_semantic_chunking import ( SemanticChunkingQueryEnginePack, ) def test_class(): names_of_base_classes = [ b.__name__ for b in SemanticChunkingQueryEnginePack.__mro__ ] assert BaseLlamaPack.__name__ in name...
llama_index/llama-index-packs/llama-index-packs-node-parser-semantic-chunking/tests/test_packs_node_parser.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-node-parser-semantic-chunking/tests/test_packs_node_parser.py", "repo_id": "llama_index", "token_count": 131 }
1,665
# coding=utf-8 # Copyright 2024 The Qwen team, Alibaba Group and the HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
transformers/src/transformers/models/qwen2/configuration_qwen2.py/0
{ "file_path": "transformers/src/transformers/models/qwen2/configuration_qwen2.py", "repo_id": "transformers", "token_count": 2536 }
671
.PHONY: style check-style test DATA_DIR = data dir_guard=@mkdir -p $(@D) # Format source code automatically style: npm run lint # Check the source code is formatted correctly check-style: npm run lint-check TESTS_RESOURCES = $(DATA_DIR)/small.txt $(DATA_DIR)/roberta.json $(DATA_DIR)/tokenizer-wiki.json $(DATA_DI...
tokenizers/bindings/node/Makefile/0
{ "file_path": "tokenizers/bindings/node/Makefile", "repo_id": "tokenizers", "token_count": 406 }
452
package msgstream import ( "context" "github.com/cockroachdb/errors" "github.com/milvus-io/milvus/pkg/mq/msgstream/mqwrapper" ) var _ Factory = &CommonFactory{} // CommonFactory is a Factory for creating message streams with common logic. // // It contains a function field named newer, which is a function that ...
milvus/pkg/mq/msgstream/common_mq_factory.go/0
{ "file_path": "milvus/pkg/mq/msgstream/common_mq_factory.go", "repo_id": "milvus", "token_count": 720 }
1,887
# Self-Play: a classic technique to train competitive agents in adversarial games Now that we've studied the basics of multi-agents, we're ready to go deeper. As mentioned in the introduction, we're going **to train agents in an adversarial game with SoccerTwos, a 2vs2 game**. <figure> <img src="https://huggingface.c...
deep-rl-class/units/en/unit7/self-play.mdx/0
{ "file_path": "deep-rl-class/units/en/unit7/self-play.mdx", "repo_id": "deep-rl-class", "token_count": 2245 }
183
import { BaseListChatMessageHistory } from "@langchain/core/chat_history"; import { BaseMessage, StoredMessage, mapChatMessagesToStoredMessages, mapStoredMessagesToChatMessages, } from "@langchain/core/messages"; import { Client } from "cassandra-driver"; import { CassandraClientFactory, CassandraClientArg...
langchainjs/libs/langchain-community/src/stores/message/cassandra.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/stores/message/cassandra.ts", "repo_id": "langchainjs", "token_count": 1526 }
1,035
import clsx from "clsx"; import { ClassValue } from "clsx"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); }
langserve/langserve/playground/src/utils/cn.ts/0
{ "file_path": "langserve/langserve/playground/src/utils/cn.ts", "repo_id": "langserve", "token_count": 70 }
1,088
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/vector_stores/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,782
// 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/rate_limit_interceptor.go/0
{ "file_path": "milvus/internal/proxy/rate_limit_interceptor.go", "repo_id": "milvus", "token_count": 2540 }
1,742
import type { BaseLanguageModelCallOptions } from "@langchain/core/language_models/base"; import { SimpleChatModel, type BaseChatModelParams, } from "@langchain/core/language_models/chat_models"; import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { AIMessageChunk, BaseMessage, ...
langchainjs/libs/langchain-community/src/chat_models/ollama.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/chat_models/ollama.ts", "repo_id": "langchainjs", "token_count": 4881 }
1,018
"""OpenAI Assistant Agent.""" import asyncio import json import logging import time from typing import Any, Dict, List, Optional, Tuple, Union, cast from llama_index.legacy.agent.openai.utils import get_function_by_name from llama_index.legacy.agent.types import BaseAgent from llama_index.legacy.callbacks import ( ...
llama_index/llama-index-legacy/llama_index/legacy/agent/openai_assistant_agent.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/agent/openai_assistant_agent.py", "repo_id": "llama_index", "token_count": 8327 }
1,688
# RAGatouille Retriever Pack RAGatouille is a [cool library](https://github.com/bclavie/RAGatouille) that lets you use e.g. ColBERT and other SOTA retrieval models in your RAG pipeline. You can use it to either run inference on ColBERT, or use it to train/fine-tune models. This LlamaPack shows you an easy way to bund...
llama_index/llama-index-packs/llama-index-packs-ragatouille-retriever/README.md/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-ragatouille-retriever/README.md", "repo_id": "llama_index", "token_count": 777 }
1,865
from langchain_community.chat_models.tongyi import ( ChatTongyi, ) __all__ = [ "ChatTongyi", ]
langchain/libs/langchain/langchain/chat_models/tongyi.py/0
{ "file_path": "langchain/libs/langchain/langchain/chat_models/tongyi.py", "repo_id": "langchain", "token_count": 46 }
499
# Confluence Loader This loader loads pages from a given Confluence cloud instance. The user needs to specify the base URL for a Confluence instance to initialize the ConfluenceReader - base URL needs to end with `/wiki`. The user can optionally specify OAuth 2.0 credentials to authenticate with the Confluence instanc...
llama_index/llama-index-integrations/readers/llama-index-readers-confluence/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-confluence/README.md", "repo_id": "llama_index", "token_count": 1607 }
1,333
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
accelerate/docs/source/basic_tutorials/migration.md/0
{ "file_path": "accelerate/docs/source/basic_tutorials/migration.md", "repo_id": "accelerate", "token_count": 1276 }
1
# Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
trl/examples/scripts/ppo_multi_adapter.py/0
{ "file_path": "trl/examples/scripts/ppo_multi_adapter.py", "repo_id": "trl", "token_count": 1997 }
776
// 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/paramtable/autoindex_param.go/0
{ "file_path": "milvus/pkg/util/paramtable/autoindex_param.go", "repo_id": "milvus", "token_count": 1550 }
2,063
from __future__ import annotations import json from datetime import timedelta from typing import TYPE_CHECKING, Any, Optional from langchain_core.chat_history import BaseChatMessageHistory from langchain_core.messages import ( BaseMessage, message_to_dict, messages_from_dict, ) from langchain_core.utils i...
langchain/libs/community/langchain_community/chat_message_histories/momento.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_message_histories/momento.py", "repo_id": "langchain", "token_count": 2903 }
235
import unittest import pytest from langchain_community.document_loaders.parsers.language.kotlin import KotlinSegmenter @pytest.mark.requires("tree_sitter", "tree_sitter_languages") class TestKotlinSegmenter(unittest.TestCase): def setUp(self) -> None: self.example_code = """fun foo(a: Int): Int { re...
langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_kotlin.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/document_loaders/parsers/language/test_kotlin.py", "repo_id": "langchain", "token_count": 721 }
371
import pRetry from "p-retry"; import PQueueMod from "p-queue"; const STATUS_NO_RETRY = [ 400, // Bad Request 401, // Unauthorized 403, // Forbidden 404, // Not Found 405, // Method Not Allowed 406, // Not Acceptable 407, // Proxy Authentication Required 408, // Request Timeout ]; const STATUS_IGNORE = ...
langsmith-sdk/js/src/utils/async_caller.ts/0
{ "file_path": "langsmith-sdk/js/src/utils/async_caller.ts", "repo_id": "langsmith-sdk", "token_count": 1881 }
1,103
// 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/storage/types.go/0
{ "file_path": "milvus/internal/storage/types.go", "repo_id": "milvus", "token_count": 871 }
1,790
"""Provides a ChatBot UI for a Github Repository. Powered by Llama Index and Panel.""" import os import pickle from pathlib import Path import nest_asyncio import panel as pn import param from llama_index.core import VectorStoreIndex from llama_index.readers.github import GithubClient, GithubRepositoryReader # neede...
llama_index/llama-index-packs/llama-index-packs-panel-chatbot/llama_index/packs/panel_chatbot/app.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-panel-chatbot/llama_index/packs/panel_chatbot/app.py", "repo_id": "llama_index", "token_count": 5415 }
1,687
import { LlamaCppEmbeddings } from "@langchain/community/embeddings/llama_cpp"; const llamaPath = "/Replace/with/path/to/your/model/gguf-llama2-q4_0.bin"; const embeddings = new LlamaCppEmbeddings({ modelPath: llamaPath, }); const res = embeddings.embedQuery("Hello Llama!"); console.log(res); /* [ 15043, 365, 2...
langchainjs/examples/src/embeddings/llama_cpp_basic.ts/0
{ "file_path": "langchainjs/examples/src/embeddings/llama_cpp_basic.ts", "repo_id": "langchainjs", "token_count": 136 }
802
from langchain.schema.exceptions import __all__ EXPECTED_ALL = ["LangChainException"] def test_all_imports() -> None: assert set(__all__) == set(EXPECTED_ALL)
langchain/libs/langchain/tests/unit_tests/schema/test_exceptions.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/schema/test_exceptions.py", "repo_id": "langchain", "token_count": 61 }
608
import { ChatOllama } from "@langchain/community/chat_models/ollama"; import { StringOutputParser } from "@langchain/core/output_parsers"; const model = new ChatOllama({ baseUrl: "http://localhost:11434", // Default value model: "llama2", // Default value }); const stream = await model .pipe(new StringOutputPar...
langchainjs/examples/src/models/chat/integration_ollama.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/integration_ollama.ts", "repo_id": "langchainjs", "token_count": 318 }
847
# 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/owlv2/configuration_owlv2.py/0
{ "file_path": "transformers/src/transformers/models/owlv2/configuration_owlv2.py", "repo_id": "transformers", "token_count": 5978 }
724
from __future__ import annotations import logging from typing import ( TYPE_CHECKING, Any, AsyncGenerator, AsyncIterator, Callable, Dict, Generator, Iterator, List, Mapping, Optional, Tuple, Type, Union, ) from langchain_core.callbacks import ( AsyncCallback...
langchain/libs/community/langchain_community/chat_models/gpt_router.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_models/gpt_router.py", "repo_id": "langchain", "token_count": 5750 }
238
# coding=utf-8 # Copyright 2022 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/dpt/convert_dpt_hybrid_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/dpt/convert_dpt_hybrid_to_pytorch.py", "repo_id": "transformers", "token_count": 5467 }
610
import { TavilySearchResults } from "@langchain/community/tools/tavily_search"; import { ChatOpenAI } from "@langchain/openai"; import type { ChatPromptTemplate } from "@langchain/core/prompts"; import { pull } from "langchain/hub"; import { AgentExecutor, createOpenAIFunctionsAgent } from "langchain/agents"; // Defi...
langchainjs/examples/src/agents/stream_events.ts/0
{ "file_path": "langchainjs/examples/src/agents/stream_events.ts", "repo_id": "langchainjs", "token_count": 941 }
756
// 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/pkoracle/candidate.go/0
{ "file_path": "milvus/internal/querynodev2/pkoracle/candidate.go", "repo_id": "milvus", "token_count": 703 }
1,773