Ivan Roman commited on
Commit
f2d8bf0
·
1 Parent(s): 247eb76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import openai
2
- import gradio
3
 
4
  openai.api_key = "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"
5
 
@@ -16,8 +16,17 @@ def CustomChatGPT(user_input):
16
  messages.append({"role": "assistant", "content": ChatGPT_reply})
17
  return ChatGPT_reply
18
 
19
- description="Welcome to CannaAssist AI Assistant! This chatbot is designed to help answer your questions related to BioTrack and the cannabis regulations in New Mexico. Simply type your question or message in the input box and get an informative response from the assistant."
 
 
 
 
 
 
 
 
 
 
 
20
 
21
- demo = gradio.Interface(fn=CustomChatGPT, inputs="text", outputs="text", title="BioTrack AI Assistant", description=description)
22
-
23
- demo.launch()
 
1
  import openai
2
+ import gradio as gr
3
 
4
  openai.api_key = "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"
5
 
 
16
  messages.append({"role": "assistant", "content": ChatGPT_reply})
17
  return ChatGPT_reply
18
 
19
+ iface = gr.Interface(
20
+ fn=CustomChatGPT,
21
+ inputs=gr.inputs.Textbox(lines=5, placeholder='Type here...'),
22
+ outputs="text",
23
+ title="BioTrack AI Assistant",
24
+ description="This is a BioTrack AI Assistant. You can ask any questions related to BioTrack and cannabis regulations in New Mexico.",
25
+ examples=[
26
+ ["What is BioTrack?"],
27
+ ["Tell me about cannabis regulations in New Mexico."]
28
+ ],
29
+ theme="huggingface"
30
+ )
31
 
32
+ iface.launch()