Spaces:
Sleeping
Sleeping
Gbssreejith
commited on
Commit
•
57c78bf
1
Parent(s):
7908bd6
Update app.py
Browse files
app.py
CHANGED
@@ -459,6 +459,16 @@ def generate_text(prompt_text, max_length=50, temperature=0.7, top_k=50, top_p=0
|
|
459 |
wp_responses = re.split(r"\[WP\].*?\n|\[RESPONSE\]", generated_text)[1:]
|
460 |
return wp_responses[1]
|
461 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
# Define the Gradio interface using Blocks
|
463 |
with gr.Blocks() as demo:
|
464 |
with gr.Row():
|
@@ -481,4 +491,10 @@ with gr.Blocks() as demo:
|
|
481 |
outputs=output_text
|
482 |
)
|
483 |
|
|
|
|
|
|
|
|
|
|
|
|
|
484 |
demo.launch(share=True,debug=True)
|
|
|
459 |
wp_responses = re.split(r"\[WP\].*?\n|\[RESPONSE\]", generated_text)[1:]
|
460 |
return wp_responses[1]
|
461 |
|
462 |
+
|
463 |
+
# Define example prompts
|
464 |
+
examples = [
|
465 |
+
"What is the classical conceptualisation of oxidation and reduction in redox reactions?",
|
466 |
+
"What is the difference between alkenes and alkynes in terms of reactivity?",
|
467 |
+
"What is the first law of thermodynamics in thermodynamics?",
|
468 |
+
"What is a popular type of vending machine in banking services?",
|
469 |
+
"What has the worldwide campaign against smallpox led to?"
|
470 |
+
]
|
471 |
+
|
472 |
# Define the Gradio interface using Blocks
|
473 |
with gr.Blocks() as demo:
|
474 |
with gr.Row():
|
|
|
491 |
outputs=output_text
|
492 |
)
|
493 |
|
494 |
+
gr.Examples(
|
495 |
+
examples=examples,
|
496 |
+
inputs=prompt,
|
497 |
+
)
|
498 |
+
|
499 |
+
|
500 |
demo.launch(share=True,debug=True)
|