Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,8 @@ def test_handler(optionSelection, prompt: str = "Write an introductory paragraph
|
|
| 30 |
openai.api_version = '2020-11-07'
|
| 31 |
|
| 32 |
completion = openai.ChatCompletion.create(
|
| 33 |
-
model = model
|
|
|
|
| 34 |
messages = messages,
|
| 35 |
temperature = 0.7
|
| 36 |
)
|
|
@@ -46,7 +47,7 @@ def test_handler(optionSelection, prompt: str = "Write an introductory paragraph
|
|
| 46 |
|
| 47 |
with gr.Blocks() as LLMDemoTabbedScreen:
|
| 48 |
with gr.Tab("Text-to-Text (Text Completion)"):
|
| 49 |
-
|
| 50 |
test_string = gr.Textbox(label="Try String", value=TEST_MESSAGE, lines=2)
|
| 51 |
test_string_response = gr.Textbox(label="Response")
|
| 52 |
test_string_output_info = gr.Label(value="Output Info", label="Info")
|
|
@@ -55,7 +56,7 @@ with gr.Blocks() as LLMDemoTabbedScreen:
|
|
| 55 |
|
| 56 |
test_button.click(
|
| 57 |
fn=test_handler,
|
| 58 |
-
inputs=[
|
| 59 |
outputs=[test_string_output_info, test_string_response]
|
| 60 |
)
|
| 61 |
|
|
|
|
| 30 |
openai.api_version = '2020-11-07'
|
| 31 |
|
| 32 |
completion = openai.ChatCompletion.create(
|
| 33 |
+
model = model
|
| 34 |
+
,
|
| 35 |
messages = messages,
|
| 36 |
temperature = 0.7
|
| 37 |
)
|
|
|
|
| 47 |
|
| 48 |
with gr.Blocks() as LLMDemoTabbedScreen:
|
| 49 |
with gr.Tab("Text-to-Text (Text Completion)"):
|
| 50 |
+
llm_options = gr.Radio(llm_api_options, label="Select one", info="Which service do you want to use?", value="OpenAI API")
|
| 51 |
test_string = gr.Textbox(label="Try String", value=TEST_MESSAGE, lines=2)
|
| 52 |
test_string_response = gr.Textbox(label="Response")
|
| 53 |
test_string_output_info = gr.Label(value="Output Info", label="Info")
|
|
|
|
| 56 |
|
| 57 |
test_button.click(
|
| 58 |
fn=test_handler,
|
| 59 |
+
inputs=[llm_options, test_string],
|
| 60 |
outputs=[test_string_output_info, test_string_response]
|
| 61 |
)
|
| 62 |
|