Skip to main content

A library for efficient text-based prompt search with resource monitoring.

Project description

Search Prompts

search-prompts is a library for efficient text search in Hugging Face datasets with resource monitoring (CPU, memory, network).

Installation

You can install the library via pip: pip install search-prompts

Example Usage

from search_prompts import search_prompts_with_monitoring

Search parameters

query = "You are an AI assistant" dataset_name = "rombodawg/Everything_Instruct" config_name = "default"

Perform search with resource monitoring

matching_prompts, resource_usage = search_prompts_with_monitoring( query=query, dataset_name=dataset_name, config_name=config_name, batch_size=1000, max_results=5, chunk_size=5000, monitor_interval=1, )

Display search results

print("\nSearch Results:") if matching_prompts: for instruction in matching_prompts: print(f"- {instruction}") else: print("No matches found.")

Display resource usage

print("\nResource Usage During Execution:") print(f"Average CPU Usage: {resource_usage['avg_cpu_usage']:.2f}%") print(f"Peak Memory Usage: {resource_usage['peak_memory_usage']:.2f} MB") print(f"Network Data Sent: {resource_usage['network_sent_mb']:.2f} MB") print(f"Network Data Received: {resource_usage['network_recv_mb']:.2f} MB") print(f"Total Execution Time: {resource_usage['total_execution_time']:.2f} seconds")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

search_prompts-1.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

search_prompts-1.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file search_prompts-1.1.0.tar.gz.

File metadata

  • Download URL: search_prompts-1.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for search_prompts-1.1.0.tar.gz
Algorithm Hash digest
SHA256 63be756c29757b3d757ab020faab0eac061a884a39f93fd23c89ddac8d8801d0
MD5 ebca48ed2e9345b8d97e0e80b1e35de6
BLAKE2b-256 415fa684626f2296f1adea7d431fe4ad04f13f742555e97676fda457e83851f7

See more details on using hashes here.

File details

Details for the file search_prompts-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: search_prompts-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for search_prompts-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f62f991323b75d67fa998316a5f18ba917199cefe9a2f14d7d54596aefda70a1
MD5 dd70e054e3d4c1ef4b0a3fe8f455a538
BLAKE2b-256 c67af23232b65852fd70af8c02d246ec33f1b51db6920b449bafdb2c5a27be2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page