jslin09 commited on
Commit
d97db75
1 Parent(s): bccb339

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,9 +1,11 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
  generator = pipeline('text-generation', model='jslin09/bloom-560m-finetuned-fraud')
5
 
6
  def generate(text):
 
 
7
  result = generator(text, max_length=500, num_return_sequences=1)
8
  return result[0]["generated_text"]
9
 
 
1
  import gradio as gr
2
+ from transformers import pipeline, set_seed
3
 
4
  generator = pipeline('text-generation', model='jslin09/bloom-560m-finetuned-fraud')
5
 
6
  def generate(text):
7
+ seed = random.randint(10, 500)
8
+ set_seed(seed)
9
  result = generator(text, max_length=500, num_return_sequences=1)
10
  return result[0]["generated_text"]
11