CoolFace
Apppublic

ethansmith2000/MegaEdit

sourceHugging Facecreativeml-openrail-mupdated 4y agoView on Hugging Face
0likes
utils.py27 linesDownload Raw Back to root
1import os2 3 4class Endpoint:5    def __init__(self):6        self._url = None7 8    @property9    def url(self):10        if self._url is None:11            self._url = self.get_url()12 13        return self._url14 15    def get_url(self):16        endpoint = os.environ.get("endpoint")17 18        return endpoint19 20 21def get_token():22    token = os.environ.get("auth_token")23 24    if token is None:25        raise ValueError("auth-token not found in environment variables")26 27    return token