Dagfinn1962 commited on
Commit
2614d13
1 Parent(s): a1974cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -28
app.py CHANGED
@@ -1,8 +1,10 @@
1
- import gradio as gr
2
- import openai
3
- import os
4
  import time
5
  import logging
 
 
 
 
 
6
  logging.basicConfig(format="%(asctime)s - %(message)s", level=logging.INFO)
7
  logging.warning("READY. App started...")
8
 
@@ -109,35 +111,26 @@ def call_inf_server(prompt, openai_key):
109
  return response
110
 
111
 
112
- with gr.Blocks(theme='HaleyCH/HaleyCH_Theme') as demo:
113
- # org :
114
- #theme=gr.themes.Glass(
115
- #primary_hue="lime",
116
- #secondary_hue="emerald",
117
- #neutral_hue="zinc",
118
-
119
-
120
-
121
  gr.Markdown(
122
- """
123
- <br><h1><center>Chat with gpt-3.5-turbo</center></h1>
124
- This is a lightweight gpt-3.5-turbo conversation
125
- completion.
126
  """
127
- )
128
  conversation = Chat()
129
  with gr.Row():
130
  with gr.Column():
131
  # to do: change to openaikey input for public release
132
  openai_key = gr.Textbox(
133
- label="",
134
- value="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",
135
  type="password",
136
- placeholder="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",
137
- info="",
138
- show_label=False,
139
  )
140
-
141
  chatbot = gr.Chatbot().style(height=400)
142
  with gr.Row():
143
  with gr.Column():
@@ -172,11 +165,6 @@ with gr.Blocks(theme='HaleyCH/HaleyCH_Theme') as demo:
172
  "biased, or otherwise offensive outputs.",
173
  elem_classes=["disclaimer"],
174
  )
175
- with gr.Row():
176
- gr.Markdown(
177
- "[Privacy policy](https://gist.github.com/samhavens/c29c68cdcd420a9aa0202d0839876dac)",
178
- elem_classes=["disclaimer"],
179
- )
180
 
181
  submit_event = msg.submit(
182
  fn=conversation.user_turn,
 
 
 
 
1
  import time
2
  import logging
3
+ import gradio as gr
4
+
5
+ from src.llm_boilers import llm_boiler
6
+
7
+
8
  logging.basicConfig(format="%(asctime)s - %(message)s", level=logging.INFO)
9
  logging.warning("READY. App started...")
10
 
 
111
  return response
112
 
113
 
114
+ with gr.Blocks(
115
+ theme=gr.themes.Soft(),
116
+ css=".disclaimer {font-variant-caps: all-small-caps;}",
117
+ ) as demo:
 
 
 
 
 
118
  gr.Markdown(
119
+ """<h1><center>Chat with gpt-3.5-turbo</center></h1>
120
+ This is a lightweight demo of gpt-3.5-turbo conversation completion. It was designed as a template for in-context learning applications to be built on top of.
 
 
121
  """
122
+ )
123
  conversation = Chat()
124
  with gr.Row():
125
  with gr.Column():
126
  # to do: change to openaikey input for public release
127
  openai_key = gr.Textbox(
128
+ label="OpenAI Key",
129
+ value="",
130
  type="password",
131
+ placeholder="sk..",
132
+ info="You have to provide your own OpenAI API key.",
 
133
  )
 
134
  chatbot = gr.Chatbot().style(height=400)
135
  with gr.Row():
136
  with gr.Column():
 
165
  "biased, or otherwise offensive outputs.",
166
  elem_classes=["disclaimer"],
167
  )
 
 
 
 
 
168
 
169
  submit_event = msg.submit(
170
  fn=conversation.user_turn,