joe chou commited on
Commit
31d8b31
1 Parent(s): 4c5792f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -16,13 +16,20 @@ import sentencepiece as spm
16
  import streamlit as st
17
  import matplotlib.image as mpimg
18
  import matplotlib.pyplot as plt
19
-
 
20
 
21
 
22
 
23
  @st.cache(suppress_st_warning=True)
24
  def init():
25
- torch.manual_seed(1)
 
 
 
 
 
 
26
  parser = argparse.ArgumentParser()
27
  add_options(parser)
28
  args = parser.parse_args()
 
16
  import streamlit as st
17
  import matplotlib.image as mpimg
18
  import matplotlib.pyplot as plt
19
+
20
+
21
 
22
 
23
 
24
  @st.cache(suppress_st_warning=True)
25
  def init():
26
+ seed =1
27
+ torch.manual_seed(seed)
28
+ np.random.seed(seed)
29
+ torch.cuda.manual_seed(seed)
30
+ torch.cuda.manual_seed_all(seed)
31
+ torch.backends.cudnn.deterministic = True
32
+ torch.backends.cudnn.benchmark = False
33
  parser = argparse.ArgumentParser()
34
  add_options(parser)
35
  args = parser.parse_args()