Gopala Krishna commited on
Commit
a882137
1 Parent(s): 7cb143b

initial commit

Browse files
.vs/MyChatGPTTurbo/FileContentIndex/575a833f-9206-4d99-9060-e54f87d1354f.vsidx ADDED
Binary file (127 Bytes). View file
 
.vs/MyChatGPTTurbo/FileContentIndex/a3a27069-9725-4970-9e9b-a70449614ce6.vsidx ADDED
Binary file (4.96 kB). View file
 
.vs/MyChatGPTTurbo/FileContentIndex/d624c5a3-56bf-478d-8d61-2879288291d7.vsidx ADDED
Binary file (4.75 kB). View file
 
.vs/MyChatGPTTurbo/FileContentIndex/read.lock ADDED
File without changes
.vs/MyChatGPTTurbo/v17/.wsuo ADDED
Binary file (21.5 kB). View file
 
.vs/VSWorkspaceState.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "ExpandedNodes": [
3
+ ""
4
+ ],
5
+ "SelectedNode": "\\C:\\Python\\Programs\\Gradio\\HuggingSpace\\MyChatGPTTurbo",
6
+ "PreviewInSolutionExplorer": false
7
+ }
.vs/slnx.sqlite ADDED
Binary file (90.1 kB). View file
 
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import openai
2
+ import gradio as gr
3
+
4
+ openai.api_key = "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"
5
+
6
+ messages = [
7
+ {"role": "system", "content": "My AI Assistant"},
8
+ ]
9
+
10
+ def chatbot(input):
11
+ if input:
12
+ messages.append({"role": "user", "content": input})
13
+ chat = openai.ChatCompletion.create(
14
+ model="gpt-3.5-turbo", messages=messages
15
+ )
16
+ reply = chat.choices[0].message.content
17
+ messages.append({"role": "assistant", "content": reply})
18
+ return reply
19
+
20
+ inputs = gr.inputs.Textbox(lines=7, label="Query")
21
+ outputs = gr.outputs.Textbox(label="Response")
22
+
23
+ gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="My ChatGPT Turbo",
24
+ theme="compact").launch()
25
+
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ openai