Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,16 @@ import gradio as gr
|
|
2 |
import os
|
3 |
import torch, torchvision, einops
|
4 |
import spaces
|
|
|
5 |
from transformers import AutoModelForCausalLM
|
6 |
from huggingface_hub import login
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
hf_token = os.getenv("HF_TOKEN")
|
9 |
login(token=hf_token, add_to_git_credential=True)
|
|
|
2 |
import os
|
3 |
import torch, torchvision, einops
|
4 |
import spaces
|
5 |
+
import flash_attention
|
6 |
from transformers import AutoModelForCausalLM
|
7 |
from huggingface_hub import login
|
8 |
+
import subprocess
|
9 |
+
|
10 |
+
subprocess.run(
|
11 |
+
"pip install flash-attn --no-build-isolation",
|
12 |
+
env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
|
13 |
+
shell=True,
|
14 |
+
)
|
15 |
|
16 |
hf_token = os.getenv("HF_TOKEN")
|
17 |
login(token=hf_token, add_to_git_credential=True)
|