Remove upload script
This commit is contained in:
parent
884dee2c6e
commit
48917d691a
@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
import urllib.request
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
|
|
||||||
def upload_files(file_dict: Dict[str, str]) -> str:
|
|
||||||
data = json.dumps(file_dict).encode()
|
|
||||||
|
|
||||||
url = "https://api.markprompt.com/train"
|
|
||||||
headers = {
|
|
||||||
"Authorization": f'Bearer {os.getenv("MARKPROMPT_API_KEY", "")}',
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
}
|
|
||||||
req = urllib.request.Request(url, data=data, headers=headers, method="POST")
|
|
||||||
response = urllib.request.urlopen(req)
|
|
||||||
result = response.read()
|
|
||||||
return result.decode("utf-8")
|
|
||||||
|
|
||||||
|
|
||||||
files = {}
|
|
||||||
for file in Path(".").glob("**/*.md"):
|
|
||||||
with file.open() as f:
|
|
||||||
files[str(file)] = f.read()
|
|
||||||
|
|
||||||
print(upload_files(files))
|
|
Loading…
x
Reference in New Issue
Block a user