Spaces:
Build error
Build error
Fix CSS Title Error, Add Image
Browse files
app.py
CHANGED
|
@@ -54,9 +54,10 @@ def get_similar_quotes(philosopher, question):
|
|
| 54 |
return top3quotes
|
| 55 |
|
| 56 |
def main(question, philosopher):
|
| 57 |
-
|
|
|
|
| 58 |
|
| 59 |
-
with gr.Blocks(css=".gradio-container {background-image: url('file=mountains_resized.jpg')} #title{color: white}") as demo:
|
| 60 |
gr.Markdown("""
|
| 61 |
# Ask a Philsopher
|
| 62 |
""", elem_id="title"
|
|
@@ -65,6 +66,7 @@ with gr.Blocks(css=".gradio-container {background-image: url('file=mountains_res
|
|
| 65 |
with gr.Column():
|
| 66 |
inp1 = gr.Textbox(placeholder="Place your question here...", label="Ask a question")
|
| 67 |
inp2 = gr.Dropdown(choices=["stoic", "krishnamurti"], value="stoic", label="Choose a philosopher")
|
|
|
|
| 68 |
|
| 69 |
with gr.Column():
|
| 70 |
out1 = gr.Textbox(
|
|
@@ -78,6 +80,6 @@ with gr.Blocks(css=".gradio-container {background-image: url('file=mountains_res
|
|
| 78 |
interactive=False,
|
| 79 |
wrap=True)
|
| 80 |
btn = gr.Button("Run")
|
| 81 |
-
btn.click(fn=main, inputs=[inp1,inp2], outputs=[out1,out2])
|
| 82 |
|
| 83 |
demo.launch()
|
|
|
|
| 54 |
return top3quotes
|
| 55 |
|
| 56 |
def main(question, philosopher):
|
| 57 |
+
out_image = "marcus-aurelius.jpg"
|
| 58 |
+
return ask_philosopher(philosopher, question), get_similar_quotes(philosopher, question), out_image
|
| 59 |
|
| 60 |
+
with gr.Blocks(css=".gradio-container {background-image: url('file=mountains_resized.jpg')} #title {color: white}") as demo:
|
| 61 |
gr.Markdown("""
|
| 62 |
# Ask a Philsopher
|
| 63 |
""", elem_id="title"
|
|
|
|
| 66 |
with gr.Column():
|
| 67 |
inp1 = gr.Textbox(placeholder="Place your question here...", label="Ask a question")
|
| 68 |
inp2 = gr.Dropdown(choices=["stoic", "krishnamurti"], value="stoic", label="Choose a philosopher")
|
| 69 |
+
out_image = gr.Image()
|
| 70 |
|
| 71 |
with gr.Column():
|
| 72 |
out1 = gr.Textbox(
|
|
|
|
| 80 |
interactive=False,
|
| 81 |
wrap=True)
|
| 82 |
btn = gr.Button("Run")
|
| 83 |
+
btn.click(fn=main, inputs=[inp1,inp2], outputs=[out1,out2,out_image])
|
| 84 |
|
| 85 |
demo.launch()
|