Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,9 @@ 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 |
|
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"],
|
|
|
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"],
|