Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ openai.api_key = os.getenv('OPENAI_API_KEY')
|
|
11 |
# Pricing constants
|
12 |
INPUT_COST_PER_TOKEN = 0.50 / 1_000_000
|
13 |
OUTPUT_COST_PER_TOKEN = 1.50 / 1_000_000
|
14 |
-
|
15 |
def print_like_dislike(x: gr.LikeData):
|
16 |
print(x.index, x.value, x.liked)
|
17 |
|
@@ -169,7 +169,7 @@ css = """
|
|
169 |
|
170 |
|
171 |
# Initial example questions from the initialization
|
172 |
-
|
173 |
|
174 |
with gr.Blocks(css=css) as demo:
|
175 |
examples_state = gr.State([])
|
@@ -199,6 +199,12 @@ with gr.Blocks(css=css) as demo:
|
|
199 |
label="Initial Question"
|
200 |
)
|
201 |
initialize_button = gr.Button("Initialize Chat")
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
|
203 |
with gr.Column(scale=1, elem_id="chat-container"):
|
204 |
chatbot = gr.Chatbot(
|
|
|
11 |
# Pricing constants
|
12 |
INPUT_COST_PER_TOKEN = 0.50 / 1_000_000
|
13 |
OUTPUT_COST_PER_TOKEN = 1.50 / 1_000_000
|
14 |
+
|
15 |
def print_like_dislike(x: gr.LikeData):
|
16 |
print(x.index, x.value, x.liked)
|
17 |
|
|
|
169 |
|
170 |
|
171 |
# Initial example questions from the initialization
|
172 |
+
questions = [["I'm 14 years old girl living in Utar Pradesh show where I can take HPV vaccine and more information about the HPV"], ["I'm 14 years old female and want to become a graphic designer. I'm living in Uttar Pradesh in India. How can I start?"],["Im a 15 years old bout living in New Delhi how i can lear more about the climate change and What I can do myself?"]]
|
173 |
|
174 |
with gr.Blocks(css=css) as demo:
|
175 |
examples_state = gr.State([])
|
|
|
199 |
label="Initial Question"
|
200 |
)
|
201 |
initialize_button = gr.Button("Initialize Chat")
|
202 |
+
|
203 |
+
question_examples = gr.Examples(
|
204 |
+
examples = questions,
|
205 |
+
input = initial_question_input,
|
206 |
+
label = "Intial Questions"
|
207 |
+
)
|
208 |
|
209 |
with gr.Column(scale=1, elem_id="chat-container"):
|
210 |
chatbot = gr.Chatbot(
|