Spaces:
Sleeping
Sleeping
Commit ·
9c59b08
1
Parent(s): 5415007
upd app.py
Browse files
app.py
CHANGED
|
@@ -10,11 +10,12 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
| 10 |
def respond(
|
| 11 |
message,
|
| 12 |
history: list[tuple[str, str]],
|
|
|
|
| 13 |
max_tokens,
|
| 14 |
temperature,
|
| 15 |
top_p,
|
| 16 |
):
|
| 17 |
-
messages = [{"role": "system", "content":
|
| 18 |
|
| 19 |
for val in history:
|
| 20 |
if val[0]:
|
|
@@ -43,7 +44,7 @@ def respond(
|
|
| 43 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 44 |
"""
|
| 45 |
demo = gr.ChatInterface(
|
| 46 |
-
respond,
|
| 47 |
additional_inputs=[
|
| 48 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
| 49 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
|
|
|
| 10 |
def respond(
|
| 11 |
message,
|
| 12 |
history: list[tuple[str, str]],
|
| 13 |
+
system_message,
|
| 14 |
max_tokens,
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
| 18 |
+
messages = [{"role": "system", "content": system_message}]
|
| 19 |
|
| 20 |
for val in history:
|
| 21 |
if val[0]:
|
|
|
|
| 44 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 45 |
"""
|
| 46 |
demo = gr.ChatInterface(
|
| 47 |
+
respond(system_message="if the prompt is 'найди то, что ещё не изучено', ask 'в какой области лингвистики или литературоведения?' after getting the answer, find the research gap using the given information and using both Google Scholar and Academia.edu and then formalize it as a bulleted list with 2-8 points"),
|
| 48 |
additional_inputs=[
|
| 49 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
| 50 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|