jblocher commited on
Commit
3c54aee
·
1 Parent(s): 3dffda6

trying an intro

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -18,8 +18,9 @@ Begin by asking me my name, the topic of our conversation, and the type of assig
18
  #model = "gpt-3.5-turbo" # free and fast
19
  #model = "gpt-4" # latest and greatest
20
 
21
- def CustomChatGPT(message, history):
22
  history_openai_format = [{"role": "system", "content": sys_message}]
 
23
  for human, assistant in history:
24
  history_openai_format.append({"role": "user", "content": human})
25
  history_openai_format.append({"role": "assistant", "content": assistant})
@@ -38,7 +39,11 @@ def CustomChatGPT(message, history):
38
  partial_message = partial_message + chunk['choices'][0]['delta']['content']
39
  yield partial_message
40
 
41
- gradio.ChatInterface(fn=CustomChatGPT, theme = 'gradio/soft', title = "Blocher Family Middle School AI Tutor").queue().launch()
 
 
 
 
42
 
43
 
44
 
 
18
  #model = "gpt-3.5-turbo" # free and fast
19
  #model = "gpt-4" # latest and greatest
20
 
21
+ def CustomChatGPT(message, history, user_name):
22
  history_openai_format = [{"role": "system", "content": sys_message}]
23
+ history_openai_format.append({"role": "assistant", "content": f"Hi, '{dd}', what would you like to talk about today?"})
24
  for human, assistant in history:
25
  history_openai_format.append({"role": "user", "content": human})
26
  history_openai_format.append({"role": "assistant", "content": assistant})
 
39
  partial_message = partial_message + chunk['choices'][0]['delta']['content']
40
  yield partial_message
41
 
42
+ # set which Blocher kid it is
43
+ dd = gradio.Dropdown(choices=["Claire","Will","Sam","Miles"],label="Your Name",show_label=True,)
44
+
45
+ gradio.ChatInterface(fn=CustomChatGPT, additional_inputs = [dd],
46
+ theme = 'gradio/soft', title = "Blocher Family Middle School AI Tutor").queue().launch()
47
 
48
 
49