Spaces:
Runtime error
Runtime error
Add zero space support.
Browse files- app.py +3 -0
- requirements.txt +2 -4
app.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
import os
|
2 |
import shutil
|
3 |
|
@@ -79,6 +81,7 @@ class Chat:
|
|
79 |
return state
|
80 |
|
81 |
@torch.inference_mode()
|
|
|
82 |
def generate(self, tensor: list, modals: list, prompt: str, first_run: bool, state):
|
83 |
# TODO: support multiple turns of conversation.
|
84 |
assert len(tensor) == len(modals)
|
|
|
1 |
+
import spaces
|
2 |
+
|
3 |
import os
|
4 |
import shutil
|
5 |
|
|
|
81 |
return state
|
82 |
|
83 |
@torch.inference_mode()
|
84 |
+
@spaces.GPU
|
85 |
def generate(self, tensor: list, modals: list, prompt: str, first_run: bool, state):
|
86 |
# TODO: support multiple turns of conversation.
|
87 |
assert len(tensor) == len(modals)
|
requirements.txt
CHANGED
@@ -4,11 +4,9 @@ torchvision==0.15.2
|
|
4 |
torch==2.0.1
|
5 |
transformers==4.37.2
|
6 |
tokenizers==0.15.1
|
7 |
-
|
8 |
-
accelerate==0.21.0
|
9 |
-
peft==0.4.0
|
10 |
-
timm==0.6.13
|
11 |
numpy
|
|
|
12 |
# data processing
|
13 |
decord==0.6.0
|
14 |
imageio==2.34.0
|
|
|
4 |
torch==2.0.1
|
5 |
transformers==4.37.2
|
6 |
tokenizers==0.15.1
|
7 |
+
timm
|
|
|
|
|
|
|
8 |
numpy
|
9 |
+
spaces
|
10 |
# data processing
|
11 |
decord==0.6.0
|
12 |
imageio==2.34.0
|