mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-08 20:58:11 +00:00
ci: add coverage and ruff (#1383)
* add coverage calculation and push Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * new codecov version and usage of token Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * enable ruff formatter instead of black and isort Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * apply ruff lint fixes Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * apply ruff unsafe fixes Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * add removed imports Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * runs 1 on linter issues Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * finalize linter fixes Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * Update pyproject.toml Co-authored-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com> Signed-off-by: Michele Dolfi <97102151+dolfim-ibm@users.noreply.github.com> --------- Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> Signed-off-by: Michele Dolfi <97102151+dolfim-ibm@users.noreply.github.com> Co-authored-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com>
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true,
|
||||
"id": "u076oUSF_YUG"
|
||||
@@ -72,12 +72,11 @@
|
||||
"%pip install rich\n",
|
||||
"%pip install torch\n",
|
||||
"\n",
|
||||
"import logging\n",
|
||||
"import warnings\n",
|
||||
"\n",
|
||||
"warnings.filterwarnings(\"ignore\")\n",
|
||||
"\n",
|
||||
"import logging\n",
|
||||
"\n",
|
||||
"# Suppress Weaviate client logs\n",
|
||||
"logging.getLogger(\"weaviate\").setLevel(logging.ERROR)"
|
||||
]
|
||||
@@ -119,7 +118,7 @@
|
||||
" device = torch.device(\"mps\")\n",
|
||||
" print(\"MPS GPU is enabled.\")\n",
|
||||
"else:\n",
|
||||
" raise EnvironmentError(\n",
|
||||
" raise OSError(\n",
|
||||
" \"No GPU or MPS device found. Please check your environment and ensure GPU or MPS support is configured.\"\n",
|
||||
" )"
|
||||
]
|
||||
@@ -226,7 +225,6 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from docling.datamodel.document import ConversionResult\n",
|
||||
"from docling.document_converter import DocumentConverter\n",
|
||||
"\n",
|
||||
"# Instantiate the doc converter\n",
|
||||
@@ -345,7 +343,7 @@
|
||||
"\n",
|
||||
" openai_api_key = os.getenv(openai_api_key_var)\n",
|
||||
" if not openai_api_key:\n",
|
||||
" raise EnvironmentError(\n",
|
||||
" raise OSError(\n",
|
||||
" f\"Environment variable '{openai_api_key_var}' is not set. \"\n",
|
||||
" \"Please define it before running this script.\"\n",
|
||||
" )"
|
||||
@@ -387,7 +385,6 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import weaviate.classes.config as wc\n",
|
||||
"from weaviate.classes.config import DataType, Property\n",
|
||||
"\n",
|
||||
"# Define the collection name\n",
|
||||
"collection_name = \"docling\"\n",
|
||||
|
||||
Reference in New Issue
Block a user