Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,13 +4,13 @@ import torch
|
|
| 4 |
from transformers import pipeline
|
| 5 |
|
| 6 |
# νκ΅μ΄ -> μμ΄ λ²μ
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
print(f"
|
| 11 |
|
| 12 |
# μμ΄ -> νκ΅μ΄ λ²μ
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
print(f"\nInput: {
|
|
|
|
| 4 |
from transformers import pipeline
|
| 5 |
|
| 6 |
# νκ΅μ΄ -> μμ΄ λ²μ
|
| 7 |
+
translator_ko_to_en = pipeline("translation_en_ko", model="Helsinki-NLP/opus-mt-ko-en")
|
| 8 |
+
input_text_ko = "μλ
νμΈμ, μ¬λ¬λΆ μ΄λμ?"
|
| 9 |
+
output_text_en = translator_ko_to_en(input_text_ko)[0]["translation_text"]
|
| 10 |
+
print(f"Korean to English\nInput: {input_text_ko}\nOutput: {output_text_en}")
|
| 11 |
|
| 12 |
# μμ΄ -> νκ΅μ΄ λ²μ
|
| 13 |
+
translator_en_to_ko = pipeline("translation_en_to_ko", model="EleutherAI/pile-small-cased-v2")
|
| 14 |
+
input_text_en = "Hello, how are you doing today?"
|
| 15 |
+
output_text_ko = translator_en_to_ko(input_text_en)[0]["translation_text"]
|
| 16 |
+
print(f"\nEnglish to Korean\nInput: {input_text_en}\nOutput: {output_text_ko}")
|