Spaces:
				
			
			
	
			
			
		Paused
		
	
	
	
			
			
	
	
	
	
		
		
		Paused
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -89,9 +89,10 @@ def upload_imgorvideo(gr_video, gr_img, text_input,chatbot,audio_flag): | |
| 89 | 
             
                    chat_state = conv_llava_llama_2.copy()
         | 
| 90 | 
             
                if gr_img is None and gr_video is None:
         | 
| 91 | 
             
                    return None, None, None, gr.update(interactive=True), chat_state, None
         | 
| 92 | 
            -
                elif  | 
| 93 | 
            -
                    print( | 
| 94 | 
            -
                    chatbot = [(( | 
|  | |
| 95 | 
             
                    chat_state = Conversation(
         | 
| 96 | 
             
                        system= "You are able to understand the visual content that the user provides."
         | 
| 97 | 
             
                       "Follow the instructions carefully and explain your answers in detail.",
         | 
| @@ -102,12 +103,11 @@ def upload_imgorvideo(gr_video, gr_img, text_input,chatbot,audio_flag): | |
| 102 | 
             
                        sep="###",
         | 
| 103 | 
             
                    )
         | 
| 104 | 
             
                    img_list = []
         | 
| 105 | 
            -
                    llm_message = chat. | 
| 106 | 
             
                    return gr.update(interactive=False), gr.update(interactive=False), gr.update(interactive=True, placeholder='Type and press Enter'), gr.update(value="Start Chatting", interactive=False), chat_state, img_list,chatbot
         | 
| 107 | 
            -
                elif  | 
| 108 | 
            -
                    print( | 
| 109 | 
            -
                    chatbot = [(( | 
| 110 | 
            -
                    chat_state = default_conversation.copy()
         | 
| 111 | 
             
                    chat_state = Conversation(
         | 
| 112 | 
             
                        system= "You are able to understand the visual content that the user provides."
         | 
| 113 | 
             
                       "Follow the instructions carefully and explain your answers in detail.",
         | 
| @@ -118,7 +118,7 @@ def upload_imgorvideo(gr_video, gr_img, text_input,chatbot,audio_flag): | |
| 118 | 
             
                        sep="###",
         | 
| 119 | 
             
                    )
         | 
| 120 | 
             
                    img_list = []
         | 
| 121 | 
            -
                    llm_message = chat. | 
| 122 | 
             
                    return gr.update(interactive=False), gr.update(interactive=False), gr.update(interactive=True, placeholder='Type and press Enter'), gr.update(value="Start Chatting", interactive=False), chat_state, img_list,chatbot
         | 
| 123 | 
             
                else:
         | 
| 124 | 
             
                    # img_list = []
         | 
|  | |
| 89 | 
             
                    chat_state = conv_llava_llama_2.copy()
         | 
| 90 | 
             
                if gr_img is None and gr_video is None:
         | 
| 91 | 
             
                    return None, None, None, gr.update(interactive=True), chat_state, None
         | 
| 92 | 
            +
                elif gr_video is not None:
         | 
| 93 | 
            +
                    print(gr_video)
         | 
| 94 | 
            +
                    chatbot = [((gr_video,), None)]
         | 
| 95 | 
            +
                    chat_state = default_conversation.copy()
         | 
| 96 | 
             
                    chat_state = Conversation(
         | 
| 97 | 
             
                        system= "You are able to understand the visual content that the user provides."
         | 
| 98 | 
             
                       "Follow the instructions carefully and explain your answers in detail.",
         | 
|  | |
| 103 | 
             
                        sep="###",
         | 
| 104 | 
             
                    )
         | 
| 105 | 
             
                    img_list = []
         | 
| 106 | 
            +
                    llm_message = chat.upload_video(gr_video, chat_state, img_list)
         | 
| 107 | 
             
                    return gr.update(interactive=False), gr.update(interactive=False), gr.update(interactive=True, placeholder='Type and press Enter'), gr.update(value="Start Chatting", interactive=False), chat_state, img_list,chatbot
         | 
| 108 | 
            +
                elif gr_img is not None:
         | 
| 109 | 
            +
                    print(gr_img)
         | 
| 110 | 
            +
                    chatbot = [((gr_img,), None)]
         | 
|  | |
| 111 | 
             
                    chat_state = Conversation(
         | 
| 112 | 
             
                        system= "You are able to understand the visual content that the user provides."
         | 
| 113 | 
             
                       "Follow the instructions carefully and explain your answers in detail.",
         | 
|  | |
| 118 | 
             
                        sep="###",
         | 
| 119 | 
             
                    )
         | 
| 120 | 
             
                    img_list = []
         | 
| 121 | 
            +
                    llm_message = chat.upload_img(gr_img, chat_state, img_list)
         | 
| 122 | 
             
                    return gr.update(interactive=False), gr.update(interactive=False), gr.update(interactive=True, placeholder='Type and press Enter'), gr.update(value="Start Chatting", interactive=False), chat_state, img_list,chatbot
         | 
| 123 | 
             
                else:
         | 
| 124 | 
             
                    # img_list = []
         | 
