No project description provided
Project description
MistralAI Questionnaire
This project provides a toolkit for generating questionnaire from documents: [txt
, docx
, pdf
] to .csv
dataset format.
Requirements
Before starting, you need to install the following libraries: .. code-block:: python
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
langchain
langchain_community
langchain-huggingface
playwright
html2text
sentence_transformers
faiss-cpu
pandas
peft==0.4.0
trl==0.4.7
pypdf
bitsandbytes
accelerate
Description
ModelManager
This class is responsible for loading mistralai model and generating QA.
Constructor
^^^^^^^^^^^
.. code-block:: python
__init__(self, model_name)
- **model_name**: The path or name of the pre-trained model.
Methods
^^^^^^^
- **setup_tokenizer()**: Loads and configures the tokenizer for the model.
- **setup_bitsandbytes_parameters()**: Configures parameters for bit quantization (BitsAndBytes).
- **from_pretrained()**: Loads the model with pre-trained weights and quantization configuration.
- **print_model_parameters(examples)**: Prints the number of trainable and total parameters of the model.
- **__call__(self, *args, **kwargs)**: The main method for running the generate tasks.
Usage
-----
To start generating QA, you should create an instance of the ``ModelManager`` class and call its ``__call__`` method, passing the necessary arguments.
.. code-block:: python
from questionnaire_mistral.models import ModelManager
model = ModelManager(model_name="path_to_model")
model(document=document, task=task, document_content=document_content, task_count=task_count)
License
-------
The project is distributed under the MIT License.
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
questionnaire_mistral-3.0.tar.gz
(10.6 kB
view hashes)
Built Distribution
Close
Hashes for questionnaire_mistral-3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee8ec7680216e0195d0d18b2e8980713f80376d160498469bbc368e27efa1761 |
|
MD5 | 038f717c707a6accf20a3ac9ae15edcf |
|
BLAKE2b-256 | 57596a56db941a6ef1a97c9e4b350c7c1253f1b53c4ed940cdf7e8e87344d74e |
Close
Hashes for questionnaire_mistral-3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bed3b0ea4e91c7c2d325f4f1185a5271b9b3bfb062d4c4a32525676fd023414 |
|
MD5 | 5bceeca56bb60761e02f4e02a1bb83b8 |
|
BLAKE2b-256 | 3b34fc1702f8735338c75af0ac0dcde89dbe8275282fa471d147605402e3038d |