Keiraj commited on
Commit
384392e
Β·
verified Β·
1 Parent(s): c98706e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -1,10 +1,8 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
- # Connect to Hugging Face model
5
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
6
 
7
- # Define the chat response function
8
  def respond(
9
  message,
10
  history: list[tuple[str, str]],
@@ -36,18 +34,24 @@ def respond(
36
  response += token
37
  yield response
38
 
39
- # Gradio interface layout
40
  demo = gr.ChatInterface(
41
  respond,
42
  additional_inputs=[
43
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
44
  ],
45
- css=".gradio-container {background-color: #ffeef8;} .gr-button {background-color: #ff88cc; color: white; border-radius: 12px;} .gr-input {border: 2px solid #ff66b2; border-radius: 10px;} .gr-output {border: 2px solid #ff66b2; border-radius: 10px; padding: 10px;} .gr-button:hover {background-color: #ff66b2;} .gr-textbox {background-color: #fff1f5;}",
46
- theme="huggingface", # Hugging Face's default theme
47
- title="Cuddly Chatbot 🐾", # Title for the app
48
- description="Welcome to the most adorable chatbot! πŸ’–",
 
 
 
 
 
 
 
 
49
  )
50
 
51
  if __name__ == "__main__":
52
  demo.launch()
53
-
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
 
4
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
5
 
 
6
  def respond(
7
  message,
8
  history: list[tuple[str, str]],
 
34
  response += token
35
  yield response
36
 
 
37
  demo = gr.ChatInterface(
38
  respond,
39
  additional_inputs=[
40
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
41
  ],
42
+ css="""
43
+ .gradio-container {background-color: #ffeef8; font-family: 'Comic Sans MS', sans-serif;}
44
+ .gr-button {background-color: #ff88cc; color: white; border-radius: 12px; padding: 10px;}
45
+ .gr-input {border: 2px solid #ff66b2; border-radius: 10px; background-color: #fff1f5; font-size: 18px;}
46
+ .gr-output {border: 2px solid #ff66b2; border-radius: 10px; padding: 15px; background-color: #ffffff; font-size: 18px; font-weight: bold;}
47
+ .gr-button:hover {background-color: #ff66b2; transition: background-color 0.3s;}
48
+ .gr-textbox {background-color: #fff1f5;}
49
+ .gradio-interface {padding: 20px; margin: 20px; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);}
50
+ .gradio-container input, .gradio-container button {font-family: 'Comic Sans MS', sans-serif;}
51
+ """,
52
+ title="Cuddly Chatbot 🐾",
53
+ description="A sweet and friendly assistant for all your questions! πŸ’–",
54
  )
55
 
56
  if __name__ == "__main__":
57
  demo.launch()