Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,13 +6,13 @@ import fasttext
|
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
models = {'en': 'Narsil/deberta-large-mnli-zero-cls', # English
|
| 9 |
-
'ru': 'DeepPavlov/xlm-roberta-large-en-ru-mnli' # Russian
|
| 10 |
'uz': 'coppercitylabs/uzbek-news-category-classifier'
|
| 11 |
} #Uzbek
|
| 12 |
|
| 13 |
|
| 14 |
hypothesis_templates = {'en': 'This example is {}.', # English
|
| 15 |
-
'ru': 'Этот пример {}.' # Russian
|
| 16 |
'uz': 'Бу мисол {}.' # Uzbek}
|
| 17 |
|
| 18 |
|
|
@@ -22,7 +22,7 @@ classifiers = {'en': pipeline("zero-shot-classification", hypothesis_template=hy
|
|
| 22 |
'ru': pipeline("zero-shot-classification", hypothesis_template=hypothesis_templates['ru'],
|
| 23 |
model=models['ru']),
|
| 24 |
'uz': pipeline("zero-shot-classification", hypothesis_template=hypothesis_templates['uz'],
|
| 25 |
-
model=models['uz'])
|
| 26 |
}
|
| 27 |
|
| 28 |
fasttext_model = fasttext.load_model(hf_hub_download("julien-c/fasttext-language-id", "lid.176.bin"))
|
|
@@ -46,6 +46,7 @@ def prep_examples():
|
|
| 46 |
examples = [
|
| 47 |
[example_text1, example_labels1],
|
| 48 |
[example_text2, example_labels2],
|
|
|
|
| 49 |
]
|
| 50 |
|
| 51 |
return examples
|
|
|
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
models = {'en': 'Narsil/deberta-large-mnli-zero-cls', # English
|
| 9 |
+
'ru': 'DeepPavlov/xlm-roberta-large-en-ru-mnli', # Russian
|
| 10 |
'uz': 'coppercitylabs/uzbek-news-category-classifier'
|
| 11 |
} #Uzbek
|
| 12 |
|
| 13 |
|
| 14 |
hypothesis_templates = {'en': 'This example is {}.', # English
|
| 15 |
+
'ru': 'Этот пример {}.', # Russian
|
| 16 |
'uz': 'Бу мисол {}.' # Uzbek}
|
| 17 |
|
| 18 |
|
|
|
|
| 22 |
'ru': pipeline("zero-shot-classification", hypothesis_template=hypothesis_templates['ru'],
|
| 23 |
model=models['ru']),
|
| 24 |
'uz': pipeline("zero-shot-classification", hypothesis_template=hypothesis_templates['uz'],
|
| 25 |
+
model=models['uz'])
|
| 26 |
}
|
| 27 |
|
| 28 |
fasttext_model = fasttext.load_model(hf_hub_download("julien-c/fasttext-language-id", "lid.176.bin"))
|
|
|
|
| 46 |
examples = [
|
| 47 |
[example_text1, example_labels1],
|
| 48 |
[example_text2, example_labels2],
|
| 49 |
+
[example_text3, example_labels3]
|
| 50 |
]
|
| 51 |
|
| 52 |
return examples
|