Update app.py
Browse files503 unmodified lines504505506507508509510511512513514515516517518519507508509510511512513514515516517518519520521522503 unmodified lines repetition_penalty_slider = gr.Slider(label="Repetition Penalty", minimum=1.0, maximum=2.0, value=1.0, step=0.1) web_search_checkbox = gr.Checkbox(label="Enable Web Search", value=False) def chat(question, history, temperature, top_p, repetition_penalty, web_search): answer = ask_question(question, temperature, top_p, repetition_penalty, web_search) if "news" in question.lower(): # Split the answer into individual news items news_items = answer.split("---") for item in news_items: if item.strip(): history.append((question, item.strip())) else: history.append((question, answer)) return "", history def chat(question, history, temperature, top_p, repetition_penalty, web_search): answer = ask_question(question, temperature, top_p, repetition_penalty, web_search) if "news" in question.lower(): # Split the answer into individual news items news_items = answer.split("---") for item in news_items: if item.strip(): history.append((question, item.strip())) else: history.append((question, answer)) return "", history submit_button.click(chat, inputs=[question_input, chatbot, temperature_slider, top_p_slider, repetition_penalty_slider, web_search_checkbox], outputs=[question_input, chatbot]) app.py+13-13