Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from subtitles import Video_To_Text | |
| from summary import summary_nlp,Summary_BART | |
| from translate import Translation | |
| def Processing(url,model,lang): | |
| summary_result=" " | |
| trans_res=" " | |
| language="" | |
| data=Video_To_Text(url) | |
| if(model=="NLP"): | |
| summary_result=summary_nlp(data) | |
| elif(model=="BART"): | |
| summary_result=Summary_BART(data) | |
| if(lang=="Urdu"): | |
| language="urdu" | |
| elif(lang=="German"): | |
| language="german" | |
| elif(lang=="Hindi"): | |
| language="hindi" | |
| trans_res=Translation(summary_result,language) | |
| return summary_result,trans_res | |
| interface=gr.Interface(fn=Processing,inputs=[gr.components.Textbox(placeholder="Enter YouTube Video Link",label="YouTube Video Link"),gr.components.Radio(["NLP","BART"],type="value",label="Select any one Summary Model"),gr.components.Radio(["Urdu","German","Hindi"],type="value",label="Select any one Language")], | |
| outputs=[gr.components.Textbox(label="Summary in English"),gr.components.Textbox(label="Summary in English")], | |
| examples=[ | |
| ["https://www.youtube.com/watch?v=ZSt9tm3RoUU","BART","Urdu"], | |
| ] | |
| ) | |
| interface.launch(debug=True) |