CannaTech commited on
Commit
ed3eff1
·
1 Parent(s): e13f8b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,8 +1,10 @@
1
  import openai
2
  import gradio as gr
3
 
4
- openai.api_key = "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
 
5
  messages = [{"role": "system", "content": "You are an expert in Technical Support and Customer Service that specializes in New Mexico Cannabis Regulatory Compliance and training people how to use software called BioTrack"}]
 
6
  def CustomChatGPT(category, user_input):
7
  user_input = "In the context of {category} specifically and using your expertise and knowledge of cannabis regulations in New Mexico and BioTrack" + user_input
8
  messages.append({"role": "user", "content": user_input})
@@ -13,6 +15,7 @@ def CustomChatGPT(category, user_input):
13
  ChatGPT_reply = response["choices"][0]["message"]["content"]
14
  messages.append({"role": "assistant", "content": ChatGPT_reply})
15
  return ChatGPT_reply
 
16
  iface = gr.Interface(
17
  fn=CustomChatGPT,
18
  inputs=[gr.inputs.Dropdown(choices=['BioTrack', 'Regulations', 'Best Practices', 'General Question'], label='Category'), gr.inputs.Textbox(lines=1, placeholder='Type here...', label='Your Question')],
@@ -27,6 +30,6 @@ iface = gr.Interface(
27
  ],
28
  theme="huggingface"
29
  )
30
- iface.launch()
31
 
 
32
 
 
1
  import openai
2
  import gradio as gr
3
 
4
+ openai.api_key = "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"
5
+
6
  messages = [{"role": "system", "content": "You are an expert in Technical Support and Customer Service that specializes in New Mexico Cannabis Regulatory Compliance and training people how to use software called BioTrack"}]
7
+
8
  def CustomChatGPT(category, user_input):
9
  user_input = "In the context of {category} specifically and using your expertise and knowledge of cannabis regulations in New Mexico and BioTrack" + user_input
10
  messages.append({"role": "user", "content": user_input})
 
15
  ChatGPT_reply = response["choices"][0]["message"]["content"]
16
  messages.append({"role": "assistant", "content": ChatGPT_reply})
17
  return ChatGPT_reply
18
+
19
  iface = gr.Interface(
20
  fn=CustomChatGPT,
21
  inputs=[gr.inputs.Dropdown(choices=['BioTrack', 'Regulations', 'Best Practices', 'General Question'], label='Category'), gr.inputs.Textbox(lines=1, placeholder='Type here...', label='Your Question')],
 
30
  ],
31
  theme="huggingface"
32
  )
 
33
 
34
+ iface.launch()
35