text stringlengths 3 1.68M | id stringlengths 13 169 | metadata dict | __index_level_0__ int64 0 2.21k |
|---|---|---|---|
# coding=utf-8
# Copyright 2021 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/encoder_decoder/modeling_tf_encoder_decoder.py/0 | {
"file_path": "transformers/src/transformers/models/encoder_decoder/modeling_tf_encoder_decoder.py",
"repo_id": "transformers",
"token_count": 14142
} | 601 |
// 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.go/0 | {
"file_path": "milvus/internal/tso/global_allocator.go",
"repo_id": "milvus",
"token_count": 1920
} | 1,866 |
# 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/src/transformers/models/whisper/configuration_whisper.py/0 | {
"file_path": "transformers/src/transformers/models/whisper/configuration_whisper.py",
"repo_id": "transformers",
"token_count": 6886
} | 699 |
#!/bin/bash
# Exit immediately for non zero status
set -e
# Print commands
set -x
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SO... | milvus/tests/scripts/e2e-restful.sh/0 | {
"file_path": "milvus/tests/scripts/e2e-restful.sh",
"repo_id": "milvus",
"token_count": 1315
} | 2,191 |
import pytest
from langchain_core.documents import Document
from langchain_community.embeddings import FakeEmbeddings
from langchain_community.retrievers.svm import SVMRetriever
class TestSVMRetriever:
@pytest.mark.requires("sklearn")
def test_from_texts(self) -> None:
input_texts = ["I have a pen.",... | langchain/libs/community/tests/unit_tests/retrievers/test_svm.py/0 | {
"file_path": "langchain/libs/community/tests/unit_tests/retrievers/test_svm.py",
"repo_id": "langchain",
"token_count": 735
} | 401 |
<jupyter_start><jupyter_text>Entraîner un modèle de langage causal de zéro (TensorFlow)Ici nous entraînons un modèle à générer du code Python. Le Python utilisant des fonctions basées sur des mots anglais, nous gardons un gpt-2 anglais dans l'optique d'obtenir de meilleures performances que ce que l'on pourrait s'atten... | notebooks/course/fr/chapter7/section6_tf.ipynb/0 | {
"file_path": "notebooks/course/fr/chapter7/section6_tf.ipynb",
"repo_id": "notebooks",
"token_count": 2527
} | 315 |
from __future__ import annotations
from typing import Any, Callable, Dict, Iterable, List, Optional
from langchain_core.callbacks import CallbackManagerForRetrieverRun
from langchain_core.documents import Document
from langchain_core.pydantic_v1 import Field
from langchain_core.retrievers import BaseRetriever
def d... | langchain/libs/community/langchain_community/retrievers/bm25.py/0 | {
"file_path": "langchain/libs/community/langchain_community/retrievers/bm25.py",
"repo_id": "langchain",
"token_count": 1581
} | 286 |
import logging
import multiprocessing
import os
import shutil
import socket
import subprocess
import tempfile
import time
from typing import (
Any,
Dict,
Generator,
Iterator,
List,
Optional,
Sequence,
Tuple,
Callable,
)
import hypothesis
import pytest
import uvicorn
from requests.ex... | chroma/chromadb/test/conftest.py/0 | {
"file_path": "chroma/chromadb/test/conftest.py",
"repo_id": "chroma",
"token_count": 8754
} | 23 |
<!--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/en/model_doc/dit.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/dit.md",
"repo_id": "transformers",
"token_count": 1429
} | 460 |
<!--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 agree... | diffusers/docs/source/ko/training/text_inversion.md/0 | {
"file_path": "diffusers/docs/source/ko/training/text_inversion.md",
"repo_id": "diffusers",
"token_count": 9076
} | 201 |
# Using LLaMA models with TRL
We've begun rolling out examples to use Meta's LLaMA models in `trl` (see [Meta's LLaMA release](https://ai.facebook.com/blog/large-language-model-llama-meta-ai/) for the original LLaMA model).
## Efficient training strategies
Even training the smallest LLaMA model requires an enormous ... | trl/docs/source/using_llama_models.mdx/0 | {
"file_path": "trl/docs/source/using_llama_models.mdx",
"repo_id": "trl",
"token_count": 2999
} | 879 |
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable l... | milvus/internal/core/src/common/Utils.h/0 | {
"file_path": "milvus/internal/core/src/common/Utils.h",
"repo_id": "milvus",
"token_count": 2275
} | 1,865 |
"""Test document summary retrievers."""
from llama_index.core.indices.document_summary.base import (
DocumentSummaryIndex,
DocumentSummaryRetrieverMode,
)
from llama_index.core.indices.document_summary.retrievers import (
DocumentSummaryIndexEmbeddingRetriever,
DocumentSummaryIndexLLMRetriever,
)
def ... | llama_index/llama-index-core/tests/indices/document_summary/test_retrievers.py/0 | {
"file_path": "llama_index/llama-index-core/tests/indices/document_summary/test_retrievers.py",
"repo_id": "llama_index",
"token_count": 432
} | 1,218 |
python_tests(
name="tests",
skip_tests=True,
)
| llama_index/llama-index-legacy/tests/selectors/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/tests/selectors/BUILD",
"repo_id": "llama_index",
"token_count": 25
} | 1,566 |
<!--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/ja/model_doc/blenderbot.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/blenderbot.md",
"repo_id": "transformers",
"token_count": 2298
} | 481 |
import math
from locust import User, TaskSet, task, constant
from locust import LoadTestShape
class StepLoadShape(LoadTestShape):
"""
A step load shape
Keyword arguments:
step_time -- Time between steps
step_load -- User increase amount at each step
spawn_rate -- Users to stop/star... | milvus/tests/benchmark/milvus_benchmark/runners/test.py/0 | {
"file_path": "milvus/tests/benchmark/milvus_benchmark/runners/test.py",
"repo_id": "milvus",
"token_count": 368
} | 1,937 |
# coding=utf-8
# Copyright 2021 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/canine/convert_canine_original_tf_checkpoint_to_pytorch.py/0 | {
"file_path": "transformers/src/transformers/models/canine/convert_canine_original_tf_checkpoint_to_pytorch.py",
"repo_id": "transformers",
"token_count": 742
} | 645 |
"""MyScale vector store.
An index that is built on top of an existing MyScale cluster.
"""
import json
import logging
from typing import Any, Dict, List, Optional, cast
from llama_index.legacy.readers.myscale import (
MyScaleSettings,
escape_str,
format_list_to_string,
)
from llama_index.legacy.schema i... | llama_index/llama-index-legacy/llama_index/legacy/vector_stores/myscale.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/myscale.py",
"repo_id": "llama_index",
"token_count": 5367
} | 1,786 |
"""Test modelscope embeddings."""
from langchain_community.embeddings.modelscope_hub import ModelScopeEmbeddings
def test_modelscope_embedding_documents() -> None:
"""Test modelscope embeddings for documents."""
documents = ["foo bar"]
embedding = ModelScopeEmbeddings()
output = embedding.embed_docume... | langchain/libs/community/tests/integration_tests/embeddings/test_modelscope_hub.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/embeddings/test_modelscope_hub.py",
"repo_id": "langchain",
"token_count": 207
} | 362 |
# Writing Custom Modules
A core design principle of LlamaIndex is that **almost every core module can be subclassed and customized**.
This allows you to use LlamaIndex for any advanced LLM use case, beyond the capabilities offered by our prepackaged modules. You're free to write as much custom code for any given modu... | llama_index/docs/optimizing/custom_modules.md/0 | {
"file_path": "llama_index/docs/optimizing/custom_modules.md",
"repo_id": "llama_index",
"token_count": 614
} | 1,149 |
// 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/querynode/client/client.go/0 | {
"file_path": "milvus/internal/distributed/querynode/client/client.go",
"repo_id": "milvus",
"token_count": 4807
} | 1,717 |
import { NodeHandler, ASTParser } from "./base.js";
import { ArrayLiteralType } from "./types.js";
/**
* Handles array expressions in the LangChain Expression Language (LCEL).
* It extends the NodeHandler base class, providing functionality to
* accept and handle array expressions.
*/
export class ArrayLiteralExpr... | langchainjs/langchain/src/output_parsers/expression_type_handlers/array_literal_expression_handler.ts/0 | {
"file_path": "langchainjs/langchain/src/output_parsers/expression_type_handlers/array_literal_expression_handler.ts",
"repo_id": "langchainjs",
"token_count": 543
} | 973 |
# coding=utf-8
# Copyright 2020 Google and 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... | transformers/src/transformers/models/pegasus/tokenization_pegasus_fast.py/0 | {
"file_path": "transformers/src/transformers/models/pegasus/tokenization_pegasus_fast.py",
"repo_id": "transformers",
"token_count": 4338
} | 714 |
from langchain_community.graphs import Neo4jGraph
graph = Neo4jGraph()
graph.query(
"""
MERGE (m:Movie {name:"Top Gun"})
WITH m
UNWIND ["Tom Cruise", "Val Kilmer", "Anthony Edwards", "Meg Ryan"] AS actor
MERGE (a:Actor {name:actor})
MERGE (a)-[:ACTED_IN]->(m)
WITH a
WHERE a.name = "Tom Cruise"
MERGE (a)-[:ACTED_I... | langchain/templates/neo4j-cypher-memory/ingest.py/0 | {
"file_path": "langchain/templates/neo4j-cypher-memory/ingest.py",
"repo_id": "langchain",
"token_count": 143
} | 662 |
"""Wrapper around Embedchain Retriever."""
from __future__ import annotations
from typing import Any, Iterable, List, Optional
from langchain_core.callbacks import CallbackManagerForRetrieverRun
from langchain_core.documents import Document
from langchain_core.retrievers import BaseRetriever
class EmbedchainRetrie... | langchain/libs/community/langchain_community/retrievers/embedchain.py/0 | {
"file_path": "langchain/libs/community/langchain_community/retrievers/embedchain.py",
"repo_id": "langchain",
"token_count": 888
} | 287 |
<jupyter_start><jupyter_text>LLM Caching integrationsThis notebook covers how to cache results of individual LLM calls using different caches.<jupyter_code>from langchain.globals import set_llm_cache
from langchain_openai import OpenAI
# To make the caching really obvious, lets use a slower model.
llm = OpenAI(model_n... | langchain/docs/docs/integrations/llms/llm_caching.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/llms/llm_caching.ipynb",
"repo_id": "langchain",
"token_count": 5113
} | 120 |
<jupyter_start><jupyter_text>Evaluating Agents' Intermediate Steps[](https://colab.research.google.com/github/langchain-ai/langsmith-cookbook/blob/main/testing-examples/agent_steps/evaluating_agents.ipynb)In many scenarios, evaluating an agent isn't merely about the final outcome, but about understanding the steps it t... | langsmith-cookbook/testing-examples/agent_steps/evaluating_agents.ipynb/0 | {
"file_path": "langsmith-cookbook/testing-examples/agent_steps/evaluating_agents.ipynb",
"repo_id": "langsmith-cookbook",
"token_count": 3273
} | 1,060 |
# coding=utf-8
# Copyright 2019-present, Facebook, Inc and 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
#
# Un... | transformers/src/transformers/models/flaubert/modeling_tf_flaubert.py/0 | {
"file_path": "transformers/src/transformers/models/flaubert/modeling_tf_flaubert.py",
"repo_id": "transformers",
"token_count": 25400
} | 618 |
STEAM_GET_GAMES_DETAILS = """
This tool is a wrapper around python-steam-api's steam.apps.search_games API and
steam.apps.get_app_details API, useful when you need to search for a game.
The input to this tool is a string specifying the name of the game you want to
search for. For example, to search fo... | langchain/libs/community/langchain_community/tools/steam/prompt.py/0 | {
"file_path": "langchain/libs/community/langchain_community/tools/steam/prompt.py",
"repo_id": "langchain",
"token_count": 484
} | 301 |
# Privacy and Security
By default, LLamaIndex sends your data to OpenAI for generating embeddings and natural language responses. However, it is important to note that this can be configured according to your preferences. LLamaIndex provides the flexibility to use your own embedding model or run a large language model... | llama_index/docs/understanding/using_llms/privacy.md/0 | {
"file_path": "llama_index/docs/understanding/using_llms/privacy.md",
"repo_id": "llama_index",
"token_count": 197
} | 1,188 |
"""LlamaIndex data structures."""
# indices
from llama_index.core.indices.composability.graph import ComposableGraph
from llama_index.core.indices.document_summary import (
DocumentSummaryIndex,
GPTDocumentSummaryIndex,
)
from llama_index.core.indices.document_summary.base import DocumentSummaryIndex
from llam... | llama_index/llama-index-core/llama_index/core/indices/__init__.py/0 | {
"file_path": "llama_index/llama-index-core/llama_index/core/indices/__init__.py",
"repo_id": "llama_index",
"token_count": 883
} | 1,120 |
from typing import Optional
from llama_index.legacy.storage.docstore.keyval_docstore import KVDocumentStore
from llama_index.legacy.storage.docstore.types import DEFAULT_BATCH_SIZE
from llama_index.legacy.storage.kvstore.mongodb_kvstore import MongoDBKVStore
class MongoDocumentStore(KVDocumentStore):
"""Mongo Do... | llama_index/llama-index-legacy/llama_index/legacy/storage/docstore/mongo_docstore.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/docstore/mongo_docstore.py",
"repo_id": "llama_index",
"token_count": 662
} | 1,643 |
import string
from typing import Dict, Any
import hypothesis.strategies as st
import pytest
from hypothesis import given, settings
from chromadb.api import ServerAPI
from chromadb.config import System
from chromadb.test.conftest import _fastapi_fixture
@st.composite
def token_config(draw: st.DrawFn) -> Dict[str, An... | chroma/chromadb/test/auth/test_token_auth.py/0 | {
"file_path": "chroma/chromadb/test/auth/test_token_auth.py",
"repo_id": "chroma",
"token_count": 2189
} | 19 |
python_tests(
name="tests",
skip_tests=True,
)
| llama_index/llama-index-legacy/tests/indices/vector_store/auto_retriever/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/tests/indices/vector_store/auto_retriever/BUILD",
"repo_id": "llama_index",
"token_count": 25
} | 1,636 |
from typing import Any, Awaitable, Callable, Dict, Optional
from uuid import UUID
from langchain_core.callbacks import AsyncCallbackHandler, BaseCallbackHandler
def _default_approve(_input: str) -> bool:
msg = (
"Do you approve of the following input? "
"Anything except 'Y'/'Yes' (case-insensitiv... | langchain/libs/community/langchain_community/callbacks/human.py/0 | {
"file_path": "langchain/libs/community/langchain_community/callbacks/human.py",
"repo_id": "langchain",
"token_count": 1081
} | 217 |
# 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/src/transformers/models/nezha/modeling_nezha.py/0 | {
"file_path": "transformers/src/transformers/models/nezha/modeling_nezha.py",
"repo_id": "transformers",
"token_count": 32061
} | 670 |
python_sources()
| llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-sec-filings/llama_index/readers/sec_filings/prepline_sec_filings/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,517 |
<!--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/custom_pipeline_overview.md/0 | {
"file_path": "diffusers/docs/source/ko/using-diffusers/custom_pipeline_overview.md",
"repo_id": "diffusers",
"token_count": 2382
} | 196 |
from langgraph.channels.binop import BinaryOperatorAggregate
from langgraph.channels.context import Context
from langgraph.channels.last_value import LastValue
from langgraph.channels.topic import Topic
__all__ = [
"LastValue",
"Topic",
"Context",
"BinaryOperatorAggregate",
]
| langgraph/langgraph/channels/__init__.py/0 | {
"file_path": "langgraph/langgraph/channels/__init__.py",
"repo_id": "langgraph",
"token_count": 95
} | 1,052 |
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | transformers/examples/legacy/seq2seq/old_test_seq2seq_examples_multi_gpu.py/0 | {
"file_path": "transformers/examples/legacy/seq2seq/old_test_seq2seq_examples_multi_gpu.py",
"repo_id": "transformers",
"token_count": 771
} | 572 |
[tool.poetry]
name = "rag-ollama-multi-query"
version = "0.1.0"
description = "RAG with multi-query retriever using Ollama"
authors = [
"Lance Martin <lance@langchain.dev>",
]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
langchain = "^0.1"
openai = "<2"
tiktoken = ">=0.5.1"
chromadb = ">... | langchain/templates/rag-ollama-multi-query/pyproject.toml/0 | {
"file_path": "langchain/templates/rag-ollama-multi-query/pyproject.toml",
"repo_id": "langchain",
"token_count": 302
} | 698 |
import random
import time
import pandas as pd
import numpy as np
import pytest
from base.client_base import TestcaseBase
from common import common_func as cf
from common import common_type as ct
from utils.util_log import test_log as log
from common.common_type import CaseLabel, CheckTasks
from pymilvus.grpc_gen.commo... | milvus/tests/python_client/testcases/test_delete.py/0 | {
"file_path": "milvus/tests/python_client/testcases/test_delete.py",
"repo_id": "milvus",
"token_count": 47193
} | 2,128 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/storage/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/storage/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,601 |
from llama_index.core.multi_modal_llms.base import MultiModalLLM
from llama_index.multi_modal_llms.openai import OpenAIMultiModal
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in OpenAIMultiModal.__mro__]
assert MultiModalLLM.__name__ in names_of_base_classes
| llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/tests/test_multi-modal-llms_openai.py/0 | {
"file_path": "llama_index/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/tests/test_multi-modal-llms_openai.py",
"repo_id": "llama_index",
"token_count": 115
} | 1,291 |
from typing import Optional
from llama_index.core.storage.docstore.keyval_docstore import KVDocumentStore
from llama_index.core.storage.docstore.types import DEFAULT_BATCH_SIZE
from llama_index.storage.kvstore.dynamodb import DynamoDBKVStore
class DynamoDBDocumentStore(KVDocumentStore):
def __init__(
sel... | llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-dynamodb/llama_index/storage/docstore/dynamodb/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/storage/docstore/llama-index-storage-docstore-dynamodb/llama_index/storage/docstore/dynamodb/base.py",
"repo_id": "llama_index",
"token_count": 365
} | 1,467 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/pkg/util/typeutil/schema.go/0 | {
"file_path": "milvus/pkg/util/typeutil/schema.go",
"repo_id": "milvus",
"token_count": 18813
} | 1,981 |
from typing import Any, Awaitable, Callable, Dict, Optional, Sequence
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatResponseGen,
CompletionResponse,
CompletionResponseAsyncGen,
CompletionResponseGen,
LLMMetadata,
)
from llama_index.c... | llama_index/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py/0 | {
"file_path": "llama_index/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py",
"repo_id": "llama_index",
"token_count": 8110
} | 1,400 |
from llama_index.core.llama_pack import BaseLlamaPack
from llama_index.packs.ragatouille_retriever import RAGatouilleRetrieverPack
def test_class():
names_of_base_classes = [b.__name__ for b in RAGatouilleRetrieverPack.__mro__]
assert BaseLlamaPack.__name__ in names_of_base_classes
| llama_index/llama-index-packs/llama-index-packs-ragatouille-retriever/tests/test_packs_ragatouille_retriever.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-ragatouille-retriever/tests/test_packs_ragatouille_retriever.py",
"repo_id": "llama_index",
"token_count": 111
} | 1,723 |
python_tests()
| llama_index/llama-index-integrations/readers/llama-index-readers-imdb-review/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-imdb-review/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,383 |
# TODO: remove this file, only keep for backwards compatibility
from llama_index.legacy.schema import Document, ImageDocument # noqa
| llama_index/llama-index-legacy/llama_index/legacy/readers/schema/base.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/readers/schema/base.py",
"repo_id": "llama_index",
"token_count": 35
} | 1,534 |
<jupyter_start><jupyter_text>Qdrant Vector Store Creating a Qdrant client<jupyter_code>%pip install llama-index-vector-stores-qdrant
import logging
import sys
import os
import qdrant_client
from IPython.display import Markdown, display
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
from llama_in... | llama_index/docs/examples/vector_stores/QdrantIndexDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/vector_stores/QdrantIndexDemo.ipynb",
"repo_id": "llama_index",
"token_count": 1301
} | 1,217 |
<!--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... | accelerate/docs/source/basic_tutorials/troubleshooting.md/0 | {
"file_path": "accelerate/docs/source/basic_tutorials/troubleshooting.md",
"repo_id": "accelerate",
"token_count": 2832
} | 1 |
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Multi-modal, multi part chat prompt works with instances of BaseMessage 1`] = `
[
{
"id": [
"langchain_core",
"messages",
"SystemMessage",
],
"kwargs": {
"additional_kwargs": {},
"content": "You are an AI assistant named Bo... | langchainjs/langchain-core/src/prompts/tests/__snapshots__/chat.test.ts.snap/0 | {
"file_path": "langchainjs/langchain-core/src/prompts/tests/__snapshots__/chat.test.ts.snap",
"repo_id": "langchainjs",
"token_count": 1087
} | 856 |
// Licensed to the LF AI & Data foundation under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use th... | milvus/internal/util/flowgraph/flow_graph_test.go/0 | {
"file_path": "milvus/internal/util/flowgraph/flow_graph_test.go",
"repo_id": "milvus",
"token_count": 2061
} | 1,799 |
<jupyter_start><jupyter_text>Yahoo Finance NewsThis notebook goes over how to use the `yahoo_finance_news` tool with an agent. Setting upFirst, you need to install `yfinance` python package.<jupyter_code>%pip install --upgrade --quiet yfinance<jupyter_output><empty_output><jupyter_text>Example with Chain<jupyter_code... | langchain/docs/docs/integrations/tools/yahoo_finance_news.ipynb/0 | {
"file_path": "langchain/docs/docs/integrations/tools/yahoo_finance_news.ipynb",
"repo_id": "langchain",
"token_count": 756
} | 178 |
"""Test Python REPL Tools."""
import sys
import numpy as np
import pytest
from langchain_experimental.tools.python.tool import (
PythonAstREPLTool,
PythonREPLTool,
sanitize_input,
)
def test_python_repl_tool_single_input() -> None:
"""Test that the python REPL tool works with a single input."""
... | langchain/libs/experimental/tests/unit_tests/python/test_python_2.py/0 | {
"file_path": "langchain/libs/experimental/tests/unit_tests/python/test_python_2.py",
"repo_id": "langchain",
"token_count": 1701
} | 458 |
from typing import List
from llama_index.legacy.embeddings.base import BaseEmbedding
class MockEmbedding(BaseEmbedding):
@classmethod
def class_name(cls) -> str:
return "MockEmbedding"
async def _aget_query_embedding(self, query: str) -> List[float]:
del query
return [0, 0, 1, 0,... | llama_index/llama-index-legacy/tests/indices/vector_store/mock_services.py/0 | {
"file_path": "llama_index/llama-index-legacy/tests/indices/vector_store/mock_services.py",
"repo_id": "llama_index",
"token_count": 1002
} | 1,803 |
from langchain_core.agents import AgentAction, AgentFinish
from langchain.agents.output_parsers.json import JSONAgentOutputParser
def test_tool_usage() -> None:
parser = JSONAgentOutputParser()
_input = """ ```
{
"action": "search",
"action_input": "2+2"
}
```"""
output = parser.invoke(_input)
... | langchain/libs/langchain/tests/unit_tests/agents/output_parsers/test_json.py/0 | {
"file_path": "langchain/libs/langchain/tests/unit_tests/agents/output_parsers/test_json.py",
"repo_id": "langchain",
"token_count": 255
} | 594 |
"""Taken from: https://docs.pinecone.io/docs/hybrid-search"""
import hashlib
from typing import Any, Dict, List, Optional
from langchain_core.callbacks import CallbackManagerForRetrieverRun
from langchain_core.documents import Document
from langchain_core.embeddings import Embeddings
from langchain_core.pydantic_v1 i... | langchain/libs/community/langchain_community/retrievers/pinecone_hybrid_search.py/0 | {
"file_path": "langchain/libs/community/langchain_community/retrievers/pinecone_hybrid_search.py",
"repo_id": "langchain",
"token_count": 2534
} | 277 |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | datasets/metrics/wiki_split/wiki_split.py/0 | {
"file_path": "datasets/metrics/wiki_split/wiki_split.py",
"repo_id": "datasets",
"token_count": 5827
} | 132 |
from pathlib import Path
from typing import Any, Dict, List, Optional
from llama_index.core import ServiceContext
from llama_index.core.llama_pack.base import BaseLlamaPack
from llama_index.core.response_synthesizers import TreeSummarize
from llama_index.core.schema import NodeWithScore
from llama_index.llms.openai im... | llama_index/llama-index-packs/llama-index-packs-resume-screener/llama_index/packs/resume_screener/base.py/0 | {
"file_path": "llama_index/llama-index-packs/llama-index-packs-resume-screener/llama_index/packs/resume_screener/base.py",
"repo_id": "llama_index",
"token_count": 1016
} | 1,672 |
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | diffusers/docs/source/en/training/t2i_adapters.md/0 | {
"file_path": "diffusers/docs/source/en/training/t2i_adapters.md",
"repo_id": "diffusers",
"token_count": 3502
} | 180 |
python_tests()
| llama_index/llama-index-integrations/tools/llama-index-tools-azure-speech/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/tools/llama-index-tools-azure-speech/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,614 |
// 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/server.go/0 | {
"file_path": "milvus/internal/querycoordv2/server.go",
"repo_id": "milvus",
"token_count": 9374
} | 1,899 |
"""Test vectorstores."""
| langchain/libs/community/tests/integration_tests/vectorstores/__init__.py/0 | {
"file_path": "langchain/libs/community/tests/integration_tests/vectorstores/__init__.py",
"repo_id": "langchain",
"token_count": 7
} | 347 |
python_tests()
| llama_index/llama-index-integrations/agent/llama-index-agent-openai-legacy/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/agent/llama-index-agent-openai-legacy/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,166 |
import { OpenAI } from "@langchain/openai";
import {
EntityMemory,
ENTITY_MEMORY_CONVERSATION_TEMPLATE,
} from "langchain/memory";
import { LLMChain } from "langchain/chains";
export const run = async () => {
const memory = new EntityMemory({
llm: new OpenAI({ temperature: 0 }),
chatHistoryKey: "history"... | langchainjs/examples/src/memory/entity.ts/0 | {
"file_path": "langchainjs/examples/src/memory/entity.ts",
"repo_id": "langchainjs",
"token_count": 343
} | 797 |
// Code generated by mockery v2.32.4. DO NOT EDIT.
package proxy
import (
context "context"
internalpb "github.com/milvus-io/milvus/internal/proto/internalpb"
mock "github.com/stretchr/testify/mock"
typeutil "github.com/milvus-io/milvus/pkg/util/typeutil"
)
// MockCache is an autogenerated mock type for the Ca... | milvus/internal/proxy/mock_cache.go/0 | {
"file_path": "milvus/internal/proxy/mock_cache.go",
"repo_id": "milvus",
"token_count": 13603
} | 1,745 |
{
"answer_accuracy": 1.0,
"total": 10,
"valid": 10,
"results": [
{
"db": "wta_1",
"exec_match": false,
"answer_match": true,
"gold": {
"question": "Find the name of the winner who has the highest rank points and participated in the Australian Open tourney.",
"sql_quer... | llama_index/benchmarks/struct_indices/spider/spider-0_01-gpt-4/dev_eval.json/0 | {
"file_path": "llama_index/benchmarks/struct_indices/spider/spider-0_01-gpt-4/dev_eval.json",
"repo_id": "llama_index",
"token_count": 3768
} | 1,087 |
# Tair
This page covers how to use the Tair ecosystem within LangChain.
## Installation and Setup
Install Tair Python SDK with `pip install tair`.
## Wrappers
### VectorStore
There exists a wrapper around TairVector, allowing you to use it as a vectorstore,
whether for semantic search or example selection.
To im... | langchain/docs/docs/integrations/providers/tair.mdx/0 | {
"file_path": "langchain/docs/docs/integrations/providers/tair.mdx",
"repo_id": "langchain",
"token_count": 140
} | 160 |
import json
from typing import Any, Dict, Sequence, Tuple
import httpx
from httpx import Timeout
from llama_index.legacy.bridge.pydantic import Field
from llama_index.legacy.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS
from llama_index.legacy.core.llms.types import (
ChatMessage,
ChatResponse,... | llama_index/llama-index-legacy/llama_index/legacy/llms/ollama.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/llms/ollama.py",
"repo_id": "llama_index",
"token_count": 4111
} | 1,736 |
"""**Document Loaders** are classes to load Documents.
**Document Loaders** are usually used to load a lot of Documents in a single run.
**Class hierarchy:**
.. code-block::
BaseLoader --> <name>Loader # Examples: TextLoader, UnstructuredFileLoader
**Main helpers:**
.. code-block::
Document, <name>Text... | langchain/libs/langchain/langchain/document_loaders/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/document_loaders/__init__.py",
"repo_id": "langchain",
"token_count": 2347
} | 477 |
from langchain_google_vertexai import __all__
EXPECTED_ALL = [
"ChatVertexAI",
"VertexAIEmbeddings",
"VertexAI",
"VertexAIModelGarden",
"HarmBlockThreshold",
"HarmCategory",
"PydanticFunctionsOutputParser",
"create_structured_runnable",
]
def test_all_imports() -> None:
assert sor... | langchain/libs/partners/google-vertexai/tests/unit_tests/test_imports.py/0 | {
"file_path": "langchain/libs/partners/google-vertexai/tests/unit_tests/test_imports.py",
"repo_id": "langchain",
"token_count": 151
} | 629 |
import { smallModel } from "$lib/server/models";
import type { Conversation } from "$lib/types/Conversation";
export async function generateFromDefaultEndpoint({
messages,
preprompt,
}: {
messages: Omit<Conversation["messages"][0], "id">[];
preprompt?: string;
}): Promise<string> {
const endpoint = await smallMod... | chat-ui/src/lib/server/generateFromDefaultEndpoint.ts/0 | {
"file_path": "chat-ui/src/lib/server/generateFromDefaultEndpoint.ts",
"repo_id": "chat-ui",
"token_count": 289
} | 99 |
"""Google Scholar API Toolkit."""
from langchain_community.tools.google_scholar.tool import GoogleScholarQueryRun
__all__ = ["GoogleScholarQueryRun"]
| langchain/libs/langchain/langchain/tools/google_scholar/__init__.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/google_scholar/__init__.py",
"repo_id": "langchain",
"token_count": 44
} | 603 |
package kafka
import (
"context"
"fmt"
"math/rand"
"testing"
"time"
"github.com/confluentinc/confluent-kafka-go/kafka"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/pkg/common"
"github.com/milvus-io/milvus/pkg/mq/msgstream/mqwrapper"
)
func TestKafkaConsumer_Subscription(t *testing.T) {... | milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_consumer_test.go/0 | {
"file_path": "milvus/pkg/mq/msgstream/mqwrapper/kafka/kafka_consumer_test.go",
"repo_id": "milvus",
"token_count": 3619
} | 1,824 |
<jupyter_start><jupyter_text>Chroma Reader If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.<jupyter_code>%pip install llama-index-readers-chroma
!pip install llama-index
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().ad... | llama_index/docs/examples/data_connectors/ChromaDemo.ipynb/0 | {
"file_path": "llama_index/docs/examples/data_connectors/ChromaDemo.ipynb",
"repo_id": "llama_index",
"token_count": 488
} | 1,109 |
from typing import Any, List, Optional, Sequence, Tuple
from langchain_core._api import deprecated
from langchain_core.agents import AgentAction
from langchain_core.callbacks import BaseCallbackManager
from langchain_core.language_models import BaseLanguageModel
from langchain_core.prompts import BasePromptTemplate
fr... | langchain/libs/langchain/langchain/agents/chat/base.py/0 | {
"file_path": "langchain/libs/langchain/langchain/agents/chat/base.py",
"repo_id": "langchain",
"token_count": 2154
} | 465 |
from langchain_core.prompts.prompt import PromptTemplate
# For backwards compatibility.
Prompt = PromptTemplate
__all__ = ["PromptTemplate", "Prompt"]
| langchain/libs/langchain/langchain/prompts/prompt.py/0 | {
"file_path": "langchain/libs/langchain/langchain/prompts/prompt.py",
"repo_id": "langchain",
"token_count": 44
} | 563 |
import logging
from typing import TYPE_CHECKING, Any, List
from llama_index.legacy.bridge.pydantic import PrivateAttr
from llama_index.legacy.schema import BaseNode, MetadataMode
from llama_index.legacy.vector_stores.types import (
BasePydanticVectorStore,
VectorStoreQuery,
VectorStoreQueryResult,
)
from l... | llama_index/llama-index-legacy/llama_index/legacy/vector_stores/pgvecto_rs.py/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/vector_stores/pgvecto_rs.py",
"repo_id": "llama_index",
"token_count": 1277
} | 1,624 |
// Code generated by command: go run ip.go -out ip_amd64.s -stubs ip_stub_amd64.go. DO NOT EDIT.
#include "textflag.h"
// func IP(x []float32, y []float32) float32
// Requires: AVX, FMA3, SSE
TEXT ·IP(SB), NOSPLIT, $0-52
MOVQ x_base+0(FP), AX
MOVQ y_base+24(FP), CX
MOVQ x_len+8(FP), DX
VXORPS Y0, Y0, Y0
VX... | milvus/pkg/util/distance/asm/ip_amd64.s/0 | {
"file_path": "milvus/pkg/util/distance/asm/ip_amd64.s",
"repo_id": "milvus",
"token_count": 768
} | 1,907 |
import { NotionAPILoader } from "langchain/document_loaders/web/notionapi";
// Loading a page (including child pages all as separate documents)
const pageLoader = new NotionAPILoader({
clientOptions: {
auth: "<NOTION_INTEGRATION_TOKEN>",
},
id: "<PAGE_ID>",
type: "page",
});
// A page contents is likely t... | langchainjs/examples/src/document_loaders/notionapi.ts/0 | {
"file_path": "langchainjs/examples/src/document_loaders/notionapi.ts",
"repo_id": "langchainjs",
"token_count": 372
} | 809 |
# 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/controlnet/test_controlnet.py/0 | {
"file_path": "diffusers/examples/controlnet/test_controlnet.py",
"repo_id": "diffusers",
"token_count": 2010
} | 213 |
use super::with_tracing::{linear, linear_no_bias, Embedding, Linear};
use candle::{DType, Device, IndexOp, Result, Tensor, D};
use candle_nn::{layer_norm, LayerNorm, Module, VarBuilder};
use serde::Deserialize;
pub const DTYPE: DType = DType::F32;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
#[serde(rena... | candle/candle-transformers/src/models/jina_bert.rs/0 | {
"file_path": "candle/candle-transformers/src/models/jina_bert.rs",
"repo_id": "candle",
"token_count": 5806
} | 65 |
import os
import openai
from llama_index import (
ServiceContext,
StorageContext,
VectorStoreIndex,
load_index_from_storage,
)
from llama_index.core.llms import OpenAI
from llama_index.core.query_engine import CitationQueryEngine
from llama_index.readers.semanticscholar.base import SemanticScholarReade... | llama_index/llama-index-integrations/readers/llama-index-readers-semanticscholar/tests/test.py/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-semanticscholar/tests/test.py",
"repo_id": "llama_index",
"token_count": 1110
} | 1,552 |
<jupyter_start><jupyter_text>WatsonX Basic Usage Call `complete` with a prompt<jupyter_code>%pip install llama-index-llms-watsonx
from llama_index.llms.watsonx import WatsonX
credentials = {
"url": "https://enter.your-ibm.url",
"apikey": "insert_your_api_key",
}
project_id = "insert_your_project_id"
resp =... | llama_index/docs/examples/llm/watsonx.ipynb/0 | {
"file_path": "llama_index/docs/examples/llm/watsonx.ipynb",
"repo_id": "llama_index",
"token_count": 1492
} | 1,065 |
from functools import partial
from typing import Any, Callable, Dict, Optional, Sequence, cast
from chromadb.server.fastapi.utils import string_to_uuid
from chromadb.api import ServerAPI
from chromadb.auth import AuthzResourceTypes
def find_key_with_value_of_type(
type: AuthzResourceTypes, **kwargs: Any
) -> Dict... | chroma/chromadb/auth/fastapi_utils.py/0 | {
"file_path": "chroma/chromadb/auth/fastapi_utils.py",
"repo_id": "chroma",
"token_count": 740
} | 13 |
.. _Ref-Storage-Vector-Store:
Vector Store
=====================
.. automodapi:: llama_index.core.vector_stores
:no-inheritance-diagram:
| llama_index/docs/api_reference/storage/vector_store.rst/0 | {
"file_path": "llama_index/docs/api_reference/storage/vector_store.rst",
"repo_id": "llama_index",
"token_count": 49
} | 1,083 |
# flake8: noqa
from langchain.prompts.prompt import PromptTemplate
template = (
'''
Q: Olivia has $23. She bought five bagels for $3 each. How much money does she have left?
# solution in Python:
def solution():
"""Olivia has $23. She bought five bagels for $3 each. How much money does she have left?"""
... | langchain/libs/experimental/langchain_experimental/pal_chain/math_prompt.py/0 | {
"file_path": "langchain/libs/experimental/langchain_experimental/pal_chain/math_prompt.py",
"repo_id": "langchain",
"token_count": 1397
} | 451 |
python_sources()
| llama_index/llama-index-legacy/llama_index/legacy/playground/BUILD/0 | {
"file_path": "llama_index/llama-index-legacy/llama_index/legacy/playground/BUILD",
"repo_id": "llama_index",
"token_count": 6
} | 1,692 |
package dbmodel
import (
"time"
"github.com/chroma/chroma-coordinator/internal/types"
)
type Database struct {
ID string `gorm:"id;primaryKey;unique"`
Name string `gorm:"name;type:varchar(128);not_null;uniqueIndex:idx_tenantid_name"`
TenantID string `gorm:"tenant_id;type:... | chroma/go/coordinator/internal/metastore/db/dbmodel/database.go/0 | {
"file_path": "chroma/go/coordinator/internal/metastore/db/dbmodel/database.go",
"repo_id": "chroma",
"token_count": 410
} | 49 |
cd /d %~dp0
bin\minio.exe server s3data | milvus/deployments/windows/run_minio.bat/0 | {
"file_path": "milvus/deployments/windows/run_minio.bat",
"repo_id": "milvus",
"token_count": 18
} | 1,732 |
python_tests()
| llama_index/llama-index-integrations/readers/llama-index-readers-readwise/tests/BUILD/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-readwise/tests/BUILD",
"repo_id": "llama_index",
"token_count": 5
} | 1,363 |
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]
[tool.codespell]
check-filenames = true
check-hidden = true
skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb"
[tool.llamahub]
classes = ["StripeDocsReader"]
contains_example = false
import_path = "llama_index.readers.stripe_doc... | llama_index/llama-index-integrations/readers/llama-index-readers-stripe-docs/pyproject.toml/0 | {
"file_path": "llama_index/llama-index-integrations/readers/llama-index-readers-stripe-docs/pyproject.toml",
"repo_id": "llama_index",
"token_count": 709
} | 1,533 |
from langchain_community.tools.spark_sql.tool import (
BaseSparkSQLTool,
InfoSparkSQLTool,
ListSparkSQLTool,
QueryCheckerTool,
QuerySparkSQLTool,
)
__all__ = [
"BaseSparkSQLTool",
"QuerySparkSQLTool",
"InfoSparkSQLTool",
"ListSparkSQLTool",
"QueryCheckerTool",
]
| langchain/libs/langchain/langchain/tools/spark_sql/tool.py/0 | {
"file_path": "langchain/libs/langchain/langchain/tools/spark_sql/tool.py",
"repo_id": "langchain",
"token_count": 131
} | 567 |
import { useMemo, useState } from "react";
import { cn } from "../utils/cn";
import { ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/24/outline";
export interface PageDocument {
page_content: string;
metadata: Record<string, unknown>;
}
function PageDocument(props: { document: PageDocument; className?... | opengpts/frontend/src/components/Document.tsx/0 | {
"file_path": "opengpts/frontend/src/components/Document.tsx",
"repo_id": "opengpts",
"token_count": 1458
} | 2,059 |
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | transformers/src/transformers/quantizers/quantizer_aqlm.py/0 | {
"file_path": "transformers/src/transformers/quantizers/quantizer_aqlm.py",
"repo_id": "transformers",
"token_count": 1213
} | 751 |
# coding=utf-8
# Copyright 2020 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/tokenization_utils.py/0 | {
"file_path": "transformers/src/transformers/tokenization_utils.py",
"repo_id": "transformers",
"token_count": 20383
} | 685 |
use candle::{Result, Shape, Tensor};
use candle_nn::encoding::one_hot;
#[test]
fn test_i64_one_hot() -> Result<()> {
let device = candle::Device::Cpu;
let indices = Tensor::new(vec![vec![0i64, 2], vec![1, -1]], &device)?;
let depth = 4;
let on_value = 1.0;
let off_value = 0.0;
let one_hot = ... | candle/candle-nn/tests/one_hot.rs/0 | {
"file_path": "candle/candle-nn/tests/one_hot.rs",
"repo_id": "candle",
"token_count": 1592
} | 62 |
// Adapted from turboderp exllama: https://github.com/turboderp/exllama
#include <ATen/cuda/CUDAContext.h>
#include "q4_matrix.cuh"
#include <vector>
#include "../util.cuh"
#include "../matrix.cuh"
using namespace std;
const int UNSHUF_BLOCKSIZE_X = 64;
const int RECONS_THREADS_X = 64; // Block size and thread... | text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matrix.cu/0 | {
"file_path": "text-generation-inference/server/exllama_kernels/exllama_kernels/cuda_func/q4_matrix.cu",
"repo_id": "text-generation-inference",
"token_count": 2592
} | 434 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.