Spaces:
Running
Running
yes:
Browse files
app.py
CHANGED
@@ -7,10 +7,9 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
|
9 |
SYSTEM_MAGIC = """
|
10 |
-
|
11 |
-
You may execute the following functions:
|
12 |
|
13 |
-
"""
|
14 |
|
15 |
def respond(
|
16 |
message,
|
@@ -20,7 +19,7 @@ def respond(
|
|
20 |
temperature,
|
21 |
top_p,
|
22 |
):
|
23 |
-
messages = [{"role": "system", "content":
|
24 |
|
25 |
for val in history:
|
26 |
if val[0]:
|
@@ -64,7 +63,12 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
64 |
#)
|
65 |
with gr.Blocks() as demo:
|
66 |
with gr.Row():
|
67 |
-
gr.HTML(
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
if __name__ == "__main__":
|
70 |
demo.launch()
|
|
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
|
9 |
SYSTEM_MAGIC = """
|
10 |
+
Your container is written in HTML. All outputs must be in HTML format. User cannot see what you say unles it is in HTML.
|
|
|
11 |
|
12 |
+
<!DOCTYPE html>"""
|
13 |
|
14 |
def respond(
|
15 |
message,
|
|
|
19 |
temperature,
|
20 |
top_p,
|
21 |
):
|
22 |
+
messages = [{"role": "system", "content": SYSTEM_MAGIC}]
|
23 |
|
24 |
for val in history:
|
25 |
if val[0]:
|
|
|
63 |
#)
|
64 |
with gr.Blocks() as demo:
|
65 |
with gr.Row():
|
66 |
+
hml = gr.HTML("")
|
67 |
+
with gr.Row():
|
68 |
+
tb = gr.Textbox(placeholder="Your input here...")
|
69 |
+
with gr.Row():
|
70 |
+
bn = gr.Button("Submit")
|
71 |
+
bn.click(respond, inputs=[tb], outputs=[hml])
|
72 |
|
73 |
if __name__ == "__main__":
|
74 |
demo.launch()
|