removed Kaggle credentials bootstrap function in app.py
Browse files- .gitignore +1 -0
- app.py +14 -15
.gitignore
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
.env
|
2 |
.mcp-venv/
|
|
|
|
1 |
.env
|
2 |
.mcp-venv/
|
3 |
+
.gradio
|
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
import os, json, pathlib, tempfile
|
3 |
-
import pandas as pd
|
4 |
from typing import List, Dict
|
5 |
from kaggle.api.kaggle_api_extended import KaggleApi
|
6 |
|
@@ -72,21 +71,21 @@ demo = gr.TabbedInterface(
|
|
72 |
tab_names=["Search", "Files", "Download"]
|
73 |
)
|
74 |
|
75 |
-
def _bootstrap_kaggle_credentials():
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
|
89 |
-
_bootstrap_kaggle_credentials()
|
90 |
|
91 |
api = KaggleApi()
|
92 |
api.authenticate()
|
|
|
1 |
import gradio as gr
|
2 |
import os, json, pathlib, tempfile
|
|
|
3 |
from typing import List, Dict
|
4 |
from kaggle.api.kaggle_api_extended import KaggleApi
|
5 |
|
|
|
71 |
tab_names=["Search", "Files", "Download"]
|
72 |
)
|
73 |
|
74 |
+
# def _bootstrap_kaggle_credentials():
|
75 |
+
# user = os.getenv("KAGGLE_USERNAME")
|
76 |
+
# key = os.getenv("KAGGLE_KEY")
|
77 |
+
# if not (user and key):
|
78 |
+
# raise RuntimeError(
|
79 |
+
# "Kaggle credentials not found."
|
80 |
+
# "Set KAGGLE_USERNAME and KAGGLE_KEY as env vars or in .env"
|
81 |
+
# )
|
82 |
+
# cred_path = pathlib.Path.home() / ".kaggle" / "kaggle.json"
|
83 |
+
# if not cred_path.exists():
|
84 |
+
# cred_path.parent.mkdir(exist_ok=True)
|
85 |
+
# cred_path.write_text(json.dumps({"username": user, "key": key}))
|
86 |
+
# cred_path.chmod(0o600)
|
87 |
|
88 |
+
# _bootstrap_kaggle_credentials()
|
89 |
|
90 |
api = KaggleApi()
|
91 |
api.authenticate()
|