How can I use Series with custom models from different sources
So I’m trying to create a project using transformers, datasets and gradio that is capable of scraping arabic news sites, translate articles, summarize them and then finally factcheck them.I’ve already created all the modules necessary but now I’m kinda stuck at how I could chain all these together so I could make a simple GUI that ties it all together. My translator and summarizer modules are fine tuned models that I have uploaded to the huggingface hub but as for the fake news detector I created a tensorflow model for this purpose, saved the model and then created a predict function that would return the final result.My code so far is:scraper_obj = NewsScraper()

scraper = gr.Interface(fn=scraper_obj.scrape, inputs='text', outputs='text')

translator = gr.Interface.load(name='huggingface/vftnr/ArabicEnglishTranslation', api_key='REDACTED_TOKEN')

summarizer = gr.Interface.load(name='huggingface/vftnr/EnglishSummarization', api_key='REDACTED_TOKEN')

//factchecker = gr.Interface(fn=predict_news)

demo = gr.Series(scraper, translator, summarizer, factchecker)

demo.launch()I’m kinda stuck at the fact checker line and how should I do it exactly.
2022-06-29T18:07:25Z
hi@vftnr,The idea of Series is to chain your input→outputs → input→output  to your different predictions functions and you will see the interface for first input and the final output component.Let’s say your Scraper input is URL (text)→content (text) →  translator content (text) → translation (text) → summarizer content (text) → summary (text)  → fact checker content (text) →  ?? maybe a label with probabilities, or maybe a dataframe with results?I’m not sure of the internals of your interfaces, but just make sure they’re expecting the right inputs and outputs.ps:You can invalidate and refresh your access tokens, because they’re private, this forum is public.# scraper_obj = NewsScraper()

scraper = gr.Interface(fn=lambda x: x, inputs='text', outputs='text')

translator = gr.Interface.load(name='huggingface/vftnr/ArabicEnglishTranslation', api_key='REDACTED_TOKEN')

summarizer = gr.Interface.load(name='huggingface/vftnr/EnglishSummarization', api_key='REDACTED_TOKEN')

factchecker = gr.Interface(fn=lambda x: x, inputs='text', outputs='text')

demo = gr.Series(scraper, translator, summarizer, factchecker)

demo.launch()