amitpuri commited on
Commit
27b3699
1 Parent(s): 33dbe31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -7,6 +7,7 @@ import google.generativeai as palm
7
  #from dotenv import load_dotenv
8
  #load_dotenv()
9
 
 
10
  llm_api_options = ["OpenAI API","Azure OpenAI API","Google PaLM API", "Llama 2"]
11
  TEST_MESSAGE = "Write an introductory paragraph to explain Generative AI to the reader of this content."
12
  openai_models = ["gpt-4", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0613", "gpt-3.5-turbo",
@@ -130,19 +131,19 @@ def test_handler(optionSelection, prompt: str = TEST_MESSAGE, openai_model_name:
130
  with gr.Blocks() as LLMDemoTabbedScreen:
131
  with gr.Tab("Text-to-Text (Text Completion)"):
132
  llm_options = gr.Radio(llm_api_options, label="Select one", info="Which service do you want to use?", value="OpenAI API")
133
- with gr.Tab("Open AI"):
134
- openai_model = gr.Dropdown(openai_models, value="gpt-4", label="Model", info="Select one, for Natural language")
135
- with gr.Tab("Google PaLM API"):
136
- google_model_name = gr.Dropdown(google_palm_models,
137
- value="models/text-bison-001", label="Model", info="Select one, for Natural language")
138
  with gr.Row():
139
  with gr.Column():
140
  test_string = gr.Textbox(label="Try String", value=TEST_MESSAGE, lines=2)
141
  test_string_response = gr.Textbox(label="Response")
142
  test_string_output_info = gr.Label(value="Output Info", label="Info")
143
  test_button = gr.Button("Try it")
144
-
145
-
 
 
 
 
 
146
  test_button.click(
147
  fn=test_handler,
148
  inputs=[llm_options, test_string, openai_model, google_model_name],
 
7
  #from dotenv import load_dotenv
8
  #load_dotenv()
9
 
10
+
11
  llm_api_options = ["OpenAI API","Azure OpenAI API","Google PaLM API", "Llama 2"]
12
  TEST_MESSAGE = "Write an introductory paragraph to explain Generative AI to the reader of this content."
13
  openai_models = ["gpt-4", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0613", "gpt-3.5-turbo",
 
131
  with gr.Blocks() as LLMDemoTabbedScreen:
132
  with gr.Tab("Text-to-Text (Text Completion)"):
133
  llm_options = gr.Radio(llm_api_options, label="Select one", info="Which service do you want to use?", value="OpenAI API")
 
 
 
 
 
134
  with gr.Row():
135
  with gr.Column():
136
  test_string = gr.Textbox(label="Try String", value=TEST_MESSAGE, lines=2)
137
  test_string_response = gr.Textbox(label="Response")
138
  test_string_output_info = gr.Label(value="Output Info", label="Info")
139
  test_button = gr.Button("Try it")
140
+ with gr.Tab("API Settings"):
141
+ with gr.Tab("Open AI"):
142
+ openai_model = gr.Dropdown(openai_models, value="gpt-4", label="Model", info="Select one, for Natural language")
143
+ with gr.Tab("Google PaLM API"):
144
+ google_model_name = gr.Dropdown(google_palm_models,
145
+ value="models/text-bison-001", label="Model", info="Select one, for Natural language")
146
+
147
  test_button.click(
148
  fn=test_handler,
149
  inputs=[llm_options, test_string, openai_model, google_model_name],