Quentin GALLOUÉDEC commited on
Commit
f593a46
·
1 Parent(s): 2270352
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -16,8 +16,7 @@ def generate_text(model_name, input_text):
16
  # Check if the selected model is already loaded
17
  if model_name not in model_pipelines:
18
  # Load the model and create a pipeline if it's not already loaded
19
- model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
20
- generator = pipeline("text-generation", model=model, tokenizer="gpt2", trust_remote_code=True)
21
  model_pipelines[model_name] = generator
22
 
23
  # Get the pipeline for the selected model and generate text
 
16
  # Check if the selected model is already loaded
17
  if model_name not in model_pipelines:
18
  # Load the model and create a pipeline if it's not already loaded
19
+ generator = pipeline("text-generation", model=model_name, tokenizer="gpt2", trust_remote_code=True)
 
20
  model_pipelines[model_name] = generator
21
 
22
  # Get the pipeline for the selected model and generate text