ksuzuki01 commited on
Commit
5ec7bfb
1 Parent(s): 0c074a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -6,7 +6,7 @@ model_name = "cameltech/japanese-gpt-1b-PII-masking"
6
  model = AutoModelForCausalLM.from_pretrained(model_name)
7
  tokenizer = AutoTokenizer.from_pretrained(model_name)
8
 
9
- instruction = "文中の個人情報をマスキングせよ\n\n"
10
 
11
  if torch.cuda.is_available():
12
  model = model.to("cuda")
@@ -28,6 +28,7 @@ generation_config = {
28
  }
29
 
30
  def generate(input_text):
 
31
  input_text += tokenizer.eos_token
32
  input_text = preprocess(input_text)
33
 
 
6
  model = AutoModelForCausalLM.from_pretrained(model_name)
7
  tokenizer = AutoTokenizer.from_pretrained(model_name)
8
 
9
+ instruction = "# タスク\n入力文中の個人情報をマスキングせよ\n\n# 入力文\n"
10
 
11
  if torch.cuda.is_available():
12
  model = model.to("cuda")
 
28
  }
29
 
30
  def generate(input_text):
31
+ input_text = instruction + input_text
32
  input_text += tokenizer.eos_token
33
  input_text = preprocess(input_text)
34