Spaces:
Runtime error
Runtime error
Commit
·
813a71e
1
Parent(s):
16af54d
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ If a question does not make any sense, or is not factually coherent, explain why
|
|
| 14 |
|
| 15 |
# Define the conversation history
|
| 16 |
conversation_history = []
|
| 17 |
-
|
| 18 |
|
| 19 |
def generate_response(input_text):
|
| 20 |
global conversation_history
|
|
@@ -26,12 +26,29 @@ def generate_response(input_text):
|
|
| 26 |
|
| 27 |
return response_text
|
| 28 |
# Create a Gradio interface
|
| 29 |
-
gr.
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Define the conversation history
|
| 16 |
conversation_history = []
|
| 17 |
+
css = ".generating {visibility: hidden}"
|
| 18 |
|
| 19 |
def generate_response(input_text):
|
| 20 |
global conversation_history
|
|
|
|
| 26 |
|
| 27 |
return response_text
|
| 28 |
# Create a Gradio interface
|
| 29 |
+
with gr.Blocks(analytics_enabled=False, css=css) as demo:
|
| 30 |
+
with gr.Column():
|
| 31 |
+
gr.Markdown(
|
| 32 |
+
""" ## Mistral-7b Version-2.0
|
| 33 |
+
|
| 34 |
+
Type in the box below and click the button to generate answers to your most pressing questions!
|
| 35 |
+
|
| 36 |
+
"""
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
with gr.Row():
|
| 40 |
+
|
| 41 |
+
with gr.Column(scale=3):
|
| 42 |
+
instruction = gr.Textbox(placeholder="Enter your question here", label="Question", elem_id="q-input")
|
| 43 |
+
|
| 44 |
+
with gr.Box():
|
| 45 |
+
gr.Markdown("**Answer**")
|
| 46 |
+
output = gr.Markdown(elem_id="q-output")
|
| 47 |
+
submit = gr.Button("Generate", variant="primary")
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
submit.click(generate_response, inputs=[instruction], outputs=[output])
|
| 52 |
+
instruction.submit(generate_response, inputs=[instruction], outputs=[output])
|
| 53 |
+
|
| 54 |
+
demo.queue(concurrency_count=1).launch(debug=False,share=True)
|