Spaces:
Sleeping
Sleeping
=
commited on
Commit
•
6d06cb9
1
Parent(s):
c00de41
adding some texts
Browse files
app.py
CHANGED
@@ -107,16 +107,24 @@ try:
|
|
107 |
|
108 |
# set the model to eval mode
|
109 |
_ = model.eval()
|
110 |
-
|
|
|
|
|
111 |
# Add a title
|
112 |
-
st.header("Translate French sentences
|
113 |
-
|
114 |
-
|
115 |
# Recuperate two columns
|
116 |
left, right = st.columns(2)
|
117 |
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
|
121 |
for i in range(number):
|
122 |
|
@@ -125,8 +133,15 @@ try:
|
|
125 |
# run model inference on all test data
|
126 |
original_translations, predicted_translations, original_texts, scores = [], [], [], {}
|
127 |
|
128 |
-
|
129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
for i in range(number):
|
132 |
|
|
|
107 |
|
108 |
# set the model to eval mode
|
109 |
_ = model.eval()
|
110 |
+
|
111 |
+
language = "Wolof" if translation_type == "French ➡️ Wolof" else "French"
|
112 |
+
|
113 |
# Add a title
|
114 |
+
st.header(f"Translate French sentences to {language} 👌")
|
115 |
+
|
|
|
116 |
# Recuperate two columns
|
117 |
left, right = st.columns(2)
|
118 |
|
119 |
+
if translation_type == "French ➡️ Wolof":
|
120 |
+
|
121 |
+
# recuperate sentences
|
122 |
+
left.subheader('Give me some sentences in French: ')
|
123 |
+
|
124 |
+
else:
|
125 |
+
|
126 |
+
# recuperate sentences
|
127 |
+
left.subheader('Give me some sentences in Wolof: ')
|
128 |
|
129 |
for i in range(number):
|
130 |
|
|
|
133 |
# run model inference on all test data
|
134 |
original_translations, predicted_translations, original_texts, scores = [], [], [], {}
|
135 |
|
136 |
+
if translation_type == "French ➡️ Wolof":
|
137 |
+
|
138 |
+
# print a sentence recuperated from the session
|
139 |
+
right.subheader("Translation to Wolof:")
|
140 |
+
|
141 |
+
else:
|
142 |
+
|
143 |
+
# print a sentence recuperated from the session
|
144 |
+
right.subheader("Translation to French:")
|
145 |
|
146 |
for i in range(number):
|
147 |
|