File size: 518 Bytes
98605c5
 
 
c232276
98605c5
2306e1a
98605c5
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#app.py
import os
from flux_app.frontend import Frontend
from flux_app.backend import ModelManager

if __name__ == "__main__":
    # Get the Hugging Face token from an environment variable
    hf_token = os.environ.get("HF_TOKEN")

    if not hf_token:
        raise ValueError("Hugging Face token (HF_TOKEN) not found in environment variables.  Please set it.")
    model_manager = ModelManager(hf_token=hf_token)

    frontend = Frontend(model_manager)
    app = frontend.create_ui()
    app.queue()
    app.launch()