ybelkada commited on
Commit
ad9fc45
1 Parent(s): 11dbf82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,10 +1,14 @@
1
  import subprocess
2
  import sys
 
3
  import spaces
4
 
5
  # install packages for mamba
6
- subprocess.run("pip install https://github.com/Dao-AILab/causal-conv1d/releases/download/v1.0.0/causal_conv1d-1.0.0+cu122torch2.2cxx11abiTRUE-cp310-cp310-linux_x86_64.whl".split())
7
- subprocess.run("pip install https://github.com/state-spaces/mamba/releases/download/v1.0.1/mamba_ssm-1.0.1+cu122torch2.2cxx11abiTRUE-cp310-cp310-linux_x86_64.whl".split())
 
 
 
8
 
9
  import torch
10
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
@@ -44,7 +48,7 @@ model = AutoModelForCausalLM.from_pretrained(
44
  if device == "cuda":
45
  model = torch.compile(model)
46
 
47
- install()
48
 
49
  @spaces.GPU
50
  def stream_chat(
 
1
  import subprocess
2
  import sys
3
+ import shlex
4
  import spaces
5
 
6
  # install packages for mamba
7
+ def install():
8
+ subprocess.run(shlex.split("pip install https://github.com/Dao-AILab/causal-conv1d/releases/download/v1.0.0/causal_conv1d-1.0.0+cu122torch2.2cxx11abiTRUE-cp310-cp310-linux_x86_64.whl"))
9
+ subprocess.run(shlex.split("pip install https://github.com/state-spaces/mamba/releases/download/v1.0.1/mamba_ssm-1.0.1+cu122torch2.2cxx11abiTRUE-cp310-cp310-linux_x86_64.whl"))
10
+
11
+ install()
12
 
13
  import torch
14
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
 
48
  if device == "cuda":
49
  model = torch.compile(model)
50
 
51
+
52
 
53
  @spaces.GPU
54
  def stream_chat(