text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
// Copyright (C) 2019-2023 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/simd/ref.h/0 | {
"file_path": "milvus/internal/core/src/simd/ref.h",
"repo_id": "milvus",
"token_count": 1451
} | 1,940 |
# Cohere Rerank
Reranking documents can greatly improve any RAG application and document retrieval system.
At a high level, a rerank API is a language model which analyzes documents and reorders them based on their relevance to a given query.
Cohere offers an API for reranking documents. In this example we'll show y... | langchainjs/docs/core_docs/docs/integrations/document_compressors/cohere_rerank.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/document_compressors/cohere_rerank.mdx",
"repo_id": "langchainjs",
"token_count": 383
} | 731 |
from abc import abstractmethod
from typing import Any, List, Optional
from llama_index.legacy.core.llms.types import ChatMessage
from llama_index.legacy.llms.llm import LLM
from llama_index.legacy.schema import BaseComponent
DEFAULT_CHAT_STORE_KEY = "chat_history"
class BaseMemory(BaseComponent):
"""Base class ... | llama_index/llama-index-legacy/llama_index/legacy/memory/types.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/memory/types.py",
"repo_id": "llama_index",
"token_count": 483
} | 1,685 |
# Chat with your documents
This folder contains a (very) minimal, self-contained example of how to make an application to chat with your documents, using Chroma and Google Gemini's API.
It uses the 2022 and 2023 U.S state of the union addresses as example documents.
## How it works
The basic flow is as follows:
0. ... | chroma/examples/gemini/README.md/0 | {
"file_path": "chroma/examples/gemini/README.md",
"repo_id": "chroma",
"token_count": 677
} | 42 |
#!/usr/bin/env groovy
int total_timeout_minutes = 60 * 5
int e2e_timeout_seconds = 120 * 60
def imageTag=''
int case_timeout_seconds = 20 * 60
def chart_version='4.1.8'
pipeline {
options {
timestamps()
timeout(time: total_timeout_minutes, unit: 'MINUTES')
buildDiscarder logRotator(artifact... | milvus/ci/jenkins/PR.groovy/0 | {
"file_path": "milvus/ci/jenkins/PR.groovy",
"repo_id": "milvus",
"token_count": 12885
} | 1,890 |
from typing import TYPE_CHECKING
from langchain_community.document_loaders.parsers.language.tree_sitter_segmenter import ( # noqa: E501
TreeSitterSegmenter,
)
if TYPE_CHECKING:
from tree_sitter import Language
CHUNK_QUERY = """
[
(class_declaration) @class
(interface_declaration) @inter... | langchain/libs/community/langchain_community/document_loaders/parsers/language/java.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/parsers/language/java.py",
"repo_id": "langchain",
"token_count": 293
} | 257 |
import threading
import time
import pytest
from base.collection_wrapper import ApiCollectionWrapper
from common.common_type import CaseLabel
from common import common_func as cf
from customize.milvus_operator import MilvusOperator
from scale import constants, scale_common
from pymilvus import connections, MilvusExcep... | milvus/tests/python_client/scale/test_data_node_scale.py/0 | {
"file_path": "milvus/tests/python_client/scale/test_data_node_scale.py",
"repo_id": "milvus",
"token_count": 2324
} | 2,185 |
# (Legacy) SENet
A **SENet** is a convolutional neural network architecture that employs [squeeze-and-excitation blocks](https://paperswithcode.com/method/squeeze-and-excitation-block) to enable the network to perform dynamic channel-wise feature recalibration.
The weights from this model were ported from Gluon.
{% ... | pytorch-image-models/docs/models/.templates/models/legacy-senet.md/0 | {
"file_path": "pytorch-image-models/docs/models/.templates/models/legacy-senet.md",
"repo_id": "pytorch-image-models",
"token_count": 793
} | 348 |
from typing import TYPE_CHECKING, Dict, List, Union
from langchain_community.document_loaders.unstructured import UnstructuredFileLoader
if TYPE_CHECKING:
from chm import chm
class UnstructuredCHMLoader(UnstructuredFileLoader):
"""Load `CHM` files using `Unstructured`.
CHM means Microsoft Compiled HTML... | langchain/libs/community/langchain_community/document_loaders/chm.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/chm.py",
"repo_id": "langchain",
"token_count": 1393
} | 246 |
import importlib
import inspect
from functools import wraps
from typing import TYPE_CHECKING, Optional
from .download.download_config import DownloadConfig
from .download.streaming_download_manager import (
xbasename,
xdirname,
xet_parse,
xexists,
xgetsize,
xglob,
xgzip_open,
xisdir,
... | datasets/src/datasets/streaming.py/0 | {
"file_path": "datasets/src/datasets/streaming.py",
"repo_id": "datasets",
"token_count": 2300
} | 147 |
# pirate-speak-configurable
This template converts user input into pirate speak. It shows how you can allow
`configurable_alternatives` in the Runnable, allowing you to select from
OpenAI, Anthropic, or Cohere as your LLM Provider in the playground (or via API).
## Environment Setup
Set the following environment va... | langchain/templates/pirate-speak-configurable/README.md/0 | {
"file_path": "langchain/templates/pirate-speak-configurable/README.md",
"repo_id": "langchain",
"token_count": 670
} | 721 |
- name: querycoord
docker_container:
name: querycoord
image: "{{image}}"
command: "milvus run querycoord"
env:
ETCD_ENDPOINTS: "{{ETCD_ENDPOINTS}}"
MINIO_ADDRESS: "{{MINIO_ADDRESS}}"
PULSAR_ADDRESS: "{{PULSAR_ADDRESS}}"
QUERY_COORD_ADDRESS: "{{QUERY_COORD_ADDRESS}}"
METRI... | milvus/deployments/docker/cluster-distributed-deployment/roles/deploy-querycoord/tasks/main.yml/0 | {
"file_path": "milvus/deployments/docker/cluster-distributed-deployment/roles/deploy-querycoord/tasks/main.yml",
"repo_id": "milvus",
"token_count": 199
} | 1,729 |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from chromadb.proto import chroma_pb2 as chromadb_dot_proto_dot_chroma__pb2
from chromadb.proto import coordinator_pb2 as chromadb_dot_proto_dot_coordinator__pb2... | chroma/chromadb/proto/coordinator_pb2_grpc.py/0 | {
"file_path": "chroma/chromadb/proto/coordinator_pb2_grpc.py",
"repo_id": "chroma",
"token_count": 10878
} | 18 |
// TODO: Deprecate in favor of new Anthropic package once out of beta
import {
Anthropic,
AI_PROMPT,
HUMAN_PROMPT,
ClientOptions,
} from "@anthropic-ai/sdk";
import type { CompletionCreateParams } from "@anthropic-ai/sdk/resources/completions";
import type { Stream } from "@anthropic-ai/sdk/streaming";
import ... | langchainjs/langchain/src/chat_models/anthropic.ts/0 | {
"file_path": "langchainjs/langchain/src/chat_models/anthropic.ts",
"repo_id": "langchainjs",
"token_count": 4526
} | 887 |
import { test } from "@jest/globals";
import { HuggingFaceInference } from "../hf.js";
test("Test HuggingFace", async () => {
const model = new HuggingFaceInference({ temperature: 0.1, topP: 0.5 });
const res = await model.invoke("1 + 1 =");
console.log(res);
}, 50000);
test("Test HuggingFace with streaming", a... | langchainjs/libs/langchain-community/src/llms/tests/huggingface_hub.int.test.ts/0 | {
"file_path": "langchainjs/libs/langchain-community/src/llms/tests/huggingface_hub.int.test.ts",
"repo_id": "langchainjs",
"token_count": 408
} | 974 |
import argparse
import subprocess
import time
from loguru import logger as log
def run_kubectl_get_pod(duration, interval, release_name):
end_time = time.time() + duration
while time.time() < end_time:
cmd = f"kubectl get pod |grep {release_name}"
res = subprocess.Popen(cmd, shell=True, stdout... | milvus/tests/python_client/deploy/monitor_rolling_update.py/0 | {
"file_path": "milvus/tests/python_client/deploy/monitor_rolling_update.py",
"repo_id": "milvus",
"token_count": 413
} | 1,975 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-pdf-table/llama_index/readers/pdf_table/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-pdf-table/llama_index/readers/pdf_table/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,360 |
# 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/examples/text_to_image/test_text_to_image_lora.py/0 | {
"file_path": "diffusers/examples/text_to_image/test_text_to_image_lora.py",
"repo_id": "diffusers",
"token_count": 6163
} | 230 |
#!/usr/bin/env python
# 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/LI... | diffusers/examples/research_projects/controlnet/train_controlnet_webdataset.py/0 | {
"file_path": "diffusers/examples/research_projects/controlnet/train_controlnet_webdataset.py",
"repo_id": "diffusers",
"token_count": 25983
} | 196 |
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/src/transformers/models/swin2sr/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/swin2sr/__init__.py",
"repo_id": "transformers",
"token_count": 863
} | 736 |
from pathlib import Path
from typing import Any, Generator, Tuple
import pytest
from langchain_core.messages import AIMessage, HumanMessage
from sqlalchemy import Column, Integer, Text
from sqlalchemy.orm import DeclarativeBase
from langchain_community.chat_message_histories import SQLChatMessageHistory
from langchai... | langchain/libs/community/tests/unit_tests/chat_message_histories/test_sql.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/chat_message_histories/test_sql.py",
"repo_id": "langchain",
"token_count": 1348
} | 383 |
package planparserv2
import (
"fmt"
"strconv"
"github.com/antlr/antlr4/runtime/Go/antlr"
)
type errorListener struct {
*antlr.DefaultErrorListener
err error
}
func (l *errorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException... | milvus/internal/parser/planparserv2/error_listener.go/0 | {
"file_path": "milvus/internal/parser/planparserv2/error_listener.go",
"repo_id": "milvus",
"token_count": 156
} | 1,729 |
"""Hatena Blog reader."""
from typing import Dict, List
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
ATOM_PUB_ENTRY_URL = "{root_endpoint}/entry"
class Article:
def __init__(self) -> None:
self.title = ""
self.content = ""
self.publis... | llama_index/llama-index-integrations/readers/llama-index-readers-hatena-blog/llama_index/readers/hatena_blog/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-hatena-blog/llama_index/readers/hatena_blog/base.py",
"repo_id": "llama_index",
"token_count": 1431
} | 1,455 |
import { FakeListChatModel } from "@langchain/core/utils/testing";
import { HumanMessage } from "@langchain/core/messages";
import { StringOutputParser } from "@langchain/core/output_parsers";
/**
* The FakeListChatModel can be used to simulate ordered predefined responses.
*/
const chat = new FakeListChatModel({
... | langchainjs/examples/src/models/chat/integration_fake.ts/0 | {
"file_path": "langchainjs/examples/src/models/chat/integration_fake.ts",
"repo_id": "langchainjs",
"token_count": 486
} | 830 |
"""Loads YouTube transcript."""
from __future__ import annotations
import logging
from enum import Enum
from pathlib import Path
from typing import Any, Dict, List, Optional, Sequence, Union
from urllib.parse import parse_qs, urlparse
from langchain_core.documents import Document
from langchain_core.pydantic_v1 impor... | langchain/libs/community/langchain_community/document_loaders/youtube.py/0 | {
"file_path": "langchain/libs/community/langchain_community/document_loaders/youtube.py",
"repo_id": "langchain",
"token_count": 7215
} | 253 |
// 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/msgstream/mqwrapper/producer.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/mqwrapper/producer.go",
"repo_id": "milvus",
"token_count": 401
} | 1,923 |
from functools import partial
from typing import Any, Dict, List, Mapping, Optional, Set
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.pydantic_v1 import Extra, Field, root_validator
from langchain_community.llms.utils import enfo... | langchain/libs/community/langchain_community/llms/gpt4all.py/0 | {
"file_path": "langchain/libs/community/langchain_community/llms/gpt4all.py",
"repo_id": "langchain",
"token_count": 2859
} | 287 |
pub const AFFINE: &str = include_str!(concat!(env!("OUT_DIR"), "/affine.ptx"));
pub const BINARY: &str = include_str!(concat!(env!("OUT_DIR"), "/binary.ptx"));
pub const CAST: &str = include_str!(concat!(env!("OUT_DIR"), "/cast.ptx"));
pub const CONV: &str = include_str!(concat!(env!("OUT_DIR"), "/conv.ptx"));
pub cons... | candle/candle-kernels/src/lib.rs/0 | {
"file_path": "candle/candle-kernels/src/lib.rs",
"repo_id": "candle",
"token_count": 298
} | 57 |
# coding=utf-8
# Copyright 2021-2023 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 ... | transformers/tests/models/speecht5/test_feature_extraction_speecht5.py/0 | {
"file_path": "transformers/tests/models/speecht5/test_feature_extraction_speecht5.py",
"repo_id": "transformers",
"token_count": 8423
} | 842 |
# 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/data2vec/test_modeling_data2vec_vision.py/0 | {
"file_path": "transformers/tests/models/data2vec/test_modeling_data2vec_vision.py",
"repo_id": "transformers",
"token_count": 5926
} | 727 |
import { ReadableJsonStream } from "./utils/stream.js";
import { GooglePlatformType } from "./types.js";
export type GoogleAbstractedClientOpsMethod = "GET" | "POST";
export type GoogleAbstractedClientOpsResponseType = "json" | "stream";
export type GoogleAbstractedClientOps = {
url?: string;
method?: GoogleAbst... | langchainjs/libs/langchain-google-common/src/auth.ts/0 | {
"file_path": "langchainjs/libs/langchain-google-common/src/auth.ts",
"repo_id": "langchainjs",
"token_count": 1256
} | 1,094 |
import psutil
import time
from loguru import logger
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description='config for rolling update process')
parser.add_argument('--wait_time', type=int, default=60, help='wait time after rolling update started')
args = parser.parse_a... | milvus/tests/scripts/breakdown_rolling_update.py/0 | {
"file_path": "milvus/tests/scripts/breakdown_rolling_update.py",
"repo_id": "milvus",
"token_count": 597
} | 2,190 |
# Conclusion
Congrats on finishing this unit! You’ve just trained your first ML-Agents and shared it to the Hub 🥳.
The best way to learn is to **practice and try stuff**. Why not try another environment? [ML-Agents has 18 different environments](https://github.com/Unity-Technologies/ml-agents/blob/develop/docs/Learn... | deep-rl-class/units/en/unit5/conclusion.mdx/0 | {
"file_path": "deep-rl-class/units/en/unit5/conclusion.mdx",
"repo_id": "deep-rl-class",
"token_count": 430
} | 163 |
# flake8: noqa
from langchain_core.prompts.prompt import PromptTemplate
_DEFAULT_ENTITY_EXTRACTION_TEMPLATE = """You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally cap... | langchain/libs/langchain/langchain/indexes/prompts/entity_extraction.py/0 | {
"file_path": "langchain/libs/langchain/langchain/indexes/prompts/entity_extraction.py",
"repo_id": "langchain",
"token_count": 538
} | 542 |
{
"_type": "few_shot",
"input_variables": ["adjective"],
"prefix": "Write antonyms for the following words.",
"example_prompt_path": "example_prompt.json",
"examples": "examples.json",
"suffix": "Input: {adjective}\nOutput:"
}
| langchain/libs/core/tests/unit_tests/examples/few_shot_prompt_example_prompt.json/0 | {
"file_path": "langchain/libs/core/tests/unit_tests/examples/few_shot_prompt_example_prompt.json",
"repo_id": "langchain",
"token_count": 105
} | 444 |
from retrieval_agent.chain import agent_executor
__all__ = ["agent_executor"]
| langchain/templates/retrieval-agent/retrieval_agent/__init__.py/0 | {
"file_path": "langchain/templates/retrieval-agent/retrieval_agent/__init__.py",
"repo_id": "langchain",
"token_count": 24
} | 729 |
# coding=utf-8
# Copyright 2021 Tel AViv University, AllenAI and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | transformers/src/transformers/models/splinter/modeling_splinter.py/0 | {
"file_path": "transformers/src/transformers/models/splinter/modeling_splinter.py",
"repo_id": "transformers",
"token_count": 22234
} | 681 |
"""Table node mapping."""
from typing import Any, Dict, Optional, Sequence
from llama_index.legacy.bridge.pydantic import BaseModel
from llama_index.legacy.objects.base_node_mapping import (
DEFAULT_PERSIST_DIR,
DEFAULT_PERSIST_FNAME,
BaseObjectNodeMapping,
)
from llama_index.legacy.schema import BaseNode... | llama_index/llama-index-legacy/llama_index/legacy/objects/table_node_mapping.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/objects/table_node_mapping.py",
"repo_id": "llama_index",
"token_count": 1264
} | 1,582 |
import { VoyVectorStore } from "@langchain/community/vectorstores/voy";
import { Voy as VoyClient } from "voy-search";
import { OpenAIEmbeddings } from "@langchain/openai";
import { Document } from "@langchain/core/documents";
// Create Voy client using the library.
const voyClient = new VoyClient();
// Create embeddi... | langchainjs/examples/src/indexes/vector_stores/voy.ts/0 | {
"file_path": "langchainjs/examples/src/indexes/vector_stores/voy.ts",
"repo_id": "langchainjs",
"token_count": 422
} | 791 |
from typing import Any, Optional, Sequence, Union
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatResponseGen,
CompletionResponse,
CompletionResponseAsyncGen,
CompletionResponseGen,
LLMMetadata,
)
from llama_index.core.bridge.pydantic ... | llama_index/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py",
"repo_id": "llama_index",
"token_count": 2311
} | 1,292 |
<!--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/ja/model_doc/deit.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/deit.md",
"repo_id": "transformers",
"token_count": 3682
} | 521 |
from typing import Tuple
import numpy as np
import pytest
from langchain.evaluation.embedding_distance import (
EmbeddingDistance,
EmbeddingDistanceEvalChain,
PairwiseEmbeddingDistanceEvalChain,
)
@pytest.fixture
def vectors() -> Tuple[np.ndarray, np.ndarray]:
"""Create two random vectors."""
ve... | langchain/libs/langchain/tests/integration_tests/evaluation/embedding_distance/test_embedding.py/0 | {
"file_path": "langchain/libs/langchain/tests/integration_tests/evaluation/embedding_distance/test_embedding.py",
"repo_id": "langchain",
"token_count": 2034
} | 593 |
from llama_index.core.constants import DATA_KEY, TYPE_KEY
from llama_index.core.data_structs.data_structs import IndexStruct
from llama_index.core.data_structs.registry import (
INDEX_STRUCT_TYPE_TO_INDEX_STRUCT_CLASS,
)
def index_struct_to_json(index_struct: IndexStruct) -> dict:
return {
TYPE_KEY: i... | llama_index/llama-index-core/llama_index/core/storage/index_store/utils.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/storage/index_store/utils.py",
"repo_id": "llama_index",
"token_count": 282
} | 1,150 |
""" Adaptive Gradient Clipping
An impl of AGC, as per (https://arxiv.org/abs/2102.06171):
@article{brock2021high,
author={Andrew Brock and Soham De and Samuel L. Smith and Karen Simonyan},
title={High-Performance Large-Scale Image Recognition Without Normalization},
journal={arXiv preprint arXiv:},
year={2021... | pytorch-image-models/timm/utils/agc.py/0 | {
"file_path": "pytorch-image-models/timm/utils/agc.py",
"repo_id": "pytorch-image-models",
"token_count": 661
} | 364 |
import os
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import torch
from torch import nn
from ...models.controlnet import ControlNetModel, ControlNetOutput
from ...models.modeling_utils import ModelMixin
from ...utils import logging
logger = logging.get_logger(__name__)
class MultiControlN... | diffusers/src/diffusers/pipelines/controlnet/multicontrolnet.py/0 | {
"file_path": "diffusers/src/diffusers/pipelines/controlnet/multicontrolnet.py",
"repo_id": "diffusers",
"token_count": 3924
} | 219 |
# Copyright 2023-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | peft/src/peft/tuners/oft/layer.py/0 | {
"file_path": "peft/src/peft/tuners/oft/layer.py",
"repo_id": "peft",
"token_count": 7507
} | 320 |
<jupyter_start><jupyter_text>Gemini In this notebook, we show how to use the Gemini text models from Google in LlamaIndex. Check out the [Gemini site](https://ai.google.dev/) or the [announcement](https://deepmind.google/technologies/gemini/).If you're opening this Notebook on colab, you will need to install LlamaIndex... | llama_index/docs/examples/llm/gemini.ipynb/0 | {
"file_path": "llama_index/docs/examples/llm/gemini.ipynb",
"repo_id": "llama_index",
"token_count": 2702
} | 1,066 |
# coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/models/bloom/tokenization_bloom_fast.py/0 | {
"file_path": "transformers/src/transformers/models/bloom/tokenization_bloom_fast.py",
"repo_id": "transformers",
"token_count": 3101
} | 615 |
## 6. Root Coordinator
<img src="./figs/root_coord.png">
#### 6.1 Root Coordinator Interface
```go
type RootCoord interface {
Component
TimeTickProvider
// DDL request
// CreateCollection notifies RootCoord to create a collection
CreateCollection(ctx context.Context, req *milvuspb.CreateCollectionRequest) (*c... | milvus/docs/developer_guides/chap06_root_coordinator.md/0 | {
"file_path": "milvus/docs/developer_guides/chap06_root_coordinator.md",
"repo_id": "milvus",
"token_count": 7359
} | 1,725 |
use std::collections::HashSet;
use tantivy::{
collector::{Collector, SegmentCollector},
DocId,
};
pub struct HashSetCollector;
impl Collector for HashSetCollector {
type Fruit = HashSet<DocId>;
type Child = HashSetChildCollector;
fn for_segment(
&self,
_segment_local_id: tantivy... | milvus/internal/core/thirdparty/tantivy/tantivy-binding/src/hashset_collector.rs/0 | {
"file_path": "milvus/internal/core/thirdparty/tantivy/tantivy-binding/src/hashset_collector.rs",
"repo_id": "milvus",
"token_count": 673
} | 1,813 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.weaviate import WeaviateReader
def test_class():
names_of_base_classes = [b.__name__ for b in WeaviateReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-weaviate/tests/test_readers_weaviate.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-weaviate/tests/test_readers_weaviate.py",
"repo_id": "llama_index",
"token_count": 91
} | 1,538 |
# Develop
This readme is helpful for local dev.
### Prereqs:
- Make sure you have Java installed (for the generator). You can download it from [java.com](https://java.com)
- Make sure you set ALLOW_RESET=True for your Docker Container. If you don't do this, tests won't pass.
```
environment:
- IS_PERSISTENT=TR... | chroma/clients/js/DEVELOP.md/0 | {
"file_path": "chroma/clients/js/DEVELOP.md",
"repo_id": "chroma",
"token_count": 729
} | 29 |
from llama_index.core.tools.tool_spec.base import BaseToolSpec
from llama_index.tools.salesforce import SalesforceToolSpec
def test_class():
names_of_base_classes = [b.__name__ for b in SalesforceToolSpec.__mro__]
assert BaseToolSpec.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/tools/llama-index-tools-salesforce/tests/test_tools_salesforce.py/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-salesforce/tests/test_tools_salesforce.py",
"repo_id": "llama_index",
"token_count": 95
} | 1,501 |
# Metric Card for IndicGLUE
## Metric description
This metric is used to compute the evaluation metric for the [IndicGLUE dataset](https://huggingface.co/datasets/indic_glue).
IndicGLUE is a natural language understanding benchmark for Indian languages. It contains a wide variety of tasks and covers 11 major Indian ... | datasets/metrics/indic_glue/README.md/0 | {
"file_path": "datasets/metrics/indic_glue/README.md",
"repo_id": "datasets",
"token_count": 1527
} | 140 |
// 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/distributed/datacoord/service.go/0 | {
"file_path": "milvus/internal/distributed/datacoord/service.go",
"repo_id": "milvus",
"token_count": 6601
} | 1,796 |
python_tests(
interpreter_constraints=["==3.9.*", "==3.10.*"],
)
| llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/embeddings/llama-index-embeddings-gemini/tests/BUILD",
"repo_id": "llama_index",
"token_count": 29
} | 1,239 |
from llama_index.core.readers.base import BaseReader
from llama_index.readers.memos import MemosReader
def test_class():
names_of_base_classes = [b.__name__ for b in MemosReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/readers/llama-index-readers-memos/tests/test_readers_memos.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-memos/tests/test_readers_memos.py",
"repo_id": "llama_index",
"token_count": 88
} | 1,383 |
use crate::pre_tokenizers::unicode_scripts::scripts::{get_script, Script};
use crate::tokenizer::{normalizer::Range, PreTokenizedString, PreTokenizer, Result};
use crate::utils::macro_rules_attribute;
#[derive(Clone, Debug, PartialEq, Eq)]
#[macro_rules_attribute(impl_serde_type!)]
pub struct UnicodeScripts;
impl Uni... | tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/pre_tokenizer.rs/0 | {
"file_path": "tokenizers/tokenizers/src/pre_tokenizers/unicode_scripts/pre_tokenizer.rs",
"repo_id": "tokenizers",
"token_count": 2584
} | 422 |
from llama_index.core.llms.base import BaseLLM
from llama_index.llms.nvidia_triton import NvidiaTriton
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in NvidiaTriton.__mro__]
assert BaseLLM.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py",
"repo_id": "llama_index",
"token_count": 99
} | 1,321 |
---
sidebar_label: YandexGPT
---
# ChatYandexGPT
LangChain.js supports calling [YandexGPT](https://cloud.yandex.com/en/services/yandexgpt) chat models.
## Setup
First, you should [create a service account](https://cloud.yandex.com/en/docs/iam/operations/sa/create) with the `ai.languageModels.user` role.
Next, you ... | langchainjs/docs/core_docs/docs/integrations/chat/yandex.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/chat/yandex.mdx",
"repo_id": "langchainjs",
"token_count": 384
} | 710 |
<jupyter_start><jupyter_text>Meilisearch> [Meilisearch](https://meilisearch.com) is an open-source, lightning-fast, and hyper relevant search engine. It comes with great defaults to help developers build snappy search experiences. >> You can [self-host Meilisearch](https://www.meilisearch.com/docs/learn/getting_started... | langchain/docs/docs/integrations/vectorstores/meilisearch.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/vectorstores/meilisearch.ipynb",
"repo_id": "langchain",
"token_count": 1757
} | 177 |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.23.4
// source: chromadb/proto/chroma.proto
package coordinatorpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "re... | chroma/go/coordinator/internal/proto/coordinatorpb/chroma.pb.go/0 | {
"file_path": "chroma/go/coordinator/internal/proto/coordinatorpb/chroma.pb.go",
"repo_id": "chroma",
"token_count": 28346
} | 53 |
# template used in production for HuggingChat.
MODELS=`[
{
"name" : "mistralai/Mixtral-8x7B-Instruct-v0.1",
"description" : "The latest MoE model from Mistral AI! 8x7B and outperforms Llama 2 70B in most benchmarks.",
"websiteUrl" : "https://mistral.ai/news/mixtral-of-experts/",
"preprompt" : "",
... | chat-ui/.env.template/0 | {
"file_path": "chat-ui/.env.template",
"repo_id": "chat-ui",
"token_count": 4680
} | 88 |
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "graphs/neo4j_graph",
});
export * from "@langchain/community/graphs/neo4j_graph";
| langchainjs/langchain/src/graphs/neo4j_graph.ts/0 | {
"file_path": "langchainjs/langchain/src/graphs/neo4j_graph.ts",
"repo_id": "langchainjs",
"token_count": 80
} | 992 |
# 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/adversarial/utils_hans.py/0 | {
"file_path": "transformers/examples/research_projects/adversarial/utils_hans.py",
"repo_id": "transformers",
"token_count": 5431
} | 554 |
"""GitHub Toolkit."""
| langchain/libs/community/langchain_community/agent_toolkits/github/__init__.py/0 | {
"file_path": "langchain/libs/community/langchain_community/agent_toolkits/github/__init__.py",
"repo_id": "langchain",
"token_count": 9
} | 212 |
import type { VectorStoreRetrieverInterface } from "@langchain/core/vectorstores";
import { Tool } from "@langchain/core/tools";
import {
AIMessage,
BaseMessage,
HumanMessage,
SystemMessage,
} from "@langchain/core/messages";
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
import {
... | langchainjs/langchain/src/experimental/autogpt/agent.ts/0 | {
"file_path": "langchainjs/langchain/src/experimental/autogpt/agent.ts",
"repo_id": "langchainjs",
"token_count": 2559
} | 892 |
package broker
import (
"context"
"fmt"
"go.uber.org/zap"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus/internal/proto/rootcoordpb"
"github.com/milvus-io/milvus/internal/types"
"github.com/milvus-io/milvus/pkg/log"
... | milvus/internal/datanode/broker/rootcoord.go/0 | {
"file_path": "milvus/internal/datanode/broker/rootcoord.go",
"repo_id": "milvus",
"token_count": 1367
} | 1,799 |
from typing import Any, Callable, Dict, Optional, Sequence
import httpx
from openai import AsyncAzureOpenAI
from openai import AzureOpenAI as SyncAzureOpenAI
from llama_index.legacy.bridge.pydantic import Field, PrivateAttr, root_validator
from llama_index.legacy.callbacks import CallbackManager
from llama_index.lega... | llama_index/llama-index-legacy/llama_index/legacy/llms/azure_openai.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/azure_openai.py",
"repo_id": "llama_index",
"token_count": 3081
} | 1,614 |
<jupyter_start><jupyter_text>Exa Search Exa (formerly Metaphor Search) is a search engine fully designed for use by LLMs. Search for documents on the internet using **natural language queries**, then retrieve **cleaned HTML content** from desired documents.Unlike keyword-based search (Google), Exa's neural search capab... | langchain/docs/docs/integrations/tools/exa_search.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/tools/exa_search.ipynb",
"repo_id": "langchain",
"token_count": 3384
} | 174 |
from llama_index.core.llms.base import BaseLLM
from llama_index.llms.neutrino import Neutrino
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in Neutrino.__mro__]
assert BaseLLM.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py",
"repo_id": "llama_index",
"token_count": 97
} | 1,407 |
// 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 ... | milvus/internal/core/unittest/test_tracer.cpp/0 | {
"file_path": "milvus/internal/core/unittest/test_tracer.cpp",
"repo_id": "milvus",
"token_count": 1262
} | 1,786 |
from langchain_community.tools.azure_cognitive_services.speech2text import (
AzureCogsSpeech2TextTool,
)
__all__ = ["AzureCogsSpeech2TextTool"]
| langchain/libs/langchain/langchain/tools/azure_cognitive_services/speech2text.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/azure_cognitive_services/speech2text.py",
"repo_id": "langchain",
"token_count": 54
} | 573 |
"""Logic for formatting intermediate steps into an agent scratchpad.
Intermediate steps refers to the list of (AgentAction, observation) tuples
that result from previous iterations of the agent.
Depending on the prompting strategy you are using, you may want to format these
differently before passing them into the LLM... | langchain/libs/langchain/langchain/agents/format_scratchpad/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/format_scratchpad/__init__.py",
"repo_id": "langchain",
"token_count": 268
} | 440 |
python_tests()
| llama_index/llama-index-integrations/readers/llama-index-readers-pinecone/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-pinecone/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,446 |
from typing import Dict, Tuple
from langchain.chains.query_constructor.ir import (
Comparator,
Comparison,
Operation,
Operator,
StructuredQuery,
)
from langchain.retrievers.self_query.chroma import ChromaTranslator
DEFAULT_TRANSLATOR = ChromaTranslator()
def test_visit_comparison() -> None:
... | langchain/libs/langchain/tests/unit_tests/retrievers/self_query/test_chroma.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/retrievers/self_query/test_chroma.py",
"repo_id": "langchain",
"token_count": 1192
} | 666 |
---
- name: setup pre-requisites & Docker #Install prerequisite
hosts: dockernodes
become: yes
become_user: root
roles:
- install-modules
- docker-installation
| milvus/deployments/docker/cluster-distributed-deployment/deploy-docker.yml/0 | {
"file_path": "milvus/deployments/docker/cluster-distributed-deployment/deploy-docker.yml",
"repo_id": "milvus",
"token_count": 59
} | 1,901 |
<jupyter_start><jupyter_text>Contributing a LlamaDataset To LlamaHub `LlamaDataset`'s storage is managed through a git repository. To contribute a dataset requires making a pull request to `llama_index/llama_datasets` Github (LFS) repository. To contribute a `LabelledRagDataset` (a subclass of `BaseLlamaDataset`), two ... | llama_index/docs/examples/llama_dataset/uploading_llama_dataset.ipynb/0 | {
"file_path": "llama_index/docs/examples/llama_dataset/uploading_llama_dataset.ipynb",
"repo_id": "llama_index",
"token_count": 842
} | 1,060 |
import { GitbookLoader } from "langchain/document_loaders/web/gitbook";
export const run = async () => {
const loader = new GitbookLoader("https://docs.gitbook.com");
const docs = await loader.load(); // load single path
console.log(docs);
const allPathsLoader = new GitbookLoader("https://docs.gitbook.com", {
... | langchainjs/examples/src/document_loaders/gitbook.ts/0 | {
"file_path": "langchainjs/examples/src/document_loaders/gitbook.ts",
"repo_id": "langchainjs",
"token_count": 149
} | 828 |
poetry_requirements(
name="poetry",
)
python_requirements(
name="reqs",
)
| llama_index/llama-index-integrations/tools/llama-index-tools-waii/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-waii/BUILD",
"repo_id": "llama_index",
"token_count": 36
} | 1,442 |
# 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 applicabl... | transformers/src/transformers/models/splinter/__init__.py/0 | {
"file_path": "transformers/src/transformers/models/splinter/__init__.py",
"repo_id": "transformers",
"token_count": 927
} | 725 |
python_sources()
| llama_index/llama-index-core/llama_index/core/response/BUILD/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/response/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,244 |
# Models
[[autodoc]] timm.create_model
[[autodoc]] timm.list_models
| pytorch-image-models/hfdocs/source/reference/models.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/reference/models.mdx",
"repo_id": "pytorch-image-models",
"token_count": 29
} | 356 |
use crate::languages::LANGUAGES;
use anyhow::Error as E;
use candle::{safetensors::Load, DType, Device, IndexOp, Tensor, D};
use candle_nn::{ops::softmax, VarBuilder};
pub use candle_transformers::models::whisper::{self as m, Config};
use rand::{distributions::Distribution, rngs::StdRng, SeedableRng};
use serde::{Deser... | candle/candle-wasm-examples/whisper/src/worker.rs/0 | {
"file_path": "candle/candle-wasm-examples/whisper/src/worker.rs",
"repo_id": "candle",
"token_count": 8765
} | 87 |
import { logVersion010MigrationWarning } from "../../util/entrypoint_deprecation.js";
/* #__PURE__ */ logVersion010MigrationWarning({
oldEntrypointName: "chat_models/googlevertexai/web",
});
export * from "@langchain/community/chat_models/googlevertexai/web";
| langchainjs/langchain/src/chat_models/googlevertexai/web.ts/0 | {
"file_path": "langchainjs/langchain/src/chat_models/googlevertexai/web.ts",
"repo_id": "langchainjs",
"token_count": 83
} | 872 |
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | transformers/src/transformers/pipelines/__init__.py/0 | {
"file_path": "transformers/src/transformers/pipelines/__init__.py",
"repo_id": "transformers",
"token_count": 21555
} | 684 |
// 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/querycoordv2/meta/failed_load_cache_test.go/0 | {
"file_path": "milvus/internal/querycoordv2/meta/failed_load_cache_test.go",
"repo_id": "milvus",
"token_count": 639
} | 1,842 |
search_performance:
collections:
-
server:
db_config.primary_path: /test/milvus/db_data_011/sift_50m_100000_128_l2
cache_config.cpu_cache_capacity: 32GB
engine_config.use_blas_threshold: 0
engine_config.gpu_search_threshold: 100
gpu_resource_config.enable: true
... | milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_search_sift50m.yaml/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/suites/011_gpu_search_sift50m.yaml",
"repo_id": "milvus",
"token_count": 1966
} | 1,937 |
---
sidebar_label: Cloudflare Workers AI
---
# ChatCloudflareWorkersAI
:::info
Workers AI is currently in Open Beta and is not recommended for production data and traffic, and limits + access are subject to change
:::
Workers AI allows you to run machine learning models, on the Cloudflare network, from your own code... | langchainjs/docs/core_docs/docs/integrations/chat/cloudflare_workersai.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/chat/cloudflare_workersai.mdx",
"repo_id": "langchainjs",
"token_count": 224
} | 721 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/vector_store/retrievers/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,568 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Welcome to Candle!</title>
<link data-trunk rel="copy-file" href="tokenizer.json" />
<link data-trunk rel="copy-file" href="model.bin" />
<link data-trunk rel="rust" href="Cargo.toml" data-bin="app" data-type="main" />
<l... | candle/candle-wasm-examples/llama2-c/index.html/0 | {
"file_path": "candle/candle-wasm-examples/llama2-c/index.html",
"repo_id": "candle",
"token_count": 315
} | 81 |
# Xception
**Xception** is a convolutional neural network architecture that relies solely on [depthwise separable convolution layers](https://paperswithcode.com/method/depthwise-separable-convolution).
The weights from this model were ported from [Tensorflow/Models](https://github.com/tensorflow/models).
## How do I... | pytorch-image-models/hfdocs/source/models/xception.mdx/0 | {
"file_path": "pytorch-image-models/hfdocs/source/models/xception.mdx",
"repo_id": "pytorch-image-models",
"token_count": 2674
} | 383 |
<jupyter_start><jupyter_text>Run Template<jupyter_code>from langserve.client import RemoteRunnable
rag_app = RemoteRunnable("http://localhost:8000/rag-codellama-fireworks")
rag_app.invoke("How can I initialize a ReAct agent?")<jupyter_output><empty_output> | langchain/templates/rag-codellama-fireworks/rag_codellama_fireworks.ipynb/0 | {
"file_path": "langchain/templates/rag-codellama-fireworks/rag_codellama_fireworks.ipynb",
"repo_id": "langchain",
"token_count": 91
} | 685 |
from typing import Any, Dict, List
from langchain.pydantic_v1 import BaseModel, root_validator
from langchain_core.embeddings import Embeddings
class OpenCLIPEmbeddings(BaseModel, Embeddings):
model: Any
preprocess: Any
tokenizer: Any
# Select model: https://github.com/mlfoundations/open_clip
mod... | langchain/libs/experimental/langchain_experimental/open_clip/open_clip.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/open_clip/open_clip.py",
"repo_id": "langchain",
"token_count": 1451
} | 445 |
---
hide_table_of_contents: true
---
import CodeBlock from "@theme/CodeBlock";
# Cassandra Chat Memory
For longer-term persistence across chat sessions, you can swap out the default in-memory `chatHistory` that backs chat memory classes like `BufferMemory` for a Cassandra cluster.
## Setup
First, install the Cassa... | langchainjs/docs/core_docs/docs/integrations/chat_memory/cassandra.mdx/0 | {
"file_path": "langchainjs/docs/core_docs/docs/integrations/chat_memory/cassandra.mdx",
"repo_id": "langchainjs",
"token_count": 534
} | 724 |
<script lang="ts">
import CarbonContinue from "~icons/carbon/continue";
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-300 d... | chat-ui/src/lib/components/ContinueBtn.svelte/0 | {
"file_path": "chat-ui/src/lib/components/ContinueBtn.svelte",
"repo_id": "chat-ui",
"token_count": 149
} | 83 |
def remove_prefix(text, prefix):
return text[text.startswith(prefix) and len(prefix):]
nps = {}
for k, v in model.state_dict().items():
k = remove_prefix(k, 'module_list.')
nps[k] = v.detach().numpy()
np.savez('yolo-v3.ot', **nps)
| candle/candle-examples/examples/yolo-v3/extract-weights.py/0 | {
"file_path": "candle/candle-examples/examples/yolo-v3/extract-weights.py",
"repo_id": "candle",
"token_count": 98
} | 48 |
<!--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/using-diffusers/stable_diffusion_jax_how_to.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/stable_diffusion_jax_how_to.md",
"repo_id": "diffusers",
"token_count": 8474
} | 194 |
import json
import logging
import string
from enum import Enum
from typing import List, Optional, Tuple, Any, TypedDict, cast, Dict, TypeVar
from overrides import override
from pydantic import SecretStr
import yaml
from chromadb.auth import (
ServerAuthProvider,
ClientAuthProvider,
ServerAuthenticationReq... | chroma/chromadb/auth/token/__init__.py/0 | {
"file_path": "chroma/chromadb/auth/token/__init__.py",
"repo_id": "chroma",
"token_count": 4392
} | 14 |
import { ChatOpenAI } from "@langchain/openai";
import { HumanMessage, SystemMessage } from "@langchain/core/messages";
export const run = async () => {
const chat = new ChatOpenAI({ modelName: "gpt-3.5-turbo" });
// Pass in a list of messages to `call` to start a conversation. In this simple example, we only pass... | langchainjs/examples/src/models/chat/chat.ts/0 | {
"file_path": "langchainjs/examples/src/models/chat/chat.ts",
"repo_id": "langchainjs",
"token_count": 727
} | 891 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.