Spaces:
Runtime error
Runtime error
Added examples
Browse files
app.py
CHANGED
@@ -53,6 +53,8 @@ language_dict = {0: 'Arabic',
|
|
53 |
43: 'Ukranian',
|
54 |
44: 'Welsh'}
|
55 |
|
|
|
|
|
56 |
def inference(sentence):
|
57 |
tokenized_sentence = tokenizer(sentence, return_tensors='pt')
|
58 |
output = model(**tokenized_sentence)
|
@@ -67,6 +69,7 @@ if __name__ == '__main__':
|
|
67 |
inputs=gr.inputs.Textbox(placeholder="Enter text here", label="Text content", lines=5),
|
68 |
outputs=gr.outputs.Label(num_top_classes=6, label="Language of this text is "),
|
69 |
verbose=True,
|
|
|
70 |
title="Language Detector",
|
71 |
description="",
|
72 |
theme="grass")
|
|
|
53 |
43: 'Ukranian',
|
54 |
44: 'Welsh'}
|
55 |
|
56 |
+
examples = ['Transformers are really cool!', 'Трансформеры действительно классные!', '¡Los transformadores son realmente geniales!']
|
57 |
+
|
58 |
def inference(sentence):
|
59 |
tokenized_sentence = tokenizer(sentence, return_tensors='pt')
|
60 |
output = model(**tokenized_sentence)
|
|
|
69 |
inputs=gr.inputs.Textbox(placeholder="Enter text here", label="Text content", lines=5),
|
70 |
outputs=gr.outputs.Label(num_top_classes=6, label="Language of this text is "),
|
71 |
verbose=True,
|
72 |
+
examples = examples,
|
73 |
title="Language Detector",
|
74 |
description="",
|
75 |
theme="grass")
|