Spaces:
Runtime error
Runtime error
import gradio as gr | |
#gr.Interface.load("models/hipnologo/gpt2-imdb-finetune").launch() | |
import gradio as gr | |
def postprocess_label(label): | |
if label == "LABEL_0": | |
return "Negative" | |
elif label == "LABEL_1": | |
return "Positive" | |
else: | |
return "Unknown label" | |
iface = gr.Interface.load("models/hipnologo/gpt2-imdb-finetune") | |
iface.update(outputs=gr.outputs.Textbox(label="Sentiment", postprocess=postprocess_label)) | |
iface.launch() | |