Update app.py
Browse files
app.py
CHANGED
@@ -236,7 +236,8 @@ def clear_response(history):
|
|
236 |
|
237 |
def add_message(history, message):
|
238 |
# history=[]
|
239 |
-
global our_chatbot
|
|
|
240 |
if len(history) == 0:
|
241 |
our_chatbot = InferenceDemo(
|
242 |
args, model_path, tokenizer, model, image_processor, context_len
|
@@ -610,6 +611,7 @@ if __name__ == "__main__":
|
|
610 |
tokenizer, model, image_processor, context_len = load_pretrained_model(args.model_path, args.model_base, model_name, args.load_8bit, args.load_4bit)
|
611 |
print("### image_processor",image_processor)
|
612 |
# print("### model",model)
|
|
|
613 |
print("### tokenzier",tokenizer)
|
614 |
model=model.to(torch.device('cuda'))
|
615 |
our_chatbot = None
|
|
|
236 |
|
237 |
def add_message(history, message):
|
238 |
# history=[]
|
239 |
+
global our_chatbot
|
240 |
+
global chat_image_num
|
241 |
if len(history) == 0:
|
242 |
our_chatbot = InferenceDemo(
|
243 |
args, model_path, tokenizer, model, image_processor, context_len
|
|
|
611 |
tokenizer, model, image_processor, context_len = load_pretrained_model(args.model_path, args.model_base, model_name, args.load_8bit, args.load_4bit)
|
612 |
print("### image_processor",image_processor)
|
613 |
# print("### model",model)
|
614 |
+
chat_image_num = 0
|
615 |
print("### tokenzier",tokenizer)
|
616 |
model=model.to(torch.device('cuda'))
|
617 |
our_chatbot = None
|