Spaces:
Runtime error
Runtime error
Update game1.py
Browse files
game1.py
CHANGED
@@ -6,7 +6,7 @@ import gradio as gr
|
|
6 |
import numpy as np
|
7 |
|
8 |
|
9 |
-
def read1(lang):
|
10 |
if lang in ['en']:
|
11 |
fname = 'data1_en.txt'
|
12 |
else:
|
@@ -14,6 +14,8 @@ def read1(lang):
|
|
14 |
with open(fname, encoding='utf-8') as f:
|
15 |
content = f.readlines()
|
16 |
index_selected = random.randint(0,len(content)/2-1)
|
|
|
|
|
17 |
text = eval(content[index_selected*2])
|
18 |
interpretation = eval(content[int(index_selected*2+1)])
|
19 |
if lang == 'en':
|
|
|
6 |
import numpy as np
|
7 |
|
8 |
|
9 |
+
def read1(lang, num_selected_former):
|
10 |
if lang in ['en']:
|
11 |
fname = 'data1_en.txt'
|
12 |
else:
|
|
|
14 |
with open(fname, encoding='utf-8') as f:
|
15 |
content = f.readlines()
|
16 |
index_selected = random.randint(0,len(content)/2-1)
|
17 |
+
while index_selected == num_selected_former:
|
18 |
+
index_selected = random.randint(0,len(content)/2-1)
|
19 |
text = eval(content[index_selected*2])
|
20 |
interpretation = eval(content[int(index_selected*2+1)])
|
21 |
if lang == 'en':
|