Spaces:
Build error
Build error
Ivan Roman
commited on
Commit
·
f2d8bf0
1
Parent(s):
247eb76
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
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()
|
|
|
|