Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,14 +47,16 @@ st.set_page_config(
|
|
| 47 |
|
| 48 |
pathFileForModel = 'knowledge.txt'
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
with open(pathFileForModel, 'r', encoding='utf-8') as file:
|
| 51 |
context = file.readlines()
|
| 52 |
-
|
| 53 |
-
context = context[0]
|
| 54 |
-
|
| 55 |
|
| 56 |
translator = Translator()
|
| 57 |
-
|
| 58 |
context_translated = translator.translate(context, src='fa', dest='en').text
|
| 59 |
|
| 60 |
##part 2
|
|
|
|
| 47 |
|
| 48 |
pathFileForModel = 'knowledge.txt'
|
| 49 |
|
| 50 |
+
#with open(pathFileForModel, 'r', encoding='utf-8') as file:
|
| 51 |
+
# context = file.readlines()
|
| 52 |
+
# context = [''.join(context)]
|
| 53 |
+
# context = context[0]
|
| 54 |
+
|
| 55 |
with open(pathFileForModel, 'r', encoding='utf-8') as file:
|
| 56 |
context = file.readlines()
|
| 57 |
+
context = ''.join(context)
|
|
|
|
|
|
|
| 58 |
|
| 59 |
translator = Translator()
|
|
|
|
| 60 |
context_translated = translator.translate(context, src='fa', dest='en').text
|
| 61 |
|
| 62 |
##part 2
|