ruslanmv's picture
Update app.py
b1d31cc
raw
history blame
732 Bytes
# app.py
import os
from flux_app.frontend import Frontend
from flux_app.backend import ModelManager
def 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()
# Enable request queuing. (No extra keyword arguments here.)
app.queue()
# Launch the app with the specified server configuration.
app.launch(server_name="0.0.0.0", server_port=7860, share=False)
if __name__ == "__main__":
main()