Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -676,9 +676,9 @@ async def annotate(
|
|
676 |
|
677 |
|
678 |
# Infos GitHub
|
679 |
-
#GITHUB_REPO = "Og31330/FA_Dataset"
|
680 |
-
#GITHUB_BASE_URL = f"https://api.github.com/repos/{GITHUB_REPO}"
|
681 |
GITHUB_TOKEN = "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" # Remplace par ton token GitHub
|
|
|
|
|
682 |
|
683 |
@app.post("/upload_csv/")
|
684 |
async def upload_csv(
|
@@ -698,7 +698,7 @@ async def upload_csv(
|
|
698 |
encoded_content = base64.b64encode(content).decode("utf-8")
|
699 |
|
700 |
# 🔍 Vérification si le fichier existe déjà sur GitHub pour récupérer le sha
|
701 |
-
file_url = f"{
|
702 |
headers = {
|
703 |
"Authorization": f"Bearer {GITHUB_TOKEN}",
|
704 |
"Accept": "application/vnd.github+json"
|
|
|
676 |
|
677 |
|
678 |
# Infos GitHub
|
|
|
|
|
679 |
GITHUB_TOKEN = "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" # Remplace par ton token GitHub
|
680 |
+
GITHUB_REPO = "Og31330/FA_Dataset"
|
681 |
+
GITHUB_BASE_URL_CSV = f"https://api.github.com/repos/{GITHUB_REPO}"
|
682 |
|
683 |
@app.post("/upload_csv/")
|
684 |
async def upload_csv(
|
|
|
698 |
encoded_content = base64.b64encode(content).decode("utf-8")
|
699 |
|
700 |
# 🔍 Vérification si le fichier existe déjà sur GitHub pour récupérer le sha
|
701 |
+
file_url = f"{GITHUB_BASE_URL_CSV}/contents/csv/{csv_filename}"
|
702 |
headers = {
|
703 |
"Authorization": f"Bearer {GITHUB_TOKEN}",
|
704 |
"Accept": "application/vnd.github+json"
|