Spaces:
Paused
Paused
added HF token variable
Browse files
app.py
CHANGED
@@ -11,11 +11,9 @@ from arxiv_latex_extractor import get_paper_content
|
|
11 |
from fastapi.staticfiles import StaticFiles
|
12 |
from huggingface_hub import HfApi
|
13 |
|
14 |
-
hf_api = HfApi()
|
15 |
|
16 |
from coreservice import app
|
17 |
|
18 |
-
hf_api = HfApi()
|
19 |
|
20 |
LEADING_PROMPT = "Read the following paper:"
|
21 |
|
@@ -149,6 +147,8 @@ def load_context(paper_id):
|
|
149 |
# Upload the paper to Hugging Face
|
150 |
try:
|
151 |
if os.path.getsize(temp_file_path) > 1:
|
|
|
|
|
152 |
hf_api.upload_file(
|
153 |
path_or_fileobj=temp_file_path,
|
154 |
path_in_repo=f"papers/{paper_id}.tex",
|
|
|
11 |
from fastapi.staticfiles import StaticFiles
|
12 |
from huggingface_hub import HfApi
|
13 |
|
|
|
14 |
|
15 |
from coreservice import app
|
16 |
|
|
|
17 |
|
18 |
LEADING_PROMPT = "Read the following paper:"
|
19 |
|
|
|
147 |
# Upload the paper to Hugging Face
|
148 |
try:
|
149 |
if os.path.getsize(temp_file_path) > 1:
|
150 |
+
hf_api = HfApi(token=os.environ["HUGGINGFACE_TOKEN"])
|
151 |
+
|
152 |
hf_api.upload_file(
|
153 |
path_or_fileobj=temp_file_path,
|
154 |
path_in_repo=f"papers/{paper_id}.tex",
|