File size: 975 Bytes
32b0450
e713002
 
 
 
32b0450
9bf8d9f
 
32b0450
e713002
 
1904287
 
 
 
e713002
837275c
1904287
e713002
1904287
e713002
4be830b
 
 
1904287
4be830b
9bf8d9f
 
4be830b
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr
from transformers import pipeline

#pipe = pipeline("text-generation")
#gr.Interface.from_pipeline(pipe).launch()

API_URL = "https://api-inference.huggingface.co/models/jslin09/bloom-560m-finetuned-fraud"
headers = {"Authorization": "Bearer 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"} # Read only

description = "Legal Document Drafting with BLOOM"
api_key="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"
examples=[
          ["闕很大明知金融帳戶之存摺、提款卡及密碼係供自己使用之重要理財工具,"],
          ["森上梅前明知其無資力支付酒店消費,亦無付款意願,竟意圖為自己不法之所有,"]
]

iface = gr.Interface.load("huggingface/jslin09/bloom-560m-finetuned-fraud",
  title="Drafting",
  description=description,
  examples=examples,
  api_key=api_key,
).queue()

demo = gr.TabbedInterface(
    [iface], ["分頁標籤"],
    title="Legal Document Drafting",
)

demo.queue()
demo.launch(share=False)