Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,9 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
|
|
3 |
|
4 |
def CustomChatGPT(user_input):
|
5 |
messages.append({"role": "user", "content": enter_input_here})
|
@@ -10,6 +14,7 @@ def CustomChatGPT(user_input):
|
|
10 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
11 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
12 |
return ChatGPT_reply
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
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 a financial experts that specializes in real estate investment and negotiation"}]
|
7 |
|
8 |
def CustomChatGPT(user_input):
|
9 |
messages.append({"role": "user", "content": enter_input_here})
|
|
|
14 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
15 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
16 |
return ChatGPT_reply
|
17 |
+
|
18 |
+
demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "Real Estate Pro")
|
19 |
+
|
20 |
+
demo.launch(share=True)
|