change cuda
Browse files
minigpt4/conversation/conversation.py
CHANGED
|
@@ -674,11 +674,12 @@ class Chat:
|
|
| 674 |
# # 等待两线程结束
|
| 675 |
# thread0.join()
|
| 676 |
# thread1.join()
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
|
|
|
| 682 |
|
| 683 |
try:
|
| 684 |
self.model_list[1].to('cuda')
|
|
@@ -686,6 +687,7 @@ class Chat:
|
|
| 686 |
except Exception as e:
|
| 687 |
print('model_1 error',e)
|
| 688 |
|
|
|
|
| 689 |
output_text=answer
|
| 690 |
answer_list.append(answer_new)
|
| 691 |
|
|
@@ -775,11 +777,12 @@ class Chat:
|
|
| 775 |
|
| 776 |
# answer = answer[0]
|
| 777 |
# answer_new = answer_new[0]
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
|
| 782 |
-
|
|
|
|
| 783 |
|
| 784 |
try:
|
| 785 |
self.model_list[1].to('cuda')
|
|
@@ -787,6 +790,7 @@ class Chat:
|
|
| 787 |
except Exception as e:
|
| 788 |
print('model_1 error',e)
|
| 789 |
|
|
|
|
| 790 |
output_text=answer
|
| 791 |
|
| 792 |
answer_list.append(answer_new)
|
|
|
|
| 674 |
# # 等待两线程结束
|
| 675 |
# thread0.join()
|
| 676 |
# thread1.join()
|
| 677 |
+
|
| 678 |
+
# try:
|
| 679 |
+
# self.model_list[0].to('cuda')
|
| 680 |
+
# answer = self.model_list[0].generate_step(lr_img_list_combination, confidence_instruction, hr_img_list_combination)
|
| 681 |
+
# except Exception as e:
|
| 682 |
+
# print('model_0 error',e)
|
| 683 |
|
| 684 |
try:
|
| 685 |
self.model_list[1].to('cuda')
|
|
|
|
| 687 |
except Exception as e:
|
| 688 |
print('model_1 error',e)
|
| 689 |
|
| 690 |
+
answer = answer_new
|
| 691 |
output_text=answer
|
| 692 |
answer_list.append(answer_new)
|
| 693 |
|
|
|
|
| 777 |
|
| 778 |
# answer = answer[0]
|
| 779 |
# answer_new = answer_new[0]
|
| 780 |
+
|
| 781 |
+
# try:
|
| 782 |
+
# self.model_list[0].to('cuda')
|
| 783 |
+
# answer = self.model_list[0].generate_step(lr_img_list_combination, confidence_instruction, hr_img_list_combination)
|
| 784 |
+
# except Exception as e:
|
| 785 |
+
# print('model_0 error',e)
|
| 786 |
|
| 787 |
try:
|
| 788 |
self.model_list[1].to('cuda')
|
|
|
|
| 790 |
except Exception as e:
|
| 791 |
print('model_1 error',e)
|
| 792 |
|
| 793 |
+
answer=answer_new
|
| 794 |
output_text=answer
|
| 795 |
|
| 796 |
answer_list.append(answer_new)
|
minigpt4/models/minigpt_base.py
CHANGED
|
@@ -1787,7 +1787,7 @@ class MiniGPTBase(BaseModel):
|
|
| 1787 |
out_tokens.append(toks)
|
| 1788 |
|
| 1789 |
answers = self.llama_tokenizer.decode(out_tokens[0])
|
| 1790 |
-
|
| 1791 |
return answers
|
| 1792 |
|
| 1793 |
|
|
|
|
| 1787 |
out_tokens.append(toks)
|
| 1788 |
|
| 1789 |
answers = self.llama_tokenizer.decode(out_tokens[0])
|
| 1790 |
+
|
| 1791 |
return answers
|
| 1792 |
|
| 1793 |
|