madharjan commited on
Commit
61a97ac
·
1 Parent(s): 9755910

Remove INSTALL.md and test_requirements.py; clean up requirements.txt by removing torch

Browse files
Files changed (4) hide show
  1. INSTALL.md +0 -41
  2. app.py +0 -7
  3. requirements.txt +0 -1
  4. test_requirements.py +0 -36
INSTALL.md DELETED
@@ -1,41 +0,0 @@
1
- # Installation (Windows)
2
-
3
- Install the Python requirements and pick the correct `torch` wheel for your system.
4
-
5
- 1) Upgrade pip and install pinned packages (non-torch):
6
-
7
- ```bash
8
- python -m pip install --upgrade pip
9
- pip install -r requirements.txt
10
- ```
11
-
12
- 1) Install `torch` separately so you can pick the wheel that matches your CUDA/CPU setup.
13
-
14
- - CPU-only (Windows):
15
-
16
- ```bash
17
- pip install "torch==2.2.2+cpu" --index-url https://download.pytorch.org/whl/cpu
18
- ```
19
-
20
- - CUDA (example for CUDA 12.1; pick the matching CUDA version for your system):
21
-
22
- ```bash
23
- pip install "torch==2.2.2+cu121" --index-url https://download.pytorch.org/whl/cu121
24
- ```
25
-
26
- If you are unsure which CUDA version you have, run `nvidia-smi` in a command
27
- prompt (if you have an NVIDIA GPU). If you want, tell me your CUDA version and
28
- I can add the exact install line.
29
-
30
- 1) Optional: verify the environment with the smoke test:
31
-
32
- ```bash
33
- python test_requirements.py
34
- ```
35
-
36
- Notes:
37
-
38
- - The `requirements.txt` contains pinned versions for non-torch packages and
39
- leaves `torch` unpinned so you can choose the correct wheel for your system.
40
- - If you want me to pin exact `torch` builds for a specific CUDA version, tell
41
- me the CUDA version (e.g., `cu121`, `cu118`, or `cpu`).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -53,13 +53,6 @@ def meralion_inference(prompt, uploaded_file):
53
  # Process inputs
54
  inputs = processor(text=chat_prompt, audios=audio_array)
55
 
56
- # Move to device and fix dtype
57
- for key, value in inputs.items():
58
- if isinstance(value, torch.Tensor):
59
- inputs[key] = value.to(device)
60
- if value.dtype == torch.float32:
61
- inputs[key] = inputs[key].to(torch.bfloat16)
62
-
63
  # Generate
64
  with torch.no_grad():
65
  outputs = model.generate(
 
53
  # Process inputs
54
  inputs = processor(text=chat_prompt, audios=audio_array)
55
 
 
 
 
 
 
 
 
56
  # Generate
57
  with torch.no_grad():
58
  outputs = model.generate(
requirements.txt CHANGED
@@ -5,5 +5,4 @@ librosa==0.10.0
5
  safetensors==0.4.5
6
  accelerate==0.34.1
7
  soundfile==0.12.1
8
- torch
9
  flash-attn
 
5
  safetensors==0.4.5
6
  accelerate==0.34.1
7
  soundfile==0.12.1
 
8
  flash-attn
test_requirements.py DELETED
@@ -1,36 +0,0 @@
1
- import importlib
2
- import sys
3
-
4
- packages = [
5
- ('gradio', 'gradio'),
6
- ('torch', 'torch'),
7
- ('librosa', 'librosa'),
8
- ('transformers', 'transformers'),
9
- ('safetensors', 'safetensors'),
10
- ('accelerate', 'accelerate'),
11
- ('soundfile', 'soundfile'),
12
- ]
13
-
14
- success = True
15
- for name, mod in packages:
16
- try:
17
- m = importlib.import_module(mod)
18
- v = getattr(m, '__version__', 'unknown')
19
- print(f'{name}: OK (version={v})')
20
- except Exception as e:
21
- success = False
22
- print(f'{name}: FAIL -> {e}')
23
-
24
- # Extra torch checks
25
- try:
26
- import torch
27
- print('torch.cuda.is_available():', torch.cuda.is_available())
28
- print('torch.__version__:', getattr(torch, '__version__', 'unknown'))
29
- except Exception:
30
- pass
31
-
32
- if not success:
33
- print('\nSome imports failed. Re-run the install commands in INSTALL.md or ask for help.')
34
- sys.exit(1)
35
-
36
- print('\nAll imports succeeded (where present).')