Gopala Krishna commited on
Commit
4655007
1 Parent(s): 34564f3

Working Clean

Browse files
Files changed (2) hide show
  1. .vs/MyChatGPTTurbo/v17/.wsuo +0 -0
  2. app.py +3 -40
.vs/MyChatGPTTurbo/v17/.wsuo CHANGED
Binary files a/.vs/MyChatGPTTurbo/v17/.wsuo and b/.vs/MyChatGPTTurbo/v17/.wsuo differ
 
app.py CHANGED
@@ -1,41 +1,4 @@
1
- #import os
2
- #import openai
3
- #import gradio as gr
4
-
5
- #try:
6
- # openai.api_key = os.environ["OPENAI_API_KEY"]
7
-
8
- #except KeyError:
9
- # error_message = "System is at capacity right now.Please try again later"
10
- # print(error_message)
11
- # def chatbot(input):
12
- # return error_message
13
- #else:
14
- # messages = [
15
- # {"role": "system", "content": "My AI Assistant"},
16
- # ]
17
-
18
- #def chatbot(input):
19
- # try:
20
- # if input:
21
- # messages.append({"role": "user", "content": input})
22
- # chat = openai.ChatCompletion.create(
23
- # model="gpt-3.5-turbo", messages=messages
24
- # )
25
- # reply = chat.choices[0].message.content
26
- # messages.append({"role": "assistant", "content": reply})
27
- # return reply
28
- # except openai.error.OpenAIError as e:
29
- # return "System is at capacity right now.Please try again later"
30
- #iface = gr.Interface(
31
- # fn=chatbot,
32
- # inputs=gr.inputs.Textbox(lines=7, label="Query"),
33
- # outputs=gr.outputs.Textbox(label="Response"),
34
- # theme=gr.themes.Default(primary_hue="slate"))
35
- #iface.launch()
36
-
37
-
38
- import os
39
  import gradio as gr
40
  import json
41
  import requests
@@ -142,13 +105,13 @@ def reset_chat(chatbot, state):
142
  return None, []
143
 
144
  with gr.Blocks(css="""#col_container {width: 1000px; margin-left: auto; margin-right: auto;}
145
- #chatgpt {height: 700px; overflow: auto;}} """, theme=gr.themes.Default(primary_hue="slate") ) as demo:
146
  with gr.Row():
147
  with gr.Column(scale=14):
148
  with gr.Box():
149
  with gr.Row():
150
  with gr.Column(scale=13):
151
- inputs = gr.Textbox(label="Ask anything ⤵️ " )
152
  with gr.Column(scale=1):
153
  b1 = gr.Button('Submit', elem_id = 'submit').style(full_width=True)
154
  b2 = gr.Button('Clear', elem_id = 'clear').style(full_width=True)
 
1
+ import os
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  import gradio as gr
3
  import json
4
  import requests
 
105
  return None, []
106
 
107
  with gr.Blocks(css="""#col_container {width: 1000px; margin-left: auto; margin-right: auto;}
108
+ #chatgpt {height: 400px; overflow: auto;}} """, theme=gr.themes.Default(primary_hue="slate") ) as demo:
109
  with gr.Row():
110
  with gr.Column(scale=14):
111
  with gr.Box():
112
  with gr.Row():
113
  with gr.Column(scale=13):
114
+ inputs = gr.Textbox(label="Ask me anything ⤵️ Try: Value of pi" )
115
  with gr.Column(scale=1):
116
  b1 = gr.Button('Submit', elem_id = 'submit').style(full_width=True)
117
  b2 = gr.Button('Clear', elem_id = 'clear').style(full_width=True)