File size: 658 Bytes
5b69d8a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from channels.channel import Event, Channel
from type import TYPES
class View:
    def __init__(self, channel: Channel):
        self.channel = channel
        self.channel.on('render', self.render)
        self.channel.on('update', self.update)

    def render(self):
        with gr.Blocks() as demo:
            gr.Markdown("## Welcome to VIPER Architecture")
            gr.Markdown("This is a sample view rendering.")
            demo.launch()

    def update(self, content: str):
        with gr.Blocks() as demo:
            gr.Markdown("## Welcome to VIPER Architecture")
            gr.Markdown(content)
            demo.launch()