aka7774 commited on
Commit
dd14e03
1 Parent(s): f37fe57

Upload 4 files

Browse files
Files changed (3) hide show
  1. app.py +4 -4
  2. requirements.txt +3 -0
  3. setup.sh +11 -0
app.py CHANGED
@@ -1,7 +1,7 @@
1
- import subprocess
2
- subprocess.run('pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https://download.pytorch.org/whl/cu121', shell=True)
3
- subprocess.run('pip install flash-attn --no-build-isolation', shell=True)
4
- subprocess.run('pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"', shell=True)
5
 
6
  import fn
7
  import gradio as gr
 
1
+ if __name__ == "__main__":
2
+ import subprocess
3
+ subprocess.run('bash setup.sh', shell=True)
4
+ subprocess.run('bash venv.sh', shell=True)
5
 
6
  import fn
7
  import gradio as gr
requirements.txt CHANGED
@@ -19,3 +19,6 @@ accelerate==0.33.0
19
  peft==0.12.0
20
  wheel
21
  python-multipart
 
 
 
 
19
  peft==0.12.0
20
  wheel
21
  python-multipart
22
+ -r requirements-torch.txt
23
+ -r requirements-fa.txt
24
+ unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"
setup.sh ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/bash
2
+
3
+ sudo apt install python3.10-dev
4
+ wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.0-1_all.deb
5
+ sudo dpkg -i cuda-keyring_1.0-1_all.deb
6
+ sudo apt update
7
+ sudo apt-get install cuda-toolkit-12-1
8
+ echo 'if [ -e /usr/local/cuda ]; then' >> ~/.bashrc
9
+ echo 'export PATH="/usr/local/cuda/bin:$PATH"' >> ~/.bashrc
10
+ echo 'export LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"' >> ~/.bashrc
11
+ echo 'fi' >> ~/.bashrc