Roobick commited on
Commit
44127da
·
1 Parent(s): 569b533

removed Kaggle credentials bootstrap function in app.py

Browse files
Files changed (2) hide show
  1. .gitignore +1 -0
  2. 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
- user = os.getenv("KAGGLE_USERNAME")
77
- key = os.getenv("KAGGLE_KEY")
78
- if not (user and key):
79
- raise RuntimeError(
80
- "Kaggle credentials not found."
81
- "Set KAGGLE_USERNAME and KAGGLE_KEY as env vars or in .env"
82
- )
83
- cred_path = pathlib.Path.home() / ".kaggle" / "kaggle.json"
84
- if not cred_path.exists():
85
- cred_path.parent.mkdir(exist_ok=True)
86
- cred_path.write_text(json.dumps({"username": user, "key": key}))
87
- cred_path.chmod(0o600)
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()