Missing historical chat info?

#2
by theblackcat102 - opened

Did I miss something or the history of chat is not passes into the generation context?

def multi_turn_chat(user_input, audio_file, history, current_audio):
    try:
        if audio_file is not None:
            current_audio = audio_file  # Update state if a new file is uploaded

        if current_audio is None:
            return history + [("System", "โŒ Please upload an audio file before chatting.")], history, current_audio

        sound = llava.Sound(current_audio)
        prompt = f"<sound>\n{user_input}"

        response = model_multi.generate_content([sound, prompt], generation_config=generation_config_multi)

        history.append((user_input, response))
        return history, history, current_audio
    except Exception as e:
        history.append((user_input, f"โŒ Error: {str(e)}"))
        return history, history, current_audio

Sign up or log in to comment