aait 2.3.12.1__tar.gz → 2.3.12.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aait-2.3.12.1 → aait-2.3.12.2}/PKG-INFO +1 -1
- {aait-2.3.12.1 → aait-2.3.12.2}/aait.egg-info/PKG-INFO +1 -1
- {aait-2.3.12.1 → aait-2.3.12.2}/aait.egg-info/SOURCES.txt +5 -2
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/__init__.py +4 -1
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/llm/answers_llama.py +45 -13
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/llm/lmstudio.py +2 -2
- aait-2.3.12.2/orangecontrib/AAIT/llm/prompt_management.py +157 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/shared_functions.py +54 -43
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/widget_positioning.py +68 -64
- aait-2.3.12.2/orangecontrib/AAIT/widgets/OWConverseLLM.py +274 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWFileWithPath.py +0 -1
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWGenerateWord.py +9 -7
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWInputSelector.py +4 -1
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWLLMEngine.py +14 -7
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWLMStudio.py +200 -190
- aait-2.3.12.2/orangecontrib/AAIT/widgets/OWQuadrantclicker.py +88 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWSelectRowsDynamic.py +19 -37
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/ow_in_or_out_path.ui +13 -0
- aait-2.3.12.2/orangecontrib/AAIT/widgets/designer/owconversellm.ui +363 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owfilewithpath.ui +6 -6
- aait-2.3.12.2/orangecontrib/AAIT/widgets/designer/owquadrant_clicker.ui +276 -0
- aait-2.3.12.2/orangecontrib/AAIT/widgets/icons/quadrantclicker.svg +135 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/setup.py +1 -1
- aait-2.3.12.1/orangecontrib/AAIT/llm/prompt_management.py +0 -140
- aait-2.3.12.1/orangecontrib/AAIT/widgets/OWConverseLLM.py +0 -205
- aait-2.3.12.1/orangecontrib/AAIT/widgets/designer/owconversellm.ui +0 -126
- {aait-2.3.12.1 → aait-2.3.12.2}/License.txt +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/aait.egg-info/dependency_links.txt +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/aait.egg-info/entry_points.txt +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/aait.egg-info/namespace_packages.txt +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/aait.egg-info/requires.txt +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/aait.egg-info/top_level.txt +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/fix_torch/fix_torch_dll_error.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/fix_torch/libomp140.x86_64.dll +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/llm/__init__.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/llm/answers.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/llm/chunking.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/llm/embeddings.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/llm/lemmes.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/llm/process_documents.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/llm/translations.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/optimiser/__init__.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/optimiser/optuna_multi.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/MetManagement.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/OperationSystem.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/SimpleDialogQt.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/__init__.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/aait_repo_file.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/aait_table_viewer.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/base_widget.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/delta_local_shared_fodler.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/import_uic.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/initialize_from_ini.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/mac_utils.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/shared_variables.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/subprocess_management.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/thread_management.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/tools/__init__.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/tools/change_owcorpus.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/tools/concat_splitted_pypi.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/tools/first_time_check.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/tools/owcorpus_ok.txt +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/unlink_table_domain.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/utils/windows_utils.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWAAITResourcesManager.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWAccumulator.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWAddColumns.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWApplyRules.py +0 -0
- /aait-2.3.12.1/orangecontrib/AAIT/widgets/owautoshowcreateinstance.py → /aait-2.3.12.2/orangecontrib/AAIT/widgets/OWAutoShowCreateInstance.py +0 -0
- /aait-2.3.12.1/orangecontrib/AAIT/widgets/owautoshowtable.py → /aait-2.3.12.2/orangecontrib/AAIT/widgets/OWAutoShowTable.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWCN2rule_view.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWChunking.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWConcatRules.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWCreateEmbeddings.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWDisplayMD.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWEditTable.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWEmptySwitch.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWEndLoop.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWExecuteScript.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWExtraChunks.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWExtractTokens.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWFileMetadata.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWFileSyncChecker.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWFindFilesFromDir.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWFusionNM.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWGenerateQuestions.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWGenerateSynthesis.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWKeywords.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWKeywordsDetection.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWLanguageDetection.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWLargeLanguageModel.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWLemmatizer.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWLoadDocuments.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_CE_MiniLML6.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Embeddings.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Falcon.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_HelsinkiEnFr.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_HelsinkiFrEn.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_MPNET.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Mistral.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Qwen.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Qwen1B5_Q6.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Qwen2_5_32B.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Qwen3B_Q4.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Qwen7B_Q4.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Qwen7B_Q6.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_Solar.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_SolarUncensored.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_SpacyMD_EN.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWModel_SpacyMD_FR.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWOperationSystem.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWOptimisation.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWOptimisationSelection.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWOptimisationSendScore.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWProcessDocumentsFromPath.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWQueryLLM.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWRandomData.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWReranking.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWSaveFilepathEntry.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWSelectColumnDynamique.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWSortAndSelect.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWStartLoop.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWTable2Corpus.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWTranslation.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWTrigger.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/OWUnzipFolder.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/POW_Wfactory.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/__init__.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owMarkdown.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/ow_OperationSystem.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/ow_widget_random_data.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owaccumulator.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owaddcolumns.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owapplyrules.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owchunking.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owconcatrules.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owedgellm.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owembeddings.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owemptyswitch.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owendloop.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owexecutescript.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owexecutescript_TEST.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owextrachunks.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owextracttokens.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owfilemetadata.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owfilesyncchecker.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owfindfilesfromdir.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owfusion_nm.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owgenerate_word.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owgeneratequestions.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owgeneratesynthesis.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owkeyword.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owkeywordsdetection.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owlangdetect.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owlargelanguagemodel.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owlemmatizer.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owllm4all.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owloaddocuments.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owloadworkflow.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_ce_minilml6.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_falcon.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_helsinki_en_fr.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_helsinki_fr_en.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_mistral.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_mpnet.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_qwen.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_qwen_2.5_32b.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_qwen_instruct_1.5b_q6.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_qwen_instruct_3b_q4.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_qwen_instruct_7b_q4.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_qwen_instruct_7b_q6.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_qwencoder_7b.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_solar.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_solar_uncensored.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_spacymd_en.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owmodel_spacymd_fr.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/ownumberpointinrules.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owprocessdocuments.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owqueryllm.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owreranking.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owsavewithpath.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owselect_column_dynamic.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owselect_row_dynamic.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owsortandselect.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owstartloop.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owtable2corpus.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owtranslation.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owtrigger.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/designer/owunzipfolder.ui +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/CN2RuleViewer.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/CreateInstance.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/MDViewer.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/Mistral.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/Table.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/apply_rules.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/blue_down_arrow.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/category.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/dark_green.txt +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/de.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/document_generator.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/documents.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/edge_llm.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/endloop.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/extra_chunks.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/green_check.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/in_or_out.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/input.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/languages.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/lm_studio.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/local_interf_img_multi_pull.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/local_interf_multi_pull.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/local_interf_pull.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/local_interf_push.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/local_interf_text_pull.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/logo_solar.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/logo_uncensoredsolar.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/logo_upload.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/models.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/operationSystem.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/optimisation.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/optimizer.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/output.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owCN2_intersect_rules.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owaccumulator.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owchunking.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owconversellm.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owedittable.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owembeddings.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owemptyswitch.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owenvinfo.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owexecutescript.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owextracttokens.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owfilemetadata.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owfilesfromdir.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owfilesyncchecker.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owfilewithpath.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owfusion_nm.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owgeneratequestions.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owgeneratesynthesis.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owkeywords.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owkeywordsdetection.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owlargelanguagemodel.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owlemmatizer.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owloaddocuments.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owmodel_ce_minilml6.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owmodel_embeddings.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owmodel_falcon.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owmodel_helsinki_en_fr.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owmodel_helsinki_fr_en.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owmodel_mpnet.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owmodel_spacymd_en.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owmodel_spacymd_fr.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owoptimisation.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owoptimisationselection.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owqueryllm.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owreranking.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owsavefilepathentry.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owselectcolumndynamique.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owsortandselect.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owtable2corpus.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owtranslation.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/owtrigger.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/processdocuments.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/qwen-color.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/select_dynamic_row.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/startloop.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/tools.png +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/widgetFactory.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/AAIT/widgets/icons/zip.svg +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/orangecontrib/__init__.py +0 -0
- {aait-2.3.12.1 → aait-2.3.12.2}/setup.cfg +0 -0
|
@@ -50,6 +50,8 @@ orangecontrib/AAIT/widgets/OWAAITResourcesManager.py
|
|
|
50
50
|
orangecontrib/AAIT/widgets/OWAccumulator.py
|
|
51
51
|
orangecontrib/AAIT/widgets/OWAddColumns.py
|
|
52
52
|
orangecontrib/AAIT/widgets/OWApplyRules.py
|
|
53
|
+
orangecontrib/AAIT/widgets/OWAutoShowCreateInstance.py
|
|
54
|
+
orangecontrib/AAIT/widgets/OWAutoShowTable.py
|
|
53
55
|
orangecontrib/AAIT/widgets/OWCN2rule_view.py
|
|
54
56
|
orangecontrib/AAIT/widgets/OWChunking.py
|
|
55
57
|
orangecontrib/AAIT/widgets/OWConcatRules.py
|
|
@@ -101,6 +103,7 @@ orangecontrib/AAIT/widgets/OWOptimisation.py
|
|
|
101
103
|
orangecontrib/AAIT/widgets/OWOptimisationSelection.py
|
|
102
104
|
orangecontrib/AAIT/widgets/OWOptimisationSendScore.py
|
|
103
105
|
orangecontrib/AAIT/widgets/OWProcessDocumentsFromPath.py
|
|
106
|
+
orangecontrib/AAIT/widgets/OWQuadrantclicker.py
|
|
104
107
|
orangecontrib/AAIT/widgets/OWQueryLLM.py
|
|
105
108
|
orangecontrib/AAIT/widgets/OWRandomData.py
|
|
106
109
|
orangecontrib/AAIT/widgets/OWReranking.py
|
|
@@ -115,8 +118,6 @@ orangecontrib/AAIT/widgets/OWTrigger.py
|
|
|
115
118
|
orangecontrib/AAIT/widgets/OWUnzipFolder.py
|
|
116
119
|
orangecontrib/AAIT/widgets/POW_Wfactory.py
|
|
117
120
|
orangecontrib/AAIT/widgets/__init__.py
|
|
118
|
-
orangecontrib/AAIT/widgets/owautoshowcreateinstance.py
|
|
119
|
-
orangecontrib/AAIT/widgets/owautoshowtable.py
|
|
120
121
|
orangecontrib/AAIT/widgets/designer/owMarkdown.ui
|
|
121
122
|
orangecontrib/AAIT/widgets/designer/ow_OperationSystem.ui
|
|
122
123
|
orangecontrib/AAIT/widgets/designer/ow_in_or_out_path.ui
|
|
@@ -170,6 +171,7 @@ orangecontrib/AAIT/widgets/designer/owmodel_spacymd_en.ui
|
|
|
170
171
|
orangecontrib/AAIT/widgets/designer/owmodel_spacymd_fr.ui
|
|
171
172
|
orangecontrib/AAIT/widgets/designer/ownumberpointinrules.ui
|
|
172
173
|
orangecontrib/AAIT/widgets/designer/owprocessdocuments.ui
|
|
174
|
+
orangecontrib/AAIT/widgets/designer/owquadrant_clicker.ui
|
|
173
175
|
orangecontrib/AAIT/widgets/designer/owqueryllm.ui
|
|
174
176
|
orangecontrib/AAIT/widgets/designer/owreranking.ui
|
|
175
177
|
orangecontrib/AAIT/widgets/designer/owsavewithpath.ui
|
|
@@ -255,6 +257,7 @@ orangecontrib/AAIT/widgets/icons/owtable2corpus.svg
|
|
|
255
257
|
orangecontrib/AAIT/widgets/icons/owtranslation.svg
|
|
256
258
|
orangecontrib/AAIT/widgets/icons/owtrigger.svg
|
|
257
259
|
orangecontrib/AAIT/widgets/icons/processdocuments.svg
|
|
260
|
+
orangecontrib/AAIT/widgets/icons/quadrantclicker.svg
|
|
258
261
|
orangecontrib/AAIT/widgets/icons/qwen-color.png
|
|
259
262
|
orangecontrib/AAIT/widgets/icons/select_dynamic_row.png
|
|
260
263
|
orangecontrib/AAIT/widgets/icons/startloop.png
|
|
@@ -93,7 +93,10 @@ else: # Execute the file
|
|
|
93
93
|
"""
|
|
94
94
|
gc.collect()
|
|
95
95
|
objects = gc.get_objects()
|
|
96
|
-
|
|
96
|
+
try:
|
|
97
|
+
widget_discoveries = [obj for obj in objects if isinstance(obj, WidgetDiscovery)]
|
|
98
|
+
except Exception as e:
|
|
99
|
+
print(e)
|
|
97
100
|
return widget_discoveries
|
|
98
101
|
|
|
99
102
|
def import_proprietary_categories():
|
|
@@ -142,7 +142,7 @@ def load_model(model_path, use_gpu, n_ctx=10000):
|
|
|
142
142
|
return
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
def generate_answers(table, model_path, use_gpu=False, n_ctx=4096, query_parameters=None, workflow_id="", progress_callback=None):
|
|
145
|
+
def generate_answers(table, model_path, use_gpu=False, n_ctx=4096, query_parameters=None, workflow_id="", progress_callback=None, argself=None):
|
|
146
146
|
"""
|
|
147
147
|
Identique en signature/comportement, mais utilise llama_cpp sous le capot.
|
|
148
148
|
"""
|
|
@@ -179,6 +179,8 @@ def generate_answers(table, model_path, use_gpu=False, n_ctx=4096, query_paramet
|
|
|
179
179
|
system_prompt=system_prompt
|
|
180
180
|
)
|
|
181
181
|
|
|
182
|
+
prompt = handle_context_length(prompt, model, n_ctx, method="truncate", progress_callback=progress_callback)
|
|
183
|
+
|
|
182
184
|
answer = run_query(
|
|
183
185
|
prompt,
|
|
184
186
|
model=model,
|
|
@@ -208,7 +210,7 @@ def generate_answers(table, model_path, use_gpu=False, n_ctx=4096, query_paramet
|
|
|
208
210
|
|
|
209
211
|
if progress_callback is not None:
|
|
210
212
|
progress_value = float(100 * (i + 1) / len(data))
|
|
211
|
-
progress_callback((
|
|
213
|
+
progress_callback(("progressBar", progress_value))
|
|
212
214
|
|
|
213
215
|
if argself is not None and getattr(argself, "stop", False):
|
|
214
216
|
break
|
|
@@ -305,7 +307,7 @@ def run_query(prompt, model, max_tokens=4096, temperature=0, top_p=0, top_k=40,
|
|
|
305
307
|
write_tokens_to_file(token, workflow_id)
|
|
306
308
|
|
|
307
309
|
if progress_callback is not None:
|
|
308
|
-
progress_callback((
|
|
310
|
+
progress_callback(("assistant", token))
|
|
309
311
|
|
|
310
312
|
if argself is not None and getattr(argself, "stop", False):
|
|
311
313
|
# Arrêt demandé de l'extérieur
|
|
@@ -323,7 +325,7 @@ def run_query(prompt, model, max_tokens=4096, temperature=0, top_p=0, top_k=40,
|
|
|
323
325
|
return answer
|
|
324
326
|
|
|
325
327
|
|
|
326
|
-
def generate_conversation(table, model, conversation=None, progress_callback=None, argself=None):
|
|
328
|
+
def generate_conversation(table, model, conversation=None, n_ctx=32768, progress_callback=None, argself=None):
|
|
327
329
|
"""
|
|
328
330
|
Generates a response using a language model and appends it to a conversation.
|
|
329
331
|
|
|
@@ -362,26 +364,27 @@ def generate_conversation(table, model, conversation=None, progress_callback=Non
|
|
|
362
364
|
prompt = ""
|
|
363
365
|
# If the conversation has not started, add a default system prompt
|
|
364
366
|
if not conversation:
|
|
365
|
-
|
|
366
|
-
conversation = []
|
|
367
|
+
conversation = [{"role": "system", "content": system_prompt}]
|
|
367
368
|
|
|
368
369
|
# If the conversation has started, build the complete context
|
|
369
370
|
else:
|
|
370
371
|
for message in conversation:
|
|
371
|
-
if message["role"] == "
|
|
372
|
+
if message["role"] == "system":
|
|
373
|
+
prompt += prompt_management.apply_system_template(model_path, message["content"])
|
|
374
|
+
elif message["role"] == "user":
|
|
372
375
|
prompt += prompt_management.apply_user_template(model_path, message["content"])
|
|
373
376
|
elif message["role"] == "assistant":
|
|
374
377
|
prompt += prompt_management.apply_assistant_template(model_path, message["content"])
|
|
375
|
-
elif message["role"] == "system":
|
|
376
|
-
prompt += prompt_management.apply_system_template(model_path, message["content"])
|
|
377
378
|
|
|
378
379
|
# Add the current user prompt & assistant prompt
|
|
379
380
|
prompt += prompt_management.apply_user_template(model_path, user_prompt)
|
|
380
381
|
prompt += prompt_management.apply_assistant_template(model_path, assistant_prompt)
|
|
381
382
|
|
|
383
|
+
prompt = handle_context_length(prompt, model, n_ctx, method="truncate", progress_callback=progress_callback)
|
|
384
|
+
|
|
382
385
|
# Return progression to fill the user & assistant cards
|
|
383
386
|
progress_callback(("user", user_prompt))
|
|
384
|
-
progress_callback((
|
|
387
|
+
progress_callback(("assistant", assistant_prompt))
|
|
385
388
|
|
|
386
389
|
# Append the user message to the conversation
|
|
387
390
|
conversation.append({"role": "user", "content": user_prompt})
|
|
@@ -395,8 +398,8 @@ def generate_conversation(table, model, conversation=None, progress_callback=Non
|
|
|
395
398
|
# Append the answer to the conversation
|
|
396
399
|
conversation.append({"role": "assistant", "content": assistant_prompt + final_answer})
|
|
397
400
|
|
|
398
|
-
#
|
|
399
|
-
progress_callback((
|
|
401
|
+
# End of the progress bar
|
|
402
|
+
progress_callback(("progressBar", 100))
|
|
400
403
|
|
|
401
404
|
# Padding to add columns to the table, TEMPORARY # TODO : process the entire table for conversation
|
|
402
405
|
rows_answer = [final_answer]
|
|
@@ -427,8 +430,37 @@ def split_think(answer: str):
|
|
|
427
430
|
final_answer = re.sub(r"<think>.*?</think>", "", answer, flags=re.DOTALL).strip()
|
|
428
431
|
return think_text, final_answer
|
|
429
432
|
|
|
433
|
+
|
|
430
434
|
def conversation_to_text(conversation):
|
|
431
435
|
if not conversation:
|
|
432
436
|
return ""
|
|
433
437
|
else:
|
|
434
|
-
pass #TODO
|
|
438
|
+
pass #TODO
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
def handle_context_length(prompt, model, n_ctx, method="truncate", margin=0, progress_callback=None):
|
|
442
|
+
"""
|
|
443
|
+
Truncate a prompt to fit within n_ctx tokens, leaving margin for generation.
|
|
444
|
+
Safely handles edge cases where limit <= 0.
|
|
445
|
+
"""
|
|
446
|
+
# Keep a margin for generated tokens
|
|
447
|
+
limit = max(n_ctx - margin, 0) # clamp to at least 0
|
|
448
|
+
|
|
449
|
+
if method == "truncate":
|
|
450
|
+
tokens = model.tokenize(prompt.encode("utf-8")) # pass string, not bytes
|
|
451
|
+
initial_length = len(tokens)
|
|
452
|
+
if initial_length > limit:
|
|
453
|
+
# take last `limit` tokens safely
|
|
454
|
+
tokens = tokens[-limit:] if limit > 0 else []
|
|
455
|
+
truncated_length = len(tokens)
|
|
456
|
+
prompt = model.detokenize(tokens).decode("utf-8") if tokens else ""
|
|
457
|
+
if progress_callback:
|
|
458
|
+
warning = (
|
|
459
|
+
f"Complete prompt contains {initial_length} tokens - context limit is {limit}. "
|
|
460
|
+
f"The {truncated_length} last tokens have been kept in the prompt."
|
|
461
|
+
)
|
|
462
|
+
progress_callback(("warning", warning))
|
|
463
|
+
return prompt
|
|
464
|
+
else:
|
|
465
|
+
return prompt
|
|
466
|
+
|
|
@@ -47,7 +47,7 @@ def appel_lmstudio(prompt, model, stream=False, temperature=0.7, max_tokens=4096
|
|
|
47
47
|
|
|
48
48
|
# Vérification de la réponse
|
|
49
49
|
if response.status_code != 200:
|
|
50
|
-
raise Exception("
|
|
50
|
+
raise Exception("Error in the request")
|
|
51
51
|
|
|
52
52
|
# Initialisation de la variable de contenu
|
|
53
53
|
content = ""
|
|
@@ -75,6 +75,6 @@ def appel_lmstudio(prompt, model, stream=False, temperature=0.7, max_tokens=4096
|
|
|
75
75
|
return content
|
|
76
76
|
|
|
77
77
|
except Exception as e:
|
|
78
|
-
print(f"
|
|
78
|
+
print(f"Error : {e}")
|
|
79
79
|
return None
|
|
80
80
|
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
prompt_templates = {
|
|
4
|
+
"llama": {
|
|
5
|
+
"system": "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n{system_prompt}<|eot_id|>",
|
|
6
|
+
"user": "<|start_header_id|>user<|end_header_id|>\n{user_prompt}<|eot_id|>",
|
|
7
|
+
"assistant": "<|start_header_id|>assistant<|end_header_id|>\n{assistant_prompt}"
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
"mistral": {
|
|
11
|
+
"system": "{system_prompt}\n",
|
|
12
|
+
"user": "<s>[INST] {user_prompt} [/INST]</s>\n",
|
|
13
|
+
"assistant": "{assistant_prompt}"
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
"solar": {
|
|
17
|
+
"system": "{system_prompt}\n",
|
|
18
|
+
"user": "### User: {user_prompt}\n",
|
|
19
|
+
"assistant": "### Assistant: {assistant_prompt}"
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
"deepseek": {
|
|
23
|
+
"system": "{system_prompt}\n",
|
|
24
|
+
"user": "### Instruction: {user_prompt}\n",
|
|
25
|
+
"assistant": "### Response: {assistant_prompt}"
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
"qwen": {
|
|
29
|
+
"system": "<|im_start|>system\n{system_prompt}<|im_end|>\n",
|
|
30
|
+
"user": "<|im_start|>user\n{user_prompt}<|im_end|>\n",
|
|
31
|
+
"assistant": "<|im_start|>assistant\n{assistant_prompt}"
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
"gemma": {
|
|
35
|
+
"system": "{system_prompt}\n",
|
|
36
|
+
"user": "<start_of_turn>user\n{user_prompt}<end_of_turn>\n",
|
|
37
|
+
"assistant": "<start_of_turn>model\n{assistant_prompt}\n"
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
"granite": {
|
|
41
|
+
"system": "<|system|>\n{system_prompt}\n",
|
|
42
|
+
"user": "<|user|>\n{user_prompt}\n",
|
|
43
|
+
"assistant": "<|assistant|>\n{assistant_prompt}"
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
"phi": {
|
|
47
|
+
"system": "<|im_start|>system<|im_sep|>\n{system_prompt}<|im_end|>\n",
|
|
48
|
+
"user": "<|im_start|>user<|im_sep|>\n{user_prompt}<|im_end|>\n",
|
|
49
|
+
"assistant": "<|im_start|>assistant<|im_sep|>\n{assistant_prompt}"
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
"default": {
|
|
53
|
+
"system": "{system_prompt}",
|
|
54
|
+
"user": "{user_prompt}",
|
|
55
|
+
"assistant": "{assistant_prompt}"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
stop_tokens = {
|
|
62
|
+
"llama": "<|eot_id|>",
|
|
63
|
+
"mistral": "</s>",
|
|
64
|
+
"qwen": "<|im_end|>",
|
|
65
|
+
"gemma": "<end_of_turn>",
|
|
66
|
+
"granite": "<|endoftext|>",
|
|
67
|
+
"phi": "<|im_end|>"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
model_types = {
|
|
72
|
+
"solar-10.7b-instruct-v1.0.Q6_K.gguf": "solar",
|
|
73
|
+
"solar-10.7b-instruct-v1.0-uncensored.Q6_K.gguf": "solar",
|
|
74
|
+
"Mistral-7B-Instruct-v0.3.Q6_K.gguf": "mistral",
|
|
75
|
+
"Qwen2.5.1-Coder-7B-Instruct-Q6_K.gguf": "qwen",
|
|
76
|
+
"qwen2.5-3b-instruct-q4_k_m.gguf": "qwen",
|
|
77
|
+
"deepseek-coder-6.7b-instruct.Q6_K.gguf": "deepseek"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
model_keywords = ["qwen", "solar", "mistral", "llama", "deepseek", "gemma", "granite", "phi"]
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def get_model_type(model_path):
|
|
85
|
+
model_name = os.path.basename(model_path)
|
|
86
|
+
model_type = model_types.get(model_name)
|
|
87
|
+
if model_type is None:
|
|
88
|
+
model_type = next((keyword for keyword in model_keywords if keyword in model_name.lower()), None)
|
|
89
|
+
if model_type is None:
|
|
90
|
+
model_type = "default"
|
|
91
|
+
return model_type
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def apply_prompt_template(model_path, user_prompt, assistant_prompt="", system_prompt=""):
|
|
95
|
+
"""
|
|
96
|
+
Apply a prompt template based on the given model name and user input.
|
|
97
|
+
|
|
98
|
+
Parameters:
|
|
99
|
+
model_path (str): The name of the model used to determine its type.
|
|
100
|
+
user_prompt (str): The user input or request to embed into the prompt.
|
|
101
|
+
assistant_prompt (str, optional): The assistant's beginning of response, if any. Defaults to an empty string.
|
|
102
|
+
system_prompt (str, optional): A system-level instruction or context to include in the prompt. Defaults to an empty string.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
str: The formatted prompt that is ready to be passed to the model.
|
|
106
|
+
"""
|
|
107
|
+
# Try to identify the model's type
|
|
108
|
+
model_type = get_model_type(model_path)
|
|
109
|
+
# Retrieve the template
|
|
110
|
+
template = prompt_templates.get(model_type, prompt_templates["default"]) # Default template if none found
|
|
111
|
+
# Apply the template
|
|
112
|
+
prompt = ""
|
|
113
|
+
if system_prompt is not None:
|
|
114
|
+
prompt += template["system"].format(system_prompt=system_prompt)
|
|
115
|
+
prompt += template["user"].format(user_prompt=user_prompt)
|
|
116
|
+
prompt += template["assistant"].format(assistant_prompt=assistant_prompt)
|
|
117
|
+
return prompt
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def apply_system_template(model_path, system_prompt):
|
|
121
|
+
model_type = get_model_type(model_path)
|
|
122
|
+
template = prompt_templates.get(model_type, prompt_templates["default"])
|
|
123
|
+
return template["system"].format(system_prompt=system_prompt)
|
|
124
|
+
|
|
125
|
+
def apply_user_template(model_path, user_prompt):
|
|
126
|
+
model_type = get_model_type(model_path)
|
|
127
|
+
template = prompt_templates.get(model_type, prompt_templates["default"])
|
|
128
|
+
return template["user"].format(user_prompt=user_prompt)
|
|
129
|
+
|
|
130
|
+
def apply_assistant_template(model_path, assistant_prompt):
|
|
131
|
+
model_type = get_model_type(model_path)
|
|
132
|
+
template = prompt_templates.get(model_type, prompt_templates["default"])
|
|
133
|
+
return template["assistant"].format(assistant_prompt=assistant_prompt)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def get_stop_token(model_name):
|
|
137
|
+
"""
|
|
138
|
+
Get the stop token according to the model name / type.
|
|
139
|
+
|
|
140
|
+
Parameters:
|
|
141
|
+
model_name (str): The name of the model used to determine its type.
|
|
142
|
+
"""
|
|
143
|
+
# If there is a stop token
|
|
144
|
+
try:
|
|
145
|
+
# Get the model type
|
|
146
|
+
model_type = model_types[model_name]
|
|
147
|
+
# Get the template for the model type
|
|
148
|
+
stop_token = stop_tokens[model_type]
|
|
149
|
+
except KeyError as e:
|
|
150
|
+
print(f"Your model {model_name} has no stop token defined. See prompt_management.py. (detail: {e})")
|
|
151
|
+
return None
|
|
152
|
+
return stop_token
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
@@ -21,8 +21,11 @@ def get_ow_file_widget():
|
|
|
21
21
|
|
|
22
22
|
# Iterate through the objects in the garbage collector
|
|
23
23
|
for obj in gc.get_objects():
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
try:
|
|
25
|
+
if isinstance(obj, Orange.canvas.mainwindow.MainWindow):
|
|
26
|
+
le_self = obj
|
|
27
|
+
except Exception as e:
|
|
28
|
+
print(e)
|
|
26
29
|
return le_self
|
|
27
30
|
|
|
28
31
|
|
|
@@ -43,29 +46,31 @@ def get_duplicate_names(only_aait=False):
|
|
|
43
46
|
widgets_lists = [] # List to store lists of widgets for each OWS
|
|
44
47
|
|
|
45
48
|
print("Collecting all widgets for every OWS")
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
try:
|
|
50
|
+
for obj in gc.get_objects():
|
|
51
|
+
if isinstance(obj, Orange.canvas.mainwindow.MainWindow):
|
|
52
|
+
ows_name = obj.current_document().path().split("/")[-1]
|
|
53
|
+
ows_list.append(ows_name)
|
|
54
|
+
widgets_list = []
|
|
55
|
+
|
|
56
|
+
# Extract information about widgets for the current OWS
|
|
57
|
+
item_dict = obj.scheme_widget._SchemeEditWidget__scheme.widget_manager._OWWidgetManager__item_for_node
|
|
58
|
+
for item in item_dict.items():
|
|
59
|
+
#widget = item[1].widget # The widget is the 2nd element of the Tuple
|
|
60
|
+
widget_name = item[0].title
|
|
61
|
+
# print(" OWS :", ows_name, "ID :", id(obj))
|
|
62
|
+
# print(" Widget :", widget)
|
|
63
|
+
# print(" Widget ID:", id(widget))
|
|
64
|
+
# print(" Widget name:", widget_name)
|
|
65
|
+
category = item[0].description.category
|
|
66
|
+
|
|
67
|
+
# Targets only aait widgets or includes all widgets based on the 'only_aait' parameter
|
|
68
|
+
if category[0:9] == "dev_workflow" or not only_aait:
|
|
69
|
+
widgets_list.append(widget_name)
|
|
70
|
+
|
|
71
|
+
widgets_lists.append(widgets_list)
|
|
72
|
+
except Exception as e:
|
|
73
|
+
print(e)
|
|
69
74
|
all_duplicates = [] # List to store tuples of OWS names and sets of duplicate widget names
|
|
70
75
|
n_ows = len(ows_list)
|
|
71
76
|
|
|
@@ -102,24 +107,27 @@ def get_current_ows_gui(arg_self):
|
|
|
102
107
|
# print("----> Created Widget ID :", widget_id)
|
|
103
108
|
|
|
104
109
|
# Loop over ALL instantiated objects
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
try:
|
|
111
|
+
for obj in gc.get_objects():
|
|
112
|
+
# Stop whenever a MainWindow is found (OWS)
|
|
113
|
+
if isinstance(obj, Orange.canvas.mainwindow.MainWindow):
|
|
114
|
+
# Dictionary containing all the existing widgets (inside Tuples)
|
|
115
|
+
item_dict = obj.scheme_widget._SchemeEditWidget__scheme.widget_manager._OWWidgetManager__item_for_node
|
|
110
116
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
for item in item_dict.items():
|
|
118
|
+
# The widget (object) is the 2nd element of Tuple
|
|
119
|
+
widget = item[1].widget
|
|
114
120
|
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
if id(widget) == widget_id:
|
|
122
|
+
ows_path = obj.current_document().path()
|
|
117
123
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
# If the OWS hasn't been named / saved, force save-as
|
|
125
|
+
if not ows_path:
|
|
126
|
+
MetManagement.force_save_as(arg_self, target_canvas_id=id(obj))
|
|
121
127
|
|
|
122
|
-
|
|
128
|
+
return obj
|
|
129
|
+
except Exception as e:
|
|
130
|
+
print(e)
|
|
123
131
|
|
|
124
132
|
return None
|
|
125
133
|
|
|
@@ -134,10 +142,13 @@ def get_current_ows_name_no_gui(arg_self):
|
|
|
134
142
|
Returns:
|
|
135
143
|
The name of the associated OWS or an empty string if not found.
|
|
136
144
|
"""
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
145
|
+
try:
|
|
146
|
+
for obj in gc.get_objects():
|
|
147
|
+
if isinstance(obj, argparse.Namespace):
|
|
148
|
+
ows_path = obj.file
|
|
149
|
+
return ows_path
|
|
150
|
+
except Exception as e:
|
|
151
|
+
print(e)
|
|
141
152
|
|
|
142
153
|
return ""
|
|
143
154
|
|
|
@@ -1,64 +1,68 @@
|
|
|
1
|
-
from AnyQt.QtWidgets import QApplication
|
|
2
|
-
from AnyQt.QtCore import QTimer
|
|
3
|
-
#allows displaying a widget on opening
|
|
4
|
-
# add (not sure!)
|
|
5
|
-
# save_position = False
|
|
6
|
-
# after class declaration
|
|
7
|
-
# call show_and_adjust_at_opening at the end of init
|
|
8
|
-
def show_and_adjust_at_opening(argself,str_position):
|
|
9
|
-
# "left", "top-left", "bottom-left","bottom", "bottom-left", "bottom-right"
|
|
10
|
-
str_position=str(str_position)
|
|
11
|
-
if str_position=="None":
|
|
12
|
-
return
|
|
13
|
-
argself.show()
|
|
14
|
-
QTimer.singleShot(1000, lambda: adjust_to_quarter(argself,str_position))
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def adjust_to_quarter(argself, position: str):
|
|
18
|
-
"""
|
|
19
|
-
Resize and position the widget depending on a screen region:
|
|
20
|
-
- left / right → full height, half width
|
|
21
|
-
- top / bottom → full width, half height
|
|
22
|
-
- corners → quarter (half width × half height)
|
|
23
|
-
"""
|
|
24
|
-
app = QApplication.instance()
|
|
25
|
-
screen = app.primaryScreen().availableGeometry()
|
|
26
|
-
|
|
27
|
-
sw, sh = screen.width(), screen.height()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
x = screen.x()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
y = screen.y()
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
1
|
+
from AnyQt.QtWidgets import QApplication
|
|
2
|
+
from AnyQt.QtCore import QTimer
|
|
3
|
+
#allows displaying a widget on opening
|
|
4
|
+
# add (not sure!)
|
|
5
|
+
# save_position = False
|
|
6
|
+
# after class declaration
|
|
7
|
+
# call show_and_adjust_at_opening at the end of init
|
|
8
|
+
def show_and_adjust_at_opening(argself,str_position):
|
|
9
|
+
# "left", "top-left", "bottom-left","bottom", "bottom-left", "bottom-right"
|
|
10
|
+
str_position=str(str_position)
|
|
11
|
+
if str_position=="None" or str_position=="none":
|
|
12
|
+
return
|
|
13
|
+
argself.show()
|
|
14
|
+
QTimer.singleShot(1000, lambda: adjust_to_quarter(argself,str_position))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def adjust_to_quarter(argself, position: str):
|
|
18
|
+
"""
|
|
19
|
+
Resize and position the widget depending on a screen region:
|
|
20
|
+
- left / right → full height, half width
|
|
21
|
+
- top / bottom → full width, half height
|
|
22
|
+
- corners → quarter (half width × half height)
|
|
23
|
+
"""
|
|
24
|
+
app = QApplication.instance()
|
|
25
|
+
screen = app.primaryScreen().availableGeometry()
|
|
26
|
+
|
|
27
|
+
sw, sh = screen.width(), screen.height()
|
|
28
|
+
|
|
29
|
+
if position == "fullscreen":
|
|
30
|
+
# full screen
|
|
31
|
+
w, h = sw, sh
|
|
32
|
+
# ---- CALCUL TAILLE ----
|
|
33
|
+
elif position in ("left", "right"):
|
|
34
|
+
# full height, half width
|
|
35
|
+
w, h = sw // 2, sh
|
|
36
|
+
|
|
37
|
+
elif position in ("top", "bottom"):
|
|
38
|
+
# full width, half height
|
|
39
|
+
w, h = sw, sh // 2
|
|
40
|
+
|
|
41
|
+
elif position in ("top-left", "top-right", "bottom-left", "bottom-right"):
|
|
42
|
+
# quarter (default case)
|
|
43
|
+
w, h = sw // 2, sh // 2
|
|
44
|
+
elif position == "none" or position == "None":
|
|
45
|
+
return # ou ne rien faire
|
|
46
|
+
else:
|
|
47
|
+
# fallback: centered
|
|
48
|
+
w, h = sw // 2, sh // 2
|
|
49
|
+
|
|
50
|
+
# ---- CALCUL POSITION ----
|
|
51
|
+
if position in ("left", "top-left", "bottom-left"):
|
|
52
|
+
x = screen.x()
|
|
53
|
+
elif position in ("right", "top-right", "bottom-right"):
|
|
54
|
+
x = screen.x() + sw - w
|
|
55
|
+
else:
|
|
56
|
+
x = screen.x() + (sw - w) // 2
|
|
57
|
+
|
|
58
|
+
if position in ("top", "top-left", "top-right"):
|
|
59
|
+
y = screen.y()
|
|
60
|
+
elif position in ("bottom", "bottom-left", "bottom-right"):
|
|
61
|
+
y = screen.y() + sh - h
|
|
62
|
+
else:
|
|
63
|
+
y = screen.y() + (sh - h) // 2
|
|
64
|
+
|
|
65
|
+
# ---- APPLIQUER ----
|
|
66
|
+
argself.resize(w, h)
|
|
67
|
+
argself.move(x, y)
|
|
68
|
+
|