jhansi1 commited on
Commit
765b4a1
·
verified ·
1 Parent(s): c500dff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,10 +1,9 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
- # Initialize the InferenceClient with the model 'InfAI/parlbert-german-law'
5
  client = InferenceClient("InfAI/parlbert-german-law")
6
 
7
-
8
  def respond(
9
  message,
10
  history: list[tuple[str, str]],
@@ -38,8 +37,8 @@ def respond(
38
  yield response
39
 
40
 
41
- # Create the Gradio interface for chatbot interaction
42
- demo = gr.ChatInterface(
43
  respond,
44
  additional_inputs=[
45
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
@@ -55,5 +54,6 @@ demo = gr.ChatInterface(
55
  ],
56
  )
57
 
 
58
  if __name__ == "__main__":
59
  demo.launch()
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
+ # Use the German law-specific model
5
  client = InferenceClient("InfAI/parlbert-german-law")
6
 
 
7
  def respond(
8
  message,
9
  history: list[tuple[str, str]],
 
37
  yield response
38
 
39
 
40
+ # Updated to use gr.Chat instead of gr.ChatInterface
41
+ demo = gr.Chat(
42
  respond,
43
  additional_inputs=[
44
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
 
54
  ],
55
  )
56
 
57
+
58
  if __name__ == "__main__":
59
  demo.launch()