Spaces:
Sleeping
Sleeping
Update database.py
Browse files- database.py +3 -1
database.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import sqlite3
|
|
|
|
| 2 |
|
| 3 |
def initialize_database():
|
| 4 |
"""Initialize the SQLite database and create the 'documents' table if it doesn't exist."""
|
|
@@ -23,7 +24,8 @@ from huggingface_hub import HfApi
|
|
| 23 |
|
| 24 |
def commit_to_huggingface():
|
| 25 |
"""Commit the dataset.db file to the Hugging Face Space repository."""
|
| 26 |
-
|
|
|
|
| 27 |
|
| 28 |
# Replace with your Space's repository name
|
| 29 |
repo_id = "Danielrahmai1991/dataset_interface"
|
|
|
|
| 1 |
import sqlite3
|
| 2 |
+
import os
|
| 3 |
|
| 4 |
def initialize_database():
|
| 5 |
"""Initialize the SQLite database and create the 'documents' table if it doesn't exist."""
|
|
|
|
| 24 |
|
| 25 |
def commit_to_huggingface():
|
| 26 |
"""Commit the dataset.db file to the Hugging Face Space repository."""
|
| 27 |
+
api_token = os.getenv("hf_key")
|
| 28 |
+
api = HfApi(token=api_token)
|
| 29 |
|
| 30 |
# Replace with your Space's repository name
|
| 31 |
repo_id = "Danielrahmai1991/dataset_interface"
|