File tree 3 files changed +20
-7
lines changed
3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,20 @@ Setup your Python environment with the following commands:
34
34
# Set up a virtual environment to isolate packages from other envs.
35
35
python3.11 -m venv 3.11.venv
36
36
source 3.11.venv/bin/activate
37
+ ```
38
+
39
+ ## Install SHARK and its dependencies
40
+
41
+ First install a torch version that fulfills your needs:
37
42
38
- # Optional: faster installation of torch with just CPU support.
39
- # See other options at https://pytorch.org/get-started/locally/
43
+ ``` bash
44
+ # Fast installation of torch with just CPU support.
40
45
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
41
46
```
42
47
43
- ## Install SHARK and its dependencies
48
+ For other options, see https://pytorch.org/get-started/locally/ .
49
+
50
+ Next install shark-ai:
44
51
45
52
``` bash
46
53
pip install shark-ai[apps]
Original file line number Diff line number Diff line change @@ -9,10 +9,6 @@ huggingface-hub==0.22.2
9
9
transformers == 4.40.0
10
10
datasets
11
11
12
- # It is expected that you have installed a PyTorch version/variant specific
13
- # to your needs, so we only include a minimum version spec.
14
- torch >= 2.3.0
15
-
16
12
# Serving deps.
17
13
fastapi >= 0.112.2
18
14
uvicorn >= 0.30.6
Original file line number Diff line number Diff line change 3
3
# Licensed under the Apache License v2.0 with LLVM Exceptions.
4
4
# See https://llvm.org/LICENSE.txt for license information.
5
5
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+
7
+ import importlib .util
8
+
9
+ msg = """No module named 'torch'. Follow https://pytorch.org/get-started/locally/#start-locally to install 'torch'.
10
+ For example, on Linux to install with CPU support run:
11
+ pip3 install torch --index-url https://download.pytorch.org/whl/cpu
12
+ """
13
+
14
+ if spec := importlib .util .find_spec ("torch" ) is None :
15
+ raise ModuleNotFoundError (msg )
You can’t perform that action at this time.
0 commit comments