Spaces:
Runtime error
Runtime error
Dagfinn1962
commited on
Commit
•
f0223fa
1
Parent(s):
d0b412a
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
import time
|
2 |
import logging
|
3 |
import gradio as gr
|
|
|
4 |
from src.llm_boilers import llm_boiler
|
5 |
|
|
|
6 |
logging.basicConfig(format="%(asctime)s - %(message)s", level=logging.INFO)
|
7 |
logging.warning("READY. App started...")
|
8 |
|
@@ -109,26 +111,12 @@ def call_inf_server(prompt, openai_key):
|
|
109 |
return response
|
110 |
|
111 |
|
112 |
-
|
113 |
-
theme=gr.themes.
|
114 |
-
secondary_hue=gr.themes.Color(secondary_100="#736c1c", secondary_200="#716823", secondary_300="#fde047", secondary_400="#facc15", secondary_50="#f2e821", secondary_500="#eab308", secondary_600="#ca8a04", secondary_700="#a16207", secondary_800="#854d0e", secondary_900="#713f12", secondary_950="#653b12"),
|
115 |
-
neutral_hue=gr.themes.Color(neutral_100="#2a1304", neutral_200="#e7e5e4", neutral_300="#d6d3d1", neutral_400="#a8a29e", neutral_50="#97ae29", neutral_500="#78716c", neutral_600="#57534e", neutral_700="#44403c", neutral_800="#292524", neutral_900="#1c1917", neutral_950="#0f0e0d"),
|
116 |
-
text_size="text_lg",
|
117 |
-
spacing_size="spacing_md",
|
118 |
-
radius_size=gr.themes.Size(radius_lg="8px", radius_md="6px", radius_sm="4px", radius_xl="12px", radius_xs="2px", radius_xxl="22px", radius_xxs="5px"),
|
119 |
-
font=[gr.themes.GoogleFont('Optima'), gr.themes.GoogleFont('Candara'), gr.themes.GoogleFont('Noto Sans'), gr.themes.GoogleFont('source-sans-pro')],
|
120 |
-
font_mono=[gr.themes.GoogleFont('IBM Plex Mono'), gr.themes.GoogleFont('ui-monospace'), gr.themes.GoogleFont('Consolas'), gr.themes.GoogleFont('monospace')],
|
121 |
-
).set(
|
122 |
-
body_background_fill='*primary_500',
|
123 |
-
body_background_fill_dark='*primary_50',
|
124 |
-
background_fill_primary='*primary_50',
|
125 |
-
background_fill_primary_dark='*primary_50'
|
126 |
-
)),
|
127 |
css=".disclaimer {font-variant-caps: all-small-caps;}",
|
128 |
) as demo:
|
129 |
gr.Markdown(
|
130 |
"""<h1><center>Chat with gpt-3.5-turbo</center></h1>
|
131 |
-
|
132 |
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.
|
133 |
"""
|
134 |
)
|
@@ -137,10 +125,10 @@ def call_inf_server(prompt, openai_key):
|
|
137 |
with gr.Column():
|
138 |
# to do: change to openaikey input for public release
|
139 |
openai_key = gr.Textbox(
|
140 |
-
|
141 |
-
value="
|
142 |
type="password",
|
143 |
-
placeholder="
|
144 |
info="You have to provide your own OpenAI API key.",
|
145 |
)
|
146 |
chatbot = gr.Chatbot().style(height=400)
|
@@ -232,4 +220,4 @@ def call_inf_server(prompt, openai_key):
|
|
232 |
)
|
233 |
|
234 |
|
235 |
-
demo.queue(max_size=36, concurrency_count=14).launch(debug=True)
|
|
|
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 |
)
|
|
|
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)
|
|
|
220 |
)
|
221 |
|
222 |
|
223 |
+
demo.queue(max_size=36, concurrency_count=14).launch(debug=True)
|