liang-huggingface commited on
Commit
a22c00c
·
1 Parent(s): c9e7b23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,8 +11,8 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
11
  import torch
12
 
13
  # Load the model and tokenizer
14
- tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen-7B")
15
- model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-7B-Chat")
16
 
17
  def generate_summary(prompt):
18
  # Add instructions to the prompt to signal that you want a summary
 
11
  import torch
12
 
13
  # Load the model and tokenizer
14
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen-7B-Chat", trust_remote_code=True)
15
+ model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-7B-Chat", device_map="auto",trust_remote_code=True).eval()
16
 
17
  def generate_summary(prompt):
18
  # Add instructions to the prompt to signal that you want a summary