Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,7 @@
|
|
1 |
import os
|
2 |
# Clone the repository
|
3 |
os.system("git clone https://github.com/TimDettmers/bitsandbytes.git")
|
4 |
-
|
5 |
-
os.system("cd bitsandbytes/")
|
6 |
-
# Install dependencies
|
7 |
-
os.system("pip install -r requirements-dev.txt")
|
8 |
-
# Configure with CUDA support
|
9 |
-
os.system("cmake -DCOMPUTE_BACKEND=cuda -S .")
|
10 |
-
# Build and install
|
11 |
-
os.system("make")
|
12 |
-
os.system("pip install .")
|
13 |
-
import gradio as gr
|
14 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
15 |
-
import torch
|
16 |
-
model_name = "ruslanmv/Medical-Llama3-8B"
|
17 |
-
device_map = 'auto'
|
18 |
# Check if GPU is available
|
19 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
20 |
print(f"Using device: {device}")
|
|
|
1 |
import os
|
2 |
# Clone the repository
|
3 |
os.system("git clone https://github.com/TimDettmers/bitsandbytes.git")
|
4 |
+
os.system("cd bitsandbytes/ && pip install -r requirements-dev.txt && cmake -DCOMPUTE_BACKEND=cuda -S . && make && pip install .")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
# Check if GPU is available
|
6 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
7 |
print(f"Using device: {device}")
|