Locutusque commited on
Commit
92ecee9
1 Parent(s): f99c184

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -25,6 +25,8 @@ def generate_text(prompt, temperature, top_p, top_k, repetition_penalty, max_len
25
  )
26
  # Extract the generated text and return it
27
  generated_text = outputs[0]['generated_text']
 
 
28
  return generated_text
29
  # Create the Gradio interface
30
  iface = gr.Interface(
 
25
  )
26
  # Extract the generated text and return it
27
  generated_text = outputs[0]['generated_text']
28
+ generator.model.cpu()
29
+ generator.device = torch.device("cpu")
30
  return generated_text
31
  # Create the Gradio interface
32
  iface = gr.Interface(