Spaces:
Runtime error
Runtime error
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 1 |
-
import openai
|
| 2 |
-
import gradio as gr
|
| 3 |
-
|
| 4 |
-
openai.api_key = "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"
|
| 5 |
-
|
| 6 |
-
messages=[{"role": "system", "content": "You are a Programming Expert"}]
|
| 7 |
-
|
| 8 |
-
def Custom_GPT(msg):
|
| 9 |
-
messages.append({"role": "user", "content": msg})
|
| 10 |
-
completion = openai.ChatCompletion.create(model='gpt-3.5-turbo', messages=messages)
|
| 11 |
-
response = completion.choices[0].message.content
|
| 12 |
-
messages.append({"role": "system", "content": response})
|
| 13 |
-
return response
|
| 14 |
-
|
| 15 |
-
demo = gr.Interface(fn=Custom_GPT, inputs="text", outputs="text", title="Coder Chatbot")
|
| 16 |
-
|
| 17 |
-
demo.launch(share=True)
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|