Skip to content

Commit c673587

Browse files
GuotongIntelbopeng1234
authored andcommitted
Use uv tool for isolate cicd env of each sample from system conda environment, including samples:
1.AI-and-Analytics/End-to-end-Workloads/JobRecommendationSystem 2.AI-and-Analytics/Features-and-Functionality/INC_QuantizationAwareTraining_TextClassification 3.AI-and-Analytics/Getting-Started-Samples/INC-Sample-for-Tensorflow 4.AI-and-Analytics/Getting-Started-Samples/IntelPython_XGBoost_GettingStarted 5.AI-and-Analytics/Getting-Started-Samples/Intel_Extension_For_SKLearn_GettingStarted 6.AI-and-Analytics/Getting-Started-Samples/Modin_GettingStarted Signed-off-by: guotongIntel <guotong.li@intel.com>
1 parent b817a0d commit c673587

File tree

8 files changed

+55
-21
lines changed

8 files changed

+55
-21
lines changed

AI-and-Analytics/End-to-end-Workloads/JobRecommendationSystem/JobRecommendationSystem.ipynb

+1
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@
904904
"metadata": {},
905905
"outputs": [],
906906
"source": [
907+
"import numpy as np\n",
907908
"import intel_extension_for_tensorflow as itex\n",
908909
"\n",
909910
"itex.experimental_ops_override()"

AI-and-Analytics/End-to-end-Workloads/JobRecommendationSystem/JobRecommendationSystem.py

+1
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ def lemmatize_text(text):
428428
# Now, let us import Intel Extension for TensorFlow*. We are using Python API `itex.experimental_ops_override()`. It automatically replace some TensorFlow operators by Custom Operators under `itex.ops` namespace, as well as to be compatible with existing trained parameters.
429429

430430
# %%
431+
import numpy as np
431432
import intel_extension_for_tensorflow as itex
432433

433434
itex.experimental_ops_override()

AI-and-Analytics/End-to-end-Workloads/JobRecommendationSystem/sample.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
"id": "JobRecommendationSystem_py",
1616
"steps": [
1717
"source /intel/oneapi/intelpython/bin/activate",
18-
"conda env remove -n user_tensorflow-gpu",
19-
"conda create --name user_tensorflow-gpu --clone tensorflow-gpu",
20-
"conda activate user_tensorflow-gpu",
21-
"pip install -r requirements.txt",
22-
"python -m ipykernel install --user --name=user_tensorflow-gpu",
23-
"python JobRecommendationSystem.py"
18+
"conda activate tensorflow-gpu",
19+
"pip install uv",
20+
"uv init",
21+
"uv python pin $(which python)",
22+
"uv venv --system-site-packages",
23+
"uv add -r requirements.txt",
24+
"uv add seaborn",
25+
"uv add numpy==1.26.4",
26+
"uv run python -m spacy download en_core_web_sm",
27+
"uv run python JobRecommendationSystem.py"
2428
]
2529
}
2630
]

AI-and-Analytics/Features-and-Functionality/INC_QuantizationAwareTraining_TextClassification/sample.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
"env": [
1515
"source /intel/oneapi/intelpython/bin/activate",
1616
"conda activate pytorch",
17-
"pip install -r requirements.txt"
17+
"pip install uv",
18+
"uv init",
19+
"uv python pin $(which python)",
20+
"uv venv --system-site-packages",
21+
"uv add -r requirements.txt",
22+
"uv add torch==2.5.0 torchvision==0.20.0"
1823
],
1924
"id": "inc_text_classification_quantization_py",
2025
"steps": [
21-
"python INC_QuantizationAwareTraining_TextClassification.py"
26+
"uv run INC_QuantizationAwareTraining_TextClassification.py"
2227
]
2328
}
2429
]

AI-and-Analytics/Getting-Started-Samples/INC-Sample-for-Tensorflow/sample.json

+11-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
{
1414
"env": ["source /intel/oneapi/intelpython/bin/activate",
1515
"conda activate tensorflow",
16-
"conda install -n tensorflow -c conda-forge python-flatbuffers -y",
17-
"conda install -n tensorflow -c https://software.repos.intel.com/python/conda/ -c conda-forge neural-compressor -y",
18-
"conda install -n tensorflow -y",
19-
"pip install jupyter ipykernel",
20-
"python -m ipykernel install --user --name=tensorflow"
16+
"pip install uv",
17+
"uv init",
18+
"uv python pin $(which python)",
19+
"uv venv --system-site-packages",
20+
"uv add -r requirements.txt",
21+
"uv add flatbuffers",
22+
"uv add neural-compressor",
23+
"pip install notebook",
24+
"uv add --dev ipykernel",
25+
"uv run ipython kernel install --user --name tensorflow"
26+
2127
],
2228
"id": "neural-compressor tensorflow",
2329
"steps": [

AI-and-Analytics/Getting-Started-Samples/IntelPython_XGBoost_GettingStarted/sample.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515
"env": [
1616
"source /intel/oneapi/intelpython/bin/activate",
1717
"conda activate base",
18-
"pip install -r requirements.txt"
18+
"pip install uv",
19+
"uv init",
20+
"uv python pin $(which python)",
21+
"uv venv --system-site-packages",
22+
"uv add -r requirements.txt"
1923
],
2024
"id": "IDP_XGBoost_GS_py",
2125
"steps": [
22-
"python IntelPython_XGBoost_GettingStarted.py"
26+
"uv run python IntelPython_XGBoost_GettingStarted.py"
2327
]
2428
}]
2529
},

AI-and-Analytics/Getting-Started-Samples/Intel_Extension_For_SKLearn_GettingStarted/sample.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515
"env": [
1616
"source /intel/oneapi/intelpython/bin/activate",
1717
"conda activate base",
18-
"pip install -r requirements.txt"
18+
"pip install uv",
19+
"uv init",
20+
"uv python pin $(which python)",
21+
"uv venv --system-site-packages",
22+
"uv add -r requirements.txt",
23+
"uv add numpy==1.26.4"
1924
],
2025
"id": "idp_sklex_gs_py",
2126
"steps": [
22-
"python Intel_Extension_For_SKLearn_GettingStarted.py"
27+
"uv run python Intel_Extension_For_SKLearn_GettingStarted.py"
2328
]
2429
}]
2530
},

AI-and-Analytics/Getting-Started-Samples/Modin_GettingStarted/sample.json

+12-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@
1010
"ciTests": {
1111
"linux": [
1212
{
13-
"env": [],
13+
"env": [
14+
"source /intel/oneapi/intelpython/bin/activate",
15+
"conda activate modin",
16+
"pip install uv",
17+
"uv init",
18+
"uv python pin $(which python)",
19+
"uv venv --system-site-packages",
20+
"uv add -r requirements.txt",
21+
"pip install notebook",
22+
"uv add --dev ipykernel",
23+
"uv run ipython kernel install --user --name modin_getting_started"
24+
],
1425
"id": "Intel_Modin_GS_py",
1526
"steps": [
16-
"source /intel/oneapi/intelpython/bin/activate",
17-
"pip install -r requirements.txt",
18-
"pip install jupyter ipykernel",
1927
"jupyter nbconvert --ExecutePreprocessor.enabled=True --to notebook Modin_GettingStarted.ipynb"
2028
]
2129
}

0 commit comments

Comments
 (0)