text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
import requests import zipfile import io import os import sys import shutil # Used by Github Action runners to upgrade sqlite version to 3.42.0 DLL_URL = "https://www.sqlite.org/2023/sqlite-dll-win64-x64-3420000.zip" if __name__ == "__main__": # Download and extract the DLL r = requests.get(DLL_URL) z = z...
chroma/bin/windows_upgrade_sqlite.py/0
{ "file_path": "chroma/bin/windows_upgrade_sqlite.py", "repo_id": "chroma", "token_count": 236 }
12
# 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/loaders/ip_adapter.py/0
{ "file_path": "diffusers/src/diffusers/loaders/ip_adapter.py", "repo_id": "diffusers", "token_count": 5546 }
210
<jupyter_start><jupyter_text>Databricks Vector SearchDatabricks Vector Search is a serverless similarity search engine that allows you to store a vector representation of your data, including metadata, in a vector database. With Vector Search, you can create auto-updating vector search indexes from Delta tables managed...
langchain/docs/docs/integrations/vectorstores/databricks_vector_search.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/vectorstores/databricks_vector_search.ipynb", "repo_id": "langchain", "token_count": 1151 }
190
from research_assistant.chain import chain __all__ = ["chain"]
langchain/templates/research-assistant/research_assistant/__init__.py/0
{ "file_path": "langchain/templates/research-assistant/research_assistant/__init__.py", "repo_id": "langchain", "token_count": 19 }
673
"""Tests for the Slack directory loader""" from pathlib import Path from langchain_community.document_loaders import SlackDirectoryLoader def test_slack_directory_loader() -> None: """Test Slack directory loader.""" file_path = Path(__file__).parent.parent / "examples/slack_export.zip" loader = SlackDire...
langchain/libs/community/tests/integration_tests/document_loaders/test_slack.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_slack.py", "repo_id": "langchain", "token_count": 270 }
327
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/pkg/mq/msgdispatcher/manager_test.go/0
{ "file_path": "milvus/pkg/mq/msgdispatcher/manager_test.go", "repo_id": "milvus", "token_count": 4713 }
2,092
[build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] [tool.codespell] check-filenames = true check-hidden = true skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb" [tool.llamahub] classes = ["GoogleTextSynthesizer", "SynthesizedResponse", "set_google_config"] contains_example = fa...
llama_index/llama-index-integrations/response_synthesizers/llama-index-response-synthesizers-google/pyproject.toml/0
{ "file_path": "llama_index/llama-index-integrations/response_synthesizers/llama-index-response-synthesizers-google/pyproject.toml", "repo_id": "llama_index", "token_count": 674 }
1,455
<jupyter_start><jupyter_text>Utilisation de modèles pré-entraînés (TensorFlow) Installez la bibliothèque 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece] from transformers import pipeline camembert_fill_mask = pipeline("fill-mask", model="camembert-base") re...
notebooks/course/fr/chapter4/section2_tf.ipynb/0
{ "file_path": "notebooks/course/fr/chapter4/section2_tf.ipynb", "repo_id": "notebooks", "token_count": 270 }
300
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, };
chat-langchain/chat-langchain/postcss.config.js/0
{ "file_path": "chat-langchain/chat-langchain/postcss.config.js", "repo_id": "chat-langchain", "token_count": 38 }
7
# LlamaIndex Llms Integration: Nvidia Triton
llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/README.md/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/README.md", "repo_id": "llama_index", "token_count": 13 }
1,363
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/pt/run_scripts.md/0
{ "file_path": "transformers/docs/source/pt/run_scripts.md", "repo_id": "transformers", "token_count": 6916 }
567
package segments import ( "context" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/internal/proto/internalpb" "github.com/milvus-io/milvus/internal/proto/querypb" "github.com/milvus-io/milvus/internal/proto/segcorepb" ) type internalReducer interface { Reduce(context.Contex...
milvus/internal/querynodev2/segments/reducer.go/0
{ "file_path": "milvus/internal/querynodev2/segments/reducer.go", "repo_id": "milvus", "token_count": 360 }
2,048
from diffusers.utils import is_accelerate_available, logging if is_accelerate_available(): pass logger = logging.get_logger(__name__) # pylint: disable=invalid-name def create_unet_diffusers_config(original_config, image_size: int, controlnet=False): """ Creates a config for the diffusers based on the...
diffusers/scripts/convert_svd_to_diffusers.py/0
{ "file_path": "diffusers/scripts/convert_svd_to_diffusers.py", "repo_id": "diffusers", "token_count": 14781 }
224
"""Dataset generation from documents.""" from __future__ import annotations import asyncio import json import re import uuid from typing import Coroutine, Dict, List, Optional, Tuple from deprecated import deprecated from llama_index.core import Document, ServiceContext, SummaryIndex from llama_index.core.bridge.pyda...
llama_index/llama-index-core/llama_index/core/evaluation/dataset_generation.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/evaluation/dataset_generation.py", "repo_id": "llama_index", "token_count": 5679 }
1,116
# 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/reward_modeling.py/0
{ "file_path": "trl/examples/scripts/reward_modeling.py", "repo_id": "trl", "token_count": 1694 }
882
<jupyter_start><jupyter_text>Embedding Documents using Optimized and Quantized EmbeddersIn this tutorial, we will demo how to build a RAG pipeline, with the embedding for all documents done using Quantized Embedders.We will use a pipeline that will:* Create a document collection.* Embed all documents using Quantized Em...
langchain/cookbook/rag_with_quantized_embeddings.ipynb/0
{ "file_path": "langchain/cookbook/rag_with_quantized_embeddings.ipynb", "repo_id": "langchain", "token_count": 1857 }
81
"""Test C Transformers wrapper.""" from langchain_community.llms import CTransformers from tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandler def test_ctransformers_call() -> None: """Test valid call to C Transformers.""" config = {"max_new_tokens": 5} callback_handler = FakeCall...
langchain/libs/community/tests/integration_tests/llms/test_ctransformers.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_ctransformers.py", "repo_id": "langchain", "token_count": 410 }
357
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/ja/index.md/0
{ "file_path": "diffusers/docs/source/ja/index.md", "repo_id": "diffusers", "token_count": 2031 }
202
diff --git a/chromadb/__init__.py b/chromadb/__init__.py index 0ff5244a..450aaf0d 100644 --- a/chromadb/__init__.py +++ b/chromadb/__init__.py @@ -55,21 +55,9 @@ except ImportError: IN_COLAB = False if sqlite3.sqlite_version_info < (3, 35, 0): - if IN_COLAB: - # In Colab, hotswap to pysqlite-binary if ...
chroma/examples/deployments/render-terraform/sqlite_version.patch/0
{ "file_path": "chroma/examples/deployments/render-terraform/sqlite_version.patch", "repo_id": "chroma", "token_count": 485 }
43
# Introduction [[introduction]] <img src="https://huggingface.co/datasets/huggingface-deep-rl-course/course-images/resolve/main/en/unit8/thumbnail.png" alt="Thumbnail"/> In unit 4, we learned about our first Policy-Based algorithm called **Reinforce**. In Policy-Based methods, **we aim to optimize the policy direc...
deep-rl-class/units/en/unit6/introduction.mdx/0
{ "file_path": "deep-rl-class/units/en/unit6/introduction.mdx", "repo_id": "deep-rl-class", "token_count": 427 }
157
# Contributing ## Contributor License Agreement We are grateful to the contributors who help evolve LangServe and dedicate their time to the project. As the primary sponsor of LangServe, LangChain, Inc. aims to build products in the open that benefit thousands of developers while allowing us to build a sustainable bu...
langserve/CONTRIBUTING.md/0
{ "file_path": "langserve/CONTRIBUTING.md", "repo_id": "langserve", "token_count": 540 }
1,037
from langchain import hub from langchain.schema import StrOutputParser from langchain_community.chat_models import ChatAnthropic from langchain_community.utilities import WikipediaAPIWrapper from langchain_core.pydantic_v1 import BaseModel from langchain_core.runnables import RunnableLambda, RunnablePassthrough class...
langchain/templates/chain-of-note-wiki/chain_of_note_wiki/chain.py/0
{ "file_path": "langchain/templates/chain-of-note-wiki/chain_of_note_wiki/chain.py", "repo_id": "langchain", "token_count": 315 }
704
# coding=utf-8 # Copyright 2023 Toshiyuki Sakamoto(tanreinama) and HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
transformers/tests/models/gptsan_japanese/test_tokenization_gptsan_japanese.py/0
{ "file_path": "transformers/tests/models/gptsan_japanese/test_tokenization_gptsan_japanese.py", "repo_id": "transformers", "token_count": 5044 }
716
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-minio/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-minio/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,487
--- hide_table_of_contents: true --- # Amazon Kendra Retriever Amazon Kendra is an intelligent search service provided by Amazon Web Services (AWS). It utilizes advanced natural language processing (NLP) and machine learning algorithms to enable powerful search capabilities across various data sources within an organ...
langchainjs/docs/core_docs/docs/integrations/retrievers/kendra-retriever.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/retrievers/kendra-retriever.mdx", "repo_id": "langchainjs", "token_count": 274 }
735
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/zh/autoclass_tutorial.md/0
{ "file_path": "transformers/docs/source/zh/autoclass_tutorial.md", "repo_id": "transformers", "token_count": 3366 }
536
import { Cohere } from "@langchain/cohere"; export const run = async () => { const model = new Cohere({ temperature: 0.7, maxTokens: 20, maxRetries: 5, }); const res = await model.call( "Question: What would be a good company name a company that makes colorful socks?\nAnswer:" ); console.log(...
langchainjs/examples/src/llms/cohere.ts/0
{ "file_path": "langchainjs/examples/src/llms/cohere.ts", "repo_id": "langchainjs", "token_count": 113 }
826
package model import ( "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" ) var ( filedSchemaPb = &schemapb.FieldSchema{ FieldID: fieldID, Name: fieldName, IsPrimaryKey: false, Descrip...
milvus/internal/metastore/model/field_test.go/0
{ "file_path": "milvus/internal/metastore/model/field_test.go", "repo_id": "milvus", "token_count": 1855 }
1,828
# coding=utf-8 # Copyright 2022 The Salesforce Team Authors and The HuggingFace Team. All rights reserved. # # Licensed under the BSD-3-clause license (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/BSD...
transformers/src/transformers/models/blip/modeling_blip_text.py/0
{ "file_path": "transformers/src/transformers/models/blip/modeling_blip_text.py", "repo_id": "transformers", "token_count": 18766 }
588
from typing import Annotated, List, Optional from uuid import uuid4 from fastapi import APIRouter, HTTPException, Path, Query from pydantic import BaseModel, Field import app.storage as storage from app.schema import Assistant, AssistantWithoutUserId, OpengptsUserId router = APIRouter() FEATURED_PUBLIC_ASSISTANTS =...
opengpts/backend/app/api/assistants.py/0
{ "file_path": "opengpts/backend/app/api/assistants.py", "repo_id": "opengpts", "token_count": 869 }
1,918
// 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/common/FieldData.cpp/0
{ "file_path": "milvus/internal/core/src/common/FieldData.cpp", "repo_id": "milvus", "token_count": 4059 }
1,639
<!--- Copyright 2021 NVIDIA Corporation. 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 agr...
transformers/examples/research_projects/quantization-qdqbert/README.md/0
{ "file_path": "transformers/examples/research_projects/quantization-qdqbert/README.md", "repo_id": "transformers", "token_count": 2094 }
540
<jupyter_start><jupyter_text>Split by tokens Language models have a token limit. You should not exceed the token limit. When you split your text into chunks it is therefore a good idea to count the number of tokens. There are many tokenizers. When you count tokens in your text you should use the same tokenizer as used ...
langchain/docs/docs/modules/data_connection/document_transformers/split_by_token.ipynb/0
{ "file_path": "langchain/docs/docs/modules/data_connection/document_transformers/split_by_token.ipynb", "repo_id": "langchain", "token_count": 4069 }
199
import argparse import docker import gzip import os import yaml from nested_lookup import nested_lookup if __name__ == "__main__": parser = argparse.ArgumentParser( description="Save Docker images") parser.add_argument("--manifest", required=True, help=...
milvus/deployments/offline/save_image.py/0
{ "file_path": "milvus/deployments/offline/save_image.py", "repo_id": "milvus", "token_count": 745 }
1,711
# Llama.cpp This page covers how to use [llama.cpp](https://github.com/ggerganov/llama.cpp) within LangChain. It is broken into two parts: installation and setup, and then references to specific Llama-cpp wrappers. ## Installation and Setup - Install the Python package with `pip install llama-cpp-python` - Download o...
langchain/docs/docs/integrations/providers/llamacpp.mdx/0
{ "file_path": "langchain/docs/docs/integrations/providers/llamacpp.mdx", "repo_id": "langchain", "token_count": 305 }
144
"""**Document Transformers** are classes to transform Documents. **Document Transformers** usually used to transform a lot of Documents in a single run. **Class hierarchy:** .. code-block:: BaseDocumentTransformer --> <name> # Examples: DoctranQATransformer, DoctranTextTranslator **Main helpers:** .. code-bl...
langchain/libs/langchain/langchain/document_transformers/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_transformers/__init__.py", "repo_id": "langchain", "token_count": 566 }
520
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/unittest/test_storage.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_storage.cpp", "repo_id": "milvus", "token_count": 2130 }
1,680
from llama_index.core.readers.base import BaseReader from llama_index.readers.snowflake import SnowflakeReader def test_class(): names_of_base_classes = [b.__name__ for b in SnowflakeReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-snowflake/tests/test_readers_snowflake.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-snowflake/tests/test_readers_snowflake.py", "repo_id": "llama_index", "token_count": 89 }
1,442
from langchain_core.tracers.stdout import ( ConsoleCallbackHandler, FunctionCallbackHandler, ) __all__ = ["FunctionCallbackHandler", "ConsoleCallbackHandler"]
langchain/libs/langchain/langchain/callbacks/tracers/stdout.py/0
{ "file_path": "langchain/libs/langchain/langchain/callbacks/tracers/stdout.py", "repo_id": "langchain", "token_count": 48 }
452
<jupyter_start><jupyter_text>Introduction aux Blocks Installez les bibliothèques 🤗 Transformers et 🤗 Gradio pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece] !pip install gradio import gradio as gr def flip_text(x): return x[::-1] demo = gr.Blocks() with demo: gr....
notebooks/course/fr/chapter9/section7.ipynb/0
{ "file_path": "notebooks/course/fr/chapter9/section7.ipynb", "repo_id": "notebooks", "token_count": 1332 }
274
# coding=utf-8 # Copyright 2022 Facebook AI and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
transformers/src/transformers/models/vit_msn/configuration_vit_msn.py/0
{ "file_path": "transformers/src/transformers/models/vit_msn/configuration_vit_msn.py", "repo_id": "transformers", "token_count": 1896 }
737
<jupyter_start><jupyter_text>Few-shot prompt templatesIn this tutorial, we'll learn how to create a prompt template that uses few-shot examples. A few-shot prompt template can be constructed from either a set of examples, or from an Example Selector object. Use CaseIn this tutorial, we'll configure few-shot examples fo...
langchain/docs/docs/modules/model_io/prompts/few_shot_examples.ipynb/0
{ "file_path": "langchain/docs/docs/modules/model_io/prompts/few_shot_examples.ipynb", "repo_id": "langchain", "token_count": 2098 }
215
"""Text to Image tool spec.""" from io import BytesIO from typing import List, Optional import openai import requests from llama_index.core.tools.tool_spec.base import BaseToolSpec class TextToImageToolSpec(BaseToolSpec): """Text to Image tool spec.""" spec_functions = ["generate_images", "show_images", "g...
llama_index/llama-index-integrations/tools/llama-index-tools-text-to-image/llama_index/tools/text_to_image/base.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-text-to-image/llama_index/tools/text_to_image/base.py", "repo_id": "llama_index", "token_count": 1168 }
1,531
# 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...
trl/trl/environment/base_environment.py/0
{ "file_path": "trl/trl/environment/base_environment.py", "repo_id": "trl", "token_count": 7661 }
863
import * as fsDefault from "node:fs"; import * as path from "node:path"; import * as os from "node:os"; import { Readable } from "node:stream"; import { S3Client, GetObjectCommand, S3ClientConfig } from "@aws-sdk/client-s3"; import { BaseDocumentLoader } from "../base.js"; import { UnstructuredLoader as UnstructuredLoa...
langchainjs/langchain/src/document_loaders/web/s3.ts/0
{ "file_path": "langchainjs/langchain/src/document_loaders/web/s3.ts", "repo_id": "langchainjs", "token_count": 1760 }
949
from langchain_community.vectorstores.sqlitevss import SQLiteVSS __all__ = ["SQLiteVSS"]
langchain/libs/langchain/langchain/vectorstores/sqlitevss.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/sqlitevss.py", "repo_id": "langchain", "token_count": 31 }
579
--- sidebar_class_name: hidden hide_table_of_contents: true --- # LangChain Expression Language Cheatsheet For a quick reference for LangChain Expression Language, check out the below overview/cheatsheet made by [@zhanghaili0610](https://twitter.com/zhanghaili0610): ![](/img/langchain-js-runnable-cheatsheet.png)
langchainjs/docs/core_docs/docs/additional_resources/tutorials/expression_language_cheatsheet.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/additional_resources/tutorials/expression_language_cheatsheet.mdx", "repo_id": "langchainjs", "token_count": 104 }
714
// 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/proxyutil/proxy_watcher_test.go/0
{ "file_path": "milvus/internal/util/proxyutil/proxy_watcher_test.go", "repo_id": "milvus", "token_count": 2138 }
2,080
# Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
datasets/src/datasets/info.py/0
{ "file_path": "datasets/src/datasets/info.py", "repo_id": "datasets", "token_count": 11409 }
143
// 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.go/0
{ "file_path": "milvus/internal/datacoord/garbage_collector.go", "repo_id": "milvus", "token_count": 7234 }
1,827
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
transformers/examples/research_projects/movement-pruning/masked_run_glue.py/0
{ "file_path": "transformers/examples/research_projects/movement-pruning/masked_run_glue.py", "repo_id": "transformers", "token_count": 18297 }
593
import json from typing import Any, AsyncIterator, Dict, Iterator, List, Mapping, Optional import aiohttp import requests from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain_core.language_models import BaseLanguageModel from langchain_core.language_m...
langchain/libs/community/langchain_community/llms/ollama.py/0
{ "file_path": "langchain/libs/community/langchain_community/llms/ollama.py", "repo_id": "langchain", "token_count": 7945 }
284
# Chat Stores A chat store serves as a centralized interface to store your chat history. Chat history is unique to other storage formats, since the order of messages is important to maintining an overall conversation. Chat stores can be organize sequences of chat messages by keys (like `user_ids` or other unique iden...
llama_index/docs/module_guides/storing/chat_stores.md/0
{ "file_path": "llama_index/docs/module_guides/storing/chat_stores.md", "repo_id": "llama_index", "token_count": 637 }
1,147
--- sidebar_class_name: hidden --- import CodeBlock from "@theme/CodeBlock"; # Combining output parsers Output parsers can be combined using `CombiningOutputParser`. This output parser takes in a list of output parsers, and will ask for (and parse) a combined output that contains all the fields of all the parsers. ...
langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/combining_output_parser.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/combining_output_parser.mdx", "repo_id": "langchainjs", "token_count": 187 }
750
"""Browser tools and toolkit.""" from langchain_community.tools.playwright.click import ClickTool from langchain_community.tools.playwright.current_page import CurrentWebPageTool from langchain_community.tools.playwright.extract_hyperlinks import ( ExtractHyperlinksTool, ) from langchain_community.tools.playwright...
langchain/libs/community/langchain_community/tools/playwright/__init__.py/0
{ "file_path": "langchain/libs/community/langchain_community/tools/playwright/__init__.py", "repo_id": "langchain", "token_count": 233 }
307
from typing import Any, Dict, List, Optional from llama_index.core import VectorStoreIndex from llama_index.core.llama_pack.base import BaseLlamaPack from llama_index.core.llms.llm import LLM from llama_index.core.query_engine import PandasQueryEngine, RetrieverQueryEngine from llama_index.core.response_synthesizers i...
llama_index/llama-index-packs/llama-index-packs-stock-market-data-query-engine/llama_index/packs/stock_market_data_query_engine/base.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-stock-market-data-query-engine/llama_index/packs/stock_market_data_query_engine/base.py", "repo_id": "llama_index", "token_count": 1603 }
1,607
from langchain_community.vectorstores.awadb import AwaDB __all__ = ["AwaDB"]
langchain/libs/langchain/langchain/vectorstores/awadb.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/awadb.py", "repo_id": "langchain", "token_count": 28 }
581
from __future__ import annotations import datetime import os from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, ) from uuid import uuid4 import numpy as np from langchain_core.documents import Document from langchain_core.embeddings import Embeddi...
langchain/libs/community/langchain_community/vectorstores/weaviate.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/weaviate.py", "repo_id": "langchain", "token_count": 9031 }
315
accelerate launch --config_file accelerate_config.yaml run_seq2seq_no_trainer.py \ --dataset_name "smangrul/MuDoConv" \ --max_source_length 128 \ --source_prefix "chatbot: " \ --max_target_length 64 \ --val_max_target_length 64 \ --val_min_target_length 20 \ --n_val_batch_generations 5 \ ...
notebooks/sagemaker/22_accelerate_sagemaker_examples/src/seq2seq/launch.sh/0
{ "file_path": "notebooks/sagemaker/22_accelerate_sagemaker_examples/src/seq2seq/launch.sh", "repo_id": "notebooks", "token_count": 355 }
319
# Copyright 2023 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
transformers/src/transformers/integrations/__init__.py/0
{ "file_path": "transformers/src/transformers/integrations/__init__.py", "repo_id": "transformers", "token_count": 2136 }
562
import argparse import intel_extension_for_pytorch as ipex import torch from diffusers import DPMSolverMultistepScheduler, StableDiffusionPipeline parser = argparse.ArgumentParser("Stable Diffusion script with intel optimization", add_help=False) parser.add_argument("--dpm", action="store_true", help="Enable DPMSol...
diffusers/examples/research_projects/intel_opts/inference_bf16.py/0
{ "file_path": "diffusers/examples/research_projects/intel_opts/inference_bf16.py", "repo_id": "diffusers", "token_count": 798 }
219
from langchain_community.llms.xinference import Xinference __all__ = ["Xinference"]
langchain/libs/langchain/langchain/llms/xinference.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/xinference.py", "repo_id": "langchain", "token_count": 27 }
553
poetry_requirements( name="poetry", )
llama_index/llama-index-integrations/llms/llama-index-llms-dashscope/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-dashscope/BUILD", "repo_id": "llama_index", "token_count": 18 }
1,349
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/pop2piano/test_modeling_pop2piano.py/0
{ "file_path": "transformers/tests/models/pop2piano/test_modeling_pop2piano.py", "repo_id": "transformers", "token_count": 15077 }
780
import { serve } from "http/server.ts"; import { ChatOpenAI } from "langchain/chat_models/openai"; import { LLMChain } from "langchain/chains"; import { CallbackManager } from "langchain/callbacks"; import { ChatPromptTemplate, HumanMessagePromptTemplate, } from "langchain/prompts"; import { corsHeaders } from ".....
langchain-template-supabase/supabase/functions/chat/index.ts/0
{ "file_path": "langchain-template-supabase/supabase/functions/chat/index.ts", "repo_id": "langchain-template-supabase", "token_count": 1007 }
71
"""Snowflake Reader.""" import logging from typing import Any, List, Optional from llama_index.core.readers.base import BaseReader from llama_index.core.schema import Document from sqlalchemy import create_engine, text from sqlalchemy.engine import Engine from sqlalchemy.orm import sessionmaker logger = logging.getL...
llama_index/llama-index-integrations/readers/llama-index-readers-snowflake/llama_index/readers/snowflake/base.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-snowflake/llama_index/readers/snowflake/base.py", "repo_id": "llama_index", "token_count": 1906 }
1,377
from langchain_community.document_loaders.airbyte import ( AirbyteCDKLoader, AirbyteGongLoader, AirbyteHubspotLoader, AirbyteSalesforceLoader, AirbyteShopifyLoader, AirbyteStripeLoader, AirbyteTypeformLoader, AirbyteZendeskSupportLoader, RecordHandler, ) __all__ = [ "RecordHandl...
langchain/libs/langchain/langchain/document_loaders/airbyte.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/airbyte.py", "repo_id": "langchain", "token_count": 218 }
474
# Copyright 2024 Pix2Pix Zero Authors and The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_pix2pix_zero.py", "repo_id": "diffusers", "token_count": 28096 }
241
from exa_py.api import HighlightsContentsOptions, TextContentsOptions # type: ignore from langchain_exa.retrievers import ExaSearchRetriever from langchain_exa.tools import ExaFindSimilarResults, ExaSearchResults __all__ = [ "ExaSearchResults", "ExaSearchRetriever", "HighlightsContentsOptions", "Text...
langchain/libs/partners/exa/langchain_exa/__init__.py/0
{ "file_path": "langchain/libs/partners/exa/langchain_exa/__init__.py", "repo_id": "langchain", "token_count": 121 }
650
<!--⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be rendered properly in your Markdown viewer. --> # DeepSpeed [DeepSpeed](https://www.deepspeed.ai/) is a library designed for speed and scale for distributed training of large models with billions ...
peft/docs/source/accelerate/deepspeed-zero3-offload.md/0
{ "file_path": "peft/docs/source/accelerate/deepspeed-zero3-offload.md", "repo_id": "peft", "token_count": 2997 }
323
"""Test the comparison chains.""" import re import pytest from langchain.evaluation.comparison.eval_chain import ( LabeledPairwiseStringEvalChain, PairwiseStringEvalChain, PairwiseStringResultOutputParser, resolve_pairwise_criteria, ) from langchain.evaluation.criteria.eval_chain import Criteria fro...
langchain/libs/langchain/tests/unit_tests/evaluation/comparison/test_eval_chain.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/evaluation/comparison/test_eval_chain.py", "repo_id": "langchain", "token_count": 1549 }
655
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-obsidian/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-obsidian/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,436
<jupyter_start><jupyter_text>LarkSuite (FeiShu)>[LarkSuite](https://www.larksuite.com/) is an enterprise collaboration platform developed by ByteDance.This notebook covers how to load data from the `LarkSuite` REST API into a format that can be ingested into LangChain, along with example usage for text summarization.Th...
langchain/docs/docs/integrations/document_loaders/larksuite.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/larksuite.ipynb", "repo_id": "langchain", "token_count": 400 }
105
from llama_index.core.readers.base import BaseReader from llama_index.readers.airbyte_cdk import AirbyteCDKReader def test_class(): names_of_base_classes = [b.__name__ for b in AirbyteCDKReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-cdk/tests/test_readers_airbyte_cdk.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-airbyte-cdk/tests/test_readers_airbyte_cdk.py", "repo_id": "llama_index", "token_count": 95 }
1,278
from langchain_community.tools.yahoo_finance_news import YahooFinanceNewsTool __all__ = ["YahooFinanceNewsTool"]
langchain/libs/langchain/langchain/tools/yahoo_finance_news.py/0
{ "file_path": "langchain/libs/langchain/langchain/tools/yahoo_finance_news.py", "repo_id": "langchain", "token_count": 35 }
559
from importlib import metadata ## Create namespaces for pydantic v1 and v2. # This code must stay at the top of the file before other modules may # attempt to import pydantic since it adds pydantic_v1 and pydantic_v2 to sys.modules. # # This hack is done for the following reasons: # * Langchain will attempt to remain ...
langserve/langserve/pydantic_v1.py/0
{ "file_path": "langserve/langserve/pydantic_v1.py", "repo_id": "langserve", "token_count": 400 }
1,090
<jupyter_start><jupyter_text>EPub >[EPUB](https://en.wikipedia.org/wiki/EPUB) is an e-book file format that uses the ".epub" file extension. The term is short for electronic publication and is sometimes styled ePub. `EPUB` is supported by many e-readers, and compatible software is available for most smartphones, tablet...
langchain/docs/docs/integrations/document_loaders/epub.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_loaders/epub.ipynb", "repo_id": "langchain", "token_count": 328 }
109
"""Azure Cognitive Vision tool spec.""" from typing import List, Optional import requests from llama_index.core.tools.tool_spec.base import BaseToolSpec CV_URL_TMPL = "https://{resource}.cognitiveservices.azure.com/computervision/imageanalysis:analyze" class AzureCVToolSpec(BaseToolSpec): """Azure Cognitive Vi...
llama_index/llama-index-integrations/tools/llama-index-tools-azure-cv/llama_index/tools/azure_cv/base.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-azure-cv/llama_index/tools/azure_cv/base.py", "repo_id": "llama_index", "token_count": 667 }
1,414
# coding=utf-8 # Copyright 2024 The HuggingFace Inc. team. # Copyright (c) 2022, NVIDIA CORPORATION. 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.a...
diffusers/src/diffusers/pipelines/pipeline_utils.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/pipeline_utils.py", "repo_id": "diffusers", "token_count": 43588 }
240
export { type BaseGetPromptAsyncOptions, BasePromptSelector, ConditionalPromptSelector, isLLM, isChatModel, } from "@langchain/core/example_selectors";
langchainjs/langchain/src/prompts/selectors/conditional.ts/0
{ "file_path": "langchainjs/langchain/src/prompts/selectors/conditional.ts", "repo_id": "langchainjs", "token_count": 56 }
941
import json import requests from aiohttp import ClientSession, ClientTimeout from pydantic import ValidationError from typing import Dict, Optional, List, AsyncIterator, Iterator from text_generation.types import ( StreamResponse, Response, Request, Parameters, Grammar, ) from text_generation.erro...
text-generation-inference/clients/python/text_generation/client.py/0
{ "file_path": "text-generation-inference/clients/python/text_generation/client.py", "repo_id": "text-generation-inference", "token_count": 9482 }
418
from llama_index.core.vector_stores.types import BasePydanticVectorStore from llama_index.vector_stores.pinecone import PineconeVectorStore def test_class(): names_of_base_classes = [b.__name__ for b in PineconeVectorStore.__mro__] assert BasePydanticVectorStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-pinecone/tests/test_vector_stores_pinecone.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-pinecone/tests/test_vector_stores_pinecone.py", "repo_id": "llama_index", "token_count": 100 }
1,533
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-monsterapi/llama_index/llms/monsterapi/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-monsterapi/llama_index/llms/monsterapi/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,288
<script lang="ts"> import { base } from "$app/paths"; import { page } from "$app/stores"; import { PUBLIC_APP_DESCRIPTION, PUBLIC_APP_NAME, PUBLIC_APP_DISCLAIMER_MESSAGE, } from "$env/static/public"; import LogoHuggingFaceBorderless from "$lib/components/icons/LogoHuggingFaceBorderless.svelte"; import Modal...
chat-ui/src/lib/components/DisclaimerModal.svelte/0
{ "file_path": "chat-ui/src/lib/components/DisclaimerModal.svelte", "repo_id": "chat-ui", "token_count": 1051 }
100
# Conversation Buffer Window `ConversationBufferWindowMemory` keeps a list of the interactions of the conversation over time. It only uses the last K interactions. This can be useful for keeping a sliding window of the most recent interactions, so the buffer does not get too large. Let's first explore the basic funct...
langchain/docs/docs/modules/memory/types/buffer_window.mdx/0
{ "file_path": "langchain/docs/docs/modules/memory/types/buffer_window.mdx", "repo_id": "langchain", "token_count": 1523 }
195
"""arXiv tool spec.""" from typing import Optional from llama_index.core.schema import Document from llama_index.core.tools.tool_spec.base import BaseToolSpec class ArxivToolSpec(BaseToolSpec): """arXiv tool spec.""" spec_functions = ["arxiv_query"] def __init__(self, max_results: Optional[int] = 3): ...
llama_index/llama-index-integrations/tools/llama-index-tools-arxiv/llama_index/tools/arxiv/base.py/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-arxiv/llama_index/tools/arxiv/base.py", "repo_id": "llama_index", "token_count": 514 }
1,612
<jupyter_start><jupyter_text>Spot Instances - Amazon SageMaker x Hugging Face Transformers Learn how to use Spot Instances and Checkpointing and save up to 90% training cost [Amazon EC2 Spot Instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html) are a way to take advantage of unused E...
notebooks/sagemaker/05_spot_instances/sagemaker-notebook.ipynb/0
{ "file_path": "notebooks/sagemaker/05_spot_instances/sagemaker-notebook.ipynb", "repo_id": "notebooks", "token_count": 3523 }
285
============= LangChain API ============= .. toctree:: :maxdepth: 2 api_reference.rst
langchain/docs/api_reference/index.rst/0
{ "file_path": "langchain/docs/api_reference/index.rst", "repo_id": "langchain", "token_count": 37 }
79
import { OpenAI, ChatOpenAI } from "@langchain/openai"; import { ConversationSummaryBufferMemory } from "langchain/memory"; import { ConversationChain } from "langchain/chains"; import { ChatPromptTemplate, HumanMessagePromptTemplate, MessagesPlaceholder, SystemMessagePromptTemplate, } from "@langchain/core/pro...
langchainjs/examples/src/memory/summary_buffer.ts/0
{ "file_path": "langchainjs/examples/src/memory/summary_buffer.ts", "repo_id": "langchainjs", "token_count": 1107 }
830
from llama_index.core.readers.base import BaseReader from llama_index.readers.dad_jokes import DadJokesReader def test_class(): names_of_base_classes = [b.__name__ for b in DadJokesReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-dad-jokes/tests/test_readers_dad_jokes.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-dad-jokes/tests/test_readers_dad_jokes.py", "repo_id": "llama_index", "token_count": 92 }
1,281
## Zulip Loader The Zulip Loader is a Python script that allows you to load data from Zulip streams using a Zulip bot's API token. It fetches messages from specified streams or all streams if none are specified, and returns a list of documents with the stream content. ### Prerequisites Create a Zulip bot and obtain ...
llama_index/llama-index-integrations/readers/llama-index-readers-zulip/README.md/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-zulip/README.md", "repo_id": "llama_index", "token_count": 392 }
1,547
"""Test Cloudflare Workers AI embeddings.""" import responses from langchain_community.embeddings.cloudflare_workersai import ( CloudflareWorkersAIEmbeddings, ) @responses.activate def test_cloudflare_workers_ai_embedding_documents() -> None: """Test Cloudflare Workers AI embeddings.""" documents = ["fo...
langchain/libs/community/tests/integration_tests/embeddings/test_cloudflare_workersai.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_cloudflare_workersai.py", "repo_id": "langchain", "token_count": 727 }
354
<jupyter_start><jupyter_text>You will need an authentication token with your Hugging Face credentials to use the `push_to_hub` method. Execute `huggingface-cli login` in your terminal or by uncommenting the following cell:<jupyter_code># !huggingface-cli login import numpy as np from datasets import load_dataset, load...
notebooks/course/videos/push_to_hub_new.ipynb/0
{ "file_path": "notebooks/course/videos/push_to_hub_new.ipynb", "repo_id": "notebooks", "token_count": 1284 }
316
<jupyter_start><jupyter_text>Clarifai LLM Example notebook to call different LLM models using clarifai If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-llms-clarifai !pip install llama-index<jupyter_output><empty_output><jupyter_text>Instal...
llama_index/docs/examples/llm/clarifai.ipynb/0
{ "file_path": "llama_index/docs/examples/llm/clarifai.ipynb", "repo_id": "llama_index", "token_count": 1110 }
1,112
{ "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "data": { "values": "<DVC_METRIC_DATA>" }, "title": "<DVC_METRIC_TITLE>", "mark": "rect", "encoding": { "x": { "field": "<DVC_METRIC_X>", "type": "nominal", "sort": "ascending", ...
datasets/.dvc/plots/confusion.json/0
{ "file_path": "datasets/.dvc/plots/confusion.json", "repo_id": "datasets", "token_count": 450 }
115
[tool.poetry] name = "extraction-openai-functions" version = "0.1.0" description = "Use OpenAI function calling for tasks like extraction or tagging" authors = [ "Lance Martin <lance@langchain.dev>", ] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8.1,<4.0" langchain = "^0.1" openai = "<2" [tool.p...
langchain/templates/extraction-openai-functions/pyproject.toml/0
{ "file_path": "langchain/templates/extraction-openai-functions/pyproject.toml", "repo_id": "langchain", "token_count": 281 }
691
# LlamaIndex Embeddings Integration: Voyageai
llama_index/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/README.md/0
{ "file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/README.md", "repo_id": "llama_index", "token_count": 13 }
1,325
<jupyter_start><jupyter_text>Quantizing a model during fine-tuning with Intel Neural Compressor (INC) for text classification tasks This notebook shows how to apply quantization aware training, using the [Intel Neural Compressor](https://github.com/intel/neural-compressor) (INC) library, for any tasks of the GLUE bench...
notebooks/examples/text_classification_quantization_inc.ipynb/0
{ "file_path": "notebooks/examples/text_classification_quantization_inc.ipynb", "repo_id": "notebooks", "token_count": 5868 }
297
import { defaultProvider } from "@aws-sdk/credential-provider-node"; import type { BaseChatModelParams } from "@langchain/core/language_models/chat_models"; import { BaseBedrockInput } from "../../utils/bedrock.js"; import { BedrockChat as BaseBedrockChat } from "./web.js"; /** * @example * ```typescript * const ...
langchainjs/libs/langchain-community/src/chat_models/bedrock/index.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/chat_models/bedrock/index.ts", "repo_id": "langchainjs", "token_count": 340 }
961
import { OpenAIEmbeddings } from "@langchain/openai"; import { Neo4jVectorStore } from "@langchain/community/vectorstores/neo4j_vector"; /* * The retrievalQuery is a customizable Cypher query fragment used in the Neo4jVectorStore class to define how * search results should be retrieved and presented from the Neo4j d...
langchainjs/examples/src/indexes/vector_stores/neo4j_vector/neo4j_vector_retrieval.ts/0
{ "file_path": "langchainjs/examples/src/indexes/vector_stores/neo4j_vector/neo4j_vector_retrieval.ts", "repo_id": "langchainjs", "token_count": 646 }
806