Spaces:
Runtime error
Runtime error
File size: 712 Bytes
9901545 9451f7b a386337 fa6f33d 9451f7b 9901545 fa6f33d 9da3db2 a386337 9da3db2 |
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 |
import gradio as gr
from huggingface_hub import login
import gradio_client as grc
from transformers import pipeline
get_completion = pipeline("summarization", model="shleifer/distilbart-cnn-12-6")
def summarize(input):
output = get_completion(input)
return output[0]['summary_text']
token = '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'
login(token=token)
gr.close_all()
demo = gr.Interface(fn=summarize, inputs="text", outputs="text")
demo.launch()
# gr.Interface.load("models/TinyPixel/Llama-2-7B-bf16-sharded").launch()
# gr.Interface.load("models/abnerzhang/Llama-2-7B-bf16-sharded").launch()
# grc.Client("ysharma/Explore_llamav2_with_TGI").deploy_discord(to_id="llama2-70b-discord-bot")
|