Spaces:
Runtime error
Runtime error
File size: 961 Bytes
11dc9a8 adec7fa 11dc9a8 adec7fa 2dc9b7e 8942d1e 2dc9b7e 8942d1e adec7fa 11dc9a8 8942d1e adec7fa 11dc9a8 |
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 31 32 |
import gradio as gr
import hopsworks
project = hopsworks.login()
fs = project.get_feature_store()
dataset_api = project.get_dataset_api()
dataset_api.download("Resources/images/latest_passenger_prediction.png")
def article_selection(sentiment):
if sentiment == "Positive":
return gr.image('latest_passenger_prediction.png')#f"""The sentence you requested is Positive!"""
elif sentiment == "Negative":
return f"""The sentence you requested is Negative!"""
else:
return f"""The sentence you requested is Neutral!"""
demo = gr.Interface(
fn=article_selection,
inputs = gr.inputs.Dropdown(["Positive","Negative","Neutral"], label="What type of news articles would you like recommended?"),
outputs = [gr.outputs.Image(label="Sentiment of News Articles")],
)
#TODO
#demo = gr.TabbedInterface([url_demo, voice_demo], ["Swedish YouTube Video to English Text", "Swedish Audio to English Text"])
demo.launch() |