Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,3 @@
|
|
1 |
-
import subprocess
|
2 |
-
subprocess.run(
|
3 |
-
'pip install flash-attn --no-build-isolation',
|
4 |
-
env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"},
|
5 |
-
shell=True
|
6 |
-
)
|
7 |
-
subprocess.run(["pip", "install", "-i", "https://pypi.org/simple/", "bitsandbytes"], check=True)
|
8 |
-
from threading import Thread
|
9 |
import torch
|
10 |
from PIL import Image
|
11 |
import gradio as gr
|
@@ -36,8 +28,9 @@ CSS = """
|
|
36 |
|
37 |
model = AutoModel.from_pretrained(
|
38 |
MODEL_ID,
|
|
|
39 |
trust_remote_code=True
|
40 |
-
)
|
41 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
|
42 |
model.eval()
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import torch
|
2 |
from PIL import Image
|
3 |
import gradio as gr
|
|
|
28 |
|
29 |
model = AutoModel.from_pretrained(
|
30 |
MODEL_ID,
|
31 |
+
torch_dtype=torch.float16,
|
32 |
trust_remote_code=True
|
33 |
+
).to(0)
|
34 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
|
35 |
model.eval()
|
36 |
|