Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
import openai
|
| 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 top engineer, quality management specialist"}]
|
| 9 |
|
| 10 |
def CustomChatGPT(user_input):
|
| 11 |
messages.append({"role": "user", "content": user_input})
|
|
@@ -22,4 +24,4 @@ title = "I am ready to answer any of your question."
|
|
| 22 |
|
| 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()
|
|
|
|
| 1 |
import openai
|
| 2 |
import os
|
| 3 |
+
import openai
|
| 4 |
+
import os
|
| 5 |
import gradio as gr
|
| 6 |
|
| 7 |
openai.api_key = os.getenv("mykey2")
|
| 8 |
|
| 9 |
+
messages = [{"role": "system", "content": "You are a genius like Albert Einstein"}]
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
def CustomChatGPT(user_input):
|
| 13 |
messages.append({"role": "user", "content": user_input})
|
|
|
|
| 24 |
|
| 25 |
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"))
|
| 26 |
|
| 27 |
+
demo.launch()
|