Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR: Support explicit specification of device #87

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

ncliang
Copy link
Contributor

@ncliang ncliang commented Aug 15, 2023

The PR allows for specifying one of cpu, cuda, or mps to be the device type. It allows for quick and easy benchmarking on Mac devices running an M series chips. If not specified, the device chosen defaults to what would have been chosen in SentenceTransformer or similar modules. To benchmark on an M1 mac, one can do something such as

python run_mteb_zh.py  --model-type sentence_transformer --model-id ~/HamaModel --device=mps

Since typer is used, the help text is also updated accordingly

$ python run_mteb_zh.py --help
                                                                                                                         Usage: run_mteb_zh.py [OPTIONS]                                                                                                                                                                                                                _─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────_
│ *  --model-type           [sentence_transformer|text2vec|luotuo|erlang  [default: None] [required]                   │
│                           shen|openai|minimax|azure]                                                                 │
│    --model-id             TEXT                                          [default: None]                              │
│    --task-type            [Classification|Reranking|Retrieval|PairClas  [default: TaskType.Classification]           │
│                           sification|All]                                                                            │
│    --task-name            TEXT                                          [default: None]                              │
│    --output-folder        PATH                                          [default: results]                           │
│    --device               [cpu|cuda|mps]                                [default: None]                              │
│    --help                                                               Show this message and exit.                  │
_──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────_

@wangyuxinwhy
Copy link
Owner

Thank you very much for your contribution

@wangyuxinwhy wangyuxinwhy merged commit c42cfde into wangyuxinwhy:main Aug 16, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants