Felladrin commited on
Commit
aa0977e
1 Parent(s): ffc6a33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -1,9 +1,6 @@
1
  import gradio as gr
2
  from transformers import pipeline, AutoTokenizer
3
 
4
- def load_model(model_name):
5
- return pipeline("text-generation", model=model_name, device="cpu")
6
-
7
  def generate(
8
  model_name,
9
  system_input,
@@ -11,7 +8,7 @@ def generate(
11
  assistant_initial_message,
12
  user_input,
13
  ):
14
- pipe = load_model(model_name)
15
 
16
  message_template = [
17
  {"role": "system", "content": system_input},
 
1
  import gradio as gr
2
  from transformers import pipeline, AutoTokenizer
3
 
 
 
 
4
  def generate(
5
  model_name,
6
  system_input,
 
8
  assistant_initial_message,
9
  user_input,
10
  ):
11
+ pipe = pipeline("text-generation", model=model_name, device="cpu")
12
 
13
  message_template = [
14
  {"role": "system", "content": system_input},