gauri-sharan commited on
Commit
8820818
β€’
1 Parent(s): 85fdff3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -5,9 +5,18 @@ import soundfile as sf
5
  import gradio as gr
6
  import spaces # Import the spaces module
7
 
8
- !pip install git+https://github.com/huggingface/transformers.git
9
- !pip install torch torchaudio --extra-index-url https://download.pytorch.org/whl/cu118
10
 
 
 
 
 
 
 
 
 
 
11
 
12
  print(torch.cuda.is_available()) # This should return True if GPU is available
13
  print(torch.cuda.get_device_name(0)) # Should display the name of your GPU (e.g., NVIDIA A100)
 
5
  import gradio as gr
6
  import spaces # Import the spaces module
7
 
8
+ import subprocess
9
+ import sys
10
 
11
+ # Function to install a package
12
+ def install(package):
13
+ subprocess.check_call([sys.executable, "-m", "pip", "install", package])
14
+
15
+ # Install Hugging Face Transformers from GitHub
16
+ install("git+https://github.com/huggingface/transformers.git")
17
+
18
+ # Install PyTorch and Torchaudio with CUDA 11.8 support
19
+ install("torch torchaudio --extra-index-url https://download.pytorch.org/whl/cu118")
20
 
21
  print(torch.cuda.is_available()) # This should return True if GPU is available
22
  print(torch.cuda.get_device_name(0)) # Should display the name of your GPU (e.g., NVIDIA A100)