Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
-
#
|
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 |
-
#
|
42 |
-
demo = gr.
|
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()
|