Spaces:
Runtime error
Runtime error
Commit
·
a49ee2f
1
Parent(s):
d4b5669
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ def call_gradio_api(user_input):
|
|
8 |
|
9 |
client = Client("https://traversaal-internal-rag-faiss-gpt3-5.hf.space/", hf_token=access_token)
|
10 |
result = client.predict(user_input, api_name="/predict")
|
11 |
-
return result[0], result[1], result[2]
|
12 |
|
13 |
# Interface for the Gradio app
|
14 |
|
@@ -16,8 +16,12 @@ new_prompt = gr.Textbox(
|
|
16 |
label="Augmented Prompt", placeholder="Augmented Prompt will appear here"
|
17 |
)
|
18 |
|
19 |
-
|
20 |
-
label="Response", placeholder="Response of the prompt will appear here"
|
|
|
|
|
|
|
|
|
21 |
)
|
22 |
|
23 |
source_list = gr.Textbox(
|
@@ -27,7 +31,7 @@ source_list = gr.Textbox(
|
|
27 |
iface = gr.Interface(
|
28 |
fn=call_gradio_api,
|
29 |
inputs="text",
|
30 |
-
outputs = [new_prompt,
|
31 |
examples=["Make me a 4-hour workshop agenda for handling conflict", "Tell me about the different skills from middle management to executive leadership", "What are some of the major debates among scholars regarding the trait versus process theories of leadership? How have these perspectives evolved over time?"],
|
32 |
layout="horizontal",
|
33 |
title="CCL Playground",
|
|
|
8 |
|
9 |
client = Client("https://traversaal-internal-rag-faiss-gpt3-5.hf.space/", hf_token=access_token)
|
10 |
result = client.predict(user_input, api_name="/predict")
|
11 |
+
return result[0], result[1], result[2], result[3]
|
12 |
|
13 |
# Interface for the Gradio app
|
14 |
|
|
|
16 |
label="Augmented Prompt", placeholder="Augmented Prompt will appear here"
|
17 |
)
|
18 |
|
19 |
+
chat_response_1 = gr.Textbox(
|
20 |
+
label="Response based on augmented prompt", placeholder="Response of the prompt will appear here"
|
21 |
+
)
|
22 |
+
|
23 |
+
chat_response_2 = gr.Textbox(
|
24 |
+
label="Response based on original prompt", placeholder="Response of the prompt will appear here"
|
25 |
)
|
26 |
|
27 |
source_list = gr.Textbox(
|
|
|
31 |
iface = gr.Interface(
|
32 |
fn=call_gradio_api,
|
33 |
inputs="text",
|
34 |
+
outputs = [new_prompt, chat_response_1, chat_response_2, source_list],
|
35 |
examples=["Make me a 4-hour workshop agenda for handling conflict", "Tell me about the different skills from middle management to executive leadership", "What are some of the major debates among scholars regarding the trait versus process theories of leadership? How have these perspectives evolved over time?"],
|
36 |
layout="horizontal",
|
37 |
title="CCL Playground",
|