Spaces:
Sleeping
Sleeping
Aishwarya Solanki
commited on
Commit
·
71ec392
1
Parent(s):
d37d386
Refining UI
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ def generate_text_chatgpt(key, prompt, temperature, top_p):
|
|
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,
|
58 |
max_tokens=50,
|
@@ -109,7 +109,7 @@ def diagnose(gpt_key, llama_key, gemini_key, top_p, temperature, symptoms):
|
|
109 |
majority_output, majority_count = output_counts.most_common(1)[0]
|
110 |
confidence = (majority_count / len(outputs)) * 100
|
111 |
else:
|
112 |
-
majority_output = "Please add the symptoms data to start the ranking process"
|
113 |
confidence = 0
|
114 |
|
115 |
return majority_output, confidence
|
@@ -152,14 +152,14 @@ with gr.Blocks() as ui:
|
|
152 |
llama_key.input(fn=api_check_msg, inputs=[llama_key, gr.Textbox(value="Llama", visible=False)], outputs=status_message)
|
153 |
status_message = gr.HTML(label="Validation Status")
|
154 |
gemini_key.input(fn=api_check_msg, inputs=[gemini_key, gr.Textbox(value="Gemini", visible=False)], outputs=status_message)
|
155 |
-
gr.
|
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(gpt_key, llama_key, gemini_key, variant="primary")
|
160 |
|
161 |
with gr.Column(scale=2, min_width=600):
|
162 |
-
gr.Markdown("### Hello, Welcome to the GUI by Team #9.")
|
163 |
temperature = gr.Slider(0.0, 1.0, value=0.7, step = 0.01, label="Temperature", info="Set the Temperature")
|
164 |
top_p = gr.Slider(1, 10, value=3, step = 1, label="top-p value", info="Set the sampling nucleus parameter")
|
165 |
symptoms = gr.Textbox(label="Add the symptom data in the input to receive diagnosis")
|
|
|
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 based on the symptoms they provided."},
|
56 |
{"role": "user", "content": prompt}],
|
57 |
temperature=temperature,
|
58 |
max_tokens=50,
|
|
|
109 |
majority_output, majority_count = output_counts.most_common(1)[0]
|
110 |
confidence = (majority_count / len(outputs)) * 100
|
111 |
else:
|
112 |
+
majority_output = "Please add the symptoms data to start the ranking process."
|
113 |
confidence = 0
|
114 |
|
115 |
return majority_output, confidence
|
|
|
152 |
llama_key.input(fn=api_check_msg, inputs=[llama_key, gr.Textbox(value="Llama", visible=False)], outputs=status_message)
|
153 |
status_message = gr.HTML(label="Validation Status")
|
154 |
gemini_key.input(fn=api_check_msg, inputs=[gemini_key, gr.Textbox(value="Gemini", visible=False)], outputs=status_message)
|
155 |
+
gr.Textbox(label="Don't have an LLM key? Get one through the below links.", type="text")
|
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(gpt_key, llama_key, gemini_key, variant="primary")
|
160 |
|
161 |
with gr.Column(scale=2, min_width=600):
|
162 |
+
gr.Markdown("### Hello, Welcome to the GUI by Team #9. This is the ranking API.")
|
163 |
temperature = gr.Slider(0.0, 1.0, value=0.7, step = 0.01, label="Temperature", info="Set the Temperature")
|
164 |
top_p = gr.Slider(1, 10, value=3, step = 1, label="top-p value", info="Set the sampling nucleus parameter")
|
165 |
symptoms = gr.Textbox(label="Add the symptom data in the input to receive diagnosis")
|