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:
- Generate subqueries for a given question.
- Generate follow-up questions for a vague question.
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 this?")
print("Follow-up questions:", result.follow_up)
print("Subqueries:", result.subquery)
For Ollama
from subquery import OllamaSubqueryGenerator
# Using the Ollama backend
generator = OllamaSubqueryGenerator()
result = generator.generate("Are the Indiana Harbor and Ship Canal and the Folsom South Canal in the same state?")
print("Follow-up questions:", result.follow_up)
print("Subqueries:", result.subquery)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file subquery-0.1.2.tar.gz
.
File metadata
- Download URL: subquery-0.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.6 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b89fc5bb4e76003734be9eed1847a34a39edc35317af2a3cff548d820e9f54c |
|
MD5 | c6cb61c6b6f54093fbedf608472ac80e |
|
BLAKE2b-256 | 1651af2aaf6b4754a1e173248206863f0bb63c739bde37940ea1e32ae2a10c79 |
File details
Details for the file subquery-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: subquery-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa5145bdc89cf9b3f4a5d50809753bf2a118ca648f29362c4e9062f4de2f8d56 |
|
MD5 | 85dcc4a4dc2988d9186e20c20ae21a5b |
|
BLAKE2b-256 | 7f61225501d59fc5b0816b6be2a8bb01ce7c10e821503387de627d6db6e55bd0 |