Spaces:
Running
on
Zero
Running
on
Zero
VictorSanh
commited on
Commit
•
bf3b7f6
1
Parent(s):
28b31c4
the updated app with lima & sft + the comparative app
Browse files- comparative_app.py +337 -0
- the_updated_app_with_tfrm_integration.py +11 -1
comparative_app.py
ADDED
@@ -0,0 +1,337 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import copy
|
2 |
+
import os
|
3 |
+
import random
|
4 |
+
# import spaces
|
5 |
+
import subprocess
|
6 |
+
import time
|
7 |
+
import torch
|
8 |
+
|
9 |
+
from threading import Thread
|
10 |
+
from typing import List, Dict, Union
|
11 |
+
from urllib.parse import urlparse
|
12 |
+
from PIL import Image
|
13 |
+
|
14 |
+
import gradio as gr
|
15 |
+
from transformers import AutoProcessor, TextIteratorStreamer
|
16 |
+
from transformers import Idefics2ForConditionalGeneration
|
17 |
+
|
18 |
+
# subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
19 |
+
|
20 |
+
DEVICE = torch.device("cuda")
|
21 |
+
MODELS = {
|
22 |
+
"idefics2 lima 200": Idefics2ForConditionalGeneration.from_pretrained(
|
23 |
+
"HuggingFaceM4/idefics2-tfrm-compatible",
|
24 |
+
torch_dtype=torch.bfloat16,
|
25 |
+
_attn_implementation="flash_attention_2",
|
26 |
+
trust_remote_code=True,
|
27 |
+
token=os.environ["HF_AUTH_TOKEN"],
|
28 |
+
revision="11794e2ae02dbf1c55d0ebd92c28e5b0b604cf5f",
|
29 |
+
).to(DEVICE),
|
30 |
+
"idefics2 sft 12600": Idefics2ForConditionalGeneration.from_pretrained(
|
31 |
+
"HuggingFaceM4/idefics2-tfrm-compatible",
|
32 |
+
torch_dtype=torch.bfloat16,
|
33 |
+
_attn_implementation="flash_attention_2",
|
34 |
+
trust_remote_code=True,
|
35 |
+
token=os.environ["HF_AUTH_TOKEN"],
|
36 |
+
revision="86f134822798266d0d8db049cc6458c625e32344",
|
37 |
+
).to(DEVICE),
|
38 |
+
}
|
39 |
+
PROCESSOR = AutoProcessor.from_pretrained(
|
40 |
+
"HuggingFaceM4/idefics2-tfrm-compatible",
|
41 |
+
token=os.environ["HF_AUTH_TOKEN"],
|
42 |
+
)
|
43 |
+
BAD_WORDS_IDS = PROCESSOR.tokenizer(["<image>", "<fake_token_around_image>"], add_special_tokens=False).input_ids
|
44 |
+
EOS_WORDS_IDS = PROCESSOR.tokenizer("<end_of_utterance>", add_special_tokens=False).input_ids + [PROCESSOR.tokenizer.eos_token_id]
|
45 |
+
|
46 |
+
SYSTEM_PROMPT = [ # Deactivating the system propmpt for now, but if I were to reactivate it, I would need to a/ transform turns into dict for applying the chat template, b/ manually overwrite the `default_template` to add the first line (that is not part of any turns), in particular for handling the bos_token.
|
47 |
+
# """The following is a conversation between a highly knowledgeable and intelligent visual AI assistant, called Assistant, and a human user, called User. In the following interactions, User and Assistant will converse in natural language, and Assistant will do its best to answer User’s questions. Assistant has the ability to perceive images and reason about the content of visual inputs. Assistant was built to be respectful, polite and inclusive. It knows a lot, and always tells the truth. When prompted with an image, it does not make up facts.
|
48 |
+
|
49 |
+
# The conversation begins:""",
|
50 |
+
# """\nUser:""",
|
51 |
+
# "https://i1.pickpik.com/photos/515/906/355/kittens-cats-pet-cute-preview.jpg",
|
52 |
+
# "Describe this image.<end_of_utterance>",
|
53 |
+
# """\nAssistant: Five kittens are standing together in the center of the photograph. From the left to right, there is one orange kitten, two kittens white and black stripes, and two brown kittens with an orange head. They are in bright green grass and it looks like they are moving forward.<end_of_utterance>""",
|
54 |
+
# "\nUser:How about this image?",
|
55 |
+
# "https://cdn.pixabay.com/photo/2017/09/25/13/12/puppy-2785074_1280.jpg",
|
56 |
+
# "Can you describe it too?<end_of_utterance>",
|
57 |
+
# """\nAssistant: A dog is lying on the floor, looking at the camera. It is looking directly at you. The dog has a white body and brown patches on its face and ears. Its eyes are dark. Its nose is black, and it has long, floppy ears, white paws, long fur, big eyes.<end_of_utterance>""",
|
58 |
+
# "\nUser: What kind of breed is it?<end_of_utterance>",
|
59 |
+
# """\nAssistant: It looks like a Cavalier King Charles Spaniel. These breeds are known for their gentle, affectionate nature. Their long ears and big, brown eyes give them a sweet, expressive face. Cavaliers are small dogs weighing between 13 and 20 pounds. They have a silky, medium-length coat that comes in various colors, including black and tan, tricolor, red and white, or black.<end_of_utterance>""",
|
60 |
+
# "\nUser: What can you tell me about this breed of dogs?<end_of_utterance>",
|
61 |
+
# """\nAssistant: One specific characteristic of the Cavalier King Charles Spaniel is its friendly and affectionate nature. This breed is known for being extremely sociable and forming strong bonds with their owners. They are often described as "velcro dogs" because they love to be close to their human companions, whether it's sitting on their laps, cuddling on the couch, or simply following them around the house.<end_of_utterance>""",
|
62 |
+
# "\nUser: ghjkhjabnufs<end_of_utterance>",
|
63 |
+
# """\nAssistant: That doesn’t seem to be a word. Could you ask me another way?<end_of_utterance>""",
|
64 |
+
# "\nUser: Do you like Cavalier King Charles Spaniel?<end_of_utterance>",
|
65 |
+
# """\nAssistant: I do not have personal opinions as I’m just a computer program. However, cavaliers are known for being excellent family pets due to their gentle and patient demeanor, making them great with children and other pets. Their affectionate nature also makes them ideal therapy dogs, as they can provide comfort and emotional support to those in need.<end_of_utterance>""",
|
66 |
+
# "\nUser: How many dogs do you see in this image?",
|
67 |
+
# "https://i.dailymail.co.uk/i/pix/2011/07/01/article-2010308-0CD22A8300000578-496_634x414.jpg",
|
68 |
+
# "<end_of_utterance>",
|
69 |
+
# """\nAssistant: There is no dogs in this image. The picture shows a tennis player jumping to volley the ball.<end_of_utterance>""",
|
70 |
+
]
|
71 |
+
|
72 |
+
API_TOKEN = os.getenv("HF_AUTH_TOKEN")
|
73 |
+
# IDEFICS_LOGO = "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/IDEFICS_logo.png"
|
74 |
+
BOT_AVATAR = "IDEFICS_logo.png"
|
75 |
+
|
76 |
+
|
77 |
+
# Chatbot utils
|
78 |
+
def turn_is_pure_media(turn):
|
79 |
+
return turn[1] is None
|
80 |
+
|
81 |
+
|
82 |
+
def format_user_prompt_with_im_history_and_system_conditioning(
|
83 |
+
user_prompt, chat_history
|
84 |
+
) -> List[Dict[str, Union[List, str]]]:
|
85 |
+
"""
|
86 |
+
Produces the resulting list that needs to go inside the processor.
|
87 |
+
It handles the potential image(s), the history and the system conditionning.
|
88 |
+
"""
|
89 |
+
resulting_list = copy.deepcopy(SYSTEM_PROMPT)
|
90 |
+
|
91 |
+
# Format history
|
92 |
+
for turn in chat_history:
|
93 |
+
if not resulting_list or (resulting_list and resulting_list[-1]["role"] != "user"):
|
94 |
+
resulting_list.append(
|
95 |
+
{
|
96 |
+
"role": "user",
|
97 |
+
"content": [],
|
98 |
+
}
|
99 |
+
)
|
100 |
+
|
101 |
+
if turn_is_pure_media(turn):
|
102 |
+
media = turn[0][0]
|
103 |
+
resulting_list[-1]["content"].append(Image.open(media))
|
104 |
+
else:
|
105 |
+
user_utterance, assistant_utterance = turn
|
106 |
+
resulting_list[-1]["content"].append(user_utterance.strip())
|
107 |
+
resulting_list.append(
|
108 |
+
{
|
109 |
+
"role": "assistant",
|
110 |
+
"content": [assistant_utterance]
|
111 |
+
}
|
112 |
+
)
|
113 |
+
|
114 |
+
# Format current input
|
115 |
+
if not user_prompt["files"]:
|
116 |
+
resulting_list.append(
|
117 |
+
{
|
118 |
+
"role": "user",
|
119 |
+
"content": [user_prompt['text']],
|
120 |
+
}
|
121 |
+
)
|
122 |
+
else:
|
123 |
+
# Choosing to put the image first (i.e. before the text), but this is an arbiratrary choice.
|
124 |
+
resulting_list.append(
|
125 |
+
{
|
126 |
+
"role": "user",
|
127 |
+
"content": [Image.open(im['path']) for im in user_prompt['files']] + [user_prompt['text']],
|
128 |
+
}
|
129 |
+
)
|
130 |
+
|
131 |
+
return resulting_list
|
132 |
+
|
133 |
+
|
134 |
+
def extract_images_from_msg_list(msg_list):
|
135 |
+
all_images = []
|
136 |
+
for msg in msg_list:
|
137 |
+
for c_ in msg["content"]:
|
138 |
+
if isinstance(c_, Image.Image):
|
139 |
+
all_images.append(c_)
|
140 |
+
return all_images
|
141 |
+
|
142 |
+
|
143 |
+
# @spaces.GPU(duration=180)
|
144 |
+
def model_inference(
|
145 |
+
user_prompt,
|
146 |
+
chat_history,
|
147 |
+
model_selector,
|
148 |
+
decoding_strategy,
|
149 |
+
temperature,
|
150 |
+
max_new_tokens,
|
151 |
+
repetition_penalty,
|
152 |
+
top_p,
|
153 |
+
):
|
154 |
+
if user_prompt["text"].strip() == "" and not user_prompt["files"]:
|
155 |
+
raise gr.Error("Please input a query and optionally image(s).")
|
156 |
+
|
157 |
+
if user_prompt["text"].strip() == "" and user_prompt["files"]:
|
158 |
+
raise gr.Error("Please input a text query along the image(s).")
|
159 |
+
|
160 |
+
for file in user_prompt["files"]:
|
161 |
+
if not file["mime_type"].startswith("image/"):
|
162 |
+
gr.Error("Idefics2 only supports images. Please input a valid image.")
|
163 |
+
|
164 |
+
if chat_history:
|
165 |
+
raise gr.Error("The comparative mode only supports single turns")
|
166 |
+
|
167 |
+
if len(MODELS) <= 1:
|
168 |
+
raise gr.Error("There should be at least 2 models to compare (3 might be a stretch on your regular 80GB H100).")
|
169 |
+
|
170 |
+
streamer = TextIteratorStreamer(
|
171 |
+
PROCESSOR.tokenizer,
|
172 |
+
skip_prompt=True,
|
173 |
+
timeout=5.,
|
174 |
+
)
|
175 |
+
|
176 |
+
# Common parameters to all decoding strategies
|
177 |
+
# This documentation is useful to read: https://huggingface.co/docs/transformers/main/en/generation_strategies
|
178 |
+
generation_args = {
|
179 |
+
"max_new_tokens": max_new_tokens,
|
180 |
+
"repetition_penalty": repetition_penalty,
|
181 |
+
"bad_words_ids": BAD_WORDS_IDS,
|
182 |
+
"eos_token_id": EOS_WORDS_IDS,
|
183 |
+
"streamer": streamer,
|
184 |
+
}
|
185 |
+
|
186 |
+
assert decoding_strategy in [
|
187 |
+
"Greedy",
|
188 |
+
"Top P Sampling",
|
189 |
+
]
|
190 |
+
if decoding_strategy == "Greedy":
|
191 |
+
generation_args["do_sample"] = False
|
192 |
+
elif decoding_strategy == "Top P Sampling":
|
193 |
+
generation_args["temperature"] = temperature
|
194 |
+
generation_args["do_sample"] = True
|
195 |
+
generation_args["top_p"] = top_p
|
196 |
+
|
197 |
+
# Creating model inputs
|
198 |
+
formated_prompt_list = format_user_prompt_with_im_history_and_system_conditioning(
|
199 |
+
user_prompt=user_prompt,
|
200 |
+
chat_history=chat_history,
|
201 |
+
)
|
202 |
+
msg = PROCESSOR.apply_chat_template(formated_prompt_list, add_generation_prompt=True, tokenize=False)
|
203 |
+
inputs = PROCESSOR.tokenizer(msg, return_tensors="pt", add_special_tokens=False)
|
204 |
+
all_images = extract_images_from_msg_list(formated_prompt_list)
|
205 |
+
if all_images:
|
206 |
+
img_inp = PROCESSOR(all_images)
|
207 |
+
inputs["pixel_values"] = torch.tensor(img_inp["pixel_values"])
|
208 |
+
inputs["pixel_attention_mask"] = torch.tensor(img_inp["pixel_attention_mask"])
|
209 |
+
inputs = {k: v.to(DEVICE) for k, v in inputs.items()}
|
210 |
+
generation_args.update(inputs)
|
211 |
+
|
212 |
+
# The regular non streaming generation mode
|
213 |
+
_ = generation_args.pop("streamer")
|
214 |
+
|
215 |
+
print(f"Input: {user_prompt}")
|
216 |
+
order = random.sample(range(len(MODELS)), len(MODELS))
|
217 |
+
result = ""
|
218 |
+
for idx, selected_model in enumerate(order):
|
219 |
+
generated_ids = MODELS[sorted(list(MODELS.keys()))[selected_model]].generate(**generation_args)
|
220 |
+
generated_text = PROCESSOR.batch_decode(generated_ids[:, generation_args["input_ids"].size(-1): ], skip_special_tokens=True)[0]
|
221 |
+
result += f"**MODEL {chr(65+idx)}**:\n{generated_text}\n\n---------------------\n\n"
|
222 |
+
print(f"MODEL {chr(65+idx)}: {sorted(list(MODELS.keys()))[selected_model]}")
|
223 |
+
print("----------")
|
224 |
+
result = result[:-25]
|
225 |
+
return result
|
226 |
+
|
227 |
+
# # The streaming generation mode
|
228 |
+
# thread = Thread(
|
229 |
+
# target=MODELS[model_selector].generate,
|
230 |
+
# kwargs=generation_args,
|
231 |
+
# )
|
232 |
+
# thread.start()
|
233 |
+
|
234 |
+
# print("start generating")
|
235 |
+
# acc_text = ""
|
236 |
+
# for text_token in streamer:
|
237 |
+
# time.sleep(0.04)
|
238 |
+
# acc_text += text_token
|
239 |
+
# if acc_text.endswith("<end_of_utterance>"):
|
240 |
+
# acc_text = acc_text[:-18]
|
241 |
+
# yield acc_text
|
242 |
+
# print("success - generated the following text:", acc_text)
|
243 |
+
|
244 |
+
|
245 |
+
# Hyper-parameters for generation
|
246 |
+
max_new_tokens = gr.Slider(
|
247 |
+
minimum=8,
|
248 |
+
maximum=1024,
|
249 |
+
value=512,
|
250 |
+
step=1,
|
251 |
+
interactive=True,
|
252 |
+
label="Maximum number of new tokens to generate",
|
253 |
+
)
|
254 |
+
repetition_penalty = gr.Slider(
|
255 |
+
minimum=0.01,
|
256 |
+
maximum=5.0,
|
257 |
+
value=1.0,
|
258 |
+
step=0.01,
|
259 |
+
interactive=True,
|
260 |
+
label="Repetition penalty",
|
261 |
+
info="1.0 is equivalent to no penalty",
|
262 |
+
)
|
263 |
+
decoding_strategy = gr.Radio(
|
264 |
+
[
|
265 |
+
"Greedy",
|
266 |
+
"Top P Sampling",
|
267 |
+
],
|
268 |
+
value="Greedy",
|
269 |
+
label="Decoding strategy",
|
270 |
+
interactive=True,
|
271 |
+
info="Higher values is equivalent to sampling more low-probability tokens.",
|
272 |
+
)
|
273 |
+
temperature = gr.Slider(
|
274 |
+
minimum=0.0,
|
275 |
+
maximum=5.0,
|
276 |
+
value=0.4,
|
277 |
+
step=0.1,
|
278 |
+
interactive=True,
|
279 |
+
label="Sampling temperature",
|
280 |
+
info="Higher values will produce more diverse outputs.",
|
281 |
+
)
|
282 |
+
top_p = gr.Slider(
|
283 |
+
minimum=0.01,
|
284 |
+
maximum=0.99,
|
285 |
+
value=0.8,
|
286 |
+
step=0.01,
|
287 |
+
interactive=True,
|
288 |
+
label="Top P",
|
289 |
+
info="Higher values is equivalent to sampling more low-probability tokens.",
|
290 |
+
)
|
291 |
+
|
292 |
+
|
293 |
+
chatbot = gr.Chatbot(
|
294 |
+
label="IDEFICS2",
|
295 |
+
avatar_images=[None, BOT_AVATAR],
|
296 |
+
height=750,
|
297 |
+
)
|
298 |
+
|
299 |
+
|
300 |
+
with gr.Blocks(fill_height=True) as demo:
|
301 |
+
# model selector should be set to `visbile=False` ultimately
|
302 |
+
with gr.Row(elem_id="model_selector_row"):
|
303 |
+
model_selector = gr.Dropdown(
|
304 |
+
choices=MODELS.keys(),
|
305 |
+
value=list(MODELS.keys())[0],
|
306 |
+
interactive=True,
|
307 |
+
show_label=False,
|
308 |
+
container=False,
|
309 |
+
label="Model",
|
310 |
+
visible=True,
|
311 |
+
)
|
312 |
+
|
313 |
+
decoding_strategy.change(
|
314 |
+
fn=lambda selection: gr.Slider(
|
315 |
+
visible=(
|
316 |
+
selection in ["contrastive_sampling", "beam_sampling", "Top P Sampling", "sampling_top_k"]
|
317 |
+
)
|
318 |
+
),
|
319 |
+
inputs=decoding_strategy,
|
320 |
+
outputs=temperature,
|
321 |
+
)
|
322 |
+
decoding_strategy.change(
|
323 |
+
fn=lambda selection: gr.Slider(visible=(selection in ["Top P Sampling"])),
|
324 |
+
inputs=decoding_strategy,
|
325 |
+
outputs=top_p,
|
326 |
+
)
|
327 |
+
|
328 |
+
gr.ChatInterface(
|
329 |
+
fn=model_inference,
|
330 |
+
chatbot=chatbot,
|
331 |
+
# examples=[{"text": "hello"}, {"text": "hola"}, {"text": "merhaba"}],
|
332 |
+
title="Idefics2 Playground",
|
333 |
+
multimodal=True,
|
334 |
+
additional_inputs=[model_selector, decoding_strategy, temperature, max_new_tokens, repetition_penalty, top_p],
|
335 |
+
)
|
336 |
+
|
337 |
+
demo.launch()
|
the_updated_app_with_tfrm_integration.py
CHANGED
@@ -18,11 +18,21 @@ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENT
|
|
18 |
|
19 |
DEVICE = torch.device("cuda")
|
20 |
MODELS = {
|
21 |
-
"idefics2": Idefics2ForConditionalGeneration.from_pretrained(
|
22 |
"HuggingFaceM4/idefics2-tfrm-compatible",
|
23 |
torch_dtype=torch.bfloat16,
|
24 |
_attn_implementation="flash_attention_2",
|
25 |
trust_remote_code=True,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
).to(DEVICE),
|
27 |
}
|
28 |
PROCESSOR = AutoProcessor.from_pretrained(
|
|
|
18 |
|
19 |
DEVICE = torch.device("cuda")
|
20 |
MODELS = {
|
21 |
+
"idefics2 lima 200": Idefics2ForConditionalGeneration.from_pretrained(
|
22 |
"HuggingFaceM4/idefics2-tfrm-compatible",
|
23 |
torch_dtype=torch.bfloat16,
|
24 |
_attn_implementation="flash_attention_2",
|
25 |
trust_remote_code=True,
|
26 |
+
token=os.environ["HF_AUTH_TOKEN"],
|
27 |
+
revision="11794e2ae02dbf1c55d0ebd92c28e5b0b604cf5f",
|
28 |
+
).to(DEVICE),
|
29 |
+
"idefics2 sft 12600": Idefics2ForConditionalGeneration.from_pretrained(
|
30 |
+
"HuggingFaceM4/idefics2-tfrm-compatible",
|
31 |
+
torch_dtype=torch.bfloat16,
|
32 |
+
_attn_implementation="flash_attention_2",
|
33 |
+
trust_remote_code=True,
|
34 |
+
token=os.environ["HF_AUTH_TOKEN"],
|
35 |
+
revision="86f134822798266d0d8db049cc6458c625e32344",
|
36 |
).to(DEVICE),
|
37 |
}
|
38 |
PROCESSOR = AutoProcessor.from_pretrained(
|