|
import os |
|
import gradio as gr |
|
|
|
|
|
def clone_repo(): |
|
|
|
clone_flag = "repo_cloned.flag" |
|
|
|
if not os.path.exists(clone_flag): |
|
print("Cloning the repository...") |
|
os.system("git clone https://github.com/ozh/cookieclicker.git .") |
|
|
|
|
|
with open(clone_flag, 'w') as f: |
|
f.write("Repository has been cloned.") |
|
else: |
|
print("Repository already cloned.") |
|
|
|
|
|
clone_repo() |
|
|
|
|
|
def display_index(): |
|
with open("index.html", "r") as file: |
|
html_content = file.read() |
|
return html_content |
|
|
|
|
|
with gr.Blocks() as app: |
|
|
|
html_display = gr.HTML() |
|
|
|
|
|
app.load(display_index, outputs=html_display) |
|
|
|
|
|
if __name__ == "__main__": |
|
app.launch() |
|
|