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
Built Distribution
Close
Hashes for questionnaire_mistral-0.2.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1866c9d8099fe98541f1958b04cb817a5041402d84de0095f23a2c956d152b9 |
|
MD5 | 7454b6e11c589ede44c77245e49f216c |
|
BLAKE2b-256 | 7ebdc03eb8d700737cb33525277a90a9e31701b7f1781983c81a24375b99b872 |
Close
Hashes for questionnaire_mistral-0.2.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14054f73c43a1db4ccbb70ecb3babbff4339a292a2aa29519bbdc30127a831d3 |
|
MD5 | 1ba00f36326d11f0ebea4534c1293178 |
|
BLAKE2b-256 | 0b3025b786bc1053578647d3eb2bceda454e115d8bc27b600182aeadb7f7b392 |