Spaces:
Running
Running
Commit
·
7770bcc
1
Parent(s):
fcdfb63
Adding images
Browse files- app.py +3 -4
- src/manager/config/model_selector.py +0 -19
app.py
CHANGED
|
@@ -133,8 +133,6 @@ async def api_login_status(request: Request):
|
|
| 133 |
return {"status": "Logged out"}
|
| 134 |
|
| 135 |
|
| 136 |
-
_logo_bytes = open("HASHIRU_LOGO.png", "rb").read()
|
| 137 |
-
_logo_b64 = base64.b64encode(_logo_bytes).decode()
|
| 138 |
_header_html = f"""
|
| 139 |
<div style="
|
| 140 |
display: flex;
|
|
@@ -142,7 +140,7 @@ _header_html = f"""
|
|
| 142 |
align-items: center;
|
| 143 |
justify-content: flex-start;
|
| 144 |
">
|
| 145 |
-
<img src="
|
| 146 |
<h1>
|
| 147 |
HASHIRU AI
|
| 148 |
</h1>
|
|
@@ -213,7 +211,8 @@ with gr.Blocks(title="HASHIRU AI", css=css, fill_width=True, fill_height=True) a
|
|
| 213 |
fn=update_model, inputs=model_dropdown, outputs=[])
|
| 214 |
with gr.Row(scale=1):
|
| 215 |
chatbot = gr.Chatbot(
|
| 216 |
-
avatar_images=("HASHIRU_2.png",
|
|
|
|
| 217 |
type="messages",
|
| 218 |
show_copy_button=True,
|
| 219 |
editable="user",
|
|
|
|
| 133 |
return {"status": "Logged out"}
|
| 134 |
|
| 135 |
|
|
|
|
|
|
|
| 136 |
_header_html = f"""
|
| 137 |
<div style="
|
| 138 |
display: flex;
|
|
|
|
| 140 |
align-items: center;
|
| 141 |
justify-content: flex-start;
|
| 142 |
">
|
| 143 |
+
<img src="https://media.githubusercontent.com/media/HASHIRU-AI/HASHIRU/refs/heads/main/HASHIRU_LOGO.png" width="40" class="logo"/>
|
| 144 |
<h1>
|
| 145 |
HASHIRU AI
|
| 146 |
</h1>
|
|
|
|
| 211 |
fn=update_model, inputs=model_dropdown, outputs=[])
|
| 212 |
with gr.Row(scale=1):
|
| 213 |
chatbot = gr.Chatbot(
|
| 214 |
+
avatar_images=("https://media.githubusercontent.com/media/HASHIRU-AI/HASHIRU/refs/heads/main/HASHIRU_2.png",
|
| 215 |
+
"https://media.githubusercontent.com/media/HASHIRU-AI/HASHIRU/refs/heads/main/HASHIRU.png"),
|
| 216 |
type="messages",
|
| 217 |
show_copy_button=True,
|
| 218 |
editable="user",
|
src/manager/config/model_selector.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
from src.manager.utils.runtime_selector import detect_runtime_environment
|
| 2 |
-
from src.cost_benefit import get_best_model
|
| 3 |
-
import os
|
| 4 |
-
from dotenv import load_dotenv
|
| 5 |
-
load_dotenv()
|
| 6 |
-
|
| 7 |
-
def choose_best_model(return_full=False):
|
| 8 |
-
env = detect_runtime_environment()
|
| 9 |
-
print(f"[INFO] Runtime Environment: {env}")
|
| 10 |
-
|
| 11 |
-
result = get_best_model(env)
|
| 12 |
-
|
| 13 |
-
if not result.get("model"):
|
| 14 |
-
print("[WARN] No model found under budget — using fallback.")
|
| 15 |
-
fallback_model = "gemini-2.0-flash" if os.getenv("GEMINI_KEY") else "llama3.2"
|
| 16 |
-
return {"model": fallback_model} if return_full else fallback_model
|
| 17 |
-
|
| 18 |
-
print(f"[INFO] Auto-selected model: {result['model']} (token cost: {result['token_cost']}, tokens/sec: {result['tokens_sec']})")
|
| 19 |
-
return result if return_full else result["model"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|