Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,9 @@ tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
|
|
16 |
model = openai.api_key = os.environ["OAPI_KEY"]
|
17 |
|
18 |
# Define the initial message and messages list
|
19 |
-
initial_message = {"role": "system", "content": 'You are a USMLE Tutor. Respond with ALWAYS layered "bullet points" (listing rather than sentences)
|
|
|
|
|
20 |
messages = [initial_message]
|
21 |
|
22 |
# Define the answer counter
|
@@ -118,7 +120,7 @@ def transcribe(audio, text):
|
|
118 |
notion_df.upload(df, 'https://www.notion.so/YENA-be569d0a40c940e7b6e0679318215790?pvs=4', title=str(published_date), api_key=API_KEY)
|
119 |
|
120 |
# Return the chat transcript
|
121 |
-
return system_message
|
122 |
|
123 |
# Define the input and output components for Gradio
|
124 |
audio_input = Audio(source="microphone", type="filepath", label="Record your message")
|
@@ -132,7 +134,7 @@ iface = gr.Interface(
|
|
132 |
inputs=[audio_input, text_input],
|
133 |
outputs=[output_text],
|
134 |
title="Your Excellence Never Abates (YENA)",
|
135 |
-
description="Talk to the AI Tutor YENA",
|
136 |
theme="compact",
|
137 |
layout="vertical",
|
138 |
allow_flagging=False
|
|
|
16 |
model = openai.api_key = os.environ["OAPI_KEY"]
|
17 |
|
18 |
# Define the initial message and messages list
|
19 |
+
initial_message = {"role": "system", "content": 'You are a USMLE Tutor. Respond with ALWAYS layered "bullet points" (listing rather than sentences) \
|
20 |
+
to all input with a fun mneumonics to memorize that list. But you can answer up to 1200 words if the user requests longer response. \
|
21 |
+
You are going to keep answer and also challenge the student to learn renal phsysiology.'}
|
22 |
messages = [initial_message]
|
23 |
|
24 |
# Define the answer counter
|
|
|
120 |
notion_df.upload(df, 'https://www.notion.so/YENA-be569d0a40c940e7b6e0679318215790?pvs=4', title=str(published_date), api_key=API_KEY)
|
121 |
|
122 |
# Return the chat transcript
|
123 |
+
return system_message['content']
|
124 |
|
125 |
# Define the input and output components for Gradio
|
126 |
audio_input = Audio(source="microphone", type="filepath", label="Record your message")
|
|
|
134 |
inputs=[audio_input, text_input],
|
135 |
outputs=[output_text],
|
136 |
title="Your Excellence Never Abates (YENA)",
|
137 |
+
description="Talk to the AI Renal Tutor YENA",
|
138 |
theme="compact",
|
139 |
layout="vertical",
|
140 |
allow_flagging=False
|