File size: 1,048 Bytes
cd483f6
 
 
af81472
 
 
cd483f6
af81472
cd483f6
 
af81472
f2dc4d4
cd483f6
 
 
 
 
af81472
 
 
 
 
cd483f6
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import gradio as gr
from huggingface_hub import InferenceClient

#-- commeting this line as it is not required in this context- By Bismit on Jan 10th, 2025
#For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference

"""
This chatbot is based on the contents of https://www.gradio.app/guides/creating-a-chatbot-fast
"""
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
def simple_respond(message,history):
    return f"I always respond with 'Hi,' regardless of the message that is passed to me, like {message}"

"""
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
"""
demo = gr.ChatInterface(
    # commented by Bismit because respond is a generic term, whereas simple_respond is the actual function defined in the code to handle and return chatbot responses.
    #respond
    simple_respond,
    type="messages"
    )


if __name__ == "__main__":
    demo.launch()