Spaces:
Sleeping
Sleeping
phamngoctukts
commited on
Commit
•
7943ceb
1
Parent(s):
d5adc26
Update app.py
Browse files
app.py
CHANGED
@@ -138,10 +138,11 @@ def response(state:AppState = AppState()):
|
|
138 |
messages.append({"role": "user", "content": [{"type": "text", "text": txt}, {"type": "image"}]})
|
139 |
else: # regular input
|
140 |
messages.append({"role": "user", "content": [{"type": "text", "text": txt}]})
|
|
|
141 |
try:
|
142 |
texts = processor.apply_chat_template(messages, add_generation_prompt=True)
|
143 |
if images == []:
|
144 |
-
inputs = processor(text=texts, return_tensors="pt").to("
|
145 |
else:
|
146 |
inputs = processor(text=texts, images=images, return_tensors="pt").to("cpu")
|
147 |
streamer = TextIteratorStreamer(processor, skip_special_tokens=True, skip_prompt=True)
|
|
|
138 |
messages.append({"role": "user", "content": [{"type": "text", "text": txt}, {"type": "image"}]})
|
139 |
else: # regular input
|
140 |
messages.append({"role": "user", "content": [{"type": "text", "text": txt}]})
|
141 |
+
buffer = "Tôi không nghe rõ"
|
142 |
try:
|
143 |
texts = processor.apply_chat_template(messages, add_generation_prompt=True)
|
144 |
if images == []:
|
145 |
+
inputs = processor(text=texts, return_tensors="pt").to("cpu")
|
146 |
else:
|
147 |
inputs = processor(text=texts, images=images, return_tensors="pt").to("cpu")
|
148 |
streamer = TextIteratorStreamer(processor, skip_special_tokens=True, skip_prompt=True)
|