Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,17 +4,18 @@ from transformers import pipeline
|
|
4 |
generator = pipeline('text-generation', model='jslin09/bloom-560m-finetuned-fraud')
|
5 |
|
6 |
def generate(text):
|
7 |
-
result = generator(text, max_length=
|
8 |
return result[0]["generated_text"]
|
9 |
|
10 |
examples = [
|
11 |
["闕很大明知金融帳戶之存摺、提款卡及密碼係供自己使用之重要理財工具,"],
|
12 |
-
["森上梅前明知其無資力支付酒店消費,亦無付款意願,竟意圖為自己不法之所有,"]
|
|
|
13 |
]
|
14 |
|
15 |
demo = gr.Interface(
|
16 |
fn=generate,
|
17 |
-
title="Drafting",
|
18 |
inputs=gr.inputs.Textbox(lines=5, label="輸入提示文字"),
|
19 |
outputs=gr.outputs.Textbox(label="生成的文本"),
|
20 |
examples=examples
|
|
|
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 |
|
10 |
examples = [
|
11 |
["闕很大明知金融帳戶之存摺、提款卡及密碼係供自己使用之重要理財工具,"],
|
12 |
+
["森上梅前明知其無資力支付酒店消費,亦無付款意願,竟意圖為自己不法之所有,"],
|
13 |
+
["王大明意圖為自己不法所有,基於竊盜之犯意,"]
|
14 |
]
|
15 |
|
16 |
demo = gr.Interface(
|
17 |
fn=generate,
|
18 |
+
title="Legal Document Drafting",
|
19 |
inputs=gr.inputs.Textbox(lines=5, label="輸入提示文字"),
|
20 |
outputs=gr.outputs.Textbox(label="生成的文本"),
|
21 |
examples=examples
|