Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -20,11 +20,12 @@ st.sidebar.write("""
|
|
20 |
1. Write something in the text area (a prompt or random text) or use the dropdown menu to select predefined sample text.
|
21 |
2. Select a task from the **task dropdown menu** below if you are providing your own text. **This is very important as it ensures the model responds accordingly.**
|
22 |
3. If you are providing your own text, please do not select any predefined sample text from the dropdown menu.
|
23 |
-
3. If a dropdown menu pops up for a nigerian language, **select the target
|
24 |
4. Click the Generate button to get a response below the text area.\n
|
|
|
25 |
**Note: Model's overall performance vary (hallucinates) due to model size and training data distribution (majorly from news articles and the bible). Performance may worsen significantly with other task outside text generation.
|
26 |
For other tasks, we suggest you try them several times due to the generator's sampling method.**\n
|
27 |
-
|
28 |
""")
|
29 |
|
30 |
max_length = 100
|
@@ -159,12 +160,13 @@ instruction_wrap = {
|
|
159 |
task_options = {
|
160 |
"select": "{}",
|
161 |
"Text Generation": "{}",
|
|
|
162 |
"Sentiment Classification": "<classify> {} <sentiment>:",
|
163 |
"Topic Classification": "<classify> {} <topic>",
|
164 |
"Instruction Following" : "<prompt> {} <response>:",
|
165 |
"Title Generation": "<title> {} <headline>",
|
166 |
-
"Text Diacritization": "<diacritize> {}",
|
167 |
-
"Text Cleaning": "<clean> {}"
|
168 |
}
|
169 |
|
170 |
# Language options for diacritize and clean tasks
|
@@ -187,7 +189,7 @@ sample_text = st.selectbox("Select a sample text to test the model:", list(sampl
|
|
187 |
task = st.selectbox("Select a task for the model:", list(task_options.keys()))
|
188 |
|
189 |
# Conditionally show language options dropdown for diacritize and clean tasks
|
190 |
-
if task in ["Diacritize text", "Clean text"]:
|
191 |
language = st.selectbox("Select a Nigerian language:", list(language_options.keys()))
|
192 |
task_value = f"{task_options[task]} {language_options[language]}"
|
193 |
else:
|
|
|
20 |
1. Write something in the text area (a prompt or random text) or use the dropdown menu to select predefined sample text.
|
21 |
2. Select a task from the **task dropdown menu** below if you are providing your own text. **This is very important as it ensures the model responds accordingly.**
|
22 |
3. If you are providing your own text, please do not select any predefined sample text from the dropdown menu.
|
23 |
+
3. If a dropdown menu pops up for a nigerian language, **select the nigerian language (base language for diacritization and text cleaning, target language for translation).**
|
24 |
4. Click the Generate button to get a response below the text area.\n
|
25 |
+
5. For Translation tasks, setting english as the target language yields the best result.
|
26 |
**Note: Model's overall performance vary (hallucinates) due to model size and training data distribution (majorly from news articles and the bible). Performance may worsen significantly with other task outside text generation.
|
27 |
For other tasks, we suggest you try them several times due to the generator's sampling method.**\n
|
28 |
+
6. Lastly, you can play with some of the generation parameters below to improve performance.
|
29 |
""")
|
30 |
|
31 |
max_length = 100
|
|
|
160 |
task_options = {
|
161 |
"select": "{}",
|
162 |
"Text Generation": "{}",
|
163 |
+
"Translation": "<translate> {} "
|
164 |
"Sentiment Classification": "<classify> {} <sentiment>:",
|
165 |
"Topic Classification": "<classify> {} <topic>",
|
166 |
"Instruction Following" : "<prompt> {} <response>:",
|
167 |
"Title Generation": "<title> {} <headline>",
|
168 |
+
"Text Diacritization": "<diacritize> {} ",
|
169 |
+
"Text Cleaning": "<clean> {} "
|
170 |
}
|
171 |
|
172 |
# Language options for diacritize and clean tasks
|
|
|
189 |
task = st.selectbox("Select a task for the model:", list(task_options.keys()))
|
190 |
|
191 |
# Conditionally show language options dropdown for diacritize and clean tasks
|
192 |
+
if task in ["Diacritize text", "Clean text", "Translation"]:
|
193 |
language = st.selectbox("Select a Nigerian language:", list(language_options.keys()))
|
194 |
task_value = f"{task_options[task]} {language_options[language]}"
|
195 |
else:
|