Spaces:
Sleeping
Sleeping
liudongqing
commited on
Commit
·
9b8bf99
1
Parent(s):
c0d1625
update the dependencies
Browse files- app.py +2 -1
- requirements.txt +1 -2
app.py
CHANGED
@@ -2,7 +2,7 @@ from transformers import AutoProcessor, AutoModelForPreTraining, MllamaForCondit
|
|
2 |
import torch
|
3 |
from threading import Thread
|
4 |
import gradio as gr
|
5 |
-
|
6 |
|
7 |
|
8 |
from zipnn import zipnn_hf
|
@@ -19,6 +19,7 @@ model = MllamaForConditionalGeneration.from_pretrained(
|
|
19 |
processor = AutoProcessor.from_pretrained(model_id)
|
20 |
|
21 |
|
|
|
22 |
def score_it(input_img):
|
23 |
image = input_img.convert("RGB").resize((224, 224))
|
24 |
|
|
|
2 |
import torch
|
3 |
from threading import Thread
|
4 |
import gradio as gr
|
5 |
+
import spaces
|
6 |
|
7 |
|
8 |
from zipnn import zipnn_hf
|
|
|
19 |
processor = AutoProcessor.from_pretrained(model_id)
|
20 |
|
21 |
|
22 |
+
@spaces.GPU
|
23 |
def score_it(input_img):
|
24 |
image = input_img.convert("RGB").resize((224, 224))
|
25 |
|
requirements.txt
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
torch==2.4.0
|
2 |
-
transformers
|
3 |
-
git+https://github.com/huggingface/transformers.git
|
4 |
accelerate>=0.26.0
|
5 |
zipnn==0.3.4
|
|
|
1 |
torch==2.4.0
|
2 |
+
transformers==4.46.2
|
|
|
3 |
accelerate>=0.26.0
|
4 |
zipnn==0.3.4
|