Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,10 +68,12 @@ import streamlit.components.v1 as components
|
|
| 68 |
from PyPDF2 import PdfReader
|
| 69 |
from huggingface_hub import HfApi
|
| 70 |
import io
|
| 71 |
-
from
|
| 72 |
-
from git import repo
|
| 73 |
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
| 75 |
#device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 76 |
|
| 77 |
# from git import Repo
|
|
@@ -496,14 +498,14 @@ def main():
|
|
| 496 |
# Write the JSON data to a file
|
| 497 |
with open(json_file, "w") as f:
|
| 498 |
f.write(json_data)
|
| 499 |
-
api.upload_file(
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
)
|
| 506 |
-
|
| 507 |
def convert_df(df):
|
| 508 |
|
| 509 |
#IMPORTANT: Cache the conversion to prevent computation on every rerun
|
|
|
|
| 68 |
from PyPDF2 import PdfReader
|
| 69 |
from huggingface_hub import HfApi
|
| 70 |
import io
|
| 71 |
+
from datasets import load_dataset
|
|
|
|
| 72 |
|
| 73 |
+
# from huggingface_hub import Repository
|
| 74 |
+
# from git import repo
|
| 75 |
+
|
| 76 |
+
# api = HfApi()
|
| 77 |
#device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 78 |
|
| 79 |
# from git import Repo
|
|
|
|
| 498 |
# Write the JSON data to a file
|
| 499 |
with open(json_file, "w") as f:
|
| 500 |
f.write(json_data)
|
| 501 |
+
# api.upload_file(
|
| 502 |
+
# path_or_fileobj=json_data,
|
| 503 |
+
# path_in_repo="ch.json",
|
| 504 |
+
# repo_id="Seetha/IMA-pipeline-streamlit",
|
| 505 |
+
# repo_type="dataset",
|
| 506 |
+
# token="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",
|
| 507 |
+
# )
|
| 508 |
+
dataset = load_dataset('json', data_files='smalljson.json')
|
| 509 |
def convert_df(df):
|
| 510 |
|
| 511 |
#IMPORTANT: Cache the conversion to prevent computation on every rerun
|