Spaces:
Runtime error
Runtime error
dinalzein
commited on
Commit
Β·
015eea5
1
Parent(s):
dfb0587
fix error
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ def identify_language2(txt):
|
|
38 |
output = model(**tokenized_txt)
|
39 |
predictions = torch.nn.functional.softmax(output.logits, dim=-1)
|
40 |
_, preds = torch.max(predictions, dim=-1)
|
41 |
-
return languages_map[
|
42 |
|
43 |
#with gr.Row():
|
44 |
examples = [
|
|
|
38 |
output = model(**tokenized_txt)
|
39 |
predictions = torch.nn.functional.softmax(output.logits, dim=-1)
|
40 |
_, preds = torch.max(predictions, dim=-1)
|
41 |
+
return languages_map[id2label[str(preds.item())]]
|
42 |
|
43 |
#with gr.Row():
|
44 |
examples = [
|