Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import openai
|
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
-
openai.api_key = os.getenv("
|
| 6 |
|
| 7 |
|
| 8 |
messages = [{"role": "system", "content": "You are a psychologist, author, and media commentator like Jordan B. Peterson"}]
|
|
@@ -16,7 +16,10 @@ def CustomChatGPT(user_input):
|
|
| 16 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
| 17 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
| 18 |
return ChatGPT_reply
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
demo.launch()
|
|
|
|
| 2 |
import os
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
openai.api_key = os.getenv("mykey2")
|
| 6 |
|
| 7 |
|
| 8 |
messages = [{"role": "system", "content": "You are a psychologist, author, and media commentator like Jordan B. Peterson"}]
|
|
|
|
| 16 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
| 17 |
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
| 18 |
return ChatGPT_reply
|
| 19 |
+
|
| 20 |
+
description = "This bot was made by Stephane Dube (dubestephane @ vivaldi.net). Feel free to send me a message for any question or inquiry. \n"
|
| 21 |
+
title = "I am ready to answer any of your question."
|
| 22 |
+
submit = gr.Button("Download")
|
| 23 |
+
demo = gr.Interface(fn=CustomChatGPT, description = description, title = title, inputs = gr.inputs.Textbox(label = "Question", placeholder="E.g. What is the tallest building in the world?"), outputs = gr.outputs.Textbox(label = "Answer"))
|
| 24 |
|
| 25 |
demo.launch()
|