Spaces:
Sleeping
Sleeping
Added some question answer
Browse files
app.py
CHANGED
|
@@ -52,10 +52,14 @@ YOUR_WORK_HTML = """
|
|
| 52 |
"""
|
| 53 |
|
| 54 |
# ---- Hugging Face reference content ----
|
| 55 |
-
|
| 56 |
<div id="hf-content" style="max-width: 800px; margin: auto; font-size: 16px; line-height: 1.6;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
{IMAGE_HTML}
|
| 58 |
-
<h1>Text Generation (Hugging Face Reference)</h1>
|
| 59 |
<h1>About Text Generation</h1>
|
| 60 |
<p>
|
| 61 |
This task covers guides on both <a href="https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads">text-generation</a> and <a href="https://huggingface.co/models?other=text2text-generation&sort=downloads">text-to-text generation</a> models.
|
|
@@ -179,9 +183,27 @@ await inference.conversational({
|
|
| 179 |
Thanks to the template, you can deploy your own instance based on a large language model with only a few clicks and customize it. Learn more about it here and create your large language model instance here.
|
| 180 |
</div>
|
| 181 |
"""
|
| 182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
# ---- Placeholder HTML pages ----
|
| 184 |
-
TEXT_GENERATION_HTML =
|
| 185 |
|
| 186 |
QUESTION_ANSWER_HTML = """
|
| 187 |
<div style="max-width: 800px; margin: auto;">
|
|
|
|
| 52 |
"""
|
| 53 |
|
| 54 |
# ---- Hugging Face reference content ----
|
| 55 |
+
TEXT_GENERATION = f"""
|
| 56 |
<div id="hf-content" style="max-width: 800px; margin: auto; font-size: 16px; line-height: 1.6;">
|
| 57 |
+
<h1>Text Generation (Hugging Face)</h1>
|
| 58 |
+
<p>
|
| 59 |
+
Generating text is the task of generating new text given another text.
|
| 60 |
+
These models can, for example, fill in incomplete text or paraphrase.
|
| 61 |
+
</p>
|
| 62 |
{IMAGE_HTML}
|
|
|
|
| 63 |
<h1>About Text Generation</h1>
|
| 64 |
<p>
|
| 65 |
This task covers guides on both <a href="https://huggingface.co/models?pipeline_tag=text-generation&sort=downloads">text-generation</a> and <a href="https://huggingface.co/models?other=text2text-generation&sort=downloads">text-to-text generation</a> models.
|
|
|
|
| 183 |
Thanks to the template, you can deploy your own instance based on a large language model with only a few clicks and customize it. Learn more about it here and create your large language model instance here.
|
| 184 |
</div>
|
| 185 |
"""
|
| 186 |
+
|
| 187 |
+
QUESTION_ANSWER = f"""
|
| 188 |
+
<div id="hf-content" style="max-width: 800px; margin: auto; font-size: 16px; line-height: 1.6;">
|
| 189 |
+
<h1>Question Answering (Hugging Face)</h1>
|
| 190 |
+
<p>
|
| 191 |
+
Question Answering models can retrieve the answer to a question from a given text, which is useful for searching for an answer in a document.
|
| 192 |
+
Some question answering models can generate answers without context!
|
| 193 |
+
</p>
|
| 194 |
+
{IMAGE_HTML}
|
| 195 |
+
<h1>About Question Answering</h1>
|
| 196 |
+
<h2>Use Cases</h2>
|
| 197 |
+
<h3>Frequently Asked Questions</h3>
|
| 198 |
+
<p>
|
| 199 |
+
You can use Question Answering (QA) models to automate the response to frequently asked questions by using a knowledge base (documents) as context.
|
| 200 |
+
Answers to customer questions can be drawn from those documents.
|
| 201 |
+
⚡⚡ If you’d like to save inference time, you can first use <a href="https://huggingface.co/tasks/sentence-similarity">passage ranking</a> models to see which document might contain the answer to the question and iterate over that document with the QA model instead.
|
| 202 |
+
</p>
|
| 203 |
+
"""
|
| 204 |
+
|
| 205 |
# ---- Placeholder HTML pages ----
|
| 206 |
+
TEXT_GENERATION_HTML = TEXT_GENERATION
|
| 207 |
|
| 208 |
QUESTION_ANSWER_HTML = """
|
| 209 |
<div style="max-width: 800px; margin: auto;">
|