Update app.py
Browse files12345678910111213141516import gradio as grfrom huggingface_hub import InferenceApidef chat_with_bot(user_input,history,hf_token):client = InferenceApi(repo_id="facebook/blenderbot-400M-distill", token=hf_token)response = client(inputs=user_input, parameters={"max_new_tokens": 100, "do_sample": True})bot_reply = response['generated_text'].strip()# Update chat historyhistory.append((user_input, bot_reply))return bot_reply, history12345678910import gradio as grfrom huggingface_hub import InferenceClientdef chat_with_bot(user_input, history, hf_token):client = InferenceClient(repo_id="facebook/blenderbot-400M-distill", token=hf_token)response = client(inputs=user_input, parameters={"max_new_tokens": 100, "do_sample": True})bot_reply = response['generated_text'].strip()history.append((user_input, bot_reply))return bot_reply, history
app.py+3-9