File size: 361 Bytes
413a0e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
import re

import main

def is_valid_name(url):
    pattern = r"^https://mangadistrict\.com(/.*)?$"
    return bool(re.match(pattern, url))

def greet(name):
    if is_valid_name(name):
        return main.main(name)
    else:
        return "Hello " + name + "!!"

demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()