joe4ai commited on
Commit
61f1828
Β·
verified Β·
1 Parent(s): 47dc851

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -20
app.py CHANGED
@@ -49,30 +49,10 @@ try:
49
  print(f"βœ… Authenticated as: {user_info['name']}")
50
  except Exception as e:
51
  raise ValueError(f"🚨 Hugging Face authentication failed: {e}")
52
- from huggingface_hub import RepositoryNotFoundError
53
 
54
  repo_id = f"{HF_ORG_NAME}/{DATASET_NAME}" # Use your organization dataset
55
  api = HfApi()
56
 
57
- # πŸ”Ή Verify if dataset exists
58
- try:
59
- repo_info = api.repo_info(repo_id, repo_type="dataset", token=HF_TOKEN)
60
- print(f"βœ… Dataset '{repo_id}' exists.")
61
- except RepositoryNotFoundError:
62
- print(f"πŸ”΄ Dataset '{repo_id}' not found. Creating it now...")
63
-
64
- try:
65
- api.create_repo(
66
- repo_id=repo_id,
67
- repo_type="dataset",
68
- private=True, # βœ… Keep it private
69
- token=HF_TOKEN,
70
- organization=HF_ORG_NAME
71
- )
72
- print(f"βœ… Dataset '{repo_id}' created successfully.")
73
- except Exception as e:
74
- raise ValueError(f"🚨 Failed to create dataset '{repo_id}': {e}")
75
-
76
  db_path = "chatbot.db"
77
 
78
  # πŸ”Ή Check if chatbot.db exists
 
49
  print(f"βœ… Authenticated as: {user_info['name']}")
50
  except Exception as e:
51
  raise ValueError(f"🚨 Hugging Face authentication failed: {e}")
 
52
 
53
  repo_id = f"{HF_ORG_NAME}/{DATASET_NAME}" # Use your organization dataset
54
  api = HfApi()
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  db_path = "chatbot.db"
57
 
58
  # πŸ”Ή Check if chatbot.db exists