Skip to main content

A package to generate subqueries and follow-up questions

Project description

Subquery

Subquery generates subqueries and follow-up questions for a given input question. Using the EXTREMELY SMOLL LLM subquery-SmolLM It's a finetuned model based on nisten/Biggie-SmoLlm-0.15B-Base

tiny as 150M (or 180M) parameters and thanks to wonderful work by Nisten and Huggingface's SmolLM-135M

It can run both with transformers and ollama backends. Ollama based GGUF model runs at 160 tps for 1 CPU.

yes.

It can do two things:

  1. Generate subqueries for a given question. q1
  2. Generate follow-up questions for a vague question. q2

This package wraps the model and provides a simple interface to generate subqueries and follow-up questions.

Installation

You can install the package with

pip install subquery

Usage

For Transformers

from subquery import TransformersSubqueryGenerator

# Using the Transformers backend
generator = TransformersSubqueryGenerator()
result = generator.generate("What is the capital of France?")

print("Follow-up questions:", result.follow_up)
print("Subqueries:", result.subquery)
from subquery import OllamaSubqueryGenerator
# Using the Ollama backend
generator = OllamaSubqueryGenerator()
result = generator.generate("What is the capital of France?")

print("Follow-up questions:", result.follow_up)
print("Subqueries:", result.subquery)

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

subquery-0.1.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

subquery-0.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file subquery-0.1.1.tar.gz.

File metadata

  • Download URL: subquery-0.1.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.6 Darwin/23.3.0

File hashes

Hashes for subquery-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b1a01796a34cdf04a6d07ac5f02bbf350c5483de1ee743cab41cf00e64b693b9
MD5 e0ac12321dc4fbe64cff87ee7b3814f3
BLAKE2b-256 21a6e665021c5121b49762b1699e04857524ac5d0177baa8a089162b0abc7c8d

See more details on using hashes here.

File details

Details for the file subquery-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: subquery-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.6 Darwin/23.3.0

File hashes

Hashes for subquery-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 29a8983c95f29459dc0d33aad69e4de61d3a81c9d7eb4a1266ad6c959b2e55a6
MD5 5d6007a05c0d7749cbb9fd82576b9d04
BLAKE2b-256 5abec715ac15cd17f11a0de1dda56629ddcc80d344651a0d10dacd4d5930ec2b

See more details on using hashes here.

Supported by

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