Shanks0465
commited on
Commit
•
3b68e9a
1
Parent(s):
4a7a1cb
Updated to Interface Application
Browse files
app.py
CHANGED
@@ -20,8 +20,12 @@ bos_id = tokenizer._convert_token_to_id_with_added_voc("<s>")
|
|
20 |
eos_id = tokenizer._convert_token_to_id_with_added_voc("</s>")
|
21 |
pad_id = tokenizer._convert_token_to_id_with_added_voc("<pad>")
|
22 |
|
|
|
|
|
|
|
23 |
|
24 |
def generate(input, task, lang):
|
|
|
25 |
if task == "IndicWikiBio":
|
26 |
model = wbmodel
|
27 |
elif task == "IndicHeadlineGeneration":
|
@@ -45,8 +49,6 @@ def generate(input, task, lang):
|
|
45 |
|
46 |
tasks = ["IndicWikiBio", "IndicHeadlineGeneration", "IndicParaphrasing",
|
47 |
"IndicSentenceSummarization", "IndicQuestionGeneration"]
|
48 |
-
INDIC = {"Assamese": "as", "Bengali": "bn", "Gujarati": "gu", "Hindi": "hi", "Kannada": "kn",
|
49 |
-
"Malayalam": "ml", "Marathi": "mr", "Odia": "or", "Punjabi": "pa", "Tamil": "ta", "Telugu": "te"}
|
50 |
languages = list(INDIC.keys())
|
51 |
|
52 |
language_drop_down = gr.inputs.Dropdown(
|
|
|
20 |
eos_id = tokenizer._convert_token_to_id_with_added_voc("</s>")
|
21 |
pad_id = tokenizer._convert_token_to_id_with_added_voc("<pad>")
|
22 |
|
23 |
+
INDIC = {"Assamese": "as", "Bengali": "bn", "Gujarati": "gu", "Hindi": "hi", "Kannada": "kn",
|
24 |
+
"Malayalam": "ml", "Marathi": "mr", "Odia": "or", "Punjabi": "pa", "Tamil": "ta", "Telugu": "te"}
|
25 |
+
|
26 |
|
27 |
def generate(input, task, lang):
|
28 |
+
lang = INDIC[lang]
|
29 |
if task == "IndicWikiBio":
|
30 |
model = wbmodel
|
31 |
elif task == "IndicHeadlineGeneration":
|
|
|
49 |
|
50 |
tasks = ["IndicWikiBio", "IndicHeadlineGeneration", "IndicParaphrasing",
|
51 |
"IndicSentenceSummarization", "IndicQuestionGeneration"]
|
|
|
|
|
52 |
languages = list(INDIC.keys())
|
53 |
|
54 |
language_drop_down = gr.inputs.Dropdown(
|