johann22 commited on
Commit
47fef84
1 Parent(s): 2642660

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -13,6 +13,22 @@ import requests
13
  import io
14
  from chat_models import models as c_models
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  loaded_model=[]
17
  chat_model=[]
18
  for i,model in enumerate(models):
 
13
  import io
14
  from chat_models import models as c_models
15
 
16
+ ########### utils ###############
17
+ from transformers import AutoProcessor
18
+
19
+ PROCESSOR = AutoProcessor.from_pretrained(
20
+ "HuggingFaceM4/idefics-9b-instruct",
21
+ token="",
22
+ )
23
+ def fetch_images(url_list: str) -> PIL.Image.Image:
24
+ """Fetching images"""
25
+ return PROCESSOR.image_processor.fetch_images(url_list)
26
+
27
+
28
+ ########### utils ###############
29
+
30
+
31
+
32
  loaded_model=[]
33
  chat_model=[]
34
  for i,model in enumerate(models):