Spaces:
Sleeping
Sleeping
Aishwarya Solanki
commited on
Commit
·
9eda1ce
1
Parent(s):
5b91c9b
Refining UI
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def generate_text_chatgpt(key, prompt, temperature, top_p):
|
|
51 |
openai.api_key = key
|
52 |
|
53 |
response = openai.chat.completions.create(
|
54 |
-
model="gpt-
|
55 |
messages=[{"role": "system", "content": "You are a talented diagnostician who is diagnosing a patient."},
|
56 |
{"role": "user", "content": prompt}],
|
57 |
temperature=temperature,
|
@@ -148,14 +148,11 @@ with gr.Blocks() as ui:
|
|
148 |
model = gr.Radio(label="LLM Selection", value="GPT-3.5-Turbo",
|
149 |
choices=["GPT-3.5-Turbo", "Llama-3", "Gemini-1.5"])
|
150 |
is_valid = False
|
151 |
-
key = gr.Textbox(label="Please input the API key for your
|
152 |
status_message = gr.HTML(label="Validation Status")
|
153 |
key.input(fn=api_check_msg, inputs=[key, model], outputs=status_message)
|
154 |
button = gr.Button(value="Don't have an API key? Get one for the GPT model here.", link="https://platform.openai.com/account/api-keys")
|
155 |
model.change(update_model_components, inputs=model, outputs=[key, button])
|
156 |
-
# gr.Button(value="OpenAi Key", link="https://platform.openai.com/account/api-keys")
|
157 |
-
# gr.Button(value="Meta Llama Key", link="https://platform.openai.com/account/api-keys")
|
158 |
-
# gr.Button(value="Gemini Key", link="https://platform.openai.com/account/api-keys")
|
159 |
gr.ClearButton(key, variant="primary")
|
160 |
|
161 |
with gr.Column(scale=2, min_width=600):
|
@@ -168,7 +165,7 @@ with gr.Blocks() as ui:
|
|
168 |
key.input(toggle_button, inputs=[symptoms, key, model], outputs=llm_btn)
|
169 |
model.change(toggle_button, inputs=[symptoms, key, model], outputs=llm_btn)
|
170 |
output = gr.Textbox(label="LLM Output Status", interactive=False, placeholder="Output will appear here...")
|
171 |
-
llm_btn.click(fn=diagnose, inputs=[key, model, top_p, temperature, symptoms], outputs=output, api_name="
|
172 |
|
173 |
|
174 |
ui.launch(share=True)
|
|
|
51 |
openai.api_key = key
|
52 |
|
53 |
response = openai.chat.completions.create(
|
54 |
+
model="gpt-3.5-turbo-1106",
|
55 |
messages=[{"role": "system", "content": "You are a talented diagnostician who is diagnosing a patient."},
|
56 |
{"role": "user", "content": prompt}],
|
57 |
temperature=temperature,
|
|
|
148 |
model = gr.Radio(label="LLM Selection", value="GPT-3.5-Turbo",
|
149 |
choices=["GPT-3.5-Turbo", "Llama-3", "Gemini-1.5"])
|
150 |
is_valid = False
|
151 |
+
key = gr.Textbox(label="Please input the API key for your Large Language model", type="password")
|
152 |
status_message = gr.HTML(label="Validation Status")
|
153 |
key.input(fn=api_check_msg, inputs=[key, model], outputs=status_message)
|
154 |
button = gr.Button(value="Don't have an API key? Get one for the GPT model here.", link="https://platform.openai.com/account/api-keys")
|
155 |
model.change(update_model_components, inputs=model, outputs=[key, button])
|
|
|
|
|
|
|
156 |
gr.ClearButton(key, variant="primary")
|
157 |
|
158 |
with gr.Column(scale=2, min_width=600):
|
|
|
165 |
key.input(toggle_button, inputs=[symptoms, key, model], outputs=llm_btn)
|
166 |
model.change(toggle_button, inputs=[symptoms, key, model], outputs=llm_btn)
|
167 |
output = gr.Textbox(label="LLM Output Status", interactive=False, placeholder="Output will appear here...")
|
168 |
+
llm_btn.click(fn=diagnose, inputs=[key, model, top_p, temperature, symptoms], outputs=output, api_name="LLM_Comparator")
|
169 |
|
170 |
|
171 |
ui.launch(share=True)
|