docsense.models
Model implementations for DocSense.
- class EmbeddingModel(model_name='Qwen/Qwen2-7B', device='cuda', max_length=512, normalize_embeddings=True)[source]
Text embedding model using Qwen.
- __init__(model_name='Qwen/Qwen2-7B', device='cuda', max_length=512, normalize_embeddings=True)[source]
Initialize the embedding model.
- class LLMModel(model_name='Qwen/Qwen2-7B', device='cuda', max_length=2048, temperature=0.0, top_p=1.0, repetition_penalty=1.1)[source]
Wrapper for Qwen language model.
- Parameters:
- __init__(model_name='Qwen/Qwen2-7B', device='cuda', max_length=2048, temperature=0.0, top_p=1.0, repetition_penalty=1.1)[source]
Initialize the LLM model.
- Parameters:
model_name (
str
) – Name of the Qwen model to usedevice (
str
) – Device to run the model on (‘cuda’ or ‘cpu’)max_length (
int
) – Maximum sequence length for generationtemperature (
float
) – Sampling temperature (0.0 for deterministic output)top_p (
float
) – Nucleus sampling parameter (1.0 for no filtering)repetition_penalty (
float
) – Penalty for repeating tokens
Modules
Text embedding model implementation using Qwen. |
|
LLM (Large Language Model) wrapper implementation. |