liudongqing commited on
Commit
c0d1625
·
1 Parent(s): d9df1f9

update the dependencies

Browse files
Files changed (2) hide show
  1. app.py +9 -4
  2. requirements.txt +2 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
- from transformers import AutoProcessor, AutoModelForPreTraining
 
2
  from threading import Thread
3
  import gradio as gr
4
  from gradio import FileData
@@ -8,10 +9,14 @@ from zipnn import zipnn_hf
8
 
9
  zipnn_hf()
10
 
11
- processor = AutoProcessor.from_pretrained("royleibov/Llama-3.2-11B-Vision-Instruct-ZipNN-Compressed")
12
- model = AutoModelForPreTraining.from_pretrained("royleibov/Llama-3.2-11B-Vision-Instruct-ZipNN-Compressed")
13
 
14
- processor = AutoProcessor.from_pretrained(model)
 
 
 
 
 
15
 
16
 
17
  def score_it(input_img):
 
1
+ from transformers import AutoProcessor, AutoModelForPreTraining, MllamaForConditionalGeneration
2
+ import torch
3
  from threading import Thread
4
  import gradio as gr
5
  from gradio import FileData
 
9
 
10
  zipnn_hf()
11
 
12
+ model_id = "royleibov/Llama-3.2-11B-Vision-Instruct-ZipNN-Compressed"
 
13
 
14
+ model = MllamaForConditionalGeneration.from_pretrained(
15
+ model_id,
16
+ torch_dtype=torch.bfloat16,
17
+ device_map="auto",
18
+ )
19
+ processor = AutoProcessor.from_pretrained(model_id)
20
 
21
 
22
  def score_it(input_img):
requirements.txt CHANGED
@@ -1,4 +1,5 @@
 
1
  transformers
2
  git+https://github.com/huggingface/transformers.git
3
  accelerate>=0.26.0
4
- zipnn
 
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