tamatwi commited on
Commit
de7eac8
1 Parent(s): d71d809

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -6,7 +6,7 @@ model_name = "rinna/japanese-gpt2-medium"
6
 
7
  # トークナイザーとパイプラインの設定
8
  tokenizer = AutoTokenizer.from_pretrained(model_name)
9
- generator = pipeline('text-generation', model=model_name, tokenizer=tokenizer, device=0) # device=0はGPUを使用する設定
10
 
11
  def generate_text(prompt, max_length):
12
  result = generator(prompt, max_length=max_length, num_return_sequences=1)
 
6
 
7
  # トークナイザーとパイプラインの設定
8
  tokenizer = AutoTokenizer.from_pretrained(model_name)
9
+ generator = pipeline('text-generation', model=model_name, tokenizer=tokenizer, device=-1) # device=0はGPUを使用する設定
10
 
11
  def generate_text(prompt, max_length):
12
  result = generator(prompt, max_length=max_length, num_return_sequences=1)