Skip to content

Commit f557f4d

Browse files
committed
Merge remote-tracking branch 'upstream/main' into riedgar-ms/model-metrics-01
2 parents b25381e + 7b4d85f commit f557f4d

File tree

4 files changed

+72
-26
lines changed

4 files changed

+72
-26
lines changed

.github/workflows/pypi_upload.yml

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,22 @@ jobs:
4343
matrix:
4444
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }}
4545
runs-on: ${{ matrix.os }}
46+
47+
env:
48+
CIBW_BUILD_VERBOSITY: 1
49+
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y"
50+
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"'
51+
4652
steps:
4753
- name: Check out the repo
4854
uses: actions/checkout@v3
4955

56+
- name: Install Rust
57+
shell: bash
58+
run: |
59+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.75.0
60+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
61+
5062
- name: Set up QEMU
5163
if: runner.os == 'Linux'
5264
uses: docker/setup-qemu-action@v2
@@ -75,36 +87,48 @@ jobs:
7587
with:
7688
python-version: '3.11'
7789

90+
- name: Install Rust
91+
shell: bash
92+
run: |
93+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.75.0
94+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
95+
96+
- name: Run cargo check
97+
shell: bash
98+
run: |
99+
cargo --version
100+
78101
- name: Build sdist (pep517)
79102
run: |
80103
python -m pip install build
81104
python -m build --sdist
105+
82106
- name: Upload sdist
83107
uses: actions/upload-artifact@v3
84108
with:
85109
name: sdist_files
86110
path: dist/*.tar.gz
87111

88-
publish_wheels:
89-
permissions:
90-
id-token: write
91-
name: Publish wheels on pypi
92-
needs: [build_wheels, build_sdist]
93-
runs-on: ubuntu-latest
94-
if: startsWith(github.ref, 'refs/tags')
95-
steps:
96-
- uses: actions/download-artifact@v3
97-
with:
98-
name: bdist_files
99-
path: dist
112+
# publish_wheels:
113+
# permissions:
114+
# id-token: write
115+
# name: Publish wheels on pypi
116+
# needs: [build_wheels, build_sdist]
117+
# runs-on: ubuntu-latest
118+
# if: startsWith(github.ref, 'refs/tags')
119+
# steps:
120+
# - uses: actions/download-artifact@v3
121+
# with:
122+
# name: bdist_files
123+
# path: dist
100124

101-
- uses: actions/download-artifact@v3
102-
with:
103-
name: sdist_files
104-
path: dist
125+
# - uses: actions/download-artifact@v3
126+
# with:
127+
# name: sdist_files
128+
# path: dist
105129

106-
- name: Publish package to PyPI
107-
uses: pypa/gh-action-pypi-publish@release/v1
108-
with:
109-
user: __token__
110-
password: ${{ secrets.PYPI_API_TOKEN }}
130+
# - name: Publish package to PyPI
131+
# uses: pypa/gh-action-pypi-publish@release/v1
132+
# with:
133+
# user: __token__
134+
# password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/workflow-pr-gate.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ jobs:
6868
# - "transformers_mistral_7b" See Issue 713
6969
- "hfllama7b"
7070
- "hfllama_mistral_7b"
71-
- "phi3cpu-mini-4k-instruct"
71+
- "transformers_phi3cpu_mini_4k_instruct"
72+
- "hfllama_phi3cpu_mini_4k_instruct"
7273
with:
7374
os: Large_Linux
7475
python-version: "3.12"
@@ -108,7 +109,8 @@ jobs:
108109
# - "transformers_mistral_7b" See Issue 713
109110
- "hfllama7b"
110111
- "hfllama_mistral_7b"
111-
- "phi3cpu-mini-4k-instruct"
112+
- "transformers_phi3cpu_mini_4k_instruct"
113+
- "hfllama_phi3cpu_mini_4k_instruct"
112114
uses: ./.github/workflows/action_plain_unit_tests.yml
113115
with:
114116
os: Large_Linux
@@ -152,7 +154,8 @@ jobs:
152154
# - "transformers_mistral_7b" See Issue 713
153155
- "hfllama7b"
154156
- "hfllama_mistral_7b"
155-
# - "phi3cpu-mini-4k-instruct" Gives trouble on MacOS
157+
# - "transformers_phi3cpu_mini_4k_instruct" Gives trouble on MacOS
158+
- "hfllama_phi3cpu_mini_4k_instruct"
156159
uses: ./.github/workflows/action_plain_unit_tests.yml
157160
with:
158161
os: macos-12
@@ -171,7 +174,8 @@ jobs:
171174
# - "transformers_mistral_7b" See Issue 713
172175
- "hfllama7b"
173176
- "hfllama_mistral_7b"
174-
- "phi3cpu-mini-4k-instruct"
177+
- "transformers_phi3cpu_mini_4k_instruct"
178+
- "hfllama_phi3cpu_mini_4k_instruct"
175179
uses: ./.github/workflows/action_plain_unit_tests.yml
176180
with:
177181
os: Large_Windows

setup.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
import sys
2+
3+
# Check if 'setup.py' is run directly with 'build'
4+
# TODO: Consider generalizing this check further?
5+
if __name__ == "__main__":
6+
if len(sys.argv) >= 2 and sys.argv[1] == "build":
7+
raise SystemExit(
8+
"Error: Direct invocation of 'setup.py build' is not recommended."
9+
"Please use 'pip' to build and install this package, like so:\n"
10+
" pip install . (for the current directory)\n"
11+
" pip install -e . (for an editable install)\n"
12+
" pip wheel . --no-deps (to build a wheel)"
13+
)
14+
115
import os
216
import re
317
import codecs

tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212
"phi2cpu": dict(
1313
name="transformers:microsoft/phi-2", kwargs={"trust_remote_code": True}
1414
),
15-
"phi3cpu-mini-4k-instruct": dict(
15+
"transformers_phi3cpu_mini_4k_instruct": dict(
1616
name="transformers:microsoft/Phi-3-mini-4k-instruct",
1717
kwargs={"trust_remote_code": True},
1818
),
19+
"hfllama_phi3cpu_mini_4k_instruct": dict(
20+
name="huggingface_hubllama:microsoft/Phi-3-mini-4k-instruct-gguf:Phi-3-mini-4k-instruct-q4.gguf",
21+
kwargs={"verbose": True, "n_ctx": 4096},
22+
),
1923
"hfllama7b": dict(
2024
name="huggingface_hubllama:TheBloke/Llama-2-7B-GGUF:llama-2-7b.Q5_K_M.gguf",
2125
kwargs={"verbose": True, "n_ctx": 4096},

0 commit comments

Comments
 (0)