Spaces:
Sleeping
Sleeping
jh000107
commited on
Commit
·
bc0de96
1
Parent(s):
f289244
last try
Browse files
app.py
CHANGED
@@ -233,7 +233,6 @@ def get_completion(conversation, model="gpt-4-1106-preview"):
|
|
233 |
'Obscene': -3
|
234 |
}
|
235 |
|
236 |
-
|
237 |
def sentiment_flow_plot(conv):
|
238 |
conv_with_labels = extract_conv_with_labels(analysis)
|
239 |
num_utterances = len(conv_with_labels)
|
@@ -309,10 +308,10 @@ with gr.Blocks() as gpt_analysis:
|
|
309 |
"This is a custom GPT model designed to provide \
|
310 |
a report on overall sentiment flow of the conversation on the \
|
311 |
volunteer's perspective.<br /> Click on them and submit them to the model to see how it works.")
|
312 |
-
conversation = gr.Textbox(label="Input", lines=2)
|
313 |
api_key = gr.Textbox(label="Key", lines=1)
|
314 |
btn_key = gr.Button(value="Submit Key")
|
315 |
btn_key.click(set_key, inputs=api_key)
|
|
|
316 |
btn = gr.Button(value="Submit")
|
317 |
with gr.Row():
|
318 |
output_box = gr.Textbox(value="", label="Output",lines=4)
|
@@ -320,4 +319,4 @@ with gr.Blocks() as gpt_analysis:
|
|
320 |
|
321 |
btn.click(get_completion, inputs=conversation, outputs=[output_box, plot_box])
|
322 |
|
323 |
-
gr.TabbedInterface([gpt_analysis], ["GPT
|
|
|
233 |
'Obscene': -3
|
234 |
}
|
235 |
|
|
|
236 |
def sentiment_flow_plot(conv):
|
237 |
conv_with_labels = extract_conv_with_labels(analysis)
|
238 |
num_utterances = len(conv_with_labels)
|
|
|
308 |
"This is a custom GPT model designed to provide \
|
309 |
a report on overall sentiment flow of the conversation on the \
|
310 |
volunteer's perspective.<br /> Click on them and submit them to the model to see how it works.")
|
|
|
311 |
api_key = gr.Textbox(label="Key", lines=1)
|
312 |
btn_key = gr.Button(value="Submit Key")
|
313 |
btn_key.click(set_key, inputs=api_key)
|
314 |
+
conversation = gr.Textbox(label="Input", lines=2)
|
315 |
btn = gr.Button(value="Submit")
|
316 |
with gr.Row():
|
317 |
output_box = gr.Textbox(value="", label="Output",lines=4)
|
|
|
319 |
|
320 |
btn.click(get_completion, inputs=conversation, outputs=[output_box, plot_box])
|
321 |
|
322 |
+
gr.TabbedInterface([gpt_analysis], ["GPT Anlysis"]).launch(inline=False)
|