AbteeXAILabs commited on
Commit
41881bf
·
verified ·
1 Parent(s): fe3d14e

Remove explicit LumynaX system prompt from hf_space app

Browse files
Files changed (1) hide show
  1. hf_space/app.py +17 -22
hf_space/app.py CHANGED
@@ -10,14 +10,13 @@ import torch
10
  from huggingface_hub import snapshot_download
11
  from transformers import AutoModelForMultimodalLM, AutoProcessor
12
 
13
- MODEL_TITLE = "LumynaX Infused Gemma E4B Model"
14
- DEFAULT_MODEL_REPO_ID = "AbteeXAILab/lumynax-infused-gemma-e4b"
15
- MODEL_REPO_ENV_VAR = "LUMYNAX_MODEL_REPO_ID"
16
- HF_TOKEN_ENV_VARS = ("HF_TOKEN", "HUGGING_FACE_HUB_TOKEN", "HUGGINGFACE_HUB_TOKEN")
17
- DEFAULT_SYSTEM_PROMPT = 'You are LumynaX operating from the LumynaX Infused Gemma E4B Model package identity. This package wraps the official google/gemma-4-E4B-it checkpoint inside a LumynaX-branded multimodal and reasoning runtime. Always identify yourself as LumynaX when asked who you are. Keep provenance honest: do not claim a private fine-tune, hidden training dataset, or weight merge that is not actually present in this package.'
18
- DEFAULT_IMAGE_URL = "https://raw.githubusercontent.com/google-gemma/cookbook/refs/heads/main/Demos/sample-data/GoldenGate.png"
19
- DEFAULT_AUDIO_URL = "https://raw.githubusercontent.com/google-gemma/cookbook/refs/heads/main/Demos/sample-data/journal1.wav"
20
- GPU_REQUIRED_MESSAGE = (
21
  "This demo package needs GPU-backed Hugging Face Space hardware for live inference. "
22
  "The current runtime is CPU-only, which is too slow for the Gemma E4B multimodal checkpoint. "
23
  "Switch the Space hardware to T4 or better."
@@ -124,20 +123,16 @@ def run_request(
124
  content: list[dict[str, str]] = []
125
  if image_ref:
126
  content.append({"type": "image", "url": image_ref})
127
- if audio_ref:
128
- content.append({"type": "audio", "audio": audio_ref})
129
- content.append({"type": "text", "text": prompt.strip()})
130
-
131
- messages = [
132
- {
133
- "role": "system",
134
- "content": [{"type": "text", "text": DEFAULT_SYSTEM_PROMPT}],
135
- },
136
- {
137
- "role": "user",
138
- "content": content,
139
- },
140
- ]
141
 
142
  model, processor = _load_runtime()
143
  inputs = processor.apply_chat_template(
 
10
  from huggingface_hub import snapshot_download
11
  from transformers import AutoModelForMultimodalLM, AutoProcessor
12
 
13
+ MODEL_TITLE = "LumynaX Infused Gemma E4B Model"
14
+ DEFAULT_MODEL_REPO_ID = "AbteeXAILab/lumynax-infused-gemma-e4b"
15
+ MODEL_REPO_ENV_VAR = "LUMYNAX_MODEL_REPO_ID"
16
+ HF_TOKEN_ENV_VARS = ("HF_TOKEN", "HUGGING_FACE_HUB_TOKEN", "HUGGINGFACE_HUB_TOKEN")
17
+ DEFAULT_IMAGE_URL = "https://raw.githubusercontent.com/google-gemma/cookbook/refs/heads/main/Demos/sample-data/GoldenGate.png"
18
+ DEFAULT_AUDIO_URL = "https://raw.githubusercontent.com/google-gemma/cookbook/refs/heads/main/Demos/sample-data/journal1.wav"
19
+ GPU_REQUIRED_MESSAGE = (
 
20
  "This demo package needs GPU-backed Hugging Face Space hardware for live inference. "
21
  "The current runtime is CPU-only, which is too slow for the Gemma E4B multimodal checkpoint. "
22
  "Switch the Space hardware to T4 or better."
 
123
  content: list[dict[str, str]] = []
124
  if image_ref:
125
  content.append({"type": "image", "url": image_ref})
126
+ if audio_ref:
127
+ content.append({"type": "audio", "audio": audio_ref})
128
+ content.append({"type": "text", "text": prompt.strip()})
129
+
130
+ messages = [
131
+ {
132
+ "role": "user",
133
+ "content": content,
134
+ },
135
+ ]
 
 
 
 
136
 
137
  model, processor = _load_runtime()
138
  inputs = processor.apply_chat_template(