text
stringlengths
3
1.68M
id
stringlengths
13
169
metadata
dict
__index_level_0__
int64
0
2.21k
use crate::arc_rwlock_serde; use crate::tasks::models::{BPEFromFilesTask, WordLevelFromFilesTask, WordPieceFromFilesTask}; use crate::trainers::Trainer; use napi::bindgen_prelude::*; use napi_derive::napi; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::sync:...
tokenizers/bindings/node/src/models.rs/0
{ "file_path": "tokenizers/bindings/node/src/models.rs", "repo_id": "tokenizers", "token_count": 3681 }
431
mod common; use common::*; use tokenizers::tokenizer::AddedToken; macro_rules! check_offsets { ($input: expr, $output:expr, $offset:expr, $result:expr) => { let offsets = $output.get_offsets()[$offset]; assert_eq!(&$input[offsets.0..offsets.1], $result); }; } #[test] fn byte_level_basic() { ...
tokenizers/tokenizers/tests/offsets.rs/0
{ "file_path": "tokenizers/tokenizers/tests/offsets.rs", "repo_id": "tokenizers", "token_count": 2497 }
460
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/glossary.md/0
{ "file_path": "transformers/docs/source/en/glossary.md", "repo_id": "transformers", "token_count": 6744 }
435
# for backwards compatibility from llama_index.core.service_context import ServiceContext __all__ = [ "ServiceContext", ]
llama_index/llama-index-core/llama_index/core/indices/service_context.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/service_context.py", "repo_id": "llama_index", "token_count": 37 }
1,130
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,308
# 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_gligen/test_stable_diffusion_gligen.py/0
{ "file_path": "diffusers/tests/pipelines/stable_diffusion_gligen/test_stable_diffusion_gligen.py", "repo_id": "diffusers", "token_count": 2745 }
268
:mod:`{{module}}`.{{objname}} {{ underline }}============== .. currentmodule:: {{ module }} .. autofunction:: {{ objname }} .. example_links:: {{ objname }}
langchain/docs/api_reference/templates/function.rst/0
{ "file_path": "langchain/docs/api_reference/templates/function.rst", "repo_id": "langchain", "token_count": 50 }
83
python_sources()
llama_index/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,223
unit-tests: python -m pytest --cov=text_generation tests install: pip install pip --upgrade pip install -e .
text-generation-inference/clients/python/Makefile/0
{ "file_path": "text-generation-inference/clients/python/Makefile", "repo_id": "text-generation-inference", "token_count": 40 }
358
<jupyter_start><jupyter_text>HTML to text>[html2text](https://github.com/Alir3z4/html2text/) is a Python package that converts a page of `HTML` into clean, easy-to-read plain `ASCII text`. The ASCII also happens to be a valid `Markdown` (a text-to-HTML format).<jupyter_code>%pip install --upgrade --quiet html2text fro...
langchain/docs/docs/integrations/document_transformers/html2text.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/document_transformers/html2text.ipynb", "repo_id": "langchain", "token_count": 311 }
114
import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized, parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface imp...
transformers/tests/sagemaker/test_multi_node_model_parallel.py/0
{ "file_path": "transformers/tests/sagemaker/test_multi_node_model_parallel.py", "repo_id": "transformers", "token_count": 2097 }
789
python_sources()
llama_index/experimental/openai_fine_tuning/BUILD/0
{ "file_path": "llama_index/experimental/openai_fine_tuning/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,113
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/unittest/test_binlog_index.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_binlog_index.cpp", "repo_id": "milvus", "token_count": 5628 }
1,765
# Get LLM import os from pathlib import Path import requests from langchain.memory import ConversationBufferMemory from langchain.utilities import SQLDatabase from langchain_community.llms import LlamaCpp from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate, M...
langchain/templates/sql-llamacpp/sql_llamacpp/chain.py/0
{ "file_path": "langchain/templates/sql-llamacpp/sql_llamacpp/chain.py", "repo_id": "langchain", "token_count": 1419 }
680
pub mod erf; pub mod kernels; trait Cpu<const ARR: usize> { type Unit; type Array; const STEP: usize; const EPR: usize; fn n() -> usize; unsafe fn zero() -> Self::Unit; unsafe fn zero_array() -> Self::Array; unsafe fn load(mem_addr: *const f32) -> Self::Unit; unsafe fn vec_add(a: S...
candle/candle-core/src/cpu/mod.rs/0
{ "file_path": "candle/candle-core/src/cpu/mod.rs", "repo_id": "candle", "token_count": 2416 }
32
"""Test Google GenerativeAI API wrapper. Note: This test must be run with the GOOGLE_API_KEY environment variable set to a valid API key. """ from pathlib import Path import pytest from langchain_core.outputs import LLMResult from langchain_community.llms.google_palm import GooglePalm from langchain_community...
langchain/libs/community/tests/integration_tests/llms/test_google_palm.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/llms/test_google_palm.py", "repo_id": "langchain", "token_count": 944 }
363
// 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/mq/mqimpl/rocksmq/server/rocksmq_retention.go/0
{ "file_path": "milvus/internal/mq/mqimpl/rocksmq/server/rocksmq_retention.go", "repo_id": "milvus", "token_count": 4345 }
1,868
--- sidebar_label: Fine-tuning sidebar_position: 8 --- # Fine-tuning Fine-tune an LLM on collected run data using these recipes: - [OpenAI Fine-Tuning](./export-to-openai/fine-tuning-on-chat-runs.ipynb): list LLM runs and convert them to OpenAI's fine-tuning format efficiently. - [Lilac Dataset Curation](./lilac/lil...
langsmith-cookbook/fine-tuning-examples/README.md/0
{ "file_path": "langsmith-cookbook/fine-tuning-examples/README.md", "repo_id": "langsmith-cookbook", "token_count": 147 }
1,138
# propositional-retrieval This template demonstrates the multi-vector indexing strategy proposed by Chen, et. al.'s [Dense X Retrieval: What Retrieval Granularity Should We Use?](https://arxiv.org/abs/2312.06648). The prompt, which you can [try out on the hub](https://smith.langchain.com/hub/wfh/proposal-indexing), di...
langchain/templates/propositional-retrieval/README.md/0
{ "file_path": "langchain/templates/propositional-retrieval/README.md", "repo_id": "langchain", "token_count": 895 }
685
package notification import ( "context" "github.com/apache/pulsar-client-go/pulsar" "github.com/chroma/chroma-coordinator/internal/model" "github.com/chroma/chroma-coordinator/internal/proto/coordinatorpb" "github.com/pingcap/log" "go.uber.org/zap" "google.golang.org/protobuf/proto" ) type Notifier interface ...
chroma/go/coordinator/internal/notification/notifier.go/0
{ "file_path": "chroma/go/coordinator/internal/notification/notifier.go", "repo_id": "chroma", "token_count": 909 }
54
from langchain_openai import __all__ EXPECTED_ALL = [ "OpenAI", "ChatOpenAI", "OpenAIEmbeddings", "AzureOpenAI", "AzureChatOpenAI", "AzureOpenAIEmbeddings", ] def test_all_imports() -> None: assert sorted(EXPECTED_ALL) == sorted(__all__)
langchain/libs/partners/openai/tests/unit_tests/test_imports.py/0
{ "file_path": "langchain/libs/partners/openai/tests/unit_tests/test_imports.py", "repo_id": "langchain", "token_count": 119 }
661
import { ChatOpenAI } from "@langchain/openai"; // To make the caching really obvious, lets use a slower model. const model = new ChatOpenAI({ modelName: "gpt-4", cache: true, }); console.time(); // The first time, it is not yet in cache, so it should take longer const res = await model.invoke("Tell me a joke!")...
langchainjs/examples/src/models/chat/caching.ts/0
{ "file_path": "langchainjs/examples/src/models/chat/caching.ts", "repo_id": "langchainjs", "token_count": 163 }
796
"""HuggingFace Security toolkit.""" from langchain_experimental.prompt_injection_identifier.hugging_face_identifier import ( HuggingFaceInjectionIdentifier, ) __all__ = ["HuggingFaceInjectionIdentifier"]
langchain/libs/experimental/langchain_experimental/prompt_injection_identifier/__init__.py/0
{ "file_path": "langchain/libs/experimental/langchain_experimental/prompt_injection_identifier/__init__.py", "repo_id": "langchain", "token_count": 67 }
447
<jupyter_start><jupyter_text>Finetuner un modèle de language masqué (TensorFlow) Installez les bibliothèques 🤗 *Datasets* et 🤗 *Transformers* pour exécuter ce *notebook*.<jupyter_code>!pip install datasets transformers[sentencepiece] !apt install git-lfs<jupyter_output><empty_output><jupyter_text>Vous aurez besoin de...
notebooks/course/fr/chapter7/section3_tf.ipynb/0
{ "file_path": "notebooks/course/fr/chapter7/section3_tf.ipynb", "repo_id": "notebooks", "token_count": 2949 }
296
<jupyter_start><jupyter_text>Fine Tuning for Text-to-SQL With Gradient and LlamaIndexIn this notebook we show you how to fine-tune llama2-7b on the [sql-create-context](https://huggingface.co/datasets/b-mc2/sql-create-context) dataset to be better at Text-to-SQL.We do this by using [gradient.ai](https://gradient.ai)**N...
llama_index/docs/examples/finetuning/gradient/gradient_text2sql.ipynb/0
{ "file_path": "llama_index/docs/examples/finetuning/gradient/gradient_text2sql.ipynb", "repo_id": "llama_index", "token_count": 4175 }
1,139
from rag_pinecone_multi_query.chain import chain __all__ = ["chain"]
langchain/templates/rag-pinecone-multi-query/rag_pinecone_multi_query/__init__.py/0
{ "file_path": "langchain/templates/rag-pinecone-multi-query/rag_pinecone_multi_query/__init__.py", "repo_id": "langchain", "token_count": 23 }
741
#[cfg(feature = "mkl")] extern crate intel_mkl_src; #[cfg(feature = "accelerate")] extern crate accelerate_src; use std::io::Write; use std::path::PathBuf; use candle_transformers::models::t5; use anyhow::{Error as E, Result}; use candle::{DType, Device, Tensor}; use candle_nn::VarBuilder; use candle_transformers::g...
candle/candle-examples/examples/t5/main.rs/0
{ "file_path": "candle/candle-examples/examples/t5/main.rs", "repo_id": "candle", "token_count": 5920 }
46
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/querynodev2/server.go/0
{ "file_path": "milvus/internal/querynodev2/server.go", "repo_id": "milvus", "token_count": 7270 }
1,914
"""LlamaIndex data structures.""" # indices from llama_index.legacy.indices.composability.graph import ComposableGraph from llama_index.legacy.indices.document_summary import ( DocumentSummaryIndex, GPTDocumentSummaryIndex, ) from llama_index.legacy.indices.document_summary.base import DocumentSummaryIndex fro...
llama_index/llama-index-legacy/llama_index/legacy/indices/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/indices/__init__.py", "repo_id": "llama_index", "token_count": 987 }
1,568
<!--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/contribute_pipeline.md/0
{ "file_path": "diffusers/docs/source/ko/using-diffusers/contribute_pipeline.md", "repo_id": "diffusers", "token_count": 5976 }
181
# Copyright 2024 Katherine Crowson, The HuggingFace Team and hlky. 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 # # ...
diffusers/src/diffusers/schedulers/scheduling_dpmsolver_sde.py/0
{ "file_path": "diffusers/src/diffusers/schedulers/scheduling_dpmsolver_sde.py", "repo_id": "diffusers", "token_count": 10604 }
251
<!--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/clip.md/0
{ "file_path": "transformers/docs/source/ja/model_doc/clip.md", "repo_id": "transformers", "token_count": 4545 }
529
{ "collection_name": "book", "fields_data": [ { "field_name": "book_id", "type": 5, "field": [ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67...
milvus/tests/scripts/restful-data/insert-data.json/0
{ "file_path": "milvus/tests/scripts/restful-data/insert-data.json", "repo_id": "milvus", "token_count": 758 }
2,132
#!/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/run_on_remote.py/0
{ "file_path": "transformers/examples/run_on_remote.py", "repo_id": "transformers", "token_count": 1321 }
595
<!--Copyright 2022 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/es/fast_tokenizers.md/0
{ "file_path": "transformers/docs/source/es/fast_tokenizers.md", "repo_id": "transformers", "token_count": 987 }
478
cluster: enabled: false log: level: debug image: all: repository: milvusdb/milvus tag: master-latest pullPolicy: IfNotPresent standalone: resources: limits: cpu: 8 memory: 16Gi requests: cpu: 4 memory: 8Gi kafka: enabled: false name: kafka replicaCount: 3 ...
milvus/tests/python_client/deploy/standalone-values.yaml/0
{ "file_path": "milvus/tests/python_client/deploy/standalone-values.yaml", "repo_id": "milvus", "token_count": 294 }
2,181
<jupyter_start><jupyter_text>Sentence Embeddings with Hugging Face Transformers, Sentence Transformers and Amazon SageMaker - Custom Inference for creating document embeddings with Hugging Face's Transformers Welcome to this getting started guide. We will use the Hugging Face Inference DLCs and Amazon SageMaker Python ...
notebooks/sagemaker/17_custom_inference_script/sagemaker-notebook.ipynb/0
{ "file_path": "notebooks/sagemaker/17_custom_inference_script/sagemaker-notebook.ipynb", "repo_id": "notebooks", "token_count": 3804 }
301
# LlamaIndex Vector_Stores Integration: Mongodb
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-mongodb/README.md/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-mongodb/README.md", "repo_id": "llama_index", "token_count": 14 }
1,489
# 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/wav2vec2/__init__.py/0
{ "file_path": "transformers/src/transformers/models/wav2vec2/__init__.py", "repo_id": "transformers", "token_count": 1908 }
673
from langchain_community.document_loaders.roam import RoamLoader __all__ = ["RoamLoader"]
langchain/libs/langchain/langchain/document_loaders/roam.py/0
{ "file_path": "langchain/libs/langchain/langchain/document_loaders/roam.py", "repo_id": "langchain", "token_count": 29 }
499
# coding=utf-8 # Copyright 2024 The Qwen team, Alibaba Group and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
transformers/tests/models/qwen2/test_modeling_qwen2.py/0
{ "file_path": "transformers/tests/models/qwen2/test_modeling_qwen2.py", "repo_id": "transformers", "token_count": 11541 }
730
<jupyter_start><jupyter_text>DeepInfra[DeepInfra](https://deepinfra.com/?utm_source=langchain) is a serverless inference as a service that provides access to a [variety of LLMs](https://deepinfra.com/models?utm_source=langchain) and [embeddings models](https://deepinfra.com/models?type=embeddings&utm_source=langchain)....
langchain/docs/docs/integrations/llms/deepinfra.ipynb/0
{ "file_path": "langchain/docs/docs/integrations/llms/deepinfra.ipynb", "repo_id": "langchain", "token_count": 796 }
128
<jupyter_start><jupyter_text>Huggingface Sagemaker-sdk - Deploy 🤗 Transformers for inference Welcome to this getting started guide, we will use the new Hugging Face Inference DLCs and Amazon SageMaker Python SDK to deploy a transformer model for inference. In this example we deploy a trained Hugging Face Transformer m...
notebooks/sagemaker/10_deploy_model_from_s3/deploy_transformer_model_from_s3.ipynb/0
{ "file_path": "notebooks/sagemaker/10_deploy_model_from_s3/deploy_transformer_model_from_s3.ipynb", "repo_id": "notebooks", "token_count": 1178 }
300
from llama_index.core.llama_pack import BaseLlamaPack from llama_index.packs.ollama_query_engine import OllamaQueryEnginePack def test_class(): names_of_base_classes = [b.__name__ for b in OllamaQueryEnginePack.__mro__] assert BaseLlamaPack.__name__ in names_of_base_classes
llama_index/llama-index-packs/llama-index-packs-ollama-query-engine/tests/test_packs_ollama_query_engine.py/0
{ "file_path": "llama_index/llama-index-packs/llama-index-packs-ollama-query-engine/tests/test_packs_ollama_query_engine.py", "repo_id": "llama_index", "token_count": 103 }
1,686
# Copyright 2022 The HuggingFace Team and Brian Chao. 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 requir...
accelerate/src/accelerate/commands/menu/input.py/0
{ "file_path": "accelerate/src/accelerate/commands/menu/input.py", "repo_id": "accelerate", "token_count": 947 }
10
import os import time import pytest from langchain_community.document_loaders import BlockchainDocumentLoader from langchain_community.document_loaders.blockchain import BlockchainType if "ALCHEMY_API_KEY" in os.environ: alchemyKeySet = True apiKey = os.environ["ALCHEMY_API_KEY"] else: alchemyKeySet = Fa...
langchain/libs/community/tests/integration_tests/document_loaders/test_blockchain.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/document_loaders/test_blockchain.py", "repo_id": "langchain", "token_count": 1574 }
326
python_sources()
llama_index/llama-index-core/llama_index/core/storage/docstore/BUILD/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/storage/docstore/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,299
from llama_index.readers.whatsapp.base import WhatsappChatLoader __all__ = ["WhatsappChatLoader"]
llama_index/llama-index-integrations/readers/llama-index-readers-whatsapp/llama_index/readers/whatsapp/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-whatsapp/llama_index/readers/whatsapp/__init__.py", "repo_id": "llama_index", "token_count": 33 }
1,473
# Data [[autodoc]] timm.data.create_dataset [[autodoc]] timm.data.create_loader [[autodoc]] timm.data.create_transform [[autodoc]] timm.data.resolve_data_config
pytorch-image-models/hfdocs/source/reference/data.mdx/0
{ "file_path": "pytorch-image-models/hfdocs/source/reference/data.mdx", "repo_id": "pytorch-image-models", "token_count": 67 }
365
<jupyter_start><jupyter_text>Multi-Modal GPT4V Pydantic ProgramIn this notebook, we show you how to generate `structured data` with new OpenAI GPT4V API via LlamaIndex. The user just needs to specify a Pydantic object.We also compared several Large Vision models for this task:* GPT4-V* Fuyu-8B* MiniGPT-4* CogVLM* Llava...
llama_index/docs/examples/multi_modal/multi_modal_pydantic.ipynb/0
{ "file_path": "llama_index/docs/examples/multi_modal/multi_modal_pydantic.ipynb", "repo_id": "llama_index", "token_count": 3861 }
1,116
from .chain import chain __all__ = ["chain"]
langchain/templates/cohere-librarian/cohere_librarian/__init__.py/0
{ "file_path": "langchain/templates/cohere-librarian/cohere_librarian/__init__.py", "repo_id": "langchain", "token_count": 15 }
632
"""Test prompt mixin.""" from llama_index.core.prompts.base import PromptTemplate from llama_index.core.prompts.mixin import ( PromptDictType, PromptMixin, PromptMixinType, ) class MockObject2(PromptMixin): def __init__(self) -> None: self._prompt_dict_2 = { "abc": PromptTemplate...
llama_index/llama-index-core/tests/prompts/test_mixin.py/0
{ "file_path": "llama_index/llama-index-core/tests/prompts/test_mixin.py", "repo_id": "llama_index", "token_count": 969 }
1,273
from llama_index.core.vector_stores.types import BasePydanticVectorStore from llama_index.vector_stores.pgvecto_rs import PGVectoRsStore def test_class(): names_of_base_classes = [b.__name__ for b in PGVectoRsStore.__mro__] assert BasePydanticVectorStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-pgvecto-rs/tests/test_vector_stores_pgvecto_rs.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-pgvecto-rs/tests/test_vector_stores_pgvecto_rs.py", "repo_id": "llama_index", "token_count": 108 }
1,472
# Copyright 2020-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 o...
transformers/examples/research_projects/movement-pruning/bertarize.py/0
{ "file_path": "transformers/examples/research_projects/movement-pruning/bertarize.py", "repo_id": "transformers", "token_count": 2329 }
592
// 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/global_allocator_test.go/0
{ "file_path": "milvus/internal/tso/global_allocator_test.go", "repo_id": "milvus", "token_count": 3393 }
1,797
"""Test GPTRouter API wrapper.""" from typing import List import pytest from langchain_core.callbacks import ( CallbackManager, ) from langchain_core.messages import AIMessage, BaseMessage, HumanMessage from langchain_core.outputs import ChatGeneration, LLMResult from langchain_core.pydantic_v1 import SecretStr f...
langchain/libs/community/tests/integration_tests/chat_models/test_gpt_router.py/0
{ "file_path": "langchain/libs/community/tests/integration_tests/chat_models/test_gpt_router.py", "repo_id": "langchain", "token_count": 1399 }
336
from llama_index.legacy.data_structs.data_structs import IndexGraph from llama_index.legacy.storage.index_store.simple_index_store import ( SimpleIndexStore, ) def test_simple_index_store_dict() -> None: index_struct = IndexGraph() index_store = SimpleIndexStore() index_store.add_index_struct(index_st...
llama_index/llama-index-legacy/tests/storage/index_store/test_simple_index_store.py/0
{ "file_path": "llama_index/llama-index-legacy/tests/storage/index_store/test_simple_index_store.py", "repo_id": "llama_index", "token_count": 197 }
1,636
--- hide_table_of_contents: true --- import CodeBlock from "@theme/CodeBlock"; # Python interpreter tool :::warning This tool executes code and can potentially perform destructive actions. Be careful that you trust any code passed to it! ::: LangChain offers an experimental tool for executing arbitrary Python code....
langchainjs/docs/core_docs/docs/integrations/tools/pyinterpreter.mdx/0
{ "file_path": "langchainjs/docs/core_docs/docs/integrations/tools/pyinterpreter.mdx", "repo_id": "langchainjs", "token_count": 206 }
771
from llama_index.core.program import BasePydanticProgram from llama_index.program.evaporate import DFEvaporateProgram def test_class(): names_of_base_classes = [b.__name__ for b in DFEvaporateProgram.__mro__] assert BasePydanticProgram.__name__ in names_of_base_classes
llama_index/llama-index-integrations/program/llama-index-program-evaporate/tests/test_program_evaporate.py/0
{ "file_path": "llama_index/llama-index-integrations/program/llama-index-program-evaporate/tests/test_program_evaporate.py", "repo_id": "llama_index", "token_count": 97 }
1,358
from typing import Any, Dict, List, Literal, Optional import numpy as np from langchain_core.embeddings import Embeddings from langchain_core.pydantic_v1 import BaseModel, Extra, root_validator class FastEmbedEmbeddings(BaseModel, Embeddings): """Qdrant FastEmbedding models. FastEmbed is a lightweight, fast,...
langchain/libs/community/langchain_community/embeddings/fastembed.py/0
{ "file_path": "langchain/libs/community/langchain_community/embeddings/fastembed.py", "repo_id": "langchain", "token_count": 1431 }
257
# 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/upernet/convert_convnext_upernet_to_pytorch.py/0
{ "file_path": "transformers/src/transformers/models/upernet/convert_convnext_upernet_to_pytorch.py", "repo_id": "transformers", "token_count": 4521 }
705
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/pipelines/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py", "repo_id": "diffusers", "token_count": 22884 }
255
# Milvus Developer Guides ​ by Rentong Guo Sep 15, 2020 ## Acknowledgement TODO: a formal acknowledgement. main content: Rentong Guo, Qingxiang Chen (appendix b) figures: Xuan Yang, Zhenshan Cao design suggestions: Zhenshan Cao, Xi Ge, Yefu Chen, Guilin Gou, Yihao Dai, Jiquan Long, Xiaomeng Yi, Peng Xu, Hai Jin, ...
milvus/docs/developer_guides/developer_guides.md/0
{ "file_path": "milvus/docs/developer_guides/developer_guides.md", "repo_id": "milvus", "token_count": 115 }
1,910
<!--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/splinter.md/0
{ "file_path": "transformers/docs/source/en/model_doc/splinter.md", "repo_id": "transformers", "token_count": 1101 }
455
"""SQL StructDatapointExtractor.""" from typing import Any, Dict, Optional, cast from llama_index.core.data_structs.table import StructDatapoint from llama_index.core.indices.common.struct_store.base import ( OUTPUT_PARSER_TYPE, BaseStructDatapointExtractor, ) from llama_index.core.prompts import BasePromptTe...
llama_index/llama-index-core/llama_index/core/indices/common/struct_store/sql.py/0
{ "file_path": "llama_index/llama-index-core/llama_index/core/indices/common/struct_store/sql.py", "repo_id": "llama_index", "token_count": 1113 }
1,260
python_tests()
llama_index/llama-index-integrations/program/llama-index-program-lmformatenforcer/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/program/llama-index-program-lmformatenforcer/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,359
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/en/model_doc/xlm-prophetnet.md/0
{ "file_path": "transformers/docs/source/en/model_doc/xlm-prophetnet.md", "repo_id": "transformers", "token_count": 1127 }
469
from llama_index.llms.openrouter.base import OpenRouter __all__ = ["OpenRouter"]
llama_index/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/__init__.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/__init__.py", "repo_id": "llama_index", "token_count": 30 }
1,367
"""Evaluation modules.""" from llama_index.legacy.evaluation.answer_relevancy import AnswerRelevancyEvaluator from llama_index.legacy.evaluation.base import ( BaseEvaluator, EvaluationResult, ) from llama_index.legacy.evaluation.batch_runner import BatchEvalRunner from llama_index.legacy.evaluation.context_rel...
llama_index/llama-index-legacy/llama_index/legacy/evaluation/__init__.py/0
{ "file_path": "llama_index/llama-index-legacy/llama_index/legacy/evaluation/__init__.py", "repo_id": "llama_index", "token_count": 1444 }
1,559
# This code was adapted from https://github.com/lucidrains/flamingo-pytorch licensed under the MIT License. # # MIT License # # Copyright (c) 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and github/lonePatient # # Permission is hereby granted, free of charge, to any person obtaining a copy # of ...
transformers/src/transformers/models/idefics/perceiver.py/0
{ "file_path": "transformers/src/transformers/models/idefics/perceiver.py", "repo_id": "transformers", "token_count": 3755 }
684
# coding=utf-8 # Copyright 2019-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 a...
transformers/tests/utils/test_doc_samples.py/0
{ "file_path": "transformers/tests/utils/test_doc_samples.py", "repo_id": "transformers", "token_count": 1747 }
807
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-spotify/llama_index/readers/spotify/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-spotify/llama_index/readers/spotify/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,527
<jupyter_start><jupyter_text>LLMsHere we'll be interacting with a server that's exposing 2 LLMs via the runnable interface.<jupyter_code>from langchain.prompts.chat import ChatPromptTemplate from langserve import RemoteRunnable openai_llm = RemoteRunnable("http://localhost:8000/openai/") anthropic = RemoteRunnable("ht...
langserve/examples/llm/client.ipynb/0
{ "file_path": "langserve/examples/llm/client.ipynb", "repo_id": "langserve", "token_count": 929 }
1,025
import copy from collections import deque, defaultdict from dataclasses import dataclass, field, replace, asdict from typing import Any, Deque, Dict, Tuple, Optional, Union __all__ = ['PretrainedCfg', 'filter_pretrained_cfg', 'DefaultCfg'] @dataclass class PretrainedCfg: """ """ # weight source location...
pytorch-image-models/timm/models/_pretrained.py/0
{ "file_path": "pytorch-image-models/timm/models/_pretrained.py", "repo_id": "pytorch-image-models", "token_count": 1341 }
360
fn main() { wasm_logger::init(wasm_logger::Config::new(log::Level::Trace)); yew::Renderer::<candle_wasm_example_whisper::App>::new().render(); }
candle/candle-wasm-examples/whisper/src/bin/app.rs/0
{ "file_path": "candle/candle-wasm-examples/whisper/src/bin/app.rs", "repo_id": "candle", "token_count": 67 }
85
// 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/metastore/kv/datacoord/kv_catalog_test.go/0
{ "file_path": "milvus/internal/metastore/kv/datacoord/kv_catalog_test.go", "repo_id": "milvus", "token_count": 15154 }
1,725
import { test } from "@jest/globals"; import { fileURLToPath } from "node:url"; import { readFileSync } from "node:fs"; import * as path from "node:path"; import { load } from "../index.js"; const IMPORTANT_IMPORTS = JSON.parse( readFileSync( path.join( path.dirname(fileURLToPath(import.meta.url)), "...
langchainjs/langchain/src/load/tests/cross_language.test.ts/0
{ "file_path": "langchainjs/langchain/src/load/tests/cross_language.test.ts", "repo_id": "langchainjs", "token_count": 1591 }
969
export { type CleanupMode, type IndexOptions, index, _batch, _deduplicateInOrder, _getSourceIdAssigner, _isBaseDocumentLoader, _HashedDocument, } from "./indexing.js";
langchainjs/langchain/src/indexes/index.ts/0
{ "file_path": "langchainjs/langchain/src/indexes/index.ts", "repo_id": "langchainjs", "token_count": 70 }
928
"""Evaluators that measure embedding distances.""" from langchain.evaluation.embedding_distance.base import ( EmbeddingDistance, EmbeddingDistanceEvalChain, PairwiseEmbeddingDistanceEvalChain, ) __all__ = [ "EmbeddingDistance", "EmbeddingDistanceEvalChain", "PairwiseEmbeddingDistanceEvalChain",...
langchain/libs/langchain/langchain/evaluation/embedding_distance/__init__.py/0
{ "file_path": "langchain/libs/langchain/langchain/evaluation/embedding_distance/__init__.py", "repo_id": "langchain", "token_count": 114 }
506
from __future__ import annotations from datetime import datetime from pathlib import Path from typing import TYPE_CHECKING, Iterator, List, Optional, Union from langchain_core.chat_sessions import ChatSession from langchain_core.messages import HumanMessage from langchain_community.chat_loaders.base import BaseChatL...
langchain/libs/community/langchain_community/chat_loaders/imessage.py/0
{ "file_path": "langchain/libs/community/langchain_community/chat_loaders/imessage.py", "repo_id": "langchain", "token_count": 3479 }
230
package httpserver import ( "fmt" "github.com/gin-gonic/gin" "github.com/golang/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/types" ) // Handlers handles http requests type Handlers struct { proxy types.ProxyComponent } // NewHandlers creates a ...
milvus/internal/distributed/proxy/httpserver/handler.go/0
{ "file_path": "milvus/internal/distributed/proxy/httpserver/handler.go", "repo_id": "milvus", "token_count": 7000 }
1,932
python_tests()
llama_index/llama-index-integrations/readers/llama-index-readers-linear/tests/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-linear/tests/BUILD", "repo_id": "llama_index", "token_count": 5 }
1,401
## Running T5 with Candle and WASM Here, we provide two examples of how to run Bert using a Candle-compiled WASM binary and runtime. ### Vanilla JS and WebWorkers To build and test the UI made in Vanilla JS and WebWorkers, first we need to build the WASM library: ```bash sh build-lib.sh ``` This will bundle the li...
candle/candle-wasm-examples/t5/README.md/0
{ "file_path": "candle/candle-wasm-examples/t5/README.md", "repo_id": "candle", "token_count": 282 }
86
from llama_index.core.vector_stores.types import VectorStore from llama_index.vector_stores.neo4jvector import Neo4jVectorStore def test_class(): names_of_base_classes = [b.__name__ for b in Neo4jVectorStore.__mro__] assert VectorStore.__name__ in names_of_base_classes
llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-neo4jvector/tests/test_vector_stores_neo4jvector.py/0
{ "file_path": "llama_index/llama-index-integrations/vector_stores/llama-index-vector-stores-neo4jvector/tests/test_vector_stores_neo4jvector.py", "repo_id": "llama_index", "token_count": 97 }
1,492
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_inpaint_legacy.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/deprecated/stable_diffusion_variants/pipeline_stable_diffusion_inpaint_legacy.py", "repo_id": "diffusers", "token_count": 18228 }
244
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/core/src/storage/AzureChunkManager.cpp/0
{ "file_path": "milvus/internal/core/src/storage/AzureChunkManager.cpp", "repo_id": "milvus", "token_count": 4921 }
1,889
python_sources()
llama_index/llama-index-integrations/readers/llama-index-readers-wordpress/llama_index/readers/wordpress/BUILD/0
{ "file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-wordpress/llama_index/readers/wordpress/BUILD", "repo_id": "llama_index", "token_count": 6 }
1,475
// 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/resource_manager_test.go/0
{ "file_path": "milvus/internal/querycoordv2/meta/resource_manager_test.go", "repo_id": "milvus", "token_count": 5531 }
1,843
import os from typing import Any, AsyncGenerator, Generator, Optional from unittest.mock import AsyncMock, MagicMock, patch import pytest from llama_index.core.base.llms.types import ChatMessage from llama_index.llms.openai import OpenAI import openai from openai.types.chat.chat_completion import ( ChatCompletion...
llama_index/llama-index-integrations/llms/llama-index-llms-openai/tests/test_openai.py/0
{ "file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-openai/tests/test_openai.py", "repo_id": "llama_index", "token_count": 6947 }
1,365
# 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/utils/loftq_utils.py/0
{ "file_path": "peft/src/peft/utils/loftq_utils.py", "repo_id": "peft", "token_count": 4002 }
338
# coding=utf-8 # Copyright 2021 Google AI and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
transformers/src/transformers/models/fnet/configuration_fnet.py/0
{ "file_path": "transformers/src/transformers/models/fnet/configuration_fnet.py", "repo_id": "transformers", "token_count": 2166 }
689
from typing import TYPE_CHECKING from ...utils import ( DIFFUSERS_SLOW_IMPORT, OptionalDependencyNotAvailable, _LazyModule, get_objects_from_module, is_torch_available, is_transformers_available, is_transformers_version, ) _dummy_objects = {} _import_structure = {} try: if not (is_tr...
diffusers/src/diffusers/pipelines/audioldm2/__init__.py/0
{ "file_path": "diffusers/src/diffusers/pipelines/audioldm2/__init__.py", "repo_id": "diffusers", "token_count": 637 }
237
from langchain_community.llms.ctranslate2 import CTranslate2 __all__ = ["CTranslate2"]
langchain/libs/langchain/langchain/llms/ctranslate2.py/0
{ "file_path": "langchain/libs/langchain/langchain/llms/ctranslate2.py", "repo_id": "langchain", "token_count": 31 }
514
package indexparamcheck import ( "strconv" "testing" "github.com/stretchr/testify/assert" "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/util/metric" ) func Test_scaNNChecker_CheckTrain(t *testing.T) { validParams := map[string]string{ DIM: strconv.Itoa(128), NL...
milvus/pkg/util/indexparamcheck/scann_checker_test.go/0
{ "file_path": "milvus/pkg/util/indexparamcheck/scann_checker_test.go", "repo_id": "milvus", "token_count": 1618 }
1,915
## Training an unconditional diffusion model Creating a training image set is [described in a different document](https://huggingface.co/docs/datasets/image_process#image-datasets). ### Installing the dependencies Before running the scripts, make sure to install the library's training dependencies: **Important** T...
diffusers/examples/unconditional_image_generation/README.md/0
{ "file_path": "diffusers/examples/unconditional_image_generation/README.md", "repo_id": "diffusers", "token_count": 1939 }
215
// Licensed to the LF AI & Data foundation under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use th...
milvus/internal/core/src/exec/expression/TermExpr.h/0
{ "file_path": "milvus/internal/core/src/exec/expression/TermExpr.h", "repo_id": "milvus", "token_count": 1333 }
1,786
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
transformers/docs/source/ko/perf_train_tpu_tf.md/0
{ "file_path": "transformers/docs/source/ko/perf_train_tpu_tf.md", "repo_id": "transformers", "token_count": 12239 }
560
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable l...
milvus/internal/core/unittest/test_sealed.cpp/0
{ "file_path": "milvus/internal/core/unittest/test_sealed.cpp", "repo_id": "milvus", "token_count": 38128 }
1,821
import neo4j, { Neo4jError } from "neo4j-driver"; interface Neo4jGraphConfig { url: string; username: string; password: string; database?: string; timeoutMs?: number; } interface StructuredSchema { nodeProps: { [key: NodeType["labels"]]: NodeType["properties"] }; relProps: { [key: RelType["type"]]: RelT...
langchainjs/libs/langchain-community/src/graphs/neo4j_graph.ts/0
{ "file_path": "langchainjs/libs/langchain-community/src/graphs/neo4j_graph.ts", "repo_id": "langchainjs", "token_count": 3442 }
969
from __future__ import annotations import base64 import json import logging import uuid from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union, ) import numpy as np from langchain_core.callbacks import ( AsyncCallbackManagerFor...
langchain/libs/community/langchain_community/vectorstores/azuresearch.py/0
{ "file_path": "langchain/libs/community/langchain_community/vectorstores/azuresearch.py", "repo_id": "langchain", "token_count": 12336 }
334