Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
import subprocess
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
# Install flash
|
7 |
-
subprocess.run('pip install
|
|
|
|
|
8 |
|
9 |
# Load model and tokenizer
|
10 |
model_name = "allenai/OLMoE-1B-7B-0924-Instruct"
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
|
|
3 |
import subprocess
|
4 |
+
import sys
|
5 |
+
|
6 |
+
# Force install the specific transformers version from the GitHub PR
|
7 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "--force-reinstall", "--no-deps", "git+https://github.com/Muennighoff/transformers.git@olmoe"])
|
8 |
|
9 |
+
# Install flash-attn
|
10 |
+
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
11 |
+
|
12 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
13 |
|
14 |
# Load model and tokenizer
|
15 |
model_name = "allenai/OLMoE-1B-7B-0924-Instruct"
|