-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into feat/comparison-and…
…-equality-operations
- Loading branch information
Showing
49 changed files
with
3,718 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: PyO3-CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- candle-pyo3/** | ||
pull_request: | ||
paths: | ||
- candle-pyo3/** | ||
|
||
jobs: | ||
build_and_test: | ||
name: Check everything builds & tests | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] # For now, only test on Linux | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
architecture: "x64" | ||
|
||
- name: Cache Cargo Registry | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install | ||
working-directory: ./candle-pyo3 | ||
run: | | ||
python -m venv .env | ||
source .env/bin/activate | ||
pip install -U pip | ||
pip install pytest maturin black | ||
python -m maturin develop -r | ||
- name: Check style | ||
working-directory: ./candle-pyo3 | ||
run: | | ||
source .env/bin/activate | ||
python stub.py --check | ||
black --check . | ||
- name: Run tests | ||
working-directory: ./candle-pyo3 | ||
run: | | ||
source .env/bin/activate | ||
python -m pytest -s -v tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# candle-blip | ||
|
||
The | ||
[blip-image-captioning](https://huggingface.co/Salesforce/blip-image-captioning-base) | ||
model can generate captions for an input image. | ||
|
||
## Running on an example | ||
|
||
```bash | ||
cargo run --example blip --release -- --image candle-examples/examples/yolo-v8/assets/bike.jpg | ||
``` | ||
|
||
``` | ||
Running on CPU, to run on GPU, build this example with `--features cuda` | ||
loaded image Tensor[dims 3, 384, 384; f32] | ||
model built | ||
several cyclists are riding down a road with cars behind them% | ||
``` | ||
![Leading group, Giro d'Italia 2021](../yolo-v8/assets/bike.jpg) |
Oops, something went wrong.