text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
package model import "github.com/chroma/chroma-coordinator/internal/types" type Database struct { ID string Name string Tenant string Ts types.Timestamp } type CreateDatabase struct { ID string Name string Tenant string Ts types.Timestamp } type GetDatabase struct { ID string Name ...
chroma/go/coordinator/internal/model/database.go/0
{ "file_path": "chroma/go/coordinator/internal/model/database.go", "repo_id": "chroma", "token_count": 140 }
49
#!/usr/bin/env bash set -e # Assert first argument is present if [ -z "$1" ]; then echo "Usage: bin/test-remote <remote-host>" exit 1 fi export CHROMA_INTEGRATION_TEST_ONLY=1 export CHROMA_SERVER_HOST=$1 export CHROMA_API_IMPL=chromadb.api.fastapi.FastAPI export CHROMA_SERVER_HTTP_PORT=8000 python -m pytest...
chroma/bin/test-remote/0
{ "file_path": "chroma/bin/test-remote", "repo_id": "chroma", "token_count": 134 }
11
python_sources()
llama_index/llama-index-legacy/llama_index/legacy/readers/weaviate/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/weaviate/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,535
<jupyter_start><jupyter_text>StreamingOften in Q&A applications it's important to show users the sources that were used to generate the answer. The simplest way to do this is for the chain to return the Documents that were retrieved in each generation.We'll work off of the Q&A app with sources we built over the [LLM Po...
langchainjs/docs/core_docs/docs/use_cases/question_answering/streaming.ipynb/0
{ "file_path": "langchainjs/docs/core_docs/docs/use_cases/question_answering/streaming.ipynb", "repo_id": "langchainjs", "token_count": 2092 }
769
# 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...
accelerate/manim_animations/big_model_inference/stage_1.py/0
{ "file_path": "accelerate/manim_animations/big_model_inference/stage_1.py", "repo_id": "accelerate", "token_count": 1904 }
8
from .module import Module from typing import Optional, Tuple, Any from candle import Tensor import candle class Embedding(Module): """A simple lookup table that stores embeddings of a fixed dictionary and size. This module is often used to store word embeddings and retrieve them using indices. The input...
candle/candle-pyo3/py_src/candle/nn/sparse.py/0
{ "file_path": "candle/candle-pyo3/py_src/candle/nn/sparse.py", "repo_id": "candle", "token_count": 590 }
68
from self_query_qdrant.chain import chain __all__ = ["chain"]
langchain/templates/self-query-qdrant/self_query_qdrant/__init__.py/0
{ "file_path": "langchain/templates/self-query-qdrant/self_query_qdrant/__init__.py", "repo_id": "langchain", "token_count": 22 }
681
<jupyter_start><jupyter_text>ClientDemo of client interacting with the simple chain server, which deploys a chain that tells jokes about a particular topic. You can interact with this via API directly<jupyter_code>import requests inputs = {"input": {"topic": "sports"}} response = requests.post("http://localhost:8000/c...
langserve/examples/configurable_chain/client.ipynb/0
{ "file_path": "langserve/examples/configurable_chain/client.ipynb", "repo_id": "langserve", "token_count": 1457 }
1,040
--- sidebar_class_name: hidden --- # Bytes output parser The `BytesOutputParser` takes language model output (either an entire response or as a stream) and converts it into binary data. This is particularly useful for streaming output to the frontend from a server. This output parser can act as a transform stream an...
langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/bytes.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/model_io/output_parsers/types/bytes.mdx", "repo_id": "langchainjs", "token_count": 208 }
763
pub(crate) mod cache; #[cfg(feature = "http")] pub(crate) mod from_pretrained; #[cfg(feature = "unstable_wasm")] mod fancy; #[cfg(feature = "unstable_wasm")] pub use fancy::SysRegex; #[cfg(not(feature = "unstable_wasm"))] mod onig; #[cfg(not(feature = "unstable_wasm"))] pub use crate::utils::onig::SysRegex; pub mod i...
tokenizers/tokenizers/src/utils/mod.rs/0
{ "file_path": "tokenizers/tokenizers/src/utils/mod.rs", "repo_id": "tokenizers", "token_count": 3092 }
482
use super::{Metadata, MetadataValueConversionError}; use crate::{ chroma_proto, errors::{ChromaError, ErrorCodes}, }; use thiserror::Error; use uuid::Uuid; #[derive(Debug, PartialEq)] pub(crate) struct Collection { pub(crate) id: Uuid, pub(crate) name: String, pub(crate) topic: String, pub(crat...
chroma/rust/worker/src/types/collection.rs/0
{ "file_path": "chroma/rust/worker/src/types/collection.rs", "repo_id": "chroma", "token_count": 1286 }
63
# Copyright 2020 The HuggingFace 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 # # Unless required by applicable law or ...
datasets/metrics/meteor/meteor.py/0
{ "file_path": "datasets/metrics/meteor/meteor.py", "repo_id": "datasets", "token_count": 1898 }
122
<jupyter_start><jupyter_text>Vector SQL Retriever with MyScale>[MyScale](https://docs.myscale.com/en/) is an integrated vector database. You can access your database in SQL and also from here, LangChain. MyScale can make a use of [various data types and functions for filters](https://blog.myscale.com/2023/06/06/why-int...
langchain/cookbook/myscale_vector_sql.ipynb/0
{ "file_path": "langchain/cookbook/myscale_vector_sql.ipynb", "repo_id": "langchain", "token_count": 1520 }
74
from langchain_community.embeddings.vertexai import VertexAIEmbeddings __all__ = ["VertexAIEmbeddings"]
langchain/libs/langchain/langchain/embeddings/vertexai.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/vertexai.py", "repo_id": "langchain", "token_count": 37 }
501
<!--Copyright 2021 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/byt5.md/0
{ "file_path": "transformers/docs/source/en/model_doc/byt5.md", "repo_id": "transformers", "token_count": 2292 }
458
package proxy import ( "context" "fmt" "plugin" "strconv" "strings" "github.com/cockroachdb/errors" "go.uber.org/zap" "google.golang.org/grpc" "github.com/milvus-io/milvus-proto/go-api/v2/hook" "github.com/milvus-io/milvus/pkg/config" "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg...
milvus/internal/proxy/hook_interceptor.go/0
{ "file_path": "milvus/internal/proxy/hook_interceptor.go", "repo_id": "milvus", "token_count": 1919 }
1,826
<!--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/ko/training/unconditional_training.md/0
{ "file_path": "diffusers/docs/source/ko/training/unconditional_training.md", "repo_id": "diffusers", "token_count": 3095 }
195
#include <cstdint> #include <cassert> #include <boost/filesystem.hpp> #include <iostream> #include "tantivy-binding.h" #include "tantivy-wrapper.h" using namespace milvus::tantivy; template <typename T> void run() { std::cout << "run " << typeid(T).name() << std::endl; auto path = "/tmp/inverted-index/test-...
milvus/internal/core/thirdparty/tantivy/test.cpp/0
{ "file_path": "milvus/internal/core/thirdparty/tantivy/test.cpp", "repo_id": "milvus", "token_count": 1676 }
1,753
# Generated content DO NOT EDIT from .. import onnx ONNXModel = onnx.ONNXModel ONNXTensorDescription = onnx.ONNXTensorDescription
candle/candle-pyo3/py_src/candle/onnx/__init__.py/0
{ "file_path": "candle/candle-pyo3/py_src/candle/onnx/__init__.py", "repo_id": "candle", "token_count": 46 }
68
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-mongodb/llama_index/readers/mongodb/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-mongodb/llama_index/readers/mongodb/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,344
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
transformers/tests/models/realm/test_retrieval_realm.py/0
{ "file_path": "transformers/tests/models/realm/test_retrieval_realm.py", "repo_id": "transformers", "token_count": 3280 }
834
## Tests ### E2E Test #### Configuration Requirements ##### Operating System | Operating System | Version | | ---------------- | -------------- | | Amazon Linux | 2023 or above | | Ubuntu | 20.04 or above | | Mac | 10.14 or above | ##### Hardware | Hardware Type | Recommended Co...
milvus/tests/README.md/0
{ "file_path": "milvus/tests/README.md", "repo_id": "milvus", "token_count": 1142 }
2,130
from langchain_community.vectorstores.momento_vector_index import ( MomentoVectorIndex, ) __all__ = ["MomentoVectorIndex"]
langchain/libs/langchain/langchain/vectorstores/momento_vector_index.py/0
{ "file_path": "langchain/libs/langchain/langchain/vectorstores/momento_vector_index.py", "repo_id": "langchain", "token_count": 41 }
604
// Code generated by mockery v2.32.4. DO NOT EDIT. package syncmgr import ( msgpb "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" mock "github.com/stretchr/testify/mock" ) // MockTask is an autogenerated mock type for the Task type type MockTask struct { mock.Mock } type MockTask_Expecter struct { mock *moc...
milvus/internal/datanode/syncmgr/mock_task.go/0
{ "file_path": "milvus/internal/datanode/syncmgr/mock_task.go", "repo_id": "milvus", "token_count": 2918 }
1,781
python_sources() poetry_requirements( name="poetry", )
llama_index/llama-index-cli/BUILD/0
{ "file_path": "llama_index/llama-index-cli/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,238
from typing import Any from llama_index.core.callbacks.base_handler import BaseCallbackHandler from deepeval.tracing.integrations.llama_index import LlamaIndexCallbackHandler def deepeval_callback_handler(**eval_params: Any) -> BaseCallbackHandler: return LlamaIndexCallbackHandler(**eval_params)
llama_index/llama-index-integrations/callbacks/llama-index-callbacks-deepeval/llama_index/callbacks/deepeval/base.py/0
{ "file_path": "llama_index/llama-index-integrations/callbacks/llama-index-callbacks-deepeval/llama_index/callbacks/deepeval/base.py", "repo_id": "llama_index", "token_count": 89 }
1,182
"""Fake Embedding class for testing purposes.""" import math from typing import List from langchain_core.embeddings import Embeddings fake_texts = ["foo", "bar", "baz"] class FakeEmbeddings(Embeddings): """Fake embeddings functionality for testing.""" def embed_documents(self, texts: List[str]) -> List[Lis...
langchain/libs/community/tests/integration_tests/vectorstores/fake_embeddings.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/vectorstores/fake_embeddings.py", "repo_id": "langchain", "token_count": 1178 }
380
<jupyter_start><jupyter_text>Speed Comparison `Safetensors` is really fast. Let's compare it against `PyTorch` by loading [gpt2](https://huggingface.co/gpt2) weights. To run the [GPU benchmark](gpu-benchmark), make sure your machine has GPU or you have selected `GPU runtime` if you are using Google Colab.Before you beg...
notebooks/safetensors_doc/en/speed.ipynb/0
{ "file_path": "notebooks/safetensors_doc/en/speed.ipynb", "repo_id": "notebooks", "token_count": 893 }
307
// 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/importutil/numpy_parser_test.go/0
{ "file_path": "milvus/internal/util/importutil/numpy_parser_test.go", "repo_id": "milvus", "token_count": 15271 }
1,900
from langchain_community.callbacks import __all__ EXPECTED_ALL = [ "AimCallbackHandler", "ArgillaCallbackHandler", "ArizeCallbackHandler", "PromptLayerCallbackHandler", "ArthurCallbackHandler", "ClearMLCallbackHandler", "CometCallbackHandler", "ContextCallbackHandler", "HumanApprova...
langchain/libs/community/tests/unit_tests/callbacks/test_imports.py/0
{ "file_path": "langchain/libs/community/tests/unit_tests/callbacks/test_imports.py", "repo_id": "langchain", "token_count": 304 }
390
"""Storage classes.""" from llama_index.core.storage.storage_context import StorageContext __all__ = [ "StorageContext", ]
llama_index/llama-index-core/llama_index/core/storage/__init__.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/storage/__init__.py", "repo_id": "llama_index", "token_count": 41 }
1,219
<!--Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
diffusers/docs/source/en/optimization/fp16.md/0
{ "file_path": "diffusers/docs/source/en/optimization/fp16.md", "repo_id": "diffusers", "token_count": 942 }
167
// 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/typeutil/hash.go/0
{ "file_path": "milvus/pkg/util/typeutil/hash.go", "repo_id": "milvus", "token_count": 1660 }
2,123
from langchain_core.tracers.langchain_v1 import LangChainTracerV1 __all__ = ["LangChainTracerV1"]
langchain/libs/langchain/langchain/callbacks/tracers/langchain_v1.py/0
{ "file_path": "langchain/libs/langchain/langchain/callbacks/tracers/langchain_v1.py", "repo_id": "langchain", "token_count": 37 }
496
# Copyright 2022 The HuggingFace Datasets Authors and the current metric script contributor. # # 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...
datasets/metrics/frugalscore/frugalscore.py/0
{ "file_path": "datasets/metrics/frugalscore/frugalscore.py", "repo_id": "datasets", "token_count": 1754 }
129
import logging import os import time from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union import openai from deprecated import deprecated from openai.types.chat import ChatCompletionMessageParam, ChatCompletionMessageToolCall from openai.types.chat.chat_completion_chunk import ChoiceDel...
llama_index/llama-index-legacy/llama_index/legacy/llms/openai_utils.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/openai_utils.py", "repo_id": "llama_index", "token_count": 5027 }
1,588
package tasks import ( "fmt" "testing" "time" "github.com/stretchr/testify/assert" ) func TestMergeTaskQueue(t *testing.T) { q := newMergeTaskQueue("test_user") assert.Equal(t, 0, q.len()) assert.Nil(t, q.front()) q.pop() assert.Nil(t, q.front()) assert.Equal(t, 0, q.len()) assert.False(t, q.expire(5*time...
milvus/internal/querynodev2/tasks/queues_test.go/0
{ "file_path": "milvus/internal/querynodev2/tasks/queues_test.go", "repo_id": "milvus", "token_count": 1864 }
1,774
from llama_index.core.readers.base import BaseReader from llama_index.readers.txtai import TxtaiReader def test_class(): names_of_base_classes = [b.__name__ for b in TxtaiReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-txtai/tests/test_readers_txtai.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-txtai/tests/test_readers_txtai.py", "repo_id": "llama_index", "token_count": 90 }
1,390
"""LangChain **Runnable** and the **LangChain Expression Language (LCEL)**. The LangChain Expression Language (LCEL) offers a declarative method to build production-grade programs that harness the power of LLMs. Programs created using LCEL and LangChain Runnables inherently support synchronous, asynchronous, batch, a...
langchain/libs/langchain/langchain/schema/runnable/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/schema/runnable/__init__.py", "repo_id": "langchain", "token_count": 593 }
567
<jupyter_start><jupyter_text>MyScale Reader If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-readers-myscale !pip install llama-index import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.getLogger()....
llama_index/docs/examples/data_connectors/MyScaleReaderDemo.ipynb/0
{ "file_path": "llama_index/docs/examples/data_connectors/MyScaleReaderDemo.ipynb", "repo_id": "llama_index", "token_count": 333 }
1,053
""" Global Context Attention Block Paper: `GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond` - https://arxiv.org/abs/1904.11492 Official code consulted as reference: https://github.com/xvjiarui/GCNet Hacked together by / Copyright 2021 Ross Wightman """ from torch import nn as nn import torc...
pytorch-image-models/timm/layers/global_context.py/0
{ "file_path": "pytorch-image-models/timm/layers/global_context.py", "repo_id": "pytorch-image-models", "token_count": 1169 }
367
{ "graph_dict": {} }
llama_index/llama-index-legacy/storage/graph_store.json/0
{ "file_path": "llama_index/llama-index-legacy/storage/graph_store.json", "repo_id": "llama_index", "token_count": 9 }
1,528
local base = import 'templates/base.libsonnet'; local tpus = import 'templates/tpus.libsonnet'; local utils = import "templates/utils.libsonnet"; local volumes = import "templates/volumes.libsonnet"; local bertBaseCased = base.BaseTest { frameworkPrefix: "hf", modelName: "bert-base-cased", mode: "example", con...
transformers/docker/transformers-pytorch-tpu/bert-base-cased.jsonnet/0
{ "file_path": "transformers/docker/transformers-pytorch-tpu/bert-base-cased.jsonnet", "repo_id": "transformers", "token_count": 371 }
462
--- sidebar_label: PromptLayer OpenAI --- # PromptLayerChatOpenAI You can pass in the optional `returnPromptLayerId` boolean to get a `promptLayerRequestId` like below. Here is an example of getting the PromptLayerChatOpenAI requestID: ```typescript import { PromptLayerChatOpenAI } from "langchain/llms/openai"; con...
langchainjs/docs/core_docs/docs/integrations/chat/prompt_layer_openai.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/chat/prompt_layer_openai.mdx", "repo_id": "langchainjs", "token_count": 578 }
729
# Copyright 2023-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
peft/tests/testing_common.py/0
{ "file_path": "peft/tests/testing_common.py", "repo_id": "peft", "token_count": 24562 }
341
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
transformers/examples/pytorch/image-classification/run_image_classification.py/0
{ "file_path": "transformers/examples/pytorch/image-classification/run_image_classification.py", "repo_id": "transformers", "token_count": 7153 }
561
"""PyTorch CspNet A PyTorch implementation of Cross Stage Partial Networks including: * CSPResNet50 * CSPResNeXt50 * CSPDarkNet53 * and DarkNet53 for good measure Based on paper `CSPNet: A New Backbone that can Enhance Learning Capability of CNN` - https://arxiv.org/abs/1911.11929 Reference impl via darknet cfg file...
pytorch-image-models/timm/models/cspnet.py/0
{ "file_path": "pytorch-image-models/timm/models/cspnet.py", "repo_id": "pytorch-image-models", "token_count": 19954 }
341
<jupyter_start><jupyter_text>ClientThis is an example client that interacts with the server that has "auth".Please reference appropriate documentation in the server code and in FastAPI to actually make this secure. Login as Alice<jupyter_code>import requests response = requests.post("http://localhost:8000/token", dat...
langserve/examples/auth/per_req_config_modifier/client.ipynb/0
{ "file_path": "langserve/examples/auth/per_req_config_modifier/client.ipynb", "repo_id": "langserve", "token_count": 444 }
1,039
// 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/storage_v2_serializer_test.go/0
{ "file_path": "milvus/internal/datanode/syncmgr/storage_v2_serializer_test.go", "repo_id": "milvus", "token_count": 4472 }
1,809
--- sidebar_position: 0 --- # Quick Start Large Language Models (LLMs) are a core component of LangChain. LangChain does not serve its own LLMs, but rather provides a standard interface for interacting with many different LLMs. There are lots of LLM providers (OpenAI, Cohere, Hugging Face, etc) - the `LLM` class is ...
langchainjs/docs/core_docs/docs/modules/model_io/llms/quick_start.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/model_io/llms/quick_start.mdx", "repo_id": "langchainjs", "token_count": 1543 }
762
from __future__ import annotations from typing import TYPE_CHECKING, List from langchain_core.pydantic_v1 import Field from langchain_community.agent_toolkits.base import BaseToolkit from langchain_community.tools import BaseTool from langchain_community.tools.office365.create_draft_message import ( O365CreateDr...
langchain/libs/community/langchain_community/agent_toolkits/office365/toolkit.py/0
{ "file_path": "langchain/libs/community/langchain_community/agent_toolkits/office365/toolkit.py", "repo_id": "langchain", "token_count": 595 }
224
#!/usr/bin/env bash # 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...
milvus/scripts/3rdparty_build.sh/0
{ "file_path": "milvus/scripts/3rdparty_build.sh", "repo_id": "milvus", "token_count": 1456 }
2,126
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 LABEL maintainer="Hugging Face" ARG DEBIAN_FRONTEND=noninteractive RUN apt update RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg RUN python3 -m pip install --no-cache-dir --upgrade pip ARG REF=main RUN git clone https://githu...
transformers/docker/transformers-tensorflow-gpu/Dockerfile/0
{ "file_path": "transformers/docker/transformers-tensorflow-gpu/Dockerfile", "repo_id": "transformers", "token_count": 374 }
429
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
transformers/examples/tensorflow/language-modeling/run_mlm.py/0
{ "file_path": "transformers/examples/tensorflow/language-modeling/run_mlm.py", "repo_id": "transformers", "token_count": 12796 }
551
<jupyter_start><jupyter_text>Private Semi-structured and Multi-modal RAG w/ LLaMA2 and LLaVAMany documents contain a mixture of content types, including text, tables, and images. Semi-structured data can be challenging for conventional RAG for at least two reasons: * Text splitting may break up tables, corrupting the d...
langchain/cookbook/Semi_structured_multi_modal_RAG_LLaMA2.ipynb/0
{ "file_path": "langchain/cookbook/Semi_structured_multi_modal_RAG_LLaMA2.ipynb", "repo_id": "langchain", "token_count": 3901 }
74
"""Configuration for unit tests.""" from importlib import util from typing import Dict, Sequence import pytest from pytest import Config, Function, Parser def pytest_addoption(parser: Parser) -> None: """Add custom command line options to pytest.""" parser.addoption( "--only-extended", action...
langchain/libs/langchain/tests/unit_tests/conftest.py/0
{ "file_path": "langchain/libs/langchain/tests/unit_tests/conftest.py", "repo_id": "langchain", "token_count": 1483 }
653
LANGCHAIN_TRACING_V2="true" LANGCHAIN_ENDPOINT="https://api.smith.langchain.com" LANGCHAIN_API_KEY="YOUR_LANGSMITH_API_KEY_HERE" LANGCHAIN_PROJECT="YOUR_PROJECT_HERE" OPENAI_API_KEY="YOUR_OPENAI_API_KEY_HERE"
langsmith-cookbook/feedback-examples/nextjs/.env.example/0
{ "file_path": "langsmith-cookbook/feedback-examples/nextjs/.env.example", "repo_id": "langsmith-cookbook", "token_count": 104 }
1,056
# coding=utf-8 # Copyright 2024 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/stablelm/test_modeling_stablelm.py/0
{ "file_path": "transformers/tests/models/stablelm/test_modeling_stablelm.py", "repo_id": "transformers", "token_count": 8002 }
815
from langchain_community.agent_toolkits.zapier.toolkit import ZapierToolkit __all__ = ["ZapierToolkit"]
langchain/libs/langchain/langchain/agents/agent_toolkits/zapier/toolkit.py/0
{ "file_path": "langchain/libs/langchain/langchain/agents/agent_toolkits/zapier/toolkit.py", "repo_id": "langchain", "token_count": 37 }
484
poetry_requirements( name="poetry", ) python_requirements( name="reqs", )
llama_index/llama-index-integrations/tools/llama-index-tools-multion/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-multion/BUILD", "repo_id": "llama_index", "token_count": 36 }
1,517
from langchain_ai21.chat_models import ChatAI21 from langchain_ai21.embeddings import AI21Embeddings from langchain_ai21.llms import AI21LLM __all__ = [ "AI21LLM", "ChatAI21", "AI21Embeddings", ]
langchain/libs/partners/ai21/langchain_ai21/__init__.py/0
{ "file_path": "langchain/libs/partners/ai21/langchain_ai21/__init__.py", "repo_id": "langchain", "token_count": 86 }
616
<jupyter_start><jupyter_text>Auto-Retrieval from a Vectara IndexThis guide shows how to perform **auto-retrieval** in LlamaIndex with Vectara. Given a natural language query, we first use the LLM to infer a set of metadata filters as well as the right query string to pass to the Vectara Index.This allows for more dynam...
llama_index/docs/examples/retrievers/vectara_auto_retriever.ipynb/0
{ "file_path": "llama_index/docs/examples/retrievers/vectara_auto_retriever.ipynb", "repo_id": "llama_index", "token_count": 2804 }
1,080
from llama_index.core.readers.base import BaseReader from llama_index.readers.kibela import KibelaReader def test_class(): names_of_base_classes = [b.__name__ for b in KibelaReader.__mro__] assert BaseReader.__name__ in names_of_base_classes
llama_index/llama-index-integrations/readers/llama-index-readers-kibela/tests/test_readers_kibela.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-kibela/tests/test_readers_kibela.py", "repo_id": "llama_index", "token_count": 91 }
1,390
# 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_xl/test_stable_diffusion_xl_adapter.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_adapter.py", "repo_id": "diffusers", "token_count": 13516 }
295
{ "details": { "best_of_sequences": null, "finish_reason": "length", "generated_tokens": 10, "prefill": [ { "id": 1, "logprob": null, "text": "<s>" }, { "id": 4911, "logprob": -6.9765625, "text": "User" }, { "id": 29...
text-generation-inference/integration-tests/models/__snapshots__/test_idefics/test_idefics.json/0
{ "file_path": "text-generation-inference/integration-tests/models/__snapshots__/test_idefics/test_idefics.json", "repo_id": "text-generation-inference", "token_count": 2062 }
366
# Ollama [Ollama](https://ollama.ai/) allows you to run open-source large language models, such as Llama 2, locally. Ollama bundles model weights, configuration, and data into a single package, defined by a Modelfile. It optimizes setup and configuration details, including GPU usage. This example goes over how to us...
langchainjs/docs/core_docs/docs/integrations/llms/ollama.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/llms/ollama.mdx", "repo_id": "langchainjs", "token_count": 426 }
709
from llama2_functions.chain import chain __all__ = ["chain"]
langchain/templates/llama2-functions/llama2_functions/__init__.py/0
{ "file_path": "langchain/templates/llama2-functions/llama2_functions/__init__.py", "repo_id": "langchain", "token_count": 21 }
652
python_tests( name="tests", skip_tests=True, )
llama_index/llama-index-legacy/tests/callbacks/BUILD/0
{ "file_path": "llama_index/llama-index-legacy/tests/callbacks/BUILD", "repo_id": "llama_index", "token_count": 25 }
1,615
python_sources()
llama_index/llama-index-integrations/tools/llama-index-tools-tavily-research/llama_index/tools/tavily_research/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-tavily-research/llama_index/tools/tavily_research/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,632
# Copyright 2024 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...
accelerate/src/accelerate/test_utils/scripts/external_deps/test_pippy.py/0
{ "file_path": "accelerate/src/accelerate/test_utils/scripts/external_deps/test_pippy.py", "repo_id": "accelerate", "token_count": 1729 }
14
/* eslint-disable prefer-template */ /* eslint-disable default-case */ /* eslint-disable no-plusplus */ // Adapted from https://github.com/gfortaine/fetch-event-source/blob/main/src/parse.ts // due to a packaging issue in the original. // MIT License import { type Readable } from "stream"; import { IterableReadableStre...
langchainjs/libs/langchain-community/src/utils/event_source_parse.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/utils/event_source_parse.ts", "repo_id": "langchainjs", "token_count": 3481 }
1,079
"""Test HuggingFace API wrapper.""" from pathlib import Path import pytest from langchain_community.llms.huggingface_hub import HuggingFaceHub from langchain_community.llms.loading import load_llm from tests.integration_tests.llms.utils import assert_llm_equality def test_huggingface_text_generation() -> None: ...
langchain/libs/community/tests/integration_tests/llms/test_huggingface_hub.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_huggingface_hub.py", "repo_id": "langchain", "token_count": 589 }
336
# Evaluating Evaluators with `LabelledEvaluatorDataset`'s The purpose of the llama-datasets is to provide builders the means to quickly benchmark LLM systems or tasks. In that spirit, the `LabelledEvaluatorDataset` exists to facilitate the evaluation of evaluators in a seamless and effortless manner. This dataset con...
llama_index/docs/module_guides/evaluating/evaluating_evaluators_with_llamadatasets.md/0
{ "file_path": "llama_index/docs/module_guides/evaluating/evaluating_evaluators_with_llamadatasets.md", "repo_id": "llama_index", "token_count": 837 }
1,140
from langchain_community.embeddings.fake import ( DeterministicFakeEmbedding, FakeEmbeddings, ) __all__ = ["FakeEmbeddings", "DeterministicFakeEmbedding"]
langchain/libs/langchain/langchain/embeddings/fake.py/0
{ "file_path": "langchain/libs/langchain/langchain/embeddings/fake.py", "repo_id": "langchain", "token_count": 57 }
532
[net] # Testing batch=1 subdivisions=1 # Training # batch=64 # subdivisions=16 width= 416 height = 416 channels=3 momentum=0.9 decay=0.0005 angle=0 saturation = 1.5 exposure = 1.5 hue=.1 learning_rate=0.001 burn_in=1000 max_batches = 500200 policy=steps steps=400000,450000 scales=.1,.1 [convolutional] batch_normaliz...
candle/candle-examples/examples/yolo-v3/yolo-v3.cfg/0
{ "file_path": "candle/candle-examples/examples/yolo-v3/yolo-v3.cfg", "repo_id": "candle", "token_count": 3586 }
51
// 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/tso/tso.go/0
{ "file_path": "milvus/internal/tso/tso.go", "repo_id": "milvus", "token_count": 2375 }
2,013
import { ExaSearchResults } from "@langchain/exa"; import { ChatOpenAI } from "@langchain/openai"; import type { ChatPromptTemplate } from "@langchain/core/prompts"; import Exa from "exa-js"; import { pull } from "langchain/hub"; import { AgentExecutor, createOpenAIFunctionsAgent } from "langchain/agents"; // Define t...
langchainjs/examples/src/tools/exa_search.ts/0
{ "file_path": "langchainjs/examples/src/tools/exa_search.ts", "repo_id": "langchainjs", "token_count": 467 }
850
import type { BaseLanguageModelInterface } from "@langchain/core/language_models/base"; import { PromptTemplate } from "@langchain/core/prompts"; import { Document } from "@langchain/core/documents"; import { ChainValues } from "@langchain/core/utils/types"; import { BaseMemory, InputValues, OutputValues } from "@langc...
langchainjs/langchain/src/experimental/generative_agents/generative_agent_memory.ts/0
{ "file_path": "langchainjs/langchain/src/experimental/generative_agents/generative_agent_memory.ts", "repo_id": "langchainjs", "token_count": 5881 }
987
# Performer fine-tuning Example authors: @TevenLeScao, @Patrickvonplaten Paper authors: Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, David Belanger, Lucy Colwell, Adrian Weller ## Requirements `datase...
transformers/examples/research_projects/performer/README.md/0
{ "file_path": "transformers/examples/research_projects/performer/README.md", "repo_id": "transformers", "token_count": 408 }
594
<script lang="ts"> export let classNames = ""; </script> <svg xmlns="http://www.w3.org/2000/svg" class={classNames} width="1em" height="1em" fill="none" viewBox="0 0 32 32" ><path fill="currentColor" fill-rule="evenodd" d="M3.143 20.286h4.286v2.142H3.143A2.143 2.143 0 0 1 1 20.287V3.143A2.143 2.143 0 0 1...
chat-ui/src/lib/components/icons/IconNew.svelte/0
{ "file_path": "chat-ui/src/lib/components/icons/IconNew.svelte", "repo_id": "chat-ui", "token_count": 426 }
89
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/clvp/feature_extraction_clvp.py/0
{ "file_path": "transformers/src/transformers/models/clvp/feature_extraction_clvp.py", "repo_id": "transformers", "token_count": 4454 }
614
// 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/segcore/TimestampIndex.cpp/0
{ "file_path": "milvus/internal/core/src/segcore/TimestampIndex.cpp", "repo_id": "milvus", "token_count": 1790 }
1,748
from langchain_core.example_selectors.length_based import ( LengthBasedExampleSelector, ) __all__ = ["LengthBasedExampleSelector"]
langchain/libs/langchain/langchain/prompts/example_selector/length_based.py/0
{ "file_path": "langchain/libs/langchain/langchain/prompts/example_selector/length_based.py", "repo_id": "langchain", "token_count": 42 }
554
package proxy import ( "context" "testing" "time" "github.com/cockroachdb/errors" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus/pkg/mq/msgstream" "github.com/milvus-io/milvus/pkg/util/merr" "github.com/milvus-io/milvus/pkg/util/resource" ) func TestReplicateManager(t *testing.T) { facto...
milvus/internal/proxy/replicate_stream_manager_test.go/0
{ "file_path": "milvus/internal/proxy/replicate_stream_manager_test.go", "repo_id": "milvus", "token_count": 943 }
2,021
import json import logging import os from collections import defaultdict from pathlib import Path from huggingface_hub import HfApi, ModelFilter import diffusers PATH_TO_REPO = Path(__file__).parent.parent.resolve() ALWAYS_TEST_PIPELINE_MODULES = [ "controlnet", "stable_diffusion", "stable_diffusion_2",...
diffusers/utils/fetch_torch_cuda_pipeline_test_matrix.py/0
{ "file_path": "diffusers/utils/fetch_torch_cuda_pipeline_test_matrix.py", "repo_id": "diffusers", "token_count": 1082 }
295
from typing import Any, Dict, List from langchain_core.language_models import BaseLanguageModel from langchain_core.messages import BaseMessage, get_buffer_string from langchain.memory.chat_memory import BaseChatMemory class ConversationTokenBufferMemory(BaseChatMemory): """Conversation chat memory with token l...
langchain/libs/langchain/langchain/memory/token_buffer.py/0
{ "file_path": "langchain/libs/langchain/langchain/memory/token_buffer.py", "repo_id": "langchain", "token_count": 849 }
558
# Read the Docs configuration file for Sphinx projects # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required version: 2 # Set the OS, Python version and other tools you might need build: os: ubuntu-22.04 tools: python: "3.11" commands: - python -mvirtualenv $READTHEDOCS_...
llama_index/.readthedocs.yaml/0
{ "file_path": "llama_index/.readthedocs.yaml", "repo_id": "llama_index", "token_count": 317 }
1,024
import logging from typing import Any, List import requests from langchain_core.documents import Document from langchain_community.document_loaders.base import BaseLoader logger = logging.getLogger(__name__) class DiffbotLoader(BaseLoader): """Load `Diffbot` json file.""" def __init__( self, api_t...
langchain/libs/community/langchain_community/document_loaders/diffbot.py/0
{ "file_path": "langchain/libs/community/langchain_community/document_loaders/diffbot.py", "repo_id": "langchain", "token_count": 912 }
235
import { htmlToText, type HtmlToTextOptions } from "html-to-text"; import { MappingDocumentTransformer, Document, } from "@langchain/core/documents"; /** * A transformer that converts HTML content to plain text. * @example * ```typescript * const loader = new CheerioWebBaseLoader("https://example.com/some-page...
langchainjs/libs/langchain-community/src/document_transformers/html_to_text.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/document_transformers/html_to_text.ts", "repo_id": "langchainjs", "token_count": 369 }
985
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
transformers/src/transformers/models/nougat/convert_nougat_to_hf.py/0
{ "file_path": "transformers/src/transformers/models/nougat/convert_nougat_to_hf.py", "repo_id": "transformers", "token_count": 4666 }
663
--- hide_table_of_contents: true sidebar_position: 4 --- # Interacting with APIs Lots of data and information is stored behind APIs. This page covers all resources available in LangChain for working with APIs. ## Chains If you are just getting started and you have relatively simple APIs, you should get started with...
langchainjs/docs/core_docs/docs/use_cases/api.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/use_cases/api.mdx", "repo_id": "langchainjs", "token_count": 225 }
741
--- sidebar_position: 1 sidebar_class_name: hidden --- # Refine The refine documents chain constructs a response by looping over the input documents and iteratively updating its answer. For each document, it passes all non-document inputs, the current document, and the latest intermediate answer to an LLM chain to ge...
langchainjs/docs/core_docs/docs/modules/chains/document/refine.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/modules/chains/document/refine.mdx", "repo_id": "langchainjs", "token_count": 412 }
805
import argparse import math import os from pathlib import Path import colossalai import torch import torch.nn.functional as F import torch.utils.checkpoint from colossalai.context.parallel_mode import ParallelMode from colossalai.core import global_context as gpc from colossalai.logging import disable_existing_loggers...
diffusers/examples/research_projects/colossalai/train_dreambooth_colossalai.py/0
{ "file_path": "diffusers/examples/research_projects/colossalai/train_dreambooth_colossalai.py", "repo_id": "diffusers", "token_count": 11176 }
212
<!--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/ko/optimization/fp16.md/0
{ "file_path": "diffusers/docs/source/ko/optimization/fp16.md", "repo_id": "diffusers", "token_count": 10812 }
195
from .base import GoogleVectorStore, google_service_context, set_google_config __all__ = [ "google_service_context", "set_google_config", "GoogleVectorStore", ]
llama_index/llama-index-legacy/llama_index/legacy/vector_stores/google/generativeai/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/google/generativeai/__init__.py", "repo_id": "llama_index", "token_count": 60 }
1,545
from abc import ABC, abstractmethod from typing import Callable, List, Tuple from langchain_core.language_models import BaseLanguageModel from langchain_core.language_models.chat_models import BaseChatModel from langchain_core.language_models.llms import BaseLLM from langchain_core.prompts import BasePromptTemplate fr...
langchain/libs/langchain/langchain/chains/prompt_selector.py/0
{ "file_path": "langchain/libs/langchain/langchain/chains/prompt_selector.py", "repo_id": "langchain", "token_count": 704 }
486
# coding=utf-8 # Copyright 2023 Microsoft 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-2....
transformers/src/transformers/models/phi/modeling_phi.py/0
{ "file_path": "transformers/src/transformers/models/phi/modeling_phi.py", "repo_id": "transformers", "token_count": 27233 }
679
use super::{super::OrderedVocabIter, WordPiece, WordPieceBuilder}; use serde::{ de::{MapAccess, Visitor}, ser::SerializeStruct, Deserialize, Deserializer, Serialize, Serializer, }; use std::collections::HashSet; impl Serialize for WordPiece { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Er...
tokenizers/tokenizers/src/models/wordpiece/serialization.rs/0
{ "file_path": "tokenizers/tokenizers/src/models/wordpiece/serialization.rs", "repo_id": "tokenizers", "token_count": 2453 }
466
import { BaseRetriever, type BaseRetrieverInput, type BaseRetrieverInterface, } from "@langchain/core/retrievers"; import type { DocumentInterface } from "@langchain/core/documents"; import { CallbackManagerForRetrieverRun } from "@langchain/core/callbacks/manager"; import { BaseDocumentCompressor } from "./docum...
langchainjs/langchain/src/retrievers/contextual_compression.ts/0
{ "file_path": "langchainjs/langchain/src/retrievers/contextual_compression.ts", "repo_id": "langchainjs", "token_count": 666 }
942
<script lang="ts"> import CarbonRotate360 from "~icons/carbon/rotate-360"; export let classNames = ""; </script> <button type="button" on:click class="btn flex h-8 rounded-lg border bg-white px-3 py-1 text-gray-500 shadow-sm transition-all hover:bg-gray-100 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-30...
chat-ui/src/lib/components/RetryBtn.svelte/0
{ "file_path": "chat-ui/src/lib/components/RetryBtn.svelte", "repo_id": "chat-ui", "token_count": 157 }
97