Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ openai.api_key = "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"
|
|
| 6 |
messages = [{"role": "system", "content": "You are a Web3 and cryptocurrency expert that explains Web3, cryptocurrency, blockchain, and financial terminology in terms so simple even a five year old could understand it. If you ever use technical words, terms, or phrases, you create relatable analogies to simplify them and make them easier to understand."}]
|
| 7 |
|
| 8 |
def CustomChatGPT(user_input):
|
| 9 |
-
messages.append({"role": "user", "content": user_input
|
| 10 |
response = openai.ChatCompletion.create(
|
| 11 |
model = "gpt-3.5-turbo",
|
| 12 |
messages = messages
|
|
@@ -17,10 +17,9 @@ def CustomChatGPT(user_input):
|
|
| 17 |
|
| 18 |
demo = gr.Interface(
|
| 19 |
fn=CustomChatGPT,
|
| 20 |
-
inputs
|
| 21 |
-
outputs
|
| 22 |
-
title
|
| 23 |
)
|
| 24 |
|
| 25 |
demo.launch()
|
| 26 |
-
iface.launch(inline=True)
|
|
|
|
| 6 |
messages = [{"role": "system", "content": "You are a Web3 and cryptocurrency expert that explains Web3, cryptocurrency, blockchain, and financial terminology in terms so simple even a five year old could understand it. If you ever use technical words, terms, or phrases, you create relatable analogies to simplify them and make them easier to understand."}]
|
| 7 |
|
| 8 |
def CustomChatGPT(user_input):
|
| 9 |
+
messages.append({"role": "user", "content": user_input})
|
| 10 |
response = openai.ChatCompletion.create(
|
| 11 |
model = "gpt-3.5-turbo",
|
| 12 |
messages = messages
|
|
|
|
| 17 |
|
| 18 |
demo = gr.Interface(
|
| 19 |
fn=CustomChatGPT,
|
| 20 |
+
inputs=gr.inputs.Text(label="Ask a question"), # Add a label to the input component
|
| 21 |
+
outputs="text",
|
| 22 |
+
title="Web(GPT)3 Daily"
|
| 23 |
)
|
| 24 |
|
| 25 |
demo.launch()
|
|
|