Spaces:
Build error
Build error
bilgeyucel
commited on
Commit
•
7c3f534
1
Parent(s):
3b27821
Improve UI further
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ Enter an OpenAI or Cohere key, choose your model and set the `max_length`.
|
|
24 |
Built by [Bilge Yucel](https://twitter.com/bilgeycl) and [Stefano Fiorucci](https://github.com/anakin87), with [Haystack](https://github.com/deepset-ai/haystack).
|
25 |
"""
|
26 |
|
27 |
-
with gr.Blocks() as demo:
|
28 |
gr.Markdown(value=description)
|
29 |
with gr.Row():
|
30 |
api_key = gr.Textbox(label="Enter your api key", type="password")
|
@@ -38,21 +38,23 @@ with gr.Blocks() as demo:
|
|
38 |
"Antibiotics are a type of medication used to treat bacterial infections. They work by either killing the bacteria or preventing them from reproducing, allowing the body’s immune system to fight off the infection. Antibiotics are usually taken orally in the form of pills, capsules, or liquid solutions, or sometimes administered intravenously. They are not effective against viral infections, and using them inappropriately can lead to antibiotic resistance. Explain the above in one sentence:",
|
39 |
"Please give a sentiment for this context. Answer with positive, negative or neutral. Context: A flicker in the dark started of interesting and I was glued to the novel. It was just a little longer that I had anticipated to get to the bottom of the story. I felt sorry for the Chloe's mother but I had thought there was something odd about her brother. Well being a murderer was it any wonder he did not like this sister's boyfriend because I think he knew what happened. I love the cover of the book and the title is good. If only hardbacks had the cover printed onto them. Answer:",
|
40 |
],
|
|
|
41 |
inputs=prompt,
|
42 |
-
label="Click on any example
|
43 |
)
|
44 |
-
submit_btn = gr.Button("
|
45 |
with gr.Row():
|
46 |
with gr.Column():
|
47 |
-
prompt_response = gr.TextArea(label="Output", show_copy_button=True)
|
48 |
with gr.Row():
|
49 |
token_count_plain = gr.Number(label="Prompt Token Count")
|
50 |
token_count_plain_completion = gr.Number(label="Output Token Count")
|
|
|
|
|
51 |
with gr.Column():
|
52 |
-
lemmatized_prompt_response = gr.TextArea(label="Output (Lemmatized Prompt)", show_copy_button=True)
|
53 |
with gr.Row():
|
54 |
token_count_lemmatized = gr.Number(label="Lemmatized Prompt Token Count")
|
55 |
token_count_lemmatized_completion = gr.Number(label="Output Token Count (Lemmatized Prompt)")
|
|
|
56 |
with gr.Accordion("See Lemmatized Prompt", open=False):
|
57 |
lemmatized_prompt = gr.TextArea(show_copy_button=True, show_label=False, container=False)
|
58 |
|
|
|
24 |
Built by [Bilge Yucel](https://twitter.com/bilgeycl) and [Stefano Fiorucci](https://github.com/anakin87), with [Haystack](https://github.com/deepset-ai/haystack).
|
25 |
"""
|
26 |
|
27 |
+
with gr.Blocks(theme="default") as demo:
|
28 |
gr.Markdown(value=description)
|
29 |
with gr.Row():
|
30 |
api_key = gr.Textbox(label="Enter your api key", type="password")
|
|
|
38 |
"Antibiotics are a type of medication used to treat bacterial infections. They work by either killing the bacteria or preventing them from reproducing, allowing the body’s immune system to fight off the infection. Antibiotics are usually taken orally in the form of pills, capsules, or liquid solutions, or sometimes administered intravenously. They are not effective against viral infections, and using them inappropriately can lead to antibiotic resistance. Explain the above in one sentence:",
|
39 |
"Please give a sentiment for this context. Answer with positive, negative or neutral. Context: A flicker in the dark started of interesting and I was glued to the novel. It was just a little longer that I had anticipated to get to the bottom of the story. I felt sorry for the Chloe's mother but I had thought there was something odd about her brother. Well being a murderer was it any wonder he did not like this sister's boyfriend because I think he knew what happened. I love the cover of the book and the title is good. If only hardbacks had the cover printed onto them. Answer:",
|
40 |
],
|
41 |
+
examples_per_page=1,
|
42 |
inputs=prompt,
|
43 |
+
label="Click on any example"
|
44 |
)
|
45 |
+
submit_btn = gr.Button("✂️ Let's lemmatize and see!")
|
46 |
with gr.Row():
|
47 |
with gr.Column():
|
|
|
48 |
with gr.Row():
|
49 |
token_count_plain = gr.Number(label="Prompt Token Count")
|
50 |
token_count_plain_completion = gr.Number(label="Output Token Count")
|
51 |
+
with gr.Row():
|
52 |
+
prompt_response = gr.TextArea(label="Output", show_copy_button=True)
|
53 |
with gr.Column():
|
|
|
54 |
with gr.Row():
|
55 |
token_count_lemmatized = gr.Number(label="Lemmatized Prompt Token Count")
|
56 |
token_count_lemmatized_completion = gr.Number(label="Output Token Count (Lemmatized Prompt)")
|
57 |
+
lemmatized_prompt_response = gr.TextArea(label="Output (Lemmatized Prompt)", show_copy_button=True)
|
58 |
with gr.Accordion("See Lemmatized Prompt", open=False):
|
59 |
lemmatized_prompt = gr.TextArea(show_copy_button=True, show_label=False, container=False)
|
60 |
|