Spaces:
Sleeping
Sleeping
Replaced logic writing token to file
Browse files- Dockerfile +2 -2
- holosubs.py +1 -1
Dockerfile
CHANGED
|
@@ -9,7 +9,7 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
| 9 |
RUN /opt/conda/bin/pip install peft
|
| 10 |
RUN /opt/conda/bin/pip install -qq https://github.com/pyannote/pyannote-audio/archive/refs/heads/develop.zip
|
| 11 |
RUN --mount=type=secret,id=HUGGINGFACE_TOKEN,mode=0444,required=true \
|
| 12 |
-
huggingface-cli login --token $(cat /run/secrets/HUGGINGFACE_TOKEN)
|
|
|
|
| 13 |
COPY . .
|
| 14 |
-
COPY /.cache /.cache
|
| 15 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 9 |
RUN /opt/conda/bin/pip install peft
|
| 10 |
RUN /opt/conda/bin/pip install -qq https://github.com/pyannote/pyannote-audio/archive/refs/heads/develop.zip
|
| 11 |
RUN --mount=type=secret,id=HUGGINGFACE_TOKEN,mode=0444,required=true \
|
| 12 |
+
huggingface-cli login --token $(cat /run/secrets/HUGGINGFACE_TOKEN) && \
|
| 13 |
+
echo "HUGGINGFACE_TOKEN=$( cat /run/secrets/HUGGINGFACE_TOKEN )" >> .env
|
| 14 |
COPY . .
|
|
|
|
| 15 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
holosubs.py
CHANGED
|
@@ -22,7 +22,7 @@ MAX_CHUNK_DURATION=30000 # ms
|
|
| 22 |
format = "%(asctime)s: %(message)s"
|
| 23 |
logging.basicConfig(format=format, level=logging.DEBUG,
|
| 24 |
datefmt="%H:%M:%S")
|
| 25 |
-
|
| 26 |
|
| 27 |
def get_video_vtt(url) -> str:
|
| 28 |
# Download wav file
|
|
|
|
| 22 |
format = "%(asctime)s: %(message)s"
|
| 23 |
logging.basicConfig(format=format, level=logging.DEBUG,
|
| 24 |
datefmt="%H:%M:%S")
|
| 25 |
+
_login(token=os.getenv('HUGGINGFACE_TOKEN'), add_to_git_credential=False)
|
| 26 |
|
| 27 |
def get_video_vtt(url) -> str:
|
| 28 |
# Download wav file
|