Skip to content

Commit

Permalink
download data on startup of app
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdai committed Sep 24, 2024
1 parent 2a6999c commit 740937f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 46 deletions.
46 changes: 0 additions & 46 deletions .devcontainer/devcontainer.json

This file was deleted.

2 changes: 2 additions & 0 deletions arc_finetuning_st/streamlit/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
from llama_index.core.tools.function_tool import async_to_sync

from arc_finetuning_st.streamlit.controller import Controller
from arc_finetuning_st.streamlit.startup import download_data

# startup
st.set_page_config(layout="wide")


@st.cache_resource
def startup() -> Tuple[Controller,]:
download_data()
controller = Controller()
return (controller,)

Expand Down
18 changes: 18 additions & 0 deletions arc_finetuning_st/streamlit/startup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import subprocess

commands = [
"wget https://github.com/fchollet/ARC-AGI/archive/refs/heads/master.zip -O ./master.zip",
"unzip ./master.zip -d ./",
"rm -rf ./data",
"mv ARC-AGI-master/data ./",
"rm -rf ARC-AGI-master",
"rm master.zip",
]


def download_data() -> None:
subprocess.run("; ".join(commands), capture_output=True, shell=True)


if __name__ == "__main__":
download_data()

0 comments on commit 740937f

Please sign in to comment.