Spaces:
Sleeping
Sleeping
Keith Bourne commited on
Commit ·
99e9ffb
1
Parent(s): a224b03
Add more GS code 9
Browse files
app.py
CHANGED
|
@@ -37,11 +37,17 @@ DATA_FILENAME = "data.csv"
|
|
| 37 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
| 38 |
st.write(f"DATA_FILENAME: {DATA_FILENAME}")
|
| 39 |
|
| 40 |
-
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 41 |
print("is none?", HF_TOKEN is None)
|
| 42 |
|
| 43 |
print("hfh", huggingface_hub.__version__)
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
# # overriding/appending to the gradio template
|
| 46 |
# SCRIPT = """
|
| 47 |
# <script>
|
|
@@ -55,9 +61,9 @@ print("hfh", huggingface_hub.__version__)
|
|
| 55 |
# with open(os.path.join(gr.networking.STATIC_TEMPLATE_LIB, "frontend", "index.html"), "a") as f:
|
| 56 |
# f.write(SCRIPT)
|
| 57 |
|
| 58 |
-
repo = Repository(
|
| 59 |
-
|
| 60 |
-
)
|
| 61 |
|
| 62 |
|
| 63 |
# def generate_html() -> str:
|
|
|
|
| 37 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
| 38 |
st.write(f"DATA_FILENAME: {DATA_FILENAME}")
|
| 39 |
|
| 40 |
+
HF_TOKEN = os.environ.get("HF_TOKEN") # os.environ['HF_TOKEN'] #
|
| 41 |
print("is none?", HF_TOKEN is None)
|
| 42 |
|
| 43 |
print("hfh", huggingface_hub.__version__)
|
| 44 |
|
| 45 |
+
# Create or clone a repo using Repository app.py · julien-c/persistent-data at main 5.
|
| 46 |
+
# These methods use a token HF_TOKEN which is passed as a secret from the Hub.
|
| 47 |
+
# Note that they also specify a local directory.
|
| 48 |
+
|
| 49 |
+
# Save your data in the directory from above. E.g. the first space 5 is appending the data to a csv.
|
| 50 |
+
|
| 51 |
# # overriding/appending to the gradio template
|
| 52 |
# SCRIPT = """
|
| 53 |
# <script>
|
|
|
|
| 61 |
# with open(os.path.join(gr.networking.STATIC_TEMPLATE_LIB, "frontend", "index.html"), "a") as f:
|
| 62 |
# f.write(SCRIPT)
|
| 63 |
|
| 64 |
+
# repo = Repository(
|
| 65 |
+
# local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
|
| 66 |
+
# )
|
| 67 |
|
| 68 |
|
| 69 |
# def generate_html() -> str:
|