jslin09 commited on
Commit
e0219f0
1 Parent(s): 5f3e2b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,13 +7,13 @@ import random
7
  model_name = "bloom-560m"
8
  model = AutoModelForCausalLM.from_pretrained(f"jslin09/{model_name}-finetuned-fraud")
9
  tokenizer = BloomTokenizerFast.from_pretrained(f'bigscience/{model_name}', bos_token = '<s>', eos_token = '</s>')
10
- rnd_seed = random.randint(10, 500)
11
 
12
  def rnd_generate(prompt):
 
13
  set_seed(rnd_seed)
14
  inputs = tokenizer(prompt, return_tensors="pt") # 回傳的張量使用 Pytorch的格式。如果是 Tensorflow 格式的話,則指定為 "tf"。
15
  results = model.generate(inputs["input_ids"],
16
- max_length=400,
17
  num_return_sequences=1,
18
  do_sample=True,
19
  temperature=0.75,
 
7
  model_name = "bloom-560m"
8
  model = AutoModelForCausalLM.from_pretrained(f"jslin09/{model_name}-finetuned-fraud")
9
  tokenizer = BloomTokenizerFast.from_pretrained(f'bigscience/{model_name}', bos_token = '<s>', eos_token = '</s>')
 
10
 
11
  def rnd_generate(prompt):
12
+ rnd_seed = random.randint(10, 500)
13
  set_seed(rnd_seed)
14
  inputs = tokenizer(prompt, return_tensors="pt") # 回傳的張量使用 Pytorch的格式。如果是 Tensorflow 格式的話,則指定為 "tf"。
15
  results = model.generate(inputs["input_ids"],
16
+ max_length=500,
17
  num_return_sequences=1,
18
  do_sample=True,
19
  temperature=0.75,