Spaces:
Running
on
L4
Running
on
L4
bump fasthtml and uvicorn
Browse files
main.py
CHANGED
|
@@ -24,7 +24,6 @@ from fasthtml.common import (
|
|
| 24 |
Script,
|
| 25 |
StreamingResponse,
|
| 26 |
fast_app,
|
| 27 |
-
serve,
|
| 28 |
)
|
| 29 |
from PIL import Image
|
| 30 |
from shad4fast import ShadHead
|
|
@@ -43,6 +42,7 @@ from frontend.app import (
|
|
| 43 |
SimMapButtonReady,
|
| 44 |
)
|
| 45 |
from frontend.layout import Layout
|
|
|
|
| 46 |
|
| 47 |
highlight_js_theme_link = Link(id="highlight-theme", rel="stylesheet", href="")
|
| 48 |
highlight_js_theme = Script(src="/static/js/highlightjs-theme.js")
|
|
@@ -68,7 +68,11 @@ awesomplete_link = Link(
|
|
| 68 |
awesomplete_js = Script(
|
| 69 |
src="https://cdnjs.cloudflare.com/ajax/libs/awesomplete/1.1.7/awesomplete.min.js"
|
| 70 |
)
|
| 71 |
-
sselink = Script(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
# Get log level from environment variable, default to INFO
|
| 74 |
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO").upper()
|
|
@@ -112,7 +116,7 @@ This means that newlines will be replaced with <br> tags, bold text will be encl
|
|
| 112 |
Do NOT include backticks (`) in your response. Only simple HTML tags and text.
|
| 113 |
"""
|
| 114 |
gemini_model = genai.GenerativeModel(
|
| 115 |
-
"gemini-2.
|
| 116 |
)
|
| 117 |
STATIC_DIR = Path("static")
|
| 118 |
IMG_DIR = STATIC_DIR / "full_images"
|
|
@@ -417,4 +421,5 @@ def get():
|
|
| 417 |
if __name__ == "__main__":
|
| 418 |
HOT_RELOAD = os.getenv("HOT_RELOAD", "False").lower() == "true"
|
| 419 |
logger.info(f"Starting app with hot reload: {HOT_RELOAD}")
|
| 420 |
-
|
|
|
|
|
|
| 24 |
Script,
|
| 25 |
StreamingResponse,
|
| 26 |
fast_app,
|
|
|
|
| 27 |
)
|
| 28 |
from PIL import Image
|
| 29 |
from shad4fast import ShadHead
|
|
|
|
| 42 |
SimMapButtonReady,
|
| 43 |
)
|
| 44 |
from frontend.layout import Layout
|
| 45 |
+
import uvicorn
|
| 46 |
|
| 47 |
highlight_js_theme_link = Link(id="highlight-theme", rel="stylesheet", href="")
|
| 48 |
highlight_js_theme = Script(src="/static/js/highlightjs-theme.js")
|
|
|
|
| 68 |
awesomplete_js = Script(
|
| 69 |
src="https://cdnjs.cloudflare.com/ajax/libs/awesomplete/1.1.7/awesomplete.min.js"
|
| 70 |
)
|
| 71 |
+
sselink = Script(
|
| 72 |
+
src="https://cdn.jsdelivr.net/npm/[email protected]",
|
| 73 |
+
integrity="sha384-A986SAtodyH8eg8x8irJnYUk7i9inVQqYigD6qZ9evobksGNIXfeFvDwLSHcp31N",
|
| 74 |
+
crossorigin="anonymous",
|
| 75 |
+
)
|
| 76 |
|
| 77 |
# Get log level from environment variable, default to INFO
|
| 78 |
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO").upper()
|
|
|
|
| 116 |
Do NOT include backticks (`) in your response. Only simple HTML tags and text.
|
| 117 |
"""
|
| 118 |
gemini_model = genai.GenerativeModel(
|
| 119 |
+
"gemini-2.5-flash", system_instruction=GEMINI_SYSTEM_PROMPT
|
| 120 |
)
|
| 121 |
STATIC_DIR = Path("static")
|
| 122 |
IMG_DIR = STATIC_DIR / "full_images"
|
|
|
|
| 421 |
if __name__ == "__main__":
|
| 422 |
HOT_RELOAD = os.getenv("HOT_RELOAD", "False").lower() == "true"
|
| 423 |
logger.info(f"Starting app with hot reload: {HOT_RELOAD}")
|
| 424 |
+
uvicorn.run("main:app", host="0.0.0.0", timeout_worker_healthcheck=30, port=7860)
|
| 425 |
+
# serve(port=7860, reload=HOT_RELOAD)
|