Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def greet(name):
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
-
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
3 |
|
4 |
+
def CustomChatGPT(user_input):
|
5 |
+
messages.append({"role": "user", "content": enter_input_here})
|
6 |
+
response = openai.ChatCompletion.create(
|
7 |
+
model = "gpt-3.5-turbo",
|
8 |
+
messages = messages
|
9 |
+
)
|
10 |
+
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
11 |
+
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
12 |
+
return ChatGPT_reply
|
13 |
+
|
14 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
15 |
+
iface.launch(share=True)
|