added description
Browse files
app.py
CHANGED
|
@@ -16,13 +16,22 @@ If I don't seem to be asking good questions, suggest questions I might ask.
|
|
| 16 |
Begin by asking me my name, the topic of our conversation, and the type of assignment I am working on.
|
| 17 |
"""
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
#model = "gpt-3.5-turbo" # free and fast
|
| 20 |
#model = "gpt-4" # latest and greatest, not yet available
|
| 21 |
|
| 22 |
def CustomChatGPT(message, history, user_name):
|
| 23 |
history_openai_format = [{"role": "system", "content": sys_message}]
|
| 24 |
-
history_openai_format.append({"role": "assistant", "content": "Hi, what is your name and what would you like to talk about today?"})
|
| 25 |
-
#history_openai_format.append({"role": "assistant", "content": f"Hi, '{dd}', what would you like to talk about today?"})
|
| 26 |
for human, assistant in history:
|
| 27 |
history_openai_format.append({"role": "user", "content": human})
|
| 28 |
history_openai_format.append({"role": "assistant", "content": assistant})
|
|
@@ -41,11 +50,10 @@ def CustomChatGPT(message, history, user_name):
|
|
| 41 |
partial_message = partial_message + chunk['choices'][0]['delta']['content']
|
| 42 |
yield partial_message
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
theme = 'gradio/soft', title = "Blocher Family Middle School AI Tutor").queue().launch()
|
| 49 |
|
| 50 |
|
| 51 |
|
|
|
|
| 16 |
Begin by asking me my name, the topic of our conversation, and the type of assignment I am working on.
|
| 17 |
"""
|
| 18 |
|
| 19 |
+
des = """
|
| 20 |
+
I am an interactive AI Chatbot to help you with your schoolwork. Start by saying Hi!
|
| 21 |
+
|
| 22 |
+
Tell me what topic you want to discuss and what kind of help you want. For example:
|
| 23 |
+
* I'm studying the Revolutionary War and I have a test I need to study for.
|
| 24 |
+
* I'm studying long division and I need to practice.
|
| 25 |
+
* I'm studying ancient India and I need some basic facts for a graphic organizer.
|
| 26 |
+
|
| 27 |
+
"""
|
| 28 |
+
|
| 29 |
+
|
| 30 |
#model = "gpt-3.5-turbo" # free and fast
|
| 31 |
#model = "gpt-4" # latest and greatest, not yet available
|
| 32 |
|
| 33 |
def CustomChatGPT(message, history, user_name):
|
| 34 |
history_openai_format = [{"role": "system", "content": sys_message}]
|
|
|
|
|
|
|
| 35 |
for human, assistant in history:
|
| 36 |
history_openai_format.append({"role": "user", "content": human})
|
| 37 |
history_openai_format.append({"role": "assistant", "content": assistant})
|
|
|
|
| 50 |
partial_message = partial_message + chunk['choices'][0]['delta']['content']
|
| 51 |
yield partial_message
|
| 52 |
|
| 53 |
+
gradio.ChatInterface(fn=CustomChatGPT,
|
| 54 |
+
theme = 'gradio/soft',
|
| 55 |
+
title = "Blocher Family Middle School AI Tutor"
|
| 56 |
+
description = des).queue().launch()
|
|
|
|
| 57 |
|
| 58 |
|
| 59 |
|