Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,7 +70,12 @@ class ESRS_info_tool(Tool):
|
|
| 70 |
############################################################################################
|
| 71 |
############################################################################################
|
| 72 |
|
| 73 |
-
def respond(message
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
system_prompt_added = """You are an expert in environmental and corporate social responsibility. You must respond to requests using the query function in the document database.
|
| 75 |
User's question : """
|
| 76 |
agent_output = agent.run(system_prompt_added + message)
|
|
@@ -100,6 +105,18 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
| 100 |
"""
|
| 101 |
demo = gr.ChatInterface(
|
| 102 |
respond,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
)
|
| 104 |
|
| 105 |
|
|
|
|
| 70 |
############################################################################################
|
| 71 |
############################################################################################
|
| 72 |
|
| 73 |
+
def respond(message,
|
| 74 |
+
history: list[tuple[str, str]],
|
| 75 |
+
system_message,
|
| 76 |
+
max_tokens,
|
| 77 |
+
temperature,
|
| 78 |
+
top_p,):
|
| 79 |
system_prompt_added = """You are an expert in environmental and corporate social responsibility. You must respond to requests using the query function in the document database.
|
| 80 |
User's question : """
|
| 81 |
agent_output = agent.run(system_prompt_added + message)
|
|
|
|
| 105 |
"""
|
| 106 |
demo = gr.ChatInterface(
|
| 107 |
respond,
|
| 108 |
+
additional_inputs=[
|
| 109 |
+
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
| 110 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 111 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 112 |
+
gr.Slider(
|
| 113 |
+
minimum=0.1,
|
| 114 |
+
maximum=1.0,
|
| 115 |
+
value=0.95,
|
| 116 |
+
step=0.05,
|
| 117 |
+
label="Top-p (nucleus sampling)",
|
| 118 |
+
),
|
| 119 |
+
],
|
| 120 |
)
|
| 121 |
|
| 122 |
|