Skip to content

Commit 593cff6

Browse files
committed
feat: espose Gradio share to env
1 parent c5d3247 commit 593cff6

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from theflow.settings import settings as flowsettings
44

55
KH_APP_DATA_DIR = getattr(flowsettings, "KH_APP_DATA_DIR", ".")
6+
KH_GRADIO_SHARE = getattr(flowsettings, "KH_GRADIO_SHARE", False)
67
GRADIO_TEMP_DIR = os.getenv("GRADIO_TEMP_DIR", None)
78
# override GRADIO_TEMP_DIR if it's not set
89
if GRADIO_TEMP_DIR is None:
@@ -21,4 +22,5 @@
2122
"libs/ktem/ktem/assets",
2223
GRADIO_TEMP_DIR,
2324
],
25+
share=KH_GRADIO_SHARE,
2426
)

flowsettings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
except Exception:
2626
KH_APP_VERSION = "local"
2727

28+
KH_GRADIO_SHARE = config("KH_GRADIO_SHARE", default=False, cast=bool)
2829
KH_ENABLE_FIRST_SETUP = config("KH_ENABLE_FIRST_SETUP", default=True, cast=bool)
2930
KH_DEMO_MODE = config("KH_DEMO_MODE", default=False, cast=bool)
3031
KH_OLLAMA_URL = config("KH_OLLAMA_URL", default="http://localhost:11434/v1/")

libs/ktem/ktem/pages/setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@ def update_model(
265265
)
266266
elif radio_model_value == "ollama":
267267
llms.update(
268-
name="ollama-long-context",
268+
name="ollama",
269269
spec={
270-
"__type__": "kotaemon.llms.LCOllamaChat",
271-
"base_url": KH_OLLAMA_URL.replace("v1/", ""),
270+
"__type__": "kotaemon.llms.ChatOpenAI",
271+
"base_url": KH_OLLAMA_URL,
272272
"model": config("LOCAL_MODEL", default="qwen2.5:7b"),
273-
"num_ctx": 8192,
273+
"api_key": "ollama",
274274
},
275275
default=True,
276276
)

0 commit comments

Comments
 (0)