jslin09's picture
Update app.py
1904287
raw
history blame
975 Bytes
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)