Shriharsh commited on
Commit
74c69fa
·
verified ·
1 Parent(s): faa59dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -13
app.py CHANGED
@@ -5,13 +5,6 @@ client = InferenceClient(
5
  "mistralai/Mistral-7B-Instruct-v0.3"
6
  )
7
 
8
- CSS = """
9
- body, .gradio-container {
10
- background-color: #0F1117;
11
- color: #FFFFFF;
12
- }
13
- """
14
-
15
  def format_prompt(message, history):
16
  prompt = "<s>"
17
  for user_prompt, bot_response in history:
@@ -47,6 +40,7 @@ def generate(
47
  yield output
48
  return output
49
 
 
50
  additional_inputs=[
51
  gr.Slider(
52
  label="Temperature",
@@ -86,16 +80,18 @@ additional_inputs=[
86
  )
87
  ]
88
 
89
- chatbot = gr.Chatbot(height=450, label="Chatbot", container=True)
 
 
90
 
91
  with gr.Blocks(css=CSS) as demo:
92
- gr.HTML("<h1>🤖 Mistral-7B-Chat 💬</h1>")
93
  gr.ChatInterface(
94
  generate,
95
- chatbot=chatbot,
96
  additional_inputs=additional_inputs,
97
- examples=[["Give me the code for Binary Search in C++"],
98
- ["Explain the chapter of The Grand Inquistor from The Brothers Karamazov."],
99
- ["Explain Newton's second law of motion."]],
100
  )
 
101
  demo.queue().launch(debug=True)
 
5
  "mistralai/Mistral-7B-Instruct-v0.3"
6
  )
7
 
 
 
 
 
 
 
 
8
  def format_prompt(message, history):
9
  prompt = "<s>"
10
  for user_prompt, bot_response in history:
 
40
  yield output
41
  return output
42
 
43
+
44
  additional_inputs=[
45
  gr.Slider(
46
  label="Temperature",
 
80
  )
81
  ]
82
 
83
+ # Create a Chatbot object with the desired height
84
+ chatbot = gr.Chatbot(height=450,
85
+ layout="bubble")
86
 
87
  with gr.Blocks(css=CSS) as demo:
88
+ gr.HTML("<h1><center>🤖 Mistral-7B-Chat 💬<h1><center>")
89
  gr.ChatInterface(
90
  generate,
91
+ chatbot=chatbot, # Use the created Chatbot object
92
  additional_inputs=additional_inputs,
93
+ examples=[["Give me the code for Binary Search in C++"], ["Explain the chapter of The Grand Inquistor from The Brothers Karmazov."], ["Explain Newton's second law."]],
94
+
 
95
  )
96
+
97
  demo.queue().launch(debug=True)