nisten commited on
Commit
aab0c47
1 Parent(s): 2b0dd1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
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 attention
7
- subprocess.run('pip install --upgrade --force-reinstall --no-deps --no-build-isolation transformers torch flash-attn ', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
 
 
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"