Spaces:
Runtime error
Runtime error
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") | |