Spaces:
Runtime error
Runtime error
Commit
·
44a69ed
1
Parent(s):
5ebac65
Delete app.py
Browse files
app.py
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
import openai
|
2 |
-
import gradio as gr
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
openai.api_key = "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"
|
7 |
-
|
8 |
-
messages = [{"role": "system", "content": "You are a financial experts that specializes in real estate investment and negotiation"}]
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
def CustomChatGPT(user_input):
|
14 |
-
messages.append({"role": "user", "content": user_input})
|
15 |
-
response = openai.ChatCompletion.create(
|
16 |
-
model = "gpt-3.5-turbo",
|
17 |
-
messages = messages
|
18 |
-
)
|
19 |
-
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
20 |
-
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
21 |
-
return ChatGPT_reply
|
22 |
-
|
23 |
-
iface = gr.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "basit cyberwala gpt")
|
24 |
-
iface.launch()
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|