= commited on
Commit
cc402a2
·
1 Parent(s): c48b0f5

adding cpu

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -44,7 +44,7 @@ temperature = st.sidebar.slider("How randomly need you the translated sentences
44
  # make the process
45
  try:
46
  # recuperate checkpoints
47
- checkpoints = torch.load(os.path.join(models[version][translation_type]['checkpoints'], "best_checkpoints.pth"))
48
 
49
  # recuperate the tokenizer
50
  tokenizer_file = models[version][translation_type]['tokenizer']
@@ -134,7 +134,7 @@ except Exception as e:
134
 
135
  st.warning("The chosen model is not available yet !", icon = "⚠️")
136
 
137
- st.write(e)
138
 
139
 
140
 
 
44
  # make the process
45
  try:
46
  # recuperate checkpoints
47
+ checkpoints = torch.load(os.path.join(models[version][translation_type]['checkpoints'], "best_checkpoints.pth"), map_location=torch.device('cpu'))
48
 
49
  # recuperate the tokenizer
50
  tokenizer_file = models[version][translation_type]['tokenizer']
 
134
 
135
  st.warning("The chosen model is not available yet !", icon = "⚠️")
136
 
137
+ # st.write(e)
138
 
139
 
140